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
Reads a filename at specific path and return a inputReader object
public static BufferedReader readDataFile(String filename,String pathOfFile) { String pathToSave = pathOfFile; BufferedReader inputReader = null; try { inputReader = new BufferedReader(new FileReader(pathToSave+filename)); } catch (FileNotFoundException ex) { System.err.println("File not found: " + filename); } return inputReader; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public Ini read(Path path) throws IOException {\n try (Reader reader = Files.newBufferedReader(path)) {\n return read(reader);\n }\n }", "public InputStream readFile( String fileName, FileType type );", "@Override\n public InputStream openInputFile(String pathname) throws IOException {\n return new FileInputStream(pathname);\n }", "protected abstract InputStream getFile(final String path);", "public FilesInputStreamLoad readFile() throws ArcException {\r\n\tFile dir = new File(this.archiveChargement + \".dir\");\r\n\tString fileName = ManipString.substringAfterFirst(this.idSource, \"_\");\r\n\tFile toRead = new File(dir + File.separator + ManipString.redoEntryName(fileName));\r\n\tFilesInputStreamLoad filesInputStreamLoadReturned = null;\r\n\ttry {\r\n\t\tfilesInputStreamLoadReturned = new FilesInputStreamLoad (toRead);\r\n\t} catch (IOException ioReadException) {\r\n\t\tthrow new ArcException(ioReadException, ArcExceptionMessage.FILE_READ_FAILED, toRead);\r\n\t}\r\n\treturn filesInputStreamLoadReturned;\r\n }", "public static BufferedReader Reader(String path) throws IOException\n\t{\n\t\treturn new BufferedReader(new InputStreamReader(new FileInputStream(path),\"UTF-8\"));\n\t}", "protected abstract InputStream getInStreamImpl(String filename) throws IOException;", "public static BufferedInputStream getInput(Path path) throws IOException {\n return get(Files.newInputStream(path));\n }", "public static BufferedReader generateInputReader(String[] args) \n\t\t\tthrows IOException\n\t{\n\t\tif(args.length == 0)\n\t\t{\n\t\t\tInputStream stream = Main.class.getResourceAsStream(\"input.txt\");\n\t\t\treturn new BufferedReader(new InputStreamReader(stream));\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn new BufferedReader(new FileReader(args[0]));\n\t\t}\n\t}", "public static BufferedReader generateInputReader(String[] args) \n\t\t\tthrows IOException\n\t{\n\t\tif(args.length == 0)\n\t\t{\n\t\t\tInputStream stream = Main.class.getResourceAsStream(\"input.txt\");\n\t\t\treturn new BufferedReader(new InputStreamReader(stream));\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn new BufferedReader(new FileReader(args[0]));\n\t\t}\n\t}", "private static IIteratingChemObjectReader<IAtomContainer> getInputReader(\n ArgumentHandler argsH, IChemObjectBuilder builder) throws FileNotFoundException {\n DataFormat inputFormat = argsH.getInputFormat();\n IIteratingChemObjectReader<IAtomContainer> reader;\n String filepath = argsH.getInputFilepath();\n InputStream in = new FileInputStream(filepath);\n switch (inputFormat) {\n case SMILES: reader = new IteratingSMILESReader(in, builder); break;\n case SIGNATURE: reader = new IteratingSignatureReader(in, builder); break;\n case SDF: reader = new IteratingSDFReader(in, builder); break;\n case ACP: reader = new IteratingACPReader(in, builder); break;\n default: reader = null; error(\"Unrecognised format\"); break;\n }\n return reader;\n }", "public static BufferedReader getReader(Path path) throws IOException {\n return Files.newBufferedReader(path);\n }", "@Override\n public InputStream openInternalInputFile(String pathname) throws IOException {\n return new FileInputStream(pathname);\n }", "public void fileRead(String filename) throws IOException;", "public FileInputStream openFileInput(final String path)\n throws java.io.FileNotFoundException {\n return GDFileSystem.openFileInput(path);\n }", "public static BufferedInputStream getInput(String fileName) throws IOException {\n return getInput(getPath(fileName));\n }", "public fileReaderDesignated() throws FileNotFoundException{\n\t\tBufferedReader in=new BufferedReader(new FileReader(fileName));\n\t\ttry {\n\t\t\treadLargerTextFile(fileName);\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}", "public Reader getReader(String filename) throws FileNotFoundException {\n\t\ttry {\n\t\t\tInputStream inputStream = new FileInputStream(filename);\n\t\t\treturn new InputStreamReader(inputStream, \"UTF-8\");\n\t\t} catch (UnsupportedEncodingException e) {\n\t\t\tthrow new IllegalStateException(\"Unable to read input\", e);\n\t\t}\n\t}", "public static File readFile(String inputName) throws IOException\r\n {\r\n String fileName = inputName; \r\n File file = new File(fileName);\r\n if (!file.canRead())\r\n {\r\n System.err.println(file.getCanonicalPath() + \": cannot be read\"); \r\n }\r\n return file; \r\n }", "public InputFileReader(String fileName) throws IOException{\n\t\t\n\t\tthis.contentsByLine = new ArrayList<>();\n\t\t\n\t\ttry {\n\t\t\tStream<String> stream = Files.lines(Paths.get(fileName));\n\t\t\tcontentsByLine = stream.collect(Collectors.toList());\n\t\t\tstream.close();\n\t\t} catch(IOException e) {\n\t\t\tthrow e;\n\t\t}\n\t}", "public static void reading(String fileName)\n {\n\n }", "InputStream getInputStream() throws FileSystemException;", "private static BufferedReader getFileContents(String path) throws FileNotFoundException{\n\t\tFile file = new File(path);\n\t\treturn new BufferedReader(new FileReader(file));\t\n\t}", "public static BufferedReader getReader(String fileName) throws IOException {\n return getReader(getPath(fileName));\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}", "public InputStream openInputStream(String path) throws SystemException;", "public MyInputStream(String fileName)\n {\n try\n {\n in = new BufferedReader\n (new FileReader(fileName));\n }\n catch (FileNotFoundException e)\n {throw new MyInputException(e.getMessage());}\n }", "public interface FileReader {\n\n String read(String fileName);\n}", "protected final ByteSource getInput(String name) {\n try {\n if (name.equals(\"-\")) {\n return new StandardInputSource();\n } else {\n File file = new File(name);\n if (!file.exists()) {\n throw new FileNotFoundException(name);\n } else if (file.isDirectory()) {\n throw new IOException(name); // TODO Message? Exception?\n } else if (!file.canRead()) {\n throw new IOException(name); // TODO Message? Exception?\n } else {\n return Files.asByteSource(file);\n }\n }\n } catch (IOException e) {\n throw new UncheckedIOException(e);\n }\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 }", "private static Optional<InputStream> openFile(Path name) {\n try {\n return Optional.of(Files.newInputStream(name, StandardOpenOption.READ));\n } catch (IOException e) {\n System.err.printf(\"Unable to open file %s for reading: %s\\n\", name, e.toString());\n }\n\n return Optional.empty();\n }", "StreamReader underlyingReader();", "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 }", "public InputStream getInputStream(Path path) throws IOException {\n Objects.requireNonNull(path);\n\n FileSystem fs = hdfsConfig.getFileSystem();\n if (fs.isFile(path)) {\n return fs.open(path);\n } else if(fs.isDirectory(path)) {\n FileStatus[] files = fs.listStatus(path);\n List<InputStream> paths = Arrays.stream(files)\n .map(f -> {\n try {\n return fs.open(f.getPath());\n } catch (IOException e) {\n LOGGER.log(Level.SEVERE, \"Cannot read file \" + f.getPath().toString(), e);\n return null;\n }\n })\n .filter(f -> f != null)\n .collect(Collectors.toList());\n return new SequenceInputStream(Collections.enumeration(paths));\n } else {\n throw new IllegalArgumentException(\"Given path \" + path.toString()\n + \" is neither file nor directory\");\n }\n }", "interface Source {\n /** Finds a reader for a given file name.\n */\n public java.io.Reader getReader (URL url) throws java.io.IOException;\n }", "InputStream getInputStream(String path) throws CruiseControlException;", "public XMLReader()\r\n {\r\n \r\n String filePathHead = \"\";\r\n\r\n Path inputPath = Paths.get(\"src\\\\dataFiles\");\r\n\r\n try\r\n {\r\n filePathHead = inputPath.toRealPath().toString();\r\n System.out.println(\"PATH: \" + inputPath.toRealPath().toString());\r\n }\r\n catch (NoSuchFileException x)\r\n {\r\n System.err.format(\"%s: no such\" + \" file or directory%n\", filePathHead);\r\n // Logic for case when file doesn't exist.\r\n }\r\n catch (IOException x)\r\n {\r\n System.err.format(\"%s%n\", x);\r\n // Logic for other sort of file error.\r\n }\r\n }", "public static DataInputStream getDataInput(Path path) throws IOException {\n return getData(Files.newInputStream(path));\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 }", "protected abstract Object readFile(BufferedReader buf) throws IOException, FileParseException;", "public InputStream readDocumentAsStream(String path) ;", "public static InputStream createInputStream(String filename) throws FileReadingException {\n File file = new File(filename);\n if (!file.exists()) {\n throw new FileReadingException(\"File Not Found: \" + filename + \"\\n\");\n }\n if (!file.isFile()) {\n throw new FileReadingException(filename + \" is not a file.\\n\");\n }\n if (!file.canRead()) {\n throw new FileReadingException(\"Reading file \" + filename + \" is not permitted.\\n\");\n }\n\n try {\n return new FileInputStream(file);\n } catch (FileNotFoundException e) {\n throw new FileReadingException(\"File Not Found: \" + filename + \"\\n\");\n }\n }", "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 }", "@Override\n public InputStream readFileInternal(String _fileName) throws IOException\n { // Reads a file from the devices internal storage. Takes a filename as a parameter and throws an IOException if failed.\n return context.openFileInput(_fileName);\n }", "public String readFileName() {\n\t\tSystem.out.println(\"Please enter the file path: \");\n\t\tBufferedReader strin = new BufferedReader(new InputStreamReader(\n\t\t\t\tSystem.in));\n\t\ttry {\n\t\t\tString fileName = strin.readLine();\n\t\t\t//检查文件是否存在,文件类型是否符合要求\n\t\t\twhile (fileName == null || fileName.trim().equals(\"\")\n\t\t\t\t\t|| fileName.indexOf(\".\") == -1 //必须要有文件名\n\t\t\t\t\t|| fileName.indexOf(ext) == -1\n\t\t\t\t\t|| !new File(fileName).exists()) {\n\t\t\t\tSystem.out.print(\"Please input the file path: \");\n\t\t\t\tstrin = new BufferedReader(new InputStreamReader(System.in));\n\t\t\t\tfileName = strin.readLine();\n\t\t\t}\n\t\t\tthis.fileName = fileName;\n\t\t\tthis.ext = fileName.substring(fileName.lastIndexOf(\".\"));\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (strin != null) {\n\t\t\t\t\tstrin.close();\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\tstrin = null;\n\t\t}\n\t\treturn fileName;\n\t}", "RandomAccessFile openInputFile(String fileName) {\n if (dbg) System.out.println(\"<br>\" + thisClass + \".openInputFile: \" +\n \"fileName = \" + fileName);\n RandomAccessFile file = null;\n try {\n file = new RandomAccessFile(fileName, \"r\");\n if (dbg) System.out.println(\"<br>\" + thisClass + \".openInputFile: \" +\n \"success: file opened for read\");\n } catch (Exception e) {\n ec.processError(e, thisClass, \"openInputFile\", \"\");\n if (dbg) System.out.println(\"<br>\" + thisClass + \".openInputFile: \" +\n \"error: file opened for read\");\n } // try-catch\n return file;\n }", "static Reader createReaderFromStream(Path path, FSDataInputStream fsdis, long size,\n CacheConfig cacheConf, Configuration conf) throws IOException {\n FSDataInputStreamWrapper wrapper = new FSDataInputStreamWrapper(fsdis);\n return pickReaderVersion(path, wrapper, size, cacheConf, null, conf);\n }", "private void fileRead(String path)\n\t{\n\t\ttry\n\t\t{\n\t\t\t// create file\n\t\t\tFile file = new File(path);\n\t\t\tFileInputStream fileStream = new FileInputStream(file);\n\t\t\t\n\t\t\t// data read\n\t\t\tthis.dataContent = new byte[(int)file.length()];\n\t\t\tint ret = fileStream.read(this.dataContent, 0, (int)file.length());\n\t\t}\n\t\tcatch(FileNotFoundException e)\n\t\t{\n\t\t\tSystem.out.println(\"File Not Found : \" + e.getMessage());\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tSystem.out.println(\"Failed File Read : \" + e.getMessage());\n\t\t}\n\t\t\n\t}", "public interface ReaderFromFile {\n\t\n\tpublic List<Data> readDataFromFile (String filename);\n}", "public MSDataReader(File in) throws IOException\n\t{\n\t\tif (in == null)\n\t\t\tthrow new NullPointerException(\"传入MSDataReader的输入流为null\");\n\t\t\n\t\tthis.file = in;\n\t\tthis.reader = new BufferedReader(new FileReader(in));\n\t\t\n\t\tinit();\n\t}", "String Reader(String FileName, Context context){\n FileInputStream inputStream = null;\n String Text = \"\";\n StringBuilder sb = null;\n try{\n //inputStream = context.openFileInput(FileName);\n inputStream = new FileInputStream(new File(FileName));\n InputStreamReader reader = new InputStreamReader(inputStream);\n BufferedReader buffRead = new BufferedReader(reader);\n sb = new StringBuilder();\n\n while ((Text = buffRead.readLine())!= null){\n sb.append(Text);\n sb.append(\"\\n\");\n }\n\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return sb.toString();\n }", "public static InputStream getInputStream(String[] args) throws FileNotFoundException {\r\n if (args.length > 0 && args[0].equals(\"-f\")) {\r\n return new FileInputStream(new File(args[1]));\r\n } else {\r\n return System.in;\r\n }\r\n }", "public InputSource makeInputSource(String path) throws IOException {\n return new InputSource(makeUrl(path).toString());\n}", "public TabbedLineReader openInput(File inFile) throws IOException {\n TabbedLineReader retVal;\n if (inFile == null) {\n log.info(\"Input will be taken from the standard input.\");\n retVal = new TabbedLineReader(System.in);\n } else if (! inFile.canRead())\n throw new FileNotFoundException(\"Input file \" + inFile + \" is not found or is unreadable.\");\n else {\n log.info(\"Input will be read from {}.\", inFile);\n retVal = new TabbedLineReader(inFile);\n }\n return retVal;\n }", "@Override\n public InputStream getInputStream() throws IOException\n {\n/**/\n/**/\n/**/\n if (Files.isDirectory(path))\n throw new IOException(path + \" is a directory\");\n\n return Files.newInputStream(path,StandardOpenOption.READ);\n }", "private void openAndReadFile() throws IOException {\n\t\tFileReader fr = new FileReader(path);\n\t\tBufferedReader textreader = new BufferedReader(fr);\n\t\tString line;\n\t\tString[] parsedLine;\n\t\twhile ((line = textreader.readLine()) != null) {\n\t\t\tparsedLine = pattern.split(line);\n\t\t\tif (parsedLine.length == 2) {\n\t\t\t\tfileData.put(parsedLine[0], parsedLine[1]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"Couldn't read line \" + line + \" in \" + path);\n\t\t\t}\n\t\t}\n\t\ttextreader.close();\n\t\tfr.close();\n\t}", "public abstract T readDataFile(String fileLine);", "public String readFromFile() throws IOException {\n return br.readLine();\n }", "private static String readLine(String filename) throws IOException {\n\t\ttry (BufferedReader reader = new BufferedReader(\n\t\t\t\tnew FileReader(filename), 256)) {\n\t\t\treturn reader.readLine();\n\t\t}\n\t}", "MafSource readSource(File sourceFile);", "private static InputStream getInputStream(final String filename) throws IOException, FileNotFoundException {\r\n final ResourcePatternResolver applicationContext = new ClassPathXmlApplicationContext(new String[] {});\r\n final Resource[] resource = applicationContext.getResources(\"classpath*:\" + filename);\r\n if (resource.length == 0) {\r\n throw new FileNotFoundException(\"Unable to find file '\" + filename + \"' in classpath.\");\r\n }\r\n return resource[0].getInputStream();\r\n }", "@Override\n public InputStream readFileExternal(String _fileName) throws IOException \n { // Reads a file saved to external storage. Takes the filename as a parameter and throws an IOException if failed.\n return new FileInputStream(externalStoragePath + _fileName);\n }", "public static String readFileFromInputStream(final InputStream is) throws IOException\n\t{\n\t\tfinal BufferedReader input = new BufferedReader(new InputStreamReader(\n\t\t\t\tis, FILE_CHARSET_NAME));\n\t\ttry\n\t\t{\n\t\t\tfinal StringBuilder contents = new StringBuilder(BUFFER_SIZE);\n\n\t\t\t// copy from input stream\n\t\t\tfinal char[] charBuffer = new char[BUFFER_SIZE];\n\t\t\tint len;\n\t\t\twhile ((len = input.read(charBuffer)) > 0)\n\t\t\t{\n\t\t\t\tcontents.append(charBuffer, 0, len);\n\t\t\t}\n\n\t\t\treturn contents.toString().replaceAll(\"\\r\\n\", \"\\n\");\n\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tinput.close();\n\t\t}\n\t}", "private static JSONObject fileReader(String path) throws Exception{\r\n return (JSONObject) jsonParser.parse(new String(Files.readAllBytes(Paths.get(path))));\r\n }", "public static BamLocusReader getLocusReader(String filepath){\n if(!instances.containsKey(filepath)){\n synchronized (BamLocusReader.class){\n if(!instances.containsKey(filepath)){\n SamHeaderAndIterator headerAndIterator = IOHelper.openInput(filepath);\n BamLocusReader reader = new BamLocusReader();\n reader.samHeaderAndIterator = headerAndIterator;\n instances.put(filepath, reader);\n return reader;\n }\n }\n\n }\n return instances.get(filepath);\n\n }", "public static PropertiesReader createPropertyReader(Path path) throws IOException {\n\n Properties properties = new Properties();\n try (FileInputStream fileInputStream = new FileInputStream(path.toFile())) {\n properties.load(fileInputStream);\n }\n Map<String, String> data = readPropertiesIntoMap(properties);\n return new PropertiesReader(data);\n }", "public File openInputFile() throws Exception{\n\t\t// Open the input file\n\t\tinputFile = new File(PLEIADEAN_FILE);\n\t\t\n\t\t// return to the caller\n\t\treturn(inputFile);\n\t}", "public static InputStream getInputStream(String file) throws IOException\n {\n InputStream in = null;\n if(Files.isReadable(Paths.get(file)))\n in = new FileInputStream(file);\n else\n {\n URL url = Thread.currentThread().getContextClassLoader().getResource(file);\n if(url != null)\n in = url.openStream();\n }\n if(in == null)\n throw new IOException();\n\n return in;\n }", "String readText(FsPath path);", "public String readFileIntoString(String filepath) throws IOException;", "public ReadFile (String file) throws java.io.FileNotFoundException\n {\n reader = new java.io.FileReader(file);\t\t//Construct the file reader\n br = new java.io.BufferedReader(reader);\t//Wrap it with a BufferedReader\n assert this.isValid(); \t\t\t//Make sure all is well and we can read the file\n }", "public static BufferedReader getBufferedReader(String filePath) {\r\n\r\n BufferedReader bufferedReader = null;\r\n try {\r\n bufferedReader = Files.newBufferedReader(Paths.get(filePath), Charset.defaultCharset());\r\n } catch (IOException ex) {\r\n Logger.getLogger(FileUtility.class.getName()).log(Level.SEVERE, \"Error in readLine\", ex);\r\n }\r\n return bufferedReader;\r\n }", "public static BufferedReader newBufferedReader(Path path) throws IOException {\n BufferedReader br = null;\n if(path.toFile().getName().endsWith(\".gz\")) {\n br = new BufferedReader(new InputStreamReader(new GZIPInputStream(new FileInputStream(path.toFile()))));\n }else {\n br = Files.newBufferedReader(path, Charset.defaultCharset());\n }\n return br;\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 static BufferedReader asReader(String name) throws IOException {\n ClassLoader classLoader = Reflection.getCallerClass(3).getClassLoader();\n return new BufferedReader(new InputStreamReader(asStream(name, classLoader), UTF_8));\n }", "public static IndexReader open(String path) throws IOException {\n return open(FSDirectory.getDirectory(path, false));\n }", "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 }", "public java.io.Reader getReader (URL url) throws java.io.IOException;", "public interface SourceFileReader {\n\t\n\t/**\n\t * Reads a file and returns its content in a List\n\t * @param fileReaderType the location of a file \n\t * (<b>local</b> for locally stored files, \n\t * <b>web</b> for files stored on the web). \n\t * @param filepath the url of the file\n\t * @return a List that contains the contents of the file \n\t * or null if the type is neither <b>local</b> nor <b>web</b>\n\t * @throws IOException\n\t */\n\tpublic List<String> readFileIntoList(String filepath) throws IOException;\n\t\n\t/**\n\t * Reads a file and returns its content in a single String\n\t * @param fileReaderType the location of a file \n\t * (<b>local</b> for locally stored files, \n\t * <b>web</b> for files stored on the web). \n\t * @param filepath the url of the file\n\t * @return a String that contains the contents of the file\n\t * or null if the type is neither <b>local</b> nor <b>web</b>\n\t * @throws IOException\n\t */\n\tpublic String readFileIntoString(String filepath) throws IOException;\n\n}", "public void ReadFrom(String pathWithFileName) throws Exception\n {\n \tPath path = Paths.get(pathWithFileName);\n content = Files.readAllBytes(path);\n fileName = path.getFileName().toString(); \n contentType = null;\n }", "public static IndexReader open(File path) throws IOException {\n return open(FSDirectory.getDirectory(path, false));\n }", "public final InputStream getInStream(String filename) throws IOException {\n\t\tint pos = filename.indexOf(\".bin\");\n\t\tsendMessage((pos > -1) ? filename.substring(0, pos) : filename);\n\t\treturn getInStreamImpl(filename);\n\t}", "protected InputStream loadFile(String zipPath) throws Exception {\n\t\treturn Files.newInputStream(Paths.get(zipPath));\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 static void readMyFile() throws IOException {\n\n List<String> allLines = Files.readAllLines(Paths.get(\"src/ErfansInputFile\"));\n System.out.println(\"allLines = \" + allLines);\n System.out.println(\"Reading the file in my computer. \");\n\n throw new FileNotFoundException(\"Kaboom, file is not found!!!\");\n }", "private FileInputStream getStreamFromPath(Context context, String fileName) {\n ParcelFileDescriptor parcelFileDesc = null;\n FileInputStream inputStream = null;\n try {\n inputStream = new FileInputStream(new File(fileName));\n if (0 != 0) {\n try {\n parcelFileDesc.close();\n } catch (IOException e) {\n Log.e(TAG, \"parcelFileDesc error!\");\n }\n }\n } catch (FileNotFoundException e2) {\n Log.e(TAG, \"getStreamFromPath FileNotFoundException.\");\n if (0 != 0) {\n parcelFileDesc.close();\n }\n } catch (Throwable th) {\n if (0 != 0) {\n try {\n parcelFileDesc.close();\n } catch (IOException e3) {\n Log.e(TAG, \"parcelFileDesc error!\");\n }\n }\n throw th;\n }\n return inputStream;\n }", "public static DataInputStream getDataInput(String fileName) throws IOException {\n return getDataInput(getPath(fileName));\n }", "public static ClassFileReader newInstance(Path path) throws IOException {\n if (!Files.exists(path)) {\n throw new FileNotFoundException(path.toString());\n }\n\n if (Files.isDirectory(path)) {\n return new DirectoryReader(path);\n } else if (path.getFileName().toString().endsWith(\".jar\")) {\n return new JarFileReader(path);\n } else {\n return new ClassFileReader(path);\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 FastaReader(String fileName) throws IOException{\n\t\tthis(new FileInputStream(fileName));\n\t}", "CharStream findFile(String name) throws IOException,\n IncludeFileNotFound {\n // Look in the directory containing the source file ...\n String dir = \".\"; // default value used e.g. when reading from stdin\n File src = getSource();\n if (src != null && src.getParent() != null) {\n dir = src.getParent();\n }\n String full = dir + \"/\" + name;\n File f = new File(full);\n if (f.exists()) {\n LOG.debug(\"Using local file \" + full);\n return CharStreams.fromFileName(full);\n }\n\n // ... and fall back to the standard library path if not found.\n final URL url = ClassLoader.getSystemResource(\"include/\" + name);\n if (url != null) {\n LOG.debug(\"Using library \" + url);\n // Use fromReader(Reader, String) to catch the file name --- fromStream(InputStream) does not.\n return CharStreams.fromReader(new InputStreamReader(url.openStream()), url.getFile());\n }\n\n throw new IncludeFileNotFound(name, this, getInputStream()); // TODO: check this\n }", "protected abstract Reader getReader() throws IOException;", "public Reader getReader(Object templateSource, String encoding)\r\n/* 43: */ throws IOException\r\n/* 44: */ {\r\n/* 45:75 */ Resource resource = (Resource)templateSource;\r\n/* 46: */ try\r\n/* 47: */ {\r\n/* 48:77 */ return new InputStreamReader(resource.getInputStream(), encoding);\r\n/* 49: */ }\r\n/* 50: */ catch (IOException ex)\r\n/* 51: */ {\r\n/* 52:80 */ if (this.logger.isDebugEnabled()) {\r\n/* 53:81 */ this.logger.debug(\"Could not find FreeMarker template: \" + resource);\r\n/* 54: */ }\r\n/* 55:83 */ throw ex;\r\n/* 56: */ }\r\n/* 57: */ }", "public static String getFileInput( String resource ){\t\n\t\tString input = new String();\n\t\t\n\t\ttry { // try to catch all errors\n\t\t\t// get file path to resource\n\t\t\tString resourcePath = getResourcePath( resource );\n\t\t\t\n\t\t\t// create path object to file\n\t\t\tPath path = FileSystems.getDefault().getPath( resourcePath );\n\t\t\t\n\t\t\t// read all lines use java-7-Files to read in an efficient way\n\t\t\tList<String> inputLines = Files.readAllLines( path, Charsets.UTF_8 );\n\t\t\t\n\t\t\t// organize lines into string\n\t\t\tfor ( String line : inputLines ) {\n\t\t\t\tinput += line + \"\\n\";\n\t\t\t}\n\t\t} catch ( IllegalArgumentException iae ) { // cannot found file\n\t\t\tSystem.err.println( \"No resources found at: \" + resource );\n\t\t\tiae.printStackTrace();\n\t\t} catch ( IllegalStateException ise ) { // cannot walk through directory tree\n\t\t\tSystem.err.println( \"Cannot get resources from: \" + resource );\n\t\t\tSystem.err.println();\n\t\t\tise.printStackTrace();\n\t\t} catch ( SecurityException se ) { // absence of rights to read from file\n\t\t\tSystem.err.println( \"You need the rights to read from file: \" + resource );\n\t\t\tSystem.err.println();\n\t\t\tse.printStackTrace();\n\t\t} catch ( IOException ioe ) { // cannot read from file\n\t\t\tSystem.err.println( \"An error has occurred. Cannot read from file: \" + resource );\n\t\t\tSystem.err.println();\n\t\t\tioe.printStackTrace();\n\t\t}\n\t\t\n\t\t// return input\n\t\treturn input;\n\t}", "public InputFile(String filePath) {\n this.filePath = filePath;\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 }", "@Override\n public Ini read(File file) throws IOException {\n try ( Reader reader = new FileReader(file)) {\n return read(reader);\n }\n }", "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 }", "public boolean openFile(String pathName) \r\n\t{\r\n\t\tboolean result;\r\n\t\t// This allows the opening of files located from this actual package.\r\n\t\tURL localPath = this.getClass().getResource(pathName);\r\n\t\tinputFile = new File(localPath.getFile());\r\n\r\n\t\t// Open input file. The input file is a field oriented and\r\n\t\t// space-separated.\r\n\t\t// The fields and expected formats are listed above in the header\r\n\r\n\t\t// Check to ensure that the inputFile exists\r\n\t\tif (!inputFile.exists()) \r\n\t\t{\r\n\t\t\tSystem.out.println(\"\\\"\" +localPath + \"\\\" should be in the same directory as: \"\r\n\t\t\t\t\t\t\t\t+ this.getClass().getPackage().getName());\r\n\t\t\t\r\n\t\t\tresult = false;\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\ttry \r\n\t\t\t{\r\n\t\t\t\t// Create a buffered reader the file\r\n\t\t\t\tinFile = new BufferedReader(new InputStreamReader(\r\n\t\t\t\t\t\tnew FileInputStream((inputFile))));\r\n\r\n\t\t\t\tresult = true;\r\n\t\t\t} // try\r\n\t\t\tcatch (Exception Error) \r\n\t\t\t{\r\n\t\t\t\tresult = false;\r\n\t\t\t} // catch\r\n\t\t} // if\r\n\r\n\t\treturn (result);\r\n\t}", "public SYEParser(InputStream input, String name) throws FileNotFoundException {\n super(input);\n this.filename = name;\n }" ]
[ "0.69449896", "0.6911625", "0.6620245", "0.66083854", "0.6544799", "0.65185416", "0.64939743", "0.6419967", "0.6383979", "0.6383979", "0.63568217", "0.63507485", "0.632583", "0.6300613", "0.6266007", "0.61675566", "0.6065786", "0.6059177", "0.6052589", "0.60443217", "0.6008741", "0.6004952", "0.60005736", "0.5980889", "0.59569645", "0.59126115", "0.5875664", "0.58656013", "0.5800771", "0.5788752", "0.5780423", "0.5780013", "0.5767727", "0.5765139", "0.5743934", "0.5701263", "0.5667708", "0.565562", "0.56508887", "0.5646809", "0.5640212", "0.5619657", "0.561384", "0.5609756", "0.55763435", "0.5560425", "0.5553826", "0.5548498", "0.5537551", "0.5528922", "0.5520081", "0.5513439", "0.549447", "0.54926485", "0.54885674", "0.5486409", "0.5481517", "0.54437757", "0.5430771", "0.54214495", "0.5414489", "0.54139525", "0.5397639", "0.53956497", "0.537163", "0.536081", "0.5360584", "0.5355877", "0.53554755", "0.5351235", "0.53481686", "0.5342409", "0.53274006", "0.5326587", "0.53249216", "0.532474", "0.5319242", "0.531868", "0.53139114", "0.53035486", "0.5302723", "0.5293677", "0.52906954", "0.5283174", "0.5280679", "0.5279509", "0.52744424", "0.52658117", "0.5261194", "0.5259189", "0.525845", "0.52569675", "0.5254095", "0.5252625", "0.52485377", "0.52437276", "0.5236479", "0.5226157", "0.52234733", "0.52215916" ]
0.581876
28
Reading All data files
public static void Algorunner(String pathOfDataset,String reportPath) throws Exception { String path = pathOfDataset; //Map to pathOfDataset String files; File folder = new File(path); File[] listOfFiles = folder.listFiles(); int fileCounter=0; for (int i = 0; i < listOfFiles.length; i++) { if (listOfFiles[i].isFile()) { files = listOfFiles[i].getName(); if (files.endsWith(".arff")) { fileCounter++; } } } File[] arffFiles = new File[fileCounter]; fileCounter=0; for (int i = 0; i < listOfFiles.length; i++) { if (listOfFiles[i].isFile()) { files = listOfFiles[i].getName(); if (files.endsWith(".arff")) { arffFiles[fileCounter] = listOfFiles[i]; fileCounter++; } } } //Code For printing all file name System.out.println("Files for Testing :"); for (int i = 0; i < arffFiles.length; i++) { if (arffFiles[i].isFile()) { System.out.println((i+1)+") "+arffFiles[i].getName()); } } Classifier[] models = { new J48(), new PART(), new DecisionTable(), new DecisionStump(), new SimpleCart(), new NaiveBayes(), // Naive Bayes Classifier new Logistic(), new Bagging(), new WLSVM(), // SVM new RandomForest(), // Random Forest new IBk(), // K- nearest neighbour new MultilayerPerceptron(), //Neural Network new AdaBoostM1() //Ada boosting }; // //Start writing about csv StringBuilder csv2 = new StringBuilder(","); StringBuilder csvFile = new StringBuilder(","); for(int k=0;k<models.length;k++) { csv2.append(models[k].getClass().getSimpleName()); if(k!=models.length-1) csv2.append(","); else csv2.append("\n"); } System.out.println(csvFile.toString()); double[][] Comparision = new double[arffFiles.length][models.length]; int[][] weight = new int[arffFiles.length][models.length]; for (int i = 0; i < arffFiles.length; i++) { BufferedReader datafile = readDataFile(arffFiles[i].getName().toString(),pathOfDataset); System.out.println("File Under Testing..... : "+arffFiles[i].getName().toString()); Instances data = new Instances(datafile); data.setClassIndex(data.numAttributes() - 1); // Choose a type of validation split //Instances[][] split = crossValidationSplit(data, 10); // Separate split into training and testing arrays //Instances[] trainingSplits = split[0]; //Instances[] testingSplits = split[1]; // Choose a set of classifiers // Run for each classifier model for(int j = 0; j < models.length; j++) { //Code For error rate Evaluation eval = new Evaluation(data); models[j].buildClassifier(data); //used when training and test set is given //eval.evaluateModel(svm, filedata2); //single data eval.crossValidateModel(models[j], data,5, new Random(1)); double recall = eval.fMeasure(0)+eval.fMeasure(1); //eval.areaUnderROC(arg0) double aoc = eval.areaUnderROC(0); aoc = eval.areaUnderROC(1); double accuracy = 1-eval.errorRate(); // System.out.println("SVM error rate : "+errormid*100); // System.out.println(models[j].getClass().getSimpleName() + ": " + String.format("%.2f%%", (1-errormid)*100) + "\n====================="); //double param2 = eval.fMeasure(1); Comparision[i][j]= 1-eval.errorRate(); } } System.out.println(); System.out.println("Accuray of classifiers : Actual : "); for(int k=0;k<arffFiles.length;k++) { csv2.append(arffFiles[k].getName().toString()); csv2.append(","); for(int l=0;l<models.length;l++) { //System.out.print(" || "+Comparision[k][l]); csv2.append(Comparision[k][l]+","); } csv2.deleteCharAt(csv2.length()-1); csv2.append("\n"); //System.out.println(); //System.out.println("********************"); } csv2.deleteCharAt(csv2.length()-1); for(int k=0;k<arffFiles.length;k++) { double[][] sample = new double[2][models.length]; for(int l=0;l<models.length;l++) { sample[0][l]=Comparision[k][l]; sample[1][l]=(l+1); } //test for work... working :) /* for(int w=0;w<2;w++) { for(int q=0;q<models.length;q++) { System.out.print(" "+sample[w][q]); } System.out.println("*******"); } */ int n = models.length; double swap1,swap2; for (int c = 0; c < ( n - 1 ); c++) { for (int d = 0; d < n - c - 1; d++) { if (sample[0][d] > sample[0][d+1]) /* For descending order use < */ { swap1 = sample[0][d]; sample[0][d] = sample[0][d+1]; sample[0][d+1] = swap1; swap2 = sample[1][d]; sample[1][d] = sample[1][d+1]; sample[1][d+1] = swap2; } } } for(int l=0;l<models.length;l++) { Double d = new Double(sample[1][l]); weight[k][d.intValue()-1] = models.length-l; } } //testing System.out.println("Rank Vector "); for(int k=0;k<arffFiles.length;k++) { csvFile.append(arffFiles[k].getName().toString()); csvFile.append(","); for(int l=0;l<models.length;l++) { System.out.print(" || "+weight[k][l]); csvFile.append(weight[k][l]); if(l!=models.length-1) csvFile.append(","); else { //if(k!=arffFiles.length-1) csvFile.append("\n"); } } System.out.println(); } csvFile.append("\n"); csvFile.append("Sum of Ranks (Lower is Better)"); csvFile.append(","); StringBuilder rank = new StringBuilder(); for(int l=0;l<models.length;l++) { int sum=0; for(int k=0;k<arffFiles.length;k++) { sum+=weight[k][l]; } rank.append((double)sum/(double)arffFiles.length); csvFile.append(sum); if(l!=models.length-1) { csvFile.append(","); rank.append(","); } else { //if(k!=arffFiles.length-1) csvFile.append("\n"); rank.append("\n"); } } csvFile.append("\n"); csvFile.append("Avrage Ranks"); csvFile.append(","); csvFile.append(rank.toString()); //Ranks of algorithms int sum=0; int series = models.length; series = (series*(series+1))/2; series = series*(arffFiles.length); for(int l=0;l<models.length;l++) { for(int k=0;k<arffFiles.length;k++) { sum += weight[k][l]; } System.out.println("Parameter for "+models[l].getClass().getSimpleName()+ " : "+sum+"/"+series ); sum=0; System.out.println(); } /* for(int w=0;w<2;w++) { for(int q=0;q<models.length;q++) { System.out.print(" "+sample[w][q]); } System.out.println(" "); System.out.println(" "); System.out.println(" "); } } */ //arffFiles.length][models.length]; System.out.println("Done"); writeCSVReport(csvFile.toString(),reportPath); writeCSVReport(csv2.toString(), reportPath); System.out.println(csvFile.toString()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void readAll() throws FileNotFoundException{ \n b = new BinaryIn(this.filename);\n this.x = b.readShort();\n this.y = b.readShort();\n \n int count = (x * y) / (8 * 8);\n this.blocks = new double[count][8][8][3];\n \n Node juuri = readTree();\n readDataToBlocks(juuri);\n }", "public static void readFiles () throws FileNotFoundException{\n try {\n data.setFeatures(data.readFeatures(\"features.txt\"));\n data.setUnknown(data.readFeatures(\"unknown.txt\"));\n data.setTargets(data.readTargets(\"targets.txt\"));\n } catch (FileNotFoundException e) {\n System.out.println(\"Document not found\");\n }\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}", "public void readData() throws FileNotFoundException {\n this.plane = readPlaneDimensions();\n this.groupBookingsList = readBookingsList();\n }", "public void readFromFile() {\n\n\t}", "public void readFiles() {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\t// Open BufferedReader to open connection to tipslocation URL and read file\n\t\t\tBufferedReader reader1 = new BufferedReader(new InputStreamReader(tipsLocation.openStream()));\n\t\t\t\n\t\t\t// Create local variable to parse through the file\n\t String tip;\n\t \n\t // While there are lines in the file to read, add lines to tips ArrayList\n\t while ((tip = reader1.readLine()) != null) {\n\t tips.add(tip);\n\t }\n\t \n\t // Close the BufferedReader\n\t reader1.close();\n\t \n\t \n\t // Open BufferedReader to open connection to factsLocation URL and read file\n\t BufferedReader reader2 = new BufferedReader(new InputStreamReader(factsLocation.openStream()));\n\t \n\t // Create local variable to parse through the file\n\t String fact;\n\t \n\t // While there are lines in the file to read: parses the int that represents\n\t // the t-cell count that is associated with the line, and add line and int to \n\t // tCellFacts hashmap\n\t while ((fact = reader2.readLine()) != null) {\n\t \t\n\t \tint tCellCount = Integer.parseInt(fact);\n\t \tfact = reader2.readLine();\n\t \t\n\t tCellFacts.put(tCellCount, fact);\n\t }\n\t \n\t // Close the second BufferedReader\n\t reader2.close();\n\t \n\t\t} catch (FileNotFoundException e) {\n\t\t\t\n\t\t\tSystem.out.println(\"Error loading files\"); e.printStackTrace();\n\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\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 void processFiles(){\n\t\tfor(String fileName : files) {\n\t\t\ttry {\n\t\t\t\tloadDataFromFile(fileName);\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\tSystem.out.println(\"Can't open file: \" + fileName);\n\t\t\t\tSystem.out.println();\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tprintInOrder();\n\t\t\tstudents.clear();\n\t\t}\n\t}", "private static void readFridgeData() throws FileNotFoundException, InvalidDateException,\n InvalidQuantityException, EmptyDescriptionException,\n RepetitiveFoodIdentifierException, InvalidFoodCategoryException, InvalidFoodLocationException {\n File file = new File(DATA_FILE_PATH);\n Scanner scanner = new Scanner(file); // create a Scanner using the File as the source\n while (scanner.hasNext()) {\n String line = scanner.nextLine();\n populateFridge(line);\n }\n scanner.close();\n }", "private void readRootData() {\n String[] temp;\n synchronized (this.mRootDataList) {\n this.mRootDataList.clear();\n File file = getRootDataFile();\n if (!file.exists()) {\n HiLog.error(RootDetectReport.HILOG_LABEL, \"readRootData file NOT exist!\", new Object[0]);\n return;\n }\n try {\n FileInputStream fileInputStream = new FileInputStream(file);\n InputStreamReader inputStreamReader = new InputStreamReader(fileInputStream, \"UTF-8\");\n BufferedReader reader = new BufferedReader(inputStreamReader);\n StringBuffer sb = new StringBuffer((int) MAX_STR_LEN);\n while (true) {\n int intChar = reader.read();\n if (intChar == -1) {\n break;\n } else if (sb.length() >= MAX_STR_LEN) {\n break;\n } else {\n sb.append((char) intChar);\n }\n }\n for (String str : sb.toString().split(System.lineSeparator())) {\n this.mRootDataList.add(str);\n }\n reader.close();\n inputStreamReader.close();\n fileInputStream.close();\n } catch (FileNotFoundException e) {\n HiLog.error(RootDetectReport.HILOG_LABEL, \"file root result list cannot be found\", new Object[0]);\n } catch (IOException e2) {\n HiLog.error(RootDetectReport.HILOG_LABEL, \"Failed to read root result list\", new Object[0]);\n }\n }\n }", "public List getAll() throws FileNotFoundException, IOException;", "private void readFileList() throws IOException {\n\t\tint entries = metadataFile.readInt();\n\n\t\tfor (int i = 0; i < entries; i++) {\n\t\t\tint hash = metadataFile.readInt();\n\t\t\tlong dataOffset = metadataFile.readInt() & 0xFFFFFFFFL;\n\t\t\tlong dataSize = metadataFile.readInt() & 0xFFFFFFFFL;\n\t\t\tint pathListIndex = metadataFile.readInt();\n\n\t\t\tlong position = metadataFile.getPosition();\n\t\t\tmetadataFile.setPosition(pathListOffset + 8 + (pathListIndex * 8));\n\n\t\t\tlong pathOffset = metadataFile.readInt() & 0xFFFFFFFFL;\n\t\t\tint pathSize = metadataFile.readInt();\n\n\t\t\tmetadataFile.setPosition(pathListOffset + pathOffset);\n\t\t\tString path = metadataFile.readString(pathSize).trim();\n\n\t\t\tif (hash == hash(path)) \n\t\t\t\tfileEntries.add(new RAFFileEntry(dataOffset, dataSize, path));\n\t\t\telse\n\t\t\t\tthrow new IOException(\"Invalid hash for item '\" + path + \"'.\");\n\n\t\t\tmetadataFile.setPosition(position);\n\t\t}\n\t}", "@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 }", "public void getLocalDatas(File root) {\n \n //remove all\n clearList();\n \n //continues until the last elem is added\n for (File elem : root.listFiles()) {\n if (!elem.isDirectory()) {\n \n //gets the Name of the file\n String name = elem.getName();\n \n //calls the static Method calcFileSize() to calculate the size of the file\n double size = CalculateFileSize.calcFileSize(elem);\n add(new DataFile(name, size));\n }\n }\n super.fireTableDataChanged();\n }", "@Override\n\tpublic Stream<Path> loadAll() {\n\t\treturn null;\n\t}", "private void initializeFileArrays(){\n File downloadedFilesFolder = new File(MainActivity.DB_PATH);\n File[] files = downloadedFilesFolder.listFiles();\n System.out.println(\"*** \" + files.length + \" ***\");\n if(files != null){\n System.out.println(\"*** \" + files.length + \" ***\");\n for(File f : files){\n if(f != null){\n System.out.println(\"***\\n FILE FOUND - \" + f.getAbsolutePath()+\"\\nSIZE - \" +\n f.length() + \" BYTES \\n***\");\n fileNames.add(f.getName());\n fileSizes.add(f.length()+\"\");\n this.files.add(f);\n }\n }\n }\n }", "public List<Task> readFile() throws FileNotFoundException, DukeException {\n List<Task> output = new ArrayList<>();\n Scanner sc = new Scanner(file);\n while (sc.hasNext()) {\n output.add(readTask(sc.nextLine()));\n }\n return output;\n }", "private void getFiles() {\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(inputFileName);\n\t\t\tinputBuffer = new BufferedReader(fr);\n\n\t\t\tFileWriter fw = new FileWriter(outputFileName);\n\t\t\toutputBuffer = new BufferedWriter(fw);\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"File not found: \" + e.getMessage());\n\t\t\tSystem.exit(-2);\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"IOException \" + e.getMessage());\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(-3);\n\t\t}\n\t}", "private void readCategories() throws Exception {\n\t\t//reads files in nz category\n\t\tif (_nzCategories.size() > 0) {\n\t\t\tfor (String category: _nzCategories) {\n\t\t\t\t// read each individual line from the category files and store it\n\t\t\t\ttry {\n\t\t\t\t\tFile file = new File(\"categories/nz/\", category);\n\t\t\t\t\tScanner myReader = new Scanner(file);\n\t\t\t\t\tList<String> allLines = new ArrayList<String>();\n\t\t\t\t\twhile(myReader.hasNextLine()) {\n\t\t\t\t\t\tString fileLine = myReader.nextLine();\n\t\t\t\t\t\tallLines.add(fileLine);\n\t\t\t\t\t}\n\t\t\t\t\tList<String> copy = new ArrayList<String>(allLines);\n\t\t\t\t\t_nzData.put(category, copy);\n\t\t\t\t\tallLines.clear();\n\t\t\t\t\tmyReader.close();\n\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//reads file in international categories\n\t\tif (_intCategories.size() > 0) {\n\t\t\tfor (String category: _intCategories) {\n\t\t\t\t// read each individual line from the category files and store it\n\t\t\t\ttry {\n\t\t\t\t\tFile file = new File(\"categories/international/\", category);\n\t\t\t\t\tScanner myReader = new Scanner(file);\n\t\t\t\t\tList<String> allLines = new ArrayList<String>();\n\t\t\t\t\twhile(myReader.hasNextLine()) {\n\t\t\t\t\t\tString fileLine = myReader.nextLine();\n\t\t\t\t\t\tallLines.add(fileLine);\n\t\t\t\t\t}\n\t\t\t\t\tList<String> copy = new ArrayList<String>(allLines);\n\t\t\t\t\t_intData.put(category, copy);\n\t\t\t\t\tallLines.clear();\n\t\t\t\t\tmyReader.close();\n\t\t\t\t} catch (FileNotFoundException e) {\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "protected void openFiles() {\n\t\tthis.container = fso.openFile(prefix+EXTENSIONS[CTR_FILE],\"rw\");\n\t\tthis.metaData = fso.openFile(prefix+EXTENSIONS[MTD_FILE], \"rw\");\n\t\tthis.reservedBitMap = fso.openFile(prefix+EXTENSIONS[RBM_FILE], \"rw\");\n\t\tthis.updatedBitMap = fso.openFile(prefix+EXTENSIONS[UBM_FILE], \"rw\");\n\t\tthis.freeList = fso.openFile(prefix+EXTENSIONS[FLT_FILE], \"rw\");\n\t}", "static void ReadAndWriteDataSet(String folderName) throws IOException\n\t{\n\t\t\n\t\t String path = \"data\"+FS+\"data_stage_one\"+FS+folderName; // Folder path \n\t\t \n\t\t String filename, line;\n\t\t File folder = new File(path);\n\t\t File[] listOfFiles = folder.listFiles();\n\t\t BufferedReader br = null;\n\t\t for(int i=0; i < listOfFiles.length; i++)\n\t\t { \n\t\t\t System.out.println(listOfFiles[i].getName());\n\t\t\t filename = path+FS+listOfFiles[i].getName();\n\t\t\t try\n\t\t\t {\n\t\t\t\t br= new BufferedReader(new FileReader(new File(filename)));\n\t\t\t\t while((line = br.readLine())!= null)\n\t\t\t\t {\n\t\t\t\t\tfor(int j=0; j<prep.length; j++)\n\t\t\t\t\t{\n\t\t\t\t\t\tStringTokenizer st = new StringTokenizer(line);\n\t\t\t\t\t\twhile(st.hasMoreTokens())\n\t\t\t\t\t\t\tif(st.nextToken().equalsIgnoreCase(prep[j]))\n\t\t\t\t\t\t\t{\t//System.out.println(line);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tif(arr[j] == null)\n\t\t\t\t\t\t\t\t\tarr[j] = new ArrayList<String>();\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\tarr[j].add(line.toLowerCase().replaceAll(\"\\\\p{Punct}\",\"\").trim().replaceAll(\"\\\\s+\", \" \"));\n\t\t\t\t\t\t\t\tbreak;\n\t\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 }\n\t\t\t catch(Exception e)\n\t\t\t {\n\t\t\t\t System.err.println(\"exception: \"+e.getMessage() );\n\t\t\t\t e.printStackTrace();\n\t\t\t\t System.exit(0);\n\t\t\t }\n\t\t\t finally\n\t\t\t {\n\t\t\t\t br.close();\n\t\t\t }\n\t\t }\n\t\t \n\t\t // Writes the entire arraylist(preposition wise seperated files)\n\t\t \n\t\t WriteSeperated(folderName);\n\t\t \n\t\t for(int i=0; i<prep.length; i++)\n\t\t {\n\t\t\t arr[i].clear();\n\t\t }\n\t\t \n\t}", "public abstract void readFromFile( ) throws Exception;", "public void readEntries() throws FileAccessException;", "public void getDataFromFile() throws SQLException{\n \n //SQL database\n getGuestDate_DB();\n getHotelRoomData_DB();\n updateRoomChanges_DB();\n \n //this.displayAll();\n //this.displayAllRooms();\n \n }", "private void readSavedFile() {\n\n String[] files = new String[0];\n \n // On récupère la liste des fichiers\n File file = new File(folderName);\n\n // check if the specified pathname is directory first\n if(file.isDirectory()){\n //list all files on directory\n files = file.list();\n }\n\n if (files != null) {\n for(String currentFile : files) {\n Vehicule voiture;\n try {\n FileInputStream fileIn = new FileInputStream(folderName + \"/\" + currentFile);\n ObjectInputStream in = new ObjectInputStream(fileIn);\n voiture = (Vehicule) in.readObject();\n addVoitureToList(voiture);\n in.close();\n fileIn.close();\n } catch (IOException i) {\n i.printStackTrace();\n return;\n } catch (ClassNotFoundException c) {\n System.out.println(\"#Erreur : Impossible de récupérer l'objet \" + currentFile);\n c.printStackTrace();\n return;\n }\n }\n }\n }", "public List<Object[]> gatherData() {\n String testDir = System.getProperty(\"test.dir\");\n logger.info(\"Data from: \" + testDir);\n String testFilter = System.getProperty(\"test.filter\");\n List<Object[]> result = new ArrayList<Object[]>();\n File testDirFile = new File(testDir);\n File rootConfigFile = new File(testDirFile, \"config.properties\");\n Properties rootProp = new Properties();\n InputStream rootIn = null;\n try {\n rootIn = new FileInputStream(rootConfigFile);\n rootProp.load(rootIn);\n } catch (IOException e) {\n // if we can't get root properties, we just take empty root\n // properties\n rootProp = new Properties();\n } finally {\n IOUtils.closeQuietly(rootIn);\n }\n\n File[] childFiles = null;\n if (testFilter == null) {\n childFiles = testDirFile.listFiles();\n } else {\n String[] wildcards = testFilter.split(\";\");\n childFiles = testDirFile\n .listFiles((FilenameFilter) new WildcardFileFilter(\n wildcards));\n }\n int idx = 0;\n for (File child : childFiles) {\n if (child.isDirectory() && directoryContainsConfig(child)) {\n File configFile = new File(child, \"config.properties\");\n Properties prop = new Properties();\n InputStream in = null;\n try {\n in = new FileInputStream(configFile);\n prop.load(in);\n \n String parent = prop.getProperty(PARENT_CFG);\n if(parent != null) {\n \tFile parentFile = new File(child, parent);\n \tif(parentFile.exists()) {\n \t\tprop.clear();\n \t\tprop.load(new FileInputStream(parentFile));\n \t\tprop.load(new FileInputStream(configFile));\n \t}\n }\n \n if (isSupportedTestType(prop)) {\n Object[] data = extractDataFromConfig(configFile,\n rootProp, prop);\n result.add(data);\n String testName = idx + \"-\" + data[1].toString();\n ((BaseSignatureTestData)data[2]).setUniqueUnitTestName(testName);\n idx++;\n }\n } catch (IOException e) {\n logger.warn(\n \"Could not run test with config:\"\n + configFile.getAbsolutePath(), e);\n } finally {\n if (in != null)\n IOUtils.closeQuietly(in);\n }\n }\n }\n return result;\n }", "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 }", "public interface ReaderFromFile {\n\t\n\tpublic List<Data> readDataFromFile (String filename);\n}", "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 void readResult() {\n File dirXml = new File(System.getProperty(\"user.dir\") + \"/target/classes/\");\n /// Get Parent Directory\n String parentDirectory = dirXml.getParent();\n File folder = new File(parentDirectory + \"/jbehave\");\n File[] listOfFiles = folder.listFiles();\n\n if (listOfFiles != null) {\n for (File listOfFile : listOfFiles) {\n if (listOfFile.isFile()) {\n String filePath = folder.getPath() + \"/\" + listOfFile.getName();\n System.out.println(\"File \" + filePath);\n if (filePath.contains(\".xml\") && !filePath.contains(\"AfterStories\") && !filePath.contains(\n \"BeforeStories\")) {\n readXML(filePath);\n }\n }\n }\n }\n }", "void massiveModeLoading( File dataPath );", "void read() {\n try {\n pre_list = new ArrayList<>();\n suf_list = new ArrayList<>();\n p_name = new ArrayList<>();\n stem_word = new ArrayList<>();\n\n //reading place and town name\n for (File places : place_name.listFiles()) {\n fin = new FileInputStream(places);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n place.add(temp);\n }\n\n }\n\n //reading month name\n for (File mont : month_name.listFiles()) {\n fin = new FileInputStream(mont);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n month.add(temp);\n }\n }\n\n //reading compound words first\n for (File comp_word : com_word_first.listFiles()) {\n fin = new FileInputStream(comp_word);\n scan = new Scanner(fin);\n while (scan.hasNextLine()) {\n temp = scan.nextLine();\n temp = Normalization(temp);\n comp_first.add(temp);\n }\n }\n //reading next word of the compound\n for (File comp_word_next : com_word_next.listFiles()) {\n fin = new FileInputStream(comp_word_next);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n comp_next.add(temp);\n }\n }\n //reading chi square feature\n for (File entry : chifile.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n chiunion.add(temp);\n }\n newunions.clear();\n newunions.addAll(chiunion);\n chiunion.clear();\n chiunion.addAll(newunions);\n chiunion.removeAll(stop_word_list);\n chiunion.removeAll(p_name);\n chiunion.removeAll(month);\n chiunion.removeAll(place);\n }\n //reading short form from abbrivation \n for (File short_list : abbrivation_short.listFiles()) {\n fin = new FileInputStream(short_list);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n shortform.add(temp);\n }\n }\n //reading long form from the abrivation \n for (File long_list : abbrivation_long.listFiles()) {\n fin = new FileInputStream(long_list);\n scan = new Scanner(fin);\n while (scan.hasNextLine()) {\n temp = scan.nextLine();\n temp = Normalization(temp);\n longform.add(temp);\n }\n }\n //reading file from stop word\n for (File stoplist : stop_word.listFiles()) {\n fin = new FileInputStream(stoplist);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n stop_word_list.add(temp);\n }\n }\n\n //reading person name list\n for (File per_name : person_name.listFiles()) {\n fin = new FileInputStream(per_name);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n p_name.add(temp);\n }\n }\n\n //reading intersection union\n for (File entry : interfile.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (temp.length() < 2 && temp.length() > 9) {\n\n } else {\n interunion.add(temp);\n }\n }\n newunions.clear();\n newunions.addAll(interunion);\n interunion.clear();\n interunion.addAll(newunions);\n interunion.removeAll(stop_word_list);\n interunion.removeAll(p_name);\n interunion.removeAll(month);\n interunion.removeAll(place);\n }\n // reading ig union\n for (File entry : igfile.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (temp.length() < 2 && temp.length() > 9) {\n\n } else {\n igunion.add(temp);\n }\n }\n for (String str : igunion) {\n int index = igunion.indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n igunion.set(index, stem_word.get(i));\n }\n }\n }\n newunions.clear();\n newunions.addAll(igunion);\n igunion.clear();\n igunion.addAll(newunions);\n igunion.removeAll(stop_word_list);\n igunion.removeAll(p_name);\n igunion.removeAll(month);\n igunion.removeAll(place);\n }\n //read df uinfion\n for (File entry : dffile.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (temp.length() < 2 && temp.length() > 9) {\n\n } else {\n dfunion.add(temp);\n }\n }\n for (String str : dfunion) {\n int index = dfunion.indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n dfunion.set(index, stem_word.get(i));\n }\n }\n }\n newunions.clear();\n newunions.addAll(dfunion);\n dfunion.clear();\n dfunion.addAll(newunions);\n dfunion.removeAll(stop_word_list);\n dfunion.removeAll(p_name);\n dfunion.removeAll(month);\n dfunion.removeAll(place);\n }\n //reading unified model\n for (File entry : unionall_3.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (temp.length() < 2 && temp.length() > 9) {\n\n } else {\n union_3.add(temp);\n }\n }\n for (String str : union_3) {\n int index = union_3.indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n union_3.set(index, stem_word.get(i));\n }\n }\n }\n newunions.clear();\n newunions.addAll(union_3);\n union_3.clear();\n union_3.addAll(newunions);\n union_3.removeAll(stop_word_list);\n union_3.removeAll(p_name);\n union_3.removeAll(month);\n union_3.removeAll(place);\n }\n //unified feature for the new model\n for (File entry : unified.listFiles()) {\n\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n newunion.add(temp);\n\n }\n for (String str : newunion) {\n int index = newunion.indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n newunion.set(index, stem_word.get(i));\n }\n }\n }\n newunions.clear();\n newunions.addAll(newunion);\n newunion.clear();\n newunion.addAll(newunions);\n newunion.removeAll(stop_word_list);\n newunion.removeAll(p_name);\n newunion.removeAll(month);\n newunion.removeAll(place);\n\n // newunion.addAll(newunions);\n }\n // reading test file and predict the class\n for (File entry : test_doc.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n file_test.add(temp);\n\n }\n newunions.clear();\n newunions.addAll(file_test);\n file_test.clear();\n file_test.addAll(newunions);\n file_test.removeAll(stop_word_list);\n file_test.removeAll(p_name);\n file_test.removeAll(month);\n file_test.removeAll(place);\n }\n //reading the whole document under economy class\n for (File entry : economy.listFiles()) {\n fill = new File(economy + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n economydocument[count1] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n economydocument[count1].add(temp);\n if (temp.length() < 2) {\n economydocument[count1].remove(temp);\n }\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n economydocument[count1].remove(temp);\n }\n }\n for (String str : economydocument[count1]) {\n int index = economydocument[count1].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n economydocument[count1].set(index, stem_word.get(i));\n }\n }\n }\n }\n economydocument[count1].removeAll(stop_word_list);\n economydocument[count1].removeAll(p_name);\n economydocument[count1].removeAll(month);\n economydocument[count1].removeAll(place);\n allecofeature.addAll(economydocument[count1]);\n ecofeature.addAll(economydocument[count1]);\n allfeature.addAll(ecofeature);\n all.addAll(allecofeature);\n count1++;\n\n }\n //reading the whole documents under education category \n for (File entry : education.listFiles()) {\n fill = new File(education + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n educationdocument[count2] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n educationdocument[count2].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n educationdocument[count2].remove(temp);\n }\n }\n }\n\n for (String str : educationdocument[count2]) {\n int index = educationdocument[count2].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n educationdocument[count2].set(index, stem_word.get(i));\n }\n }\n }\n educationdocument[count2].removeAll(stop_word_list);\n educationdocument[count2].removeAll(p_name);\n educationdocument[count2].removeAll(month);\n educationdocument[count2].removeAll(place);\n alledufeature.addAll(educationdocument[count2]);\n edufeature.addAll(educationdocument[count2]);\n allfeature.addAll(edufeature);\n all.addAll(alledufeature);\n count2++;\n }\n// //reading all the documents under sport category\n for (File entry : sport.listFiles()) {\n fill = new File(sport + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n sportdocument[count3] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n sportdocument[count3].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n sportdocument[count3].remove(temp);\n }\n }\n }\n\n for (String str : sportdocument[count3]) {\n int index = sportdocument[count3].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n sportdocument[count3].set(index, stem_word.get(i));\n }\n }\n }\n sportdocument[count3].removeAll(stop_word_list);\n sportdocument[count3].removeAll(p_name);\n sportdocument[count3].removeAll(month);\n sportdocument[count3].removeAll(place);\n allspofeature.addAll(sportdocument[count3]);\n spofeature.addAll(sportdocument[count3]);\n allfeature.addAll(spofeature);\n all.addAll(allspofeature);\n count3++;\n }\n\n// //reading all the documents under culture category\n for (File entry : culture.listFiles()) {\n fill = new File(culture + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n culturedocument[count4] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n\n culturedocument[count4].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n culturedocument[count4].remove(temp);\n }\n }\n\n }\n for (String str : culturedocument[count4]) {\n int index = culturedocument[count4].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n culturedocument[count4].set(index, stem_word.get(i));\n }\n }\n }\n culturedocument[count4].removeAll(stop_word_list);\n culturedocument[count4].removeAll(p_name);\n culturedocument[count4].removeAll(month);\n culturedocument[count4].removeAll(place);\n allculfeature.addAll(culturedocument[count4]);\n culfeature.addAll(culturedocument[count4]);\n allfeature.addAll(culfeature);\n all.addAll(allculfeature);\n count4++;\n\n }\n\n// //reading all the documents under accident category\n for (File entry : accident.listFiles()) {\n fill = new File(accident + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n accedentdocument[count5] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n accedentdocument[count5].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n accedentdocument[count5].remove(temp);\n }\n }\n\n }\n\n for (String str : accedentdocument[count5]) {\n int index = accedentdocument[count5].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n accedentdocument[count5].set(index, stem_word.get(i));\n }\n }\n }\n accedentdocument[count5].removeAll(stop_word_list);\n accedentdocument[count5].removeAll(p_name);\n accedentdocument[count5].removeAll(month);\n accedentdocument[count5].removeAll(place);\n allaccfeature.addAll(accedentdocument[count5]);\n accfeature.addAll(accedentdocument[count5]);\n allfeature.addAll(accfeature);\n all.addAll(allaccfeature);\n count5++;\n }\n\n// //reading all the documents under environmental category\n for (File entry : environmntal.listFiles()) {\n fill = new File(environmntal + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n environmntaldocument[count6] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n environmntaldocument[count6].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n environmntaldocument[count6].remove(temp);\n }\n }\n }\n\n for (String str : environmntaldocument[count6]) {\n int index = environmntaldocument[count6].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n environmntaldocument[count6].set(index, stem_word.get(i));\n }\n }\n }\n environmntaldocument[count6].removeAll(stop_word_list);\n environmntaldocument[count6].removeAll(p_name);\n environmntaldocument[count6].removeAll(month);\n environmntaldocument[count6].removeAll(place);\n allenvfeature.addAll(environmntaldocument[count6]);\n envfeature.addAll(environmntaldocument[count6]);\n allfeature.addAll(envfeature);\n all.addAll(allenvfeature);\n count6++;\n }\n\n// //reading all the documents under foreign affairs category\n for (File entry : foreign_affair.listFiles()) {\n fill = new File(foreign_affair + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n foreign_affairdocument[count7] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n foreign_affairdocument[count7].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n foreign_affairdocument[count7].remove(temp);\n }\n }\n\n }\n for (String str : foreign_affairdocument[count7]) {\n int index = foreign_affairdocument[count7].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n foreign_affairdocument[count7].set(index, stem_word.get(i));\n }\n }\n }\n foreign_affairdocument[count7].removeAll(stop_word_list);\n foreign_affairdocument[count7].removeAll(p_name);\n foreign_affairdocument[count7].removeAll(month);\n foreign_affairdocument[count7].removeAll(place);\n alldepfeature.addAll(foreign_affairdocument[count7]);\n depfeature.addAll(foreign_affairdocument[count7]);\n allfeature.addAll(depfeature);\n all.addAll(alldepfeature);\n count7++;\n }\n\n// //reading all the documents under law and justices category\n for (File entry : law_justice.listFiles()) {\n fill = new File(law_justice + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n law_justicedocument[count8] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n law_justicedocument[count8].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n law_justicedocument[count8].remove(temp);\n }\n }\n\n }\n for (String str : law_justicedocument[count8]) {\n int index = law_justicedocument[count8].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n law_justicedocument[count8].set(index, stem_word.get(i));\n }\n }\n }\n law_justicedocument[count8].removeAll(stop_word_list);\n law_justicedocument[count8].removeAll(p_name);\n law_justicedocument[count8].removeAll(month);\n law_justicedocument[count8].removeAll(month);\n alllawfeature.addAll(law_justicedocument[count8]);\n lawfeature.addAll(law_justicedocument[count8]);\n allfeature.addAll(lawfeature);\n all.addAll(alllawfeature);\n count8++;\n }\n\n// //reading all the documents under other category\n for (File entry : agri.listFiles()) {\n fill = new File(agri + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n agriculture[count9] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n agriculture[count9].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n agriculture[count9].remove(temp);\n }\n }\n\n }\n for (String str : agriculture[count9]) {\n int index = agriculture[count9].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n agriculture[count9].set(index, stem_word.get(i));\n }\n }\n }\n agriculture[count9].removeAll(stop_word_list);\n agriculture[count9].removeAll(p_name);\n agriculture[count9].removeAll(month);\n agriculture[count9].removeAll(place);\n allagrifeature.addAll(agriculture[count9]);\n agrifeature.addAll(agriculture[count9]);\n allfeature.addAll(agrifeature);\n all.addAll(allagrifeature);\n count9++;\n }\n //reading all the documents under politics category\n for (File entry : politics.listFiles()) {\n fill = new File(politics + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n politicsdocument[count10] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n politicsdocument[count10].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n politicsdocument[count10].remove(temp);\n }\n }\n }\n for (String str : politicsdocument[count10]) {\n int index = politicsdocument[count10].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n politicsdocument[count10].set(index, stem_word.get(i));\n }\n }\n }\n politicsdocument[count10].removeAll(stop_word_list);\n politicsdocument[count10].removeAll(p_name);\n politicsdocument[count10].removeAll(month);\n politicsdocument[count10].removeAll(place);\n allpolfeature.addAll(politicsdocument[count10]);\n polfeature.addAll(politicsdocument[count10]);\n allfeature.addAll(polfeature);\n all.addAll(allpolfeature);\n count10++;\n }\n //reading all the documents under science and technology category\n for (File entry : science_technology.listFiles()) {\n fill = new File(science_technology + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n science_technologydocument[count12] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n science_technologydocument[count12].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n science_technologydocument[count12].remove(temp);\n }\n }\n\n }\n for (String str : science_technologydocument[count12]) {\n int index = science_technologydocument[count12].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n science_technologydocument[count12].set(index, stem_word.get(i));\n }\n }\n }\n science_technologydocument[count12].removeAll(stop_word_list);\n science_technologydocument[count12].removeAll(p_name);\n science_technologydocument[count12].removeAll(month);\n science_technologydocument[count12].removeAll(place);\n allscifeature.addAll(science_technologydocument[count12]);\n scifeature.addAll(science_technologydocument[count12]);\n allfeature.addAll(scifeature);\n all.addAll(allscifeature);\n count12++;\n\n }\n\n //reading all the documents under health category\n for (File entry : health.listFiles()) {\n fill = new File(health + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n healthdocument[count13] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n healthdocument[count13].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n healthdocument[count13].remove(temp);\n }\n }\n }\n for (String str : healthdocument[count13]) {\n int index = healthdocument[count13].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n healthdocument[count13].set(index, stem_word.get(i));\n }\n }\n }\n healthdocument[count13].removeAll(stop_word_list);\n healthdocument[count13].removeAll(p_name);\n healthdocument[count13].removeAll(month);\n healthdocument[count13].removeAll(place);\n allhelfeature.addAll(healthdocument[count13]);\n helfeature.addAll(healthdocument[count13]);\n allfeature.addAll(helfeature);\n all.addAll(allhelfeature);\n count13++;\n }\n\n //reading all the file of relgion categories \n for (File entry : army_file.listFiles()) {\n fill = new File(army_file + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n army[count14] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n army[count14].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n army[count14].remove(temp);\n }\n }\n\n }\n for (String str : army[count14]) {\n int index = army[count14].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n army[count14].set(index, stem_word.get(i));\n }\n }\n }\n army[count14].removeAll(stop_word_list);\n army[count14].removeAll(p_name);\n army[count14].removeAll(month);\n army[count14].removeAll(place);\n allarmfeature.addAll(army[count14]);\n armfeature.addAll(army[count14]);\n allfeature.addAll(armfeature);\n all.addAll(allarmfeature);\n count14++;\n }\n } catch (Exception ex) {\n System.out.println(\"here\");\n }\n }", "public Map<String, SubjectDataContainer> loadAllFromFile(String collectionIdentifier) {\n Path collection = this.container.resolve(collectionIdentifier);\n if (!Files.exists(collection)) {\n return Collections.emptyMap();\n }\n\n Map<String, SubjectDataContainer> holders = new HashMap<>();\n try (Stream<Path> s = Files.list(collection)){\n s.filter(p -> p.getFileName().toString().endsWith(\".json\"))\n .forEach(subjectFile -> {\n try {\n LoadedSubject sub = loadFromFile(subjectFile);\n if (sub != null) {\n holders.put(sub.identifier, sub.data);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n });\n } catch (IOException e) {\n e.printStackTrace();\n }\n return holders;\n }", "List readFile(String pathToFile);", "@Test\n\tpublic void testReadDataFromFiles2(){\n\t\tassertEquals((Integer)1 , DataLoader.data.get(\"http\"));\n\t\tassertEquals((Integer)1, DataLoader.data.get(\"search\"));\n\t}", "private void fileRead(String path)\n\t{\n\t\ttry\n\t\t{\n\t\t\t// create file\n\t\t\tFile file = new File(path);\n\t\t\tFileInputStream fileStream = new FileInputStream(file);\n\t\t\t\n\t\t\t// data read\n\t\t\tthis.dataContent = new byte[(int)file.length()];\n\t\t\tint ret = fileStream.read(this.dataContent, 0, (int)file.length());\n\t\t}\n\t\tcatch(FileNotFoundException e)\n\t\t{\n\t\t\tSystem.out.println(\"File Not Found : \" + e.getMessage());\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tSystem.out.println(\"Failed File Read : \" + e.getMessage());\n\t\t}\n\t\t\n\t}", "public void getData() {\n\t\tfileIO.importRewards();\n\t\tfileIO.getPrefs();\n\t}", "public void readTable() {\r\n\r\n try ( BufferedReader b = new BufferedReader(new FileReader(\"Hashdata.txt\"))) {\r\n\r\n String line;\r\n ArrayList<String> arr = new ArrayList<>();\r\n while ((line = b.readLine()) != null) {\r\n\r\n arr.add(line);\r\n }\r\n\r\n for (String str : arr) {\r\n this.load(str);\r\n }\r\n this.print();\r\n\r\n } catch (IOException e) {\r\n System.out.println(\"Unable to read file\");\r\n }\r\n\r\n this.userInterface();\r\n\r\n }", "@Override\n\tpublic void loadData() throws FileNotFoundException {\n\t\tthis.getPromoShare();\n\t}", "public int[][][] getData() throws AreaFileException {\r\n int[][][] mydata = readData(0,0,dir[AD_NUMELEMS],numberLines);\r\n return mydata;\r\n }", "void readData(String dataFilename) {\n System.out.println(\"NormalizedStorySheetsHandler\");\n InputStream is = null;\n try {\n is = new FileInputStream(dataFilename);\n Workbook wb = WorkbookFactory.create(is);\n Sheet rolesSheet = wb.getSheet(\"Role\");\n Sheet goalsSheet = wb.getSheet(\"Goal\");\n Sheet benefitsSheet = wb.getSheet(\"Benefit\");\n Sheet criteriaSheet = wb.getSheet(\"Criterion\");\n readRows(roles, rolesSheet);\n readRows(goals, goalsSheet);\n readRows(benefits, benefitsSheet);\n readRows(criteria, criteriaSheet);\n } catch (Exception e) {\n System.out.println(e.getMessage());\n } finally {\n try {\n if (is != null) {\n is.close();\n }\n } catch (Exception e) {\n System.out.println(e.getMessage());\n }\n }\n }", "private void getDataLists(String path)\n\t{\n\t\ttry\n\t\t{\n\t\t\tFile file = new File(path);\n\t\t\tfile.createNewFile();\n\t\t\tBufferedReader fileReader = new BufferedReader(new FileReader(file));\n\t\t\t\n\t\t\tString str = null;\n\t\t\twhile((str = fileReader.readLine()) != null)\n\t\t\t{\n\t\t\t\tthis.dataList.push(str);\n\t\t\t}\n\t\t}\n\t\tcatch(IOException e)\n\t\t{\n\t\t\tSystem.out.println(\"Failed : data list read\");\n\t\t}\n\t}", "public static void readInstances(ArrayList<MISPData> data, String path_folder) throws IOException {\n\t\tfinal File folder = new File(path_folder);\r\n\t\tfor (final File fileEntry : folder.listFiles()) {//recorre los files de la carpeta folder\r\n\t\t\tif (fileEntry.isDirectory()) {\r\n\t\t\t\treadInstances(data, fileEntry.getPath());\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.print(\"-\");\r\n\t\t\t\t//System.out.println(\"Leyendo: \" + fileEntry.getName());\r\n\t\t\t\tMISPData mispd = new MISPData();//Declara una nueva variable MISPData, con atributos vacios\r\n\t\t\t\treadFile(mispd.getInstance(), fileEntry.getPath());//metodo readFile, recibe un parametro instancia vacio y el nombre del file correspondiente a una instancia a leer \r\n\t\t\t\t//mispd.instance.getIndependenSet().Print_ListAdya();//Imprime por consola la lista enlazada\r\n\t\t\t\tdata.add(mispd);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void readData(String infile) throws Exception {\r\n \t\tScanner in = new Scanner(new FileReader(infile));\r\n \t}", "public static ArrayList<MonitoredData> readFileData(){\n ArrayList<MonitoredData> data = new ArrayList<>();\n List<String> lines = new ArrayList<>();\n try (Stream<String> stream = Files.lines(Paths.get(\"Activities.txt\"))) {\n lines = stream\n .flatMap((line->Stream.of(line.split(\"\\t\\t\"))))\n .collect(Collectors.toList());\n for(int i=0; i<lines.size()-2; i+=3){\n MonitoredData md = new MonitoredData(lines.get(i), lines.get(i+1), lines.get(i+2));\n data.add(md);\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n //data.forEach(System.out::println);\n return data;\n }", "public static double allFile() {\n\t\tint allCount = 0;\n\t\tdouble allSalary = 0;\n\t\tString professor = \"Unknown\";\n\t\tdouble salary = 0.0;\n\t\topenURL(); //open dataset\n\t\twhile(input.hasNext()) {\n\t\t\tprofessor = input.next();\n\t\t\tprofessor = input.next();\n\t\t\tprofessor = input.next();\n\t\t\tsalary = input.nextDouble();\n\t\t\tallSalary += salary;\n\t\t\tallCount++;\n\t\t\tprofessor = \"all\";\t\n\t\t}\t\t\n\t\t//display all professor total salary\n\t\tSystem.out.println(\"Total salary for \" + professor + \" professors is $\" + dF.format(allSalary));\n\t\t\n\t\treturn allSalary / allCount;\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 void getParameters() {\r\n\t\ttry {\r\n\t\t\tp_encoding = \"ISO-8859-1\";\r\n\t\t\tp_page_encoding = \"utf-8\";\r\n\t\t\tp_labels_data_file = \"resources/units/labels.txt\";\r\n\t\t\tp_multiplier_data_file = \"resources/units/muldata.txt\";\r\n\t\t\tp_category_data_file = \"resources/units/catdata.txt\";\r\n\t\t\tp_unit_data_file = \"resources/units/unitdata.txt\";\r\n\t\t}\r\n\t\tcatch(Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treadDataFile(0, p_multiplier_data_file); //read data from external text file\r\n\t\treadDataFile(1, p_category_data_file); //read data from external text file\r\n\t\treadDataFile(2, p_unit_data_file); //read data from external text file\r\n\t\treadDataFile(3, p_labels_data_file); //read data from external text file\r\n\t}", "public void read() {\n\t\tFileInputStream fis;\n\t\ttry {\n\t\t\tfis = new FileInputStream(\"studentData.dat\");\n\n\t\t\tObjectInputStream ois;\n\t\t\ttry {\n\t\t\t\tois = new ObjectInputStream(fis);\n\t\t\t\ttry {\n\t\t\t\t\tstudentList = (ArrayList<Student>) ois.readObject();\n\t\t\t\t} catch (ClassNotFoundException e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t\tois.close();\n\t\t\t} catch (IOException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\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 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 void read(String fname){\r\n\t\t\t\r\n\t\t\tString line = \"\";\r\n\t\t\ttry {\r\n\t // FileReader reads text files in the default encoding.\r\n\t FileReader fileReader = new FileReader(fname);\r\n\t \r\n\t // Always wrap FileReader in BufferedReader.\r\n\t BufferedReader bufferedReader = new BufferedReader(fileReader);\r\n\t header=bufferedReader.readLine();\r\n\t \r\n\t data = new ArrayList<alldata>();\r\n\r\n\t while((line = bufferedReader.readLine()) != null) {\r\n\t \t\r\n\t //parse line and divide data by comma\r\n\t \r\n\t \t\r\n\t \tString[] lineStr = line.split(\",\");\r\n\t \t\r\n\t //create object row into which data from each line is stored and then added to array list\t\r\n\t \t\r\n\t if(lineStr.length >0) {\r\n\t \talldata row = new alldata();\r\n\t \trow.Name = lineStr[0]+ \",\" + lineStr[1];\r\n\t \trow.Num = lineStr[2];\r\n\t \trow.State = lineStr[3];\r\n\t \trow.Zip = lineStr[4];\r\n\t \trow.Age = Integer.parseInt(lineStr[6]);\r\n\t \trow.Sex = lineStr[7];\r\n\t \t\r\n\t \tdata.add(row);\r\n\t }\r\n\t \r\n\t \r\n\t } \r\n\t bufferedReader.close(); // Always close files. \r\n\t }catch(FileNotFoundException ex) {\r\n\t System.out.println(\"Unable to open file '\" + fname + \"'\"); \r\n\t }catch(IOException ex) {\r\n\t System.out.println(\"Error reading file '\" + fname + \"'\"); \r\n\t }\r\n\t\t\tSystem.out.println(\"Finish reading data from file \"+ fname);\r\n\t\t}", "public static void LoadProcessedData(String folderPath)\n\t{\n\t\tSystem.out.println(\"... loading processed data from folder \" + folderPath + \"...\");\n\t\t\n\t\t// open the directory\n\t\tFile directory = new File(folderPath);\n\t\tif (directory.exists() && directory.isDirectory())\n\t\t{\n\t\t\t// check for necessary files\n\t\t\ttry \n\t\t\t{\n\t\t\t\tfor (File current : directory.listFiles())\n\t\t\t\t{\n\t\t\t\t\tif (!current.isDirectory())\n\t\t\t\t\t{\n\t\t\t\t\t\tif (current.getName().contains(\"_\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tswitch (current.getName().split(\"_\")[1])\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcase featuresPath:\n\t\t\t\t\t\t\t\t\tFeatureExpressionCollection.DeserialzeFeatures(current);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase methodsPath:\n\t\t\t\t\t\t\t\t\tMethodCollection.DeserialzeMethods(current);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase filesPath:\n\t\t\t\t\t\t\t\t\tFileCollection.DeserialzeFiles(current);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\tcase generalPath:\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t// read text file, first line is for featureexpressioncollection\n\t\t\t\t\t\t\t\t\tList<String> lines = FileUtils.readLines(current);\n\t\t\t\t\t\t\t\t\tString general = lines.get(0);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t// set unserializable values\n\t\t\t\t\t\t\t\t\tString[] split = general.split(\"=\")[1].split(\";\");\n\t\t\t\t\t\t\t\t\tFeatureExpressionCollection.SetCount(Integer.parseInt(split[0]));\n\t\t\t\t\t\t\t\t\tFeatureExpressionCollection.AddLoc(Integer.parseInt(split[1]));\n\t\t\t\t\t\t\t\t\tFeatureExpressionCollection.SetMeanLofc(Integer.parseInt(split[2]));\n\t\t\t\t\t\t\t\t\tFeatureExpressionCollection.numberOfFeatureConstants = Integer.parseInt(split[3]);\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\n\t\t\t\t}\t\n\t\t\t\tSystem.out.println(\"... done!\");\n\t\t\t} \n\t\t\tcatch (Exception e) \n\t\t\t{\n\t\t\t\tSystem.out.println(\"ERROR: could not load processed data!\");\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"No processed data in the directory found!\");\n\t\t}\n\t}", "public Data(Main aMain, Framework frw) {\n\tmain = aMain;\n\n File pf = new File(main.myPath);\n String[] datal = pf.list(new FilenameFilter() {\n public boolean accept(File dir, String name) {\n return\n name.endsWith(\".xml\") &&\n name.startsWith(\"data\");\n }\n });\n for (int i = 0; i < datal.length; i++) {\n Document data = Framework.parse(main.myPath + datal[i], \"encounters\");\n loadFromDoc(data);\n }\n }", "private static void getResults() {\n\t\t//Variables\n\t\tFile directoryOfChunks = new File(\"output\");\n\t\tFile[] files = directoryOfChunks.listFiles();\n\t\tArrayList<String> filesInFolder = new ArrayList<>();\n\t\tArrayList<String> chunkResults = new ArrayList<>();\n\t\tBufferedReader br = null;\n\t\tReadFromFile rf = new ReadFromFile();\n\n\t\t//Get files from output folder\n\t\tif(directoryOfChunks.exists() && directoryOfChunks.isDirectory()){\n\t\t\tdirectoryName = \"output\";\n\t\t\t//Copy file names into arraylist\n\t\t\tfor (File f: files) {\n\t\t\t\t//Save file names into arraylist.\n\t\t\t\tfilesInFolder.add(f.getName());\n\t\t\t}\n\t\t}\n\t\t//if not a file or directory print error message\n\t\telse{\n\t\t\tSystem.out.println(\"No such file/directory: \" + directoryOfChunks);\n\t\t}\n\n\t\t//for loop to open and read each individual file\n\t\tfor (String file : filesInFolder) {\n\t\t\ttry {\n\n\t\t\t\tFileReader reader = new FileReader(directoryName + \"\\\\\" + file);\n\t\t\t\tbr = new BufferedReader(reader);\n\t\t\t} catch (FileNotFoundException e1) {\n\t\t\t\te1.printStackTrace();\n\t\t\t}\n\t\t\tchunkResults.addAll(rf.readFromChunk(br));\n\t\t}\n\n\t\t//Call sanitizeAndSplit\n\t\tsanitizeAndSplit(chunkResults);\n\t}", "public static void readLotteryFiles() {\n\t\tfor (int index = 0; index < NpcHandler.npcs.length; index++) {\n\t\t\tNpc npc = NpcHandler.npcs[index];\n\t\t\tif (npc == null) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (npc.npcType == 11057) {\n\t\t\t\tlotteryNpcIndex = npc.npcIndex;\n\t\t\t}\n\t\t}\n\t\ttry {\n\t\t\ttotalTicketsPurchased = Integer.parseInt(FileUtility.readFirstLine(TOTAL_TICKETS_FILE));\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tArrayList<String> data = FileUtility.readFile(LOTTERY_ENTRIES_FILE);\n\t\tfor (int index = 0; index < data.size(); index++) {\n\t\t\tString parse[] = data.get(index).split(ServerConstants.TEXT_SEPERATOR);\n\t\t\tString name = parse[0];\n\t\t\tint ticketsPurchased = Integer.parseInt(parse[1]);\n\t\t\tLotteryDatabase.lotteryDatabase.add(new LotteryDatabase(name, ticketsPurchased));\n\t\t}\n\t}", "private ArrayList<Integer> fileReader() {\n ArrayList<Integer> data = new ArrayList<>();\n try {\n Scanner scanner = new Scanner(new File(\"andmed.txt\"));\n while (scanner.hasNextLine()) {\n data.add(Integer.valueOf(scanner.nextLine()));\n }\n scanner.close();\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n return data;\n }", "public boolean readDataFile();", "protected abstract void readFile();", "private void readMetaData() throws AreaFileException {\r\n \r\n int i;\r\n// hasReadData = false;\r\n\r\n// if (! fileok) {\r\n// throw new AreaFileException(\"Error reading AreaFile directory\");\r\n// }\r\n\r\n dir = new int[AD_DIRSIZE];\r\n\r\n for (i=0; i < AD_DIRSIZE; i++) {\r\n try { dir[i] = af.readInt();\r\n } catch (IOException e) {\r\n status = -1;\r\n throw new AreaFileException(\"Error reading AreaFile directory:\" + e);\r\n }\r\n }\r\n position += AD_DIRSIZE * 4;\r\n\r\n // see if the directory needs to be byte-flipped\r\n\r\n if (dir[AD_VERSION] != VERSION_NUMBER) {\r\n McIDASUtil.flip(dir,0,19);\r\n // check again\r\n if (dir[AD_VERSION] != VERSION_NUMBER)\r\n throw new AreaFileException(\r\n \"Invalid version number - probably not an AREA file\");\r\n // word 20 may contain characters -- if small integer, flip it...\r\n if ( (dir[20] & 0xffff) == 0) McIDASUtil.flip(dir,20,20);\r\n McIDASUtil.flip(dir,21,23);\r\n // words 24-31 contain memo field\r\n McIDASUtil.flip(dir,32,50);\r\n // words 51-2 contain cal info\r\n McIDASUtil.flip(dir,53,55);\r\n // word 56 contains original source type (ascii)\r\n McIDASUtil.flip(dir,57,63);\r\n flipwords = true;\r\n }\r\n\r\n areaDirectory = new AreaDirectory(dir);\r\n\r\n // pull together some values needed by other methods\r\n navLoc = dir[AD_NAVOFFSET];\r\n calLoc = dir[AD_CALOFFSET];\r\n auxLoc = dir[AD_AUXOFFSET];\r\n datLoc = dir[AD_DATAOFFSET];\r\n numBands = dir[AD_NUMBANDS];\r\n linePrefixLength = \r\n dir[AD_DOCLENGTH] + dir[AD_CALLENGTH] + dir[AD_LEVLENGTH];\r\n if (dir[AD_VALCODE] != 0) linePrefixLength = linePrefixLength + 4;\r\n if (linePrefixLength != dir[AD_PFXSIZE]) \r\n throw new AreaFileException(\"Invalid line prefix length in AREA file.\");\r\n lineDataLength = numBands * dir[AD_NUMELEMS] * dir[AD_DATAWIDTH];\r\n lineLength = linePrefixLength + lineDataLength;\r\n numberLines = dir[AD_NUMLINES];\r\n\r\n if (datLoc > 0 && datLoc != McIDASUtil.MCMISSING) {\r\n navbytes = datLoc - navLoc;\r\n calbytes = datLoc - calLoc;\r\n auxbytes = datLoc - auxLoc;\r\n }\r\n if (auxLoc > 0 && auxLoc != McIDASUtil.MCMISSING) {\r\n navbytes = auxLoc - navLoc;\r\n calbytes = auxLoc - calLoc;\r\n }\r\n\r\n if (calLoc > 0 && calLoc != McIDASUtil.MCMISSING ) {\r\n navbytes = calLoc - navLoc;\r\n }\r\n\r\n\r\n // Read in nav block\r\n if (navLoc > 0 && navbytes > 0) {\r\n nav = new int[navbytes/4];\r\n newPosition = (long) navLoc;\r\n skipByteCount = (int) (newPosition - position);\r\n try {\r\n af.skipBytes(skipByteCount);\r\n } catch (IOException e) {\r\n status = -1;\r\n throw new AreaFileException(\"Error skipping AreaFile bytes: \" + e);\r\n }\r\n for (i=0; i<navbytes/4; i++) {\r\n try {\r\n nav[i] = af.readInt();\r\n } catch (IOException e) {\r\n status = -1;\r\n throw new AreaFileException(\"Error reading AreaFile navigation:\"+e);\r\n }\r\n }\r\n if (flipwords){\r\n flipnav(nav);\r\n }\r\n position = navLoc + navbytes;\r\n }\r\n\r\n // Read in cal block\r\n if (calLoc > 0 && calbytes > 0) {\r\n cal = new int[calbytes/4];\r\n newPosition = (long)calLoc;\r\n skipByteCount = (int) (newPosition - position);\r\n try {\r\n af.skipBytes(skipByteCount);\r\n } catch (IOException e) {\r\n status = -1;\r\n throw new AreaFileException(\"Error skipping AreaFile bytes: \" + e);\r\n }\r\n for (i=0; i<calbytes/4; i++) {\r\n try { \r\n cal[i] = af.readInt();\r\n } catch (IOException e) {\r\n status = -1;\r\n throw new AreaFileException(\"Error reading AreaFile calibration:\"+e);\r\n }\r\n }\r\n // if (flipwords) flipcal(cal);\r\n position = calLoc + calbytes;\r\n }\r\n\r\n // Read in aux block\r\n if (auxLoc > 0 && auxbytes > 0){\r\n aux = new int[auxbytes/4];\r\n newPosition = (long) auxLoc;\r\n skipByteCount = (int) (newPosition - position);\r\n try{\r\n af.skipBytes(skipByteCount);\r\n }catch (IOException e){\r\n status = -1;\r\n throw new AreaFileException(\"Error skipping AreaFile bytes: \" + e);\r\n }\r\n for (i = 0; i < auxbytes/4; i++){\r\n try{\r\n aux[i] = af.readInt();\r\n }catch (IOException e){\r\n status = -1;\r\n throw new AreaFileException(\"Error reading AreaFile aux block:\" + e);\r\n }\r\n }\r\n position = auxLoc + auxbytes;\r\n }\r\n\r\n // now return the Dir, as requested...\r\n status = 1;\r\n return;\r\n }", "private String[] getFileNames() {\n\t\tFile directory = new File(this.getClass().getClassLoader()\n\t\t\t\t.getResource(\"data\").getFile());\n\t\tList<String> fileNames = new ArrayList<String>();\n\n\t\tfor (File file : directory.listFiles())\n\t\t\tfileNames.add(file.getName());\n\n\t\treturn fileNames.toArray(new String[fileNames.size()]);\n\t}", "public void readData() throws IOException {\n // as long as there are stuff left, keep reading by sets, which are\n // pairs of description + answer\n while (hasNext()) {\n counter++;\n readSet();\n }\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}", "public int[] getData(String filename) throws IOException\n {\n\tScanner scanner = new Scanner(new File(filename)) ;\n\ttry {\n\t readData(scanner) ;\n\t return data ;\n\t}\n\tfinally {\n\t System.out.println(\"Finally closing the scanner.\") ;\n\t scanner.close() ;\n\t}\n }", "private List<String> getDataFromApi() throws IOException {\n // Get a list of up to 10 files.\n List<String> fileInfo = new ArrayList<String>();\n FileList result = mService.files().list()\n .setMaxResults(10)\n .execute();\n List<File> files = result.getItems();\n if (files != null) {\n for (File file : files) {\n fileInfo.add(String.format(\"%s (%s)\\n\",\n file.getTitle(), file.getId()));\n }\n }\n return fileInfo;\n }", "abstract public Entity[] getWorkDataFromFile(String filename)\n \tthrows IOException, InvalidStatusException;", "void readFiles(Boolean smart) \n\t//throws IOException// more here for safety\n\t{\n\t\tint i;\n\t\tfor (i = 0; i<165; ++i)\n\t\tfor (int j = 0; j<11; ++j)\n\t\t{\t//if(smart)memoryFile.readInt(board(i,j));\n\t\t\t//else \n\t\t\t\tboard[i][j] = 0;\n\t\t}\n\t\t//try memoryFileStream.close(); catch (IOException e);\n\t}", "public File getDataFile();", "public void loadAll() throws IOException {\r\n System.out.println(\"Previous setting were:\");\r\n System.out.print(\"Time: \" + SaveLoadPrev.getPrevTime(\"outputfile.txt\") + \" | \");\r\n System.out.print(\"Bus Number: \" + SaveLoadPrev.getPrevBusnum(\"outputfile.txt\") + \" | \");\r\n System.out.println(\"Bus Stop: \" + SaveLoadPrev.getPrevBusstop(\"outputfile.txt\"));\r\n String time = SaveLoadPrev.getPrevTime(\"outputfile.txt\");\r\n String busnum = SaveLoadPrev.getPrevBusnum(\"outputfile.txt\");\r\n String busstop = SaveLoadPrev.getPrevBusstop(\"outputfile.txt\");\r\n new ArriveTimeCalculator(busstop, busnum, time);\r\n }", "@Override\n\t\tvoid loadData() throws IOException {\n\t\t\tsuper.loadData();\n\t\t}", "@Override\n\tpublic List<HumanFile> findHumanFileAll() {\n\t\treturn HumanFileMapper.findHumanFileAll();\n\t}", "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 }", "public static void main (String[] args) throws IOException {\n File inFile = new File(\"/Users/kbye10/Documents/CS 250 test files/sample1.data\");\r\n FileInputStream inStream = new FileInputStream(inFile);\r\n\r\n //set up an array to read data in\r\n int fileSize = (int)inFile.length();\r\n byte[] byteArray = new byte[fileSize];\r\n\r\n //read data in and display them\r\n inStream.read(byteArray);\r\n for (int i = 0; i < fileSize; i++) {\r\n System.out.println(byteArray[i]);\r\n }\r\n\r\n inStream.close();\r\n }", "protected void initialize() throws CacheException\n {\n\n final Collection<File> files = FileUtils.listFilesRecursive(this.getBaseDir());\n\n int numSuccessfullyRead = 0;\n for (final File file : files) {\n final String md5Hex = file.getName();\n if (FileCache.MD5_PATTERN.matcher(md5Hex).matches()) {\n Md5 md5;\n try {\n md5 = Md5.fromMd5Hex(md5Hex);\n } catch (final Md5Exception e) {\n throw new CacheException(\"Couldn't add file \" + file, e);\n }\n long lastModified = file.lastModified();\n final SimpleMetaData entry = new SimpleMetaData(lastModified, this.getDefaultTtl());\n if (!entry.isExpired() && !entry.isStale()) {\n this.putEntry(md5, entry);\n numSuccessfullyRead++;\n }\n }\n }\n\n this.getLogger().info(\"{}: Loaded {} entries\", this.getName(), numSuccessfullyRead);\n }", "protected void loadDataFromFile() throws IOException {\n \t\tInputStream is = null;\n \n \t\ttry {\n \t\t\tis = new BufferedInputStream(new GZIPInputStream(\n \t\t\t\t\tnew FileInputStream(this.dataFile)));\n \n \t\t\tint dataOffset = 0;\n \t\t\tByteArrayOutputStream os = new ByteArrayOutputStream();\n \n \t\t\twhile (true) {\n \t\t\t\tint b = is.read();\n \n \t\t\t\tif (b == 0) {\n \t\t\t\t\t// field separator reached.\n \t\t\t\t\tif (this.componentId == null) {\n \t\t\t\t\t\tbyte[] encoded = os.toByteArray();\n \t\t\t\t\t\tdataOffset += encoded.length;\n \t\t\t\t\t\tdataOffset += 1; // include the separator field\n \t\t\t\t\t\tcomponentId = new String(URLEncoding.decode(encoded),\n \t\t\t\t\t\t\t\t\"UTF-8\");\n \t\t\t\t\t} else if (this.query == null) {\n \t\t\t\t\t\tbyte[] encoded = os.toByteArray();\n \t\t\t\t\t\tdataOffset += encoded.length;\n \t\t\t\t\t\tdataOffset += 1; // include the separator field\n \n \t\t\t\t\t\ttry {\n \t\t\t\t\t\t\tString queryXml = new String(URLEncoding\n \t\t\t\t\t\t\t\t\t.decode(encoded), \"UTF-8\");\n \n \t\t\t\t\t\t\t// parse the query.\n \t\t\t\t\t\t\tSAXReader reader = new SAXReader();\n \t\t\t\t\t\t\tElement root = reader.read(\n \t\t\t\t\t\t\t\t\tnew StringReader(queryXml))\n \t\t\t\t\t\t\t\t\t.getRootElement();\n \t\t\t\t\t\t\tthis.query = root.getText();\n \t\t\t\t\t\t} catch (Exception e) {\n \t\t\t\t\t\t\tthrow new IOException(\n \t\t\t\t\t\t\t\t\t\"Cannot unmarshall cached query.\");\n \t\t\t\t\t\t}\n \t\t\t\t\t} else if (this.optionalParams == null) {\n \t\t\t\t\t\tbyte[] encoded = os.toByteArray();\n \t\t\t\t\t\tdataOffset += encoded.length;\n \t\t\t\t\t\tdataOffset += 1; // include the separator field\n \n \t\t\t\t\t\tif (encoded.length > 0) {\n \t\t\t\t\t\t\tMap optionalParams = new HashMap();\n \t\t\t\t\t\t\tString urlEncoded = new String(URLEncoding\n \t\t\t\t\t\t\t\t\t.decode(encoded), \"UTF-8\");\n \t\t\t\t\t\t\tStringTokenizer tokenizer = new StringTokenizer(\n\t\t\t\t\t\t\t\t\turlEncoded, \"&\", false);\n \n \t\t\t\t\t\t\twhile (tokenizer.hasMoreTokens()) {\n String param = tokenizer.nextToken();\n\t\t\t\t\t\t\t\tString key = param.substring(0, param.indexOf('='));\n\t\t\t\t\t\t\t\tString value = param.substring(param.indexOf('=')+1);\n \t\t\t\t\t\t\t\toptionalParams.put(key, value);\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tthis.optionalParams = optionalParams;\n \t\t\t\t\t\t} else {\n \t\t\t\t\t\t\tthis.optionalParams = null;\n \t\t\t\t\t\t}\n \n \t\t\t\t\t\tthis.dataOffset = dataOffset;\n \t\t\t\t\t\treturn;\n \t\t\t\t\t}\n \n \t\t\t\t\tos.reset();\n \t\t\t\t} else if (b == -1) {\n \t\t\t\t\tthrow new IOException(\"Premature end of cached file.\");\n \t\t\t\t} else {\n \t\t\t\t\tos.write(b);\n \t\t\t\t}\n \t\t\t}\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 e) {\n \t\t\t\t\tlog.error(\"Cannot close input cache file: \"\n \t\t\t\t\t\t\t+ this.dataFile.getAbsolutePath());\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "private static void readFile() throws IOException\r\n\t{\r\n\t\tString s1;\r\n\t\tFileReader fr = new FileReader(filename);\r\n\t\tBufferedReader br = new BufferedReader(fr);\r\n\t\t\r\n\t\tSystem.out.println(\"\\ndbs3.txt File\");\r\n\t\twhile ((s1 = br.readLine())!=null)\r\n\t\t{\r\n\t\t\tSystem.out.println(s1);\r\n\t\t}//end while loop to read files\r\n\t\t\r\n\t\tbr.close();//close the buffered reader\r\n\t}", "public abstract List<LocalFile> getAllFiles();", "private void readMetadata() throws IOException {\n\t\t/*int magicNumber = */ metadataFile.readInt();\n\t\t/*int formatVersion = */ metadataFile.readInt();\n\t\t/*int managerIndex = */ metadataFile.readInt();\n\t\tfileListOffset = metadataFile.readInt() & 0xFFFFFFFFL;\n\t\tpathListOffset = metadataFile.readInt() & 0xFFFFFFFFL;\n\n\t\tmetadataFile.setPosition(fileListOffset);\n\t\treadFileList();\n\t}", "private static ArrayList<User> loadInitialData(){\n\t\tArrayList<User> users = new ArrayList<User>();\n\t\t// From the users list get all the user names\n\t\tfor (String username:Utils.FileUtils.getFileLines(Global.Constants.LIST_OF_USERS)){ // refers \"users\" file\n\t\t\tArrayList<Directory> directories = new ArrayList<Directory>();\n\t\t\t// For a user name, read the names of directories registered\n\t\t\t// Note: All directory names are provided in the file bearing user name\n\t\t\tif (Utils.FileUtils.exists(Global.Constants.DIRECTORY_LOCATION + username)) { // refers to a specific user file \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t // that has directories\n\t\t\t\tfor (String dir:Utils.FileUtils.getFileLines(Global.Constants.DIRECTORY_LOCATION + username)) {\n\t\t\t\t\tArrayList<String> documents = new ArrayList<String>();\n\t\t\t\t\t// For each directory, read names of files saved\n\t\t\t\t\t// Note: All file names are provided in the file bearing username$dirname\n\t\t\t\t\tif (Utils.FileUtils.exists(Global.Constants.DIRECTORY_LOCATION, username + \"$\" + dir)) {\n\t\t\t\t\t\tfor (String doc:Utils.FileUtils.getFileLines(Global.Constants.DIRECTORY_LOCATION + username + \"$\" + dir)) {\n\t\t\t\t\t\t\tdocuments.add(doc);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tdirectories.add(new Directory(dir, documents));\n\t\t\t\t}\n\t\t\t}\n\t\t\tusers.add(new User(username, directories));\n\t\t}\n\t\treturn users;\n\t}", "public ArrayList<Task> loadData() throws IOException {\n DateTimeFormatter validFormat = DateTimeFormatter.ofPattern(\"MMM dd yyyy HH:mm\");\n ArrayList<Task> orderList = new ArrayList<>();\n\n try {\n File dataStorage = new File(filePath);\n Scanner s = new Scanner(dataStorage);\n while (s.hasNext()) {\n String curr = s.nextLine();\n String[] currTask = curr.split(\" \\\\| \");\n assert currTask.length >= 3;\n Boolean isDone = currTask[1].equals(\"1\");\n switch (currTask[0]) {\n case \"T\":\n orderList.add(new Todo(currTask[2], isDone));\n break;\n case \"D\":\n orderList.add(new Deadline(currTask[2],\n LocalDateTime.parse(currTask[3], validFormat), isDone));\n break;\n case \"E\":\n orderList.add(new Event(currTask[2],\n LocalDateTime.parse(currTask[3], validFormat), isDone));\n break;\n }\n }\n } catch (FileNotFoundException e) {\n if (new File(\"data\").mkdir()) {\n System.out.println(\"folder data does not exist yet.\");\n } else if (new File(filePath).createNewFile()) {\n System.out.println(\"File duke.txt does not exist yet.\");\n }\n }\n return orderList;\n\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 }", "private void openAndReadFile() throws IOException {\n\t\tFileReader fr = new FileReader(path);\n\t\tBufferedReader textreader = new BufferedReader(fr);\n\t\tString line;\n\t\tString[] parsedLine;\n\t\twhile ((line = textreader.readLine()) != null) {\n\t\t\tparsedLine = pattern.split(line);\n\t\t\tif (parsedLine.length == 2) {\n\t\t\t\tfileData.put(parsedLine[0], parsedLine[1]);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"Couldn't read line \" + line + \" in \" + path);\n\t\t\t}\n\t\t}\n\t\ttextreader.close();\n\t\tfr.close();\n\t}", "public void readFile() {\n try\n {\n tasksList.clear();\n\n FileInputStream file = new FileInputStream(\"./tasksList.txt\");\n ObjectInputStream in = new ObjectInputStream(file);\n\n boolean cont = true;\n while(cont){\n Task readTask = null;\n try {\n readTask = (Task)in.readObject();\n } catch (Exception e) {\n }\n if(readTask != null)\n tasksList.add(readTask);\n else\n cont = false;\n }\n\n if(tasksList.isEmpty()) System.out.println(\"There are no todos.\");\n in.close();\n file.close();\n }\n\n catch(IOException ex)\n {\n ex.printStackTrace();\n }\n }", "public void importData(){\n // get all files from the given path\n File folder = new File(pathDataset);\n List<File> files = new ArrayList<>(Arrays.asList(folder.listFiles()));\n // iterate all found files\n //while(files.iterator().hasNext()){\n for (int k=0;k<files.size();k++) {\n File file = files.get(k);\n LOG.debug(file.toString());\n FileInputStream fis;\n String collectionName = FilenameUtils.getBaseName(file.getName());\n // ensure that the right MongoDB collection is selected\n mongoApi.setCurrentMongoCollection(collectionName);\n List<Document> documents = new ArrayList<>();\n String tempLine;\n int i = 0;\n try {\n fis = new FileInputStream(file);\n BufferedReader in = new BufferedReader(new InputStreamReader(fis));\n // Iterate all lines and use them as Strings \n // to pass them over to the current MongoDB document collection\n while ((tempLine = in.readLine()) != null) {\n if ((lines > -1) && (i >= lines)){\n break;\n }\n documents.add(Document.parse(tempLine));\n }\n LOG.debug(\"Start importing Collection\"+collectionName);\n mongoApi.getCurrentMongoCollection().insertMany(documents);\n LOG.debug(\"Finished importing Collection\"+collectionName);\n // Close streams\n in.close();\n fis.close();\n // Catch important exceptions\n } catch (FileNotFoundException ex) {\n LOG.error(\"Dataset File not found\" + ex.getMessage() + ex.getCause());\n System.exit(-1);\n } catch (IOException ex) {\n LOG.error(\"IOException: \" + ex.getMessage() + ex.getCause());\n System.exit(-1);\n }\n // end while\n }\n }", "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}", "private void loadData(DataParser dp, boolean all) throws IOException {\n\t\tProcessor p = new SkiDataProcessor();\n \t\n \t// Initiate data loader\n \tldr = new DataLoader(dp, p, 0, (all ? -1 : 3600), this);\n \t\n \t// Display progress dialog\n \tdlg = ProgressDialog.show(this, \"\", \"Loading data...\", true, true, new DialogInterface.OnCancelListener() {\n\t\t\t//FIXME\n \t\tpublic void onCancel(DialogInterface dialog) {\n \t\t\tLog.d(getLocalClassName(), \"User pressed cancel\");\n\t\t\t\tldr.cancel();\n\t\t\t}\n\t\t});\n \t\n \t//TODO More advanced progress bar?\n \tldr.loadDataInBackground();\n\t}", "public void read(List<File> filesOrDirs) throws IOException {\n List<File> files = resolveFiles(filesOrDirs);\n\n if (files.isEmpty())\n return;\n\n for (File file : files) {\n buf.clear();\n\n UUID nodeId = nodeId(file);\n\n try (FileIO io = ioFactory.create(file)) {\n fileIo = io;\n\n while (true) {\n if (io.read(buf) <= 0) {\n if (forwardRead == null)\n break;\n\n io.position(forwardRead.nextRecPos);\n\n buf.clear();\n\n curHnd = handlers;\n\n forwardRead = null;\n\n continue;\n }\n\n buf.flip();\n\n buf.mark();\n\n while (deserialize(buf, nodeId)) {\n if (forwardRead != null && forwardRead.found) {\n if (forwardRead.resetBuf) {\n buf.limit(0);\n\n io.position(forwardRead.curRecPos);\n }\n else\n buf.position(forwardRead.bufPos);\n\n curHnd = handlers;\n\n forwardRead = null;\n }\n\n buf.mark();\n }\n\n buf.reset();\n\n if (forwardRead != null)\n forwardRead.resetBuf = true;\n\n buf.compact();\n }\n }\n\n knownStrs.clear();\n forwardRead = null;\n }\n }", "public ArrayList<String> loadToRead() {\n\n\t\tSAVE_FILE = TO_READ_FILE;\n\t\tArrayList<String> list = new ArrayList<String>();\n\t\tlist = loadIds();\n\t\treturn list;\n\t}", "public static void reading(String fileName)\n {\n\n }", "public static void loadProgramData() {\n\r\n try {\r\n File f = new File(\"DetailsOfVaccination.txt.txt\"); //Accessing the file\r\n Scanner read = new Scanner(f);\r\n while (read.hasNextLine()) { //Print data in the file line by line\r\n String data = read.nextLine();\r\n System.out.println(data);\r\n }\r\n read.close();\r\n }\r\n catch (FileNotFoundException e) { //Runs if there was an error\r\n System.out.println(\"An error occurred while reading data from the file.\");\r\n e.printStackTrace();\r\n }\r\n }", "List<String[]> readAll();", "private void lesFil()\n\t{\n\t\tDATAFIL = datafil(false);\n\n\t\ttry ( ObjectInputStream innfil = new ObjectInputStream( new FileInputStream( DATAFIL ) ) )\n\t\t{\n\t\t\tbr = (Boligregister) innfil.readObject();\n\t\t\tvisMelding( \"Data er hentet fra fil.\" );\n\t\t}\n\t\tcatch(ClassNotFoundException cnfe)\n\t\t{\n\t\t\tvisMelding( \"<html>Feil:<br><br>\" + cnfe.getMessage() + \"<br><br>Oppretter tom datafil. Tar vare p&aring; gammel datafil.</html>\" );\n\t\t\ttomtRegister();\n\t\t\tDATAFIL = datafil(true);\n\t\t\tskrivTilFil(false);\n\t\t}\n\t\tcatch(FileNotFoundException fne)\n\t\t{\n\t\t\tvisMelding( \"Ingen datafil funnet. Oppretter tom datafil.\" );\n\t\t\ttomtRegister();\n\t\t\tskrivTilFil(false);\n\t\t}\n\t\tcatch(IOException ioe)\n\t\t{\n\t\t\tvisMelding( \"<html>Innlesingsfeil. Oppretter tom datafil. Tar vare p&aring; gammel datafil.</html>\" );\n\t\t\ttomtRegister();\n\t\t\tDATAFIL = datafil(true);\n\t\t\tskrivTilFil(false);\n\t\t}\n\t}", "public static void processFile(File f) throws Exception {\n\t\ttry {\r\n\t\t\tBufferedReader bufRead = new BufferedReader(new InputStreamReader(\r\n\t\t\t\t\tnew FileInputStream(f)));\r\n\t\t\tString S1 = \"\";\r\n\t\t\twhile ((S1 = bufRead.readLine()) != null) {\r\n\t\t\t\t//System.out.println(S1);\r\n\t\t\t\tgetPubTypes(S1);\r\n\t\t\t\t//System.out.println();\r\n\t\t\t}\r\n\t\t\tbufRead.close();\r\n\t\t} catch (IOException ioe) {\r\n\t\t\tSystem.out.println(\"Something is wrong with reading file! \"\r\n\t\t\t\t\t+ \"Can't find the appropriate file!\");\r\n\t\t}\r\n\r\n\t\t// return allDiseases;\r\n\r\n\t}", "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}", "Set<String> readData();", "@Override\r\n\tpublic List<FileMetaDataEntity> getAllFiles() {\n\t\treturn null;\r\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 static void getInputFileData(){\n\t\t\t\n\t\t\t// editable fields\n\t\t\t\n\t\t\tString directDistanceFile = \"../data/direct_distance_1.txt\";\n\t\t\tString graphInputFile = \"../data/graph_input_1.txt\";\n\t\t\t\n\t\t\t\n\t\t\t// end of editable fields\n\t\t\t\n\t\t\t\n\t\t\tFile file1 = new File(directDistanceFile);\n\t\t\tFile file2 = new File(graphInputFile);\n\t\t\tfiles.add(file1);\n\t\t\tfiles.add(file2);\n\t\t\t\n\t\t\t/*// Directory where data files are\n\t\t\tPath dataPath = Paths.get(\"../data\");\n\t\t\t\n\t\t\tString path = dataPath.toAbsolutePath().toString();\n\t\t\t\n\t\t\tFile dir = new File (path);\n\t\t\t\t\t\n\t\t\tif (dir.listFiles() == null){\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"WARNING: No files found.\");\n\n\t\t\t} else if (dir.listFiles() != null && dir.listFiles().length == 2) {\n\t\t\n\t\t\t\tfor (File file : dir.listFiles()){\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfiles.add(file.getName());\n\t\t\t\t\t} catch(Exception 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\t} else {\n\t\t\t\t\n\t\t\t\tSystem.out.println(\"WARNING: Data folder may only contain two files: direct_distance and\"\n\t\t\t\t\t\t+ \" graph_input. Please modify contents accordingly before proceeding for alorithm to execute.\");\n\t\t\t\t\n\t\t\t}\n\t\t\t*/\n\t\t\t\n\t\t\tfor (File file: files){\n\t\t\t\ttry {\n\t\t\t\t\t\n\t\t\t\t\t// store direct distances in a hashmap\n\t\t\t\t\tif (file.toString().contains(\"distance\")){\n\t\t\t\t\t\t\n\t\t\t\t\t\t//FileReader fileReader = new FileReader(dataPath.toString() + \"/\" + file);\n\t\t\t\t\t\tFileReader fileReader = new FileReader(file);\n\t\t\t\t BufferedReader reader = new BufferedReader(fileReader);\n\t\t\t\t String line = null;\n\t\t\t\t \n\t\t\t\t while ((line = reader.readLine()) != null) {\n\t\t\t\t \t\n\t\t\t\t \tStringBuilder num = new StringBuilder();\n\t\t\t\t \tStringBuilder str = new StringBuilder();\n\t\t\t\t \n\t\t\t\t \tfor(char c : line.toCharArray()){\n\t\t\t\t \t\t//find the distance\n\t\t\t\t if(Character.isDigit(c)){\n\t\t\t\t num.append(c);\n\t\t\t\t } \n\t\t\t\t //find the associated letter\n\t\t\t\t else if(Character.isLetter(c)){\n\t\t\t\t str.append(c); \n\t\t\t\t }\n\t\t\t\t \t}\n\t\t\t\t \t\n\t\t\t\t \t// add values into hashmap\n\t\t\t\t \tdistance.put(str.toString(), Integer.parseInt(num.toString()));\n\t\t\t\t \t\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t reader.close(); // close the reader\n\t\t\t\t\t\t\n\t\t\t\t\t\t//System.out.println(distance);\n\t\t\t\t \n\t\t\t\t } \n\t\t\t\t\t\n\t\t\t\t\t// store inputs in a \n\t\t\t\t\telse if (file.toString().contains(\"input\")){\n\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t//FileReader fileReader = new FileReader(dataPath.toString() + \"/\" + file);\n\t\t\t\t\t\tFileReader fileReader = new FileReader(file);\n\t\t\t\t BufferedReader reader = new BufferedReader(fileReader);\n\t\t\t\t \n\t\t\t\t String line = null;\n\t\t\t\t \n\t\t\t\t int x=0; // keeps track of line to add\n\t\t\t\t \n\t\t\t\t \n\t\t\t\t while ((line = reader.readLine()) != null) {\n\t\t\t\t \tString[] values = line.split(\"\\\\s+\");\n\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \t if (matrix == null) {\n\t\t\t\t \t\t //instantiate matrix\n\t\t\t\t matrix = new String[widthOfArray = values.length]\n\t\t\t\t \t\t \t\t\t[lenghtOfArray = values.length];\n\t\t\t\t }\n\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t \t// add values into the matrix\n\t\t\t\t \tfor (int i=0; i < values.length; i++){\n\t\t\t\t \t\t\n\t\t\t\t \t\tmatrix[i][x] = values[i];\n\t\t\t\t \t\t\n\t\t\t\t \t}\n\t\t\t\t \t\n\t\t\t\t \tx++; // next line\n\t\t\t\t \t\n\t\t\t\t \t\n\t\t\t\t }\n\t\t\t\t \n\t\t\t\t reader.close(); // close the reader\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t// Store input combinations in a hashmap\n\t\t\t\t\tint y=1; \n\t\t\t\t\twhile (y < lenghtOfArray){\n\t\t\t\t\t\t\n\t\t\t\t\t\tinputNodes.add(matrix[0][y]);\n\t\t\t\t\t\t\n\t\t\t\t\t\tfor (int i=1; i < widthOfArray; i++){\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tStringBuilder str = new StringBuilder();\n\t\t\t\t\t\t\tstr.append(matrix[0][y]);\n\t\t\t\t\t\t\tstr.append(matrix[i][0]);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tint inputValue = Integer.parseInt(matrix[i][y]);\n\n\t\t\t\t\t\t\tif (inputValue > 0){\n\t\t\t\t\t\t\t\tinputMap.put(str.toString(), inputValue);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\ty++;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tSystem.out.println(\"WARNING: Please check: \"+ file.toString() + \". It was not found.\");\n\t\t\t\t} \n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t}", "public FilesInputStreamLoad readFile() throws ArcException {\r\n\tFile dir = new File(this.archiveChargement + \".dir\");\r\n\tString fileName = ManipString.substringAfterFirst(this.idSource, \"_\");\r\n\tFile toRead = new File(dir + File.separator + ManipString.redoEntryName(fileName));\r\n\tFilesInputStreamLoad filesInputStreamLoadReturned = null;\r\n\ttry {\r\n\t\tfilesInputStreamLoadReturned = new FilesInputStreamLoad (toRead);\r\n\t} catch (IOException ioReadException) {\r\n\t\tthrow new ArcException(ioReadException, ArcExceptionMessage.FILE_READ_FAILED, toRead);\r\n\t}\r\n\treturn filesInputStreamLoadReturned;\r\n }", "private DataPreviewAll(String dataFolder) throws Exception\n {\n super(dataFolder);\n }", "@SuppressWarnings(\"unchecked\")\n protected List<File> getAllDocuments() {\n\n return (List<File>)stage.getProperties().get(GlobalConstants.ALL_DOCUMENTS_PROPERTY_KEY);\n }", "public void loadAllUserData(){\n\n }" ]
[ "0.68270797", "0.6816887", "0.6760399", "0.6661832", "0.6641864", "0.6426408", "0.6236608", "0.62049264", "0.6172738", "0.614309", "0.6129688", "0.61028636", "0.6045402", "0.6012763", "0.60044974", "0.5964211", "0.5954158", "0.59515643", "0.59190816", "0.5908631", "0.5908142", "0.5907517", "0.58980143", "0.5890515", "0.5879112", "0.58773226", "0.5876232", "0.5875544", "0.5871466", "0.58656096", "0.58317727", "0.5809116", "0.5795508", "0.5775303", "0.5760468", "0.5757868", "0.5757087", "0.5750509", "0.57422435", "0.57395095", "0.57271045", "0.5725824", "0.5717111", "0.5716891", "0.56928766", "0.56912845", "0.56818163", "0.56768394", "0.5674287", "0.5673657", "0.5670898", "0.5662848", "0.56622905", "0.56614435", "0.5659495", "0.56560165", "0.5649705", "0.5648315", "0.5647194", "0.56263614", "0.5624898", "0.56239873", "0.56233805", "0.5618171", "0.5616862", "0.5612601", "0.5610791", "0.5600488", "0.55968446", "0.5596739", "0.5591341", "0.5590005", "0.5580793", "0.55785465", "0.5574875", "0.55741346", "0.556924", "0.55523384", "0.55502164", "0.5536958", "0.55361605", "0.55329555", "0.5531579", "0.5530343", "0.55273134", "0.55257094", "0.55254567", "0.5522328", "0.5521938", "0.55141014", "0.55097735", "0.550927", "0.55085516", "0.5507604", "0.5504259", "0.5496405", "0.54887724", "0.5484632", "0.5480061", "0.54774183", "0.5476487" ]
0.0
-1
String reportPath = "d:/work241/reportnew4AOC.csv"; String filePath = "./data/BinaryDatasets/"; Algorunner(filePath, reportPath); String reportPath = "d:/Experiment/reports/AllResultInAccuracyFormat.csv";
public static void main(String[] args) throws Exception { String reportPath = "d:/Experiment/ExperimentFeb/reports/LargeDatasets-Accuracy.csv"; String filePath ="d:/Experiment/ExperimentFeb/temp1/"; Algorunner(filePath, reportPath); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void Algorunner(String pathOfDataset,String reportPath) throws Exception\n\t{\n\t String path = pathOfDataset; //Map to pathOfDataset \n\t String files;\n\t File folder = new File(path);\n\t File[] listOfFiles = folder.listFiles(); \n\t \n\t int fileCounter=0;\n\t for (int i = 0; i < listOfFiles.length; i++) \n\t {\n\t \n\t \t if (listOfFiles[i].isFile()) \n\t \t {\n\t \t\t files = listOfFiles[i].getName();\n\t \t\t if (files.endsWith(\".arff\"))\n\t \t\t {\n\t \t\t\t fileCounter++;\n\t \t\t }\n\t \t }\n\t }\n\t File[] arffFiles = new File[fileCounter];\n\t fileCounter=0;\n\t for (int i = 0; i < listOfFiles.length; i++) \n\t {\n\t \n\t \t if (listOfFiles[i].isFile()) \n\t \t {\n\t \t\t files = listOfFiles[i].getName();\n\t \t\t if (files.endsWith(\".arff\"))\n\t \t\t {\n\t \t\t\t arffFiles[fileCounter] = listOfFiles[i];\n\t \t\t\t fileCounter++;\n\t \n\t \t\t }\n\t \t }\n\t }\n\t //Code For printing all file name\n\t System.out.println(\"Files for Testing :\");\n\t for (int i = 0; i < arffFiles.length; i++) \n\t {\n\t \t if (arffFiles[i].isFile()) \n\t \t {\n\t \t\t System.out.println((i+1)+\") \"+arffFiles[i].getName());\n\t \t }\n\t }\n\t \n\t Classifier[] models = { \tnew J48(),\n \t\t\t\t\t\tnew PART(),\n \t\t\t\t\t\tnew DecisionTable(),\n \t\t\t\t\t\tnew DecisionStump(),\n \t\t\t\t\t\tnew SimpleCart(),\n \t\t\t\t\t\tnew NaiveBayes(), // Naive Bayes Classifier\n \t\t\t\t\t\tnew Logistic(),\n \t\t\t\t\t\tnew Bagging(),\n \t\t\t\t\t\tnew WLSVM(),\t// SVM \n \t\t\t\t\t\tnew RandomForest(),\t// Random Forest\n \t\t\t\t\t\tnew IBk(), \t// K- nearest neighbour\t\n \t\t\t\t\t\tnew MultilayerPerceptron(), //Neural Network\n \t\t\t\t\t\tnew AdaBoostM1() //Ada boosting\n\t \t\t\t\t\t\t};\n\t //\n\t \n\t //Start writing about csv\n\t StringBuilder csv2 = new StringBuilder(\",\");\t \n\t StringBuilder csvFile = new StringBuilder(\",\");\n\t for(int k=0;k<models.length;k++)\n\t {\n\t\t csv2.append(models[k].getClass().getSimpleName());\n\t\t if(k!=models.length-1)\n\t\t\t csv2.append(\",\");\n\t\t else\n\t\t\t csv2.append(\"\\n\");\n\t }\n\t System.out.println(csvFile.toString());\n\n \t\n \tdouble[][] Comparision = new double[arffFiles.length][models.length];\n \tint[][] weight = new int[arffFiles.length][models.length];\n \tfor (int i = 0; i < arffFiles.length; i++) \n \t{\n \t\tBufferedReader datafile = readDataFile(arffFiles[i].getName().toString(),pathOfDataset);\n \t\tSystem.out.println(\"File Under Testing..... : \"+arffFiles[i].getName().toString());\n \t\tInstances data = new Instances(datafile);\n \t\tdata.setClassIndex(data.numAttributes() - 1);\n \n \t\t// Choose a type of validation split\n \t\t//Instances[][] split = crossValidationSplit(data, 10);\n \n \t\t// Separate split into training and testing arrays\n \t\t//Instances[] trainingSplits = split[0];\n \t\t//Instances[] testingSplits = split[1];\n \n \t\t// Choose a set of classifiers\n \n \t\t// Run for each classifier model\n \t\tfor(int j = 0; j < models.length; j++) \n \t\t{\n \t\t\t\n \t\t\t//Code For error rate\n \t\t\tEvaluation eval = new Evaluation(data);\n \t\t\tmodels[j].buildClassifier(data);\n \t\t\t//used when training and test set is given\n \t\t\t//eval.evaluateModel(svm, filedata2);\n \t\t\t//single data\n \t\t\teval.crossValidateModel(models[j], data,5, new Random(1));\n \t\t\tdouble recall = eval.fMeasure(0)+eval.fMeasure(1);\n \t\t\t//eval.areaUnderROC(arg0)\n \t\t\tdouble aoc = eval.areaUnderROC(0);\n \t\t\taoc = eval.areaUnderROC(1);\n \t\t\t\n \t\t\tdouble accuracy = 1-eval.errorRate();\n \t\t\t// System.out.println(\"SVM error rate : \"+errormid*100);\n \t\t\t// System.out.println(models[j].getClass().getSimpleName() + \": \" + String.format(\"%.2f%%\", (1-errormid)*100) + \"\\n=====================\");\n \t\t\n \t\t\t\n \t\t\t//double param2 = eval.fMeasure(1);\n \t\t\t\n \t\t\tComparision[i][j]= 1-eval.errorRate();\n \t\t\t\n \t\t\t}\n \n \t\t}\n \t\t\n \t\tSystem.out.println();\n \t\tSystem.out.println(\"Accuray of classifiers : Actual : \");\n \t\tfor(int k=0;k<arffFiles.length;k++)\n \t\t{\n \t\t\tcsv2.append(arffFiles[k].getName().toString());\n \t\t\tcsv2.append(\",\");\n \t\t\tfor(int l=0;l<models.length;l++)\n \t\t\t{\n \t\t\t\t//System.out.print(\" || \"+Comparision[k][l]);\n \t\t\t\t\n \t\t\t\tcsv2.append(Comparision[k][l]+\",\");\n \t\t\t\t\n \t\t\t}\n \t\t\tcsv2.deleteCharAt(csv2.length()-1);\n \t\t\tcsv2.append(\"\\n\");\n \t\t\t//System.out.println();\n \t\t\t//System.out.println(\"********************\");\n \t\t}\n \t\tcsv2.deleteCharAt(csv2.length()-1);\n \t\tfor(int k=0;k<arffFiles.length;k++)\n \t\t{\n \t\t\tdouble[][] sample = new double[2][models.length];\n \t\t\tfor(int l=0;l<models.length;l++)\n \t\t\t{\n \t\t\t\tsample[0][l]=Comparision[k][l];\n \t\t\t\tsample[1][l]=(l+1);\n \t\t\t}\n \t\t\t//test for work... working :)\n \t\t\t/*\n \t\t\tfor(int w=0;w<2;w++)\n \t\t\t{\n \t\t\t\tfor(int q=0;q<models.length;q++)\n \t\t\t\t{\n \t\t\t\tSystem.out.print(\" \"+sample[w][q]);\n \t\t\t\t}\n \t\t\t\tSystem.out.println(\"*******\");\n \t\t\t}\n */\n \t\t\tint n = models.length;\n \t\t\tdouble swap1,swap2;\n \t\t\tfor (int c = 0; c < ( n - 1 ); c++) \n \t\t\t{\n \t\t\t\tfor (int d = 0; d < n - c - 1; d++) \n \t\t\t\t{\n \t\t\t\t\tif (sample[0][d] > sample[0][d+1]) /* For descending order use < */\n \t\t\t\t\t{\n \t\t\t\t\t\tswap1 = sample[0][d];\n \t\t\t\t\t\tsample[0][d] = sample[0][d+1];\n \t\t\t\t\t\tsample[0][d+1] = swap1;\n \n \t\t\t\t\t\tswap2 = sample[1][d];\n \t\t\t\t\t\tsample[1][d] = sample[1][d+1];\n \t\t\t\t\t\tsample[1][d+1] = swap2;\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t}\n \t\t\tfor(int l=0;l<models.length;l++)\n \t\t\t{\n \t\t\t\tDouble d = new Double(sample[1][l]);\n \t\t\t\tweight[k][d.intValue()-1] = models.length-l;\n \t\t\t}\n \t\t}\n \t\t//testing\n \t\tSystem.out.println(\"Rank Vector \");\n \t\tfor(int k=0;k<arffFiles.length;k++)\n \t\t{\n \t\t\tcsvFile.append(arffFiles[k].getName().toString());\n \t\t\tcsvFile.append(\",\");\n \t\t\tfor(int l=0;l<models.length;l++)\n \t\t\t{\n \t\t\t\tSystem.out.print(\" || \"+weight[k][l]);\n \t\t\t\tcsvFile.append(weight[k][l]);\n \t\t\t\tif(l!=models.length-1)\n \t\t\t\t\tcsvFile.append(\",\");\n \t\t\t\telse\n \t\t\t\t{\n \t\t\t\t\t//if(k!=arffFiles.length-1)\n \t\t\t\t\tcsvFile.append(\"\\n\");\n \t\t\t\t} \n \t\t\t}\n \t\t\tSystem.out.println();\n \n \t\t}\n \t\t\tcsvFile.append(\"\\n\");\n \t\t\tcsvFile.append(\"Sum of Ranks (Lower is Better)\");\n \t\t\tcsvFile.append(\",\");\n \n \t\t\tStringBuilder rank = new StringBuilder();\n \n \t\t\tfor(int l=0;l<models.length;l++)\n \t\t\t{\n \t\t\t\tint sum=0;\n \t\t\t\tfor(int k=0;k<arffFiles.length;k++)\n \t\t\t\t{\n \t\t\t\t\tsum+=weight[k][l];\n \t\t\t\t}\n \t\t\t\t\trank.append((double)sum/(double)arffFiles.length);\n \t\t\t\t\tcsvFile.append(sum);\n \t\t\t\t\tif(l!=models.length-1)\n \t\t\t\t\t{\n \t\t\t\t\t\tcsvFile.append(\",\");\n \t\t\t\t\t\trank.append(\",\");\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\t//if(k!=arffFiles.length-1)\n \t\t\t\t\t\tcsvFile.append(\"\\n\");\n \t\t\t\t\t\trank.append(\"\\n\");\n \t\t\t\t\t} \n \t\t\t}\n \t \n \t\t\tcsvFile.append(\"\\n\");\n \t\t\tcsvFile.append(\"Avrage Ranks\");\n \t\t\tcsvFile.append(\",\");\n \t\t\tcsvFile.append(rank.toString());\n \t\t\t//Ranks of algorithms\n \n \n \t\t\tint sum=0;\n \t\t\tint series = models.length;\n \t\t\tseries = (series*(series+1))/2;\n \t\t\tseries = series*(arffFiles.length);\n \t\t\tfor(int l=0;l<models.length;l++)\n \t\t\t{\n \t\t\t\tfor(int k=0;k<arffFiles.length;k++)\n \t\t\t\t{\n \t\t\t\t\tsum += weight[k][l];\n \t\t\t\t}\n \t\t\t\tSystem.out.println(\"Parameter for \"+models[l].getClass().getSimpleName()+ \" : \"+sum+\"/\"+series );\n \t\t\t\tsum=0;\n \t\t\t\tSystem.out.println();\n \n \t\t\t}\n \n\t\t\t\t \t\t\t\n\t\t\t\t /*\n\t\t\t\t for(int w=0;w<2;w++)\n\t\t\t\t {\n\t\t\t\t \tfor(int q=0;q<models.length;q++)\n\t\t\t\t \t{\n\t\t\t\t \tSystem.out.print(\" \"+sample[w][q]);\n\t\t\t\t \t}\n\t\t\t\t \tSystem.out.println(\" \");\n\t\t\t\t \tSystem.out.println(\" \");\n\t\t\t\t \tSystem.out.println(\" \");\n\t\t\t\t }\n\t\t\t\t } \n\t\t\t */\n\t\t\t \n \t\t\t\t//arffFiles.length][models.length];\n \t\t\tSystem.out.println(\"Done\");\n \t\t\twriteCSVReport(csvFile.toString(),reportPath);\n \t\t\twriteCSVReport(csv2.toString(), reportPath);\n \t\t\tSystem.out.println(csvFile.toString());\n\t\t \n\t}", "public void analysis(){\n\n\n this.outputFilename = \"PCAOutput\";\n if(this.fileOption==1){\n this.outputFilename += \".txt\";\n }\n else{\n this.outputFilename += \".xls\";\n }\n String message1 = \"Output file name for the analysis details:\";\n String message2 = \"\\nEnter the required name (as a single word) and click OK \";\n String message3 = \"\\nor simply click OK for default value\";\n String message = message1 + message2 + message3;\n String defaultName = this.outputFilename;\n this.outputFilename = Db.readLine(message, defaultName);\n this.analysis(this.outputFilename);\n }", "public static void main(String[] args) {\n try {\n convert(\"d:\\\\MLDATA\\\\adult.data\", \"d:\\\\MLDATA\\\\adult_standard.csv\", \"[ \\t]*,[ \\t]*\");\n convert(\"d:\\\\MLDATA\\\\adult.test\", \"d:\\\\MLDATA\\\\adult_standard_test.csv\", \"[ \\t]*,[ \\t]*\");\n }\n catch (Exception e)\n {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) {\n\t\tReviewReader secondRR = new ReviewReader(\"Sentiment_Analysis_Output.csv\", true);\n\t\n\t\t//ReviewReader secondRR = new ReviewReader(\"Sentiment_Analysis_Output.csv\", true);\n\n\t\tsecondRR.readFile();\n\t\tArrayList<Review> newValidReviews = secondRR.getValidReviews();\n\t\tReviewAnalysis ra = new ReviewAnalysis(newValidReviews);\n\t\t\n\t\tArrayList<String> report = new ArrayList<String>();\n\t\n\t\tSystem.out.println(\"We are generating the analysis report for you...\");\n\t\tSystem.out.println(\"It may take a few minutes, thanks for your patience.\" + \"\\n\");\n\n\t\tString result1 = \"The average age of positive reviews is \" + ra.getAveAgeOfPosReviews();\n\t\treport.add(result1 + \"\\n\");\n\n\t\tString result2 = \"The median age of positive reviews is \" + ra.getMedianAgeOfPosReviews();\n\t\treport.add(result2 + \"\\n\");\n\n\t\treport.add(\"Clothing ID \" + ra.getClothingIDWithMostReviews()\n\t\t+ \" has the most number of reviews.\");\n\t\treport.add( \"The average age of customers for the most popular item is \" \n\t\t\t\t+ ra.averageAgeOfMostPopular());\n\t\treport.add(\"The median age of customers for the most popular item is \" \n\t\t\t\t+ ra.medianAgeOfMostPopular());\n\t\treport.add(\"\");\n\n\t\treport.add(\"In each class, the model with best reviews and the keywords in its reviews are:\");\n\t\tArrayList<String> bestReviewModel = ra.findModelWithKeywords(1);\n\t\tfor (int i = 0; i < bestReviewModel.size(); i++) {\n\t\t\treport.add(bestReviewModel.get(i));\n\t\t}\n\t\treport.add(\"\");\n\n\t\treport.add(\"In each class, the model with worst reviews and the keywords in its reviews are:\");\n\t\tArrayList<String> worstReviewModel = ra.findModelWithKeywords(-1);\n\t\tfor (int i = 0; i < worstReviewModel.size(); i++) {\n\t\t\treport.add(worstReviewModel.get(i));\n\t\t}\n\t\treport.add(\"\");\n\n\t\treport.add(ra.numberOfReviews());\n\t\t\n\t\tAnalysisResultFileWriter arfw = new AnalysisResultFileWriter(report);\n\t\t\n\t\tarfw.writeOutputFile();\n\n\t\tSystem.out.println(\"Report is ready!\" + \"\\n\");\n\n\t\tSystem.out.println(\"Generating charts...\" + \"\\n\");\n\n\t\tPlots plot = new Plots(newValidReviews);\n\t\t\n\t\ttry {\n\t\t\tplot.plotHistogram1();\n\t\t\tplot.plotHistogram2();\n\t\t\tplot.plotPieChart(ra.getPositiveReviews().size(), ra.getNegativeReviews().size(),\n\t\t\t\t\tra.getNeutralReviews().size());\n\t\t\tplot.plotBarDeparmentToNumOfReviews(ra.getDepartmentToNumOfReview(ra.getNegativeReviews()), \n\t\t\t\t\tra.getDepartmentToNumOfReview(ra.getNeutralReviews()), ra.getDepartmentToNumOfReview(ra.getPositiveReviews()) );\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\tSystem.out.println();\n\n\t\tSystem.out.println(\"Contact us if you need more analysis reports!\"); \n\n\n\t}", "public static void main(String[] args) throws FileNotFoundException, IOException, InterruptedException {\n ArrayList<Metric> metrics = new ArrayList<Metric>();\n metrics.add(new ELOC());\n metrics.add(new NOPA());\n metrics.add(new NMNOPARAM());\n MyClassifier c1 = new MyClassifier(\"Logistic Regression\");\n c1.setClassifier(new Logistic());\n String type = \"CodeSmellDetection\";\n String smell = \"Large Class\";\n Model model = new Model(\"antModel1\", \"ant\", \"https://github.com/apache/ant.git\", metrics, c1, \"\", type, smell);\n Process process = new Process();\n String periodLength = \"All\";\n String version = \"rel/1.8.3\";\n \n String projectName = model.getProjName();\n process.initGitRepositoryFromFile(scatteringFolderPath + \"/\" + projectName\n + \"/gitRepository.data\");\n try {\n DeveloperTreeManager.calculateDeveloperTrees(process.getGitRepository()\n .getCommits(), periodLength);\n DeveloperFITreeManager.calculateDeveloperTrees(process.getGitRepository()\n .getCommits(), periodLength);\n } catch (Exception ex) {\n Logger.getLogger(TestFile.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n List<Commit> commits = process.getGitRepository().getCommits();\n PeriodManager.calculatePeriods(commits, periodLength);\n List<Period> periods = PeriodManager.getList();\n \n String dirPath = Config.baseDir + projectName + \"/models/\" + model.getName();\n Files.createDirectories(Paths.get(dirPath));\n \n for (Period p : periods) {\n File periodData = new File(dirPath + \"/predictors.csv\");\n PrintWriter pw1 = new PrintWriter(periodData);\n \n String message1 = \"nome,\";\n for(Metric m : metrics) {\n message1 += m.getNome() + \",\";\n }\n message1 += \"isSmell\\n\";\n pw1.write(message1);\n \n //String baseSmellPatch = \"C:/ProgettoTirocinio/dataset/apache-ant-data/apache_1.8.3/Validated\";\n CalculateSmellFiles cs = new CalculateSmellFiles(model.getProjName(), \"Large Class\", \"1.8.1\");\n \n List<FileBean> smellClasses = cs.getSmellClasses();\n \n String projectPath = baseFolderPath + projectName;\n \n Git.gitReset(new File(projectPath));\n Git.clean(new File(projectPath));\n \n List<FileBean> repoFiles = Git.gitList(new File(projectPath), version);\n System.out.println(\"Repo size: \"+repoFiles.size());\n \n \n for (FileBean file : repoFiles) {\n \n if (file.getPath().contains(\".java\")) {\n File workTreeFile = new File(projectPath + \"/\" + file.getPath());\n\n ClassBean classBean = null;\n \n if (workTreeFile.exists()) {\n ArrayList<ClassBean> code = new ArrayList<>();\n ArrayList<ClassBean> classes = ReadSourceCode.readSourceCode(workTreeFile, code);\n \n String body = file.getPath() + \",\";\n if (classes.size() > 0) {\n classBean = classes.get(0);\n\n }\n for(Metric m : metrics) {\n try{\n body += m.getValue(classBean, classes, null, null, null, null) + \",\";\n } catch(NullPointerException e) {\n body += \"0.0,\";\n }\n }\n \n //isSmell\n boolean isSmell = false;\n for(FileBean sm : smellClasses) {\n if(file.getPath().contains(sm.getPath())) {\n System.out.println(\"ok\");\n isSmell = true;\n break;\n }\n }\n \n body = body + isSmell + \"\\n\";\n pw1.write(body); \n }\n }\n }\n Git.gitReset(new File(projectPath));\n pw1.flush();\n }\n \n WekaEvaluator we1 = new WekaEvaluator(baseFolderPath, projectName, new Logistic(), \"Logistic Regression\", model.getName());\n \n ArrayList<Model> models = new ArrayList<Model>();\n \n models.add(model);\n System.out.println(models);\n //create a project\n Project p1 = new Project(\"https://github.com/apache/ant.git\");\n p1.setModels(models);\n p1.setName(\"ant\");\n p1.setVersion(version);\n \n ArrayList<Project> projects;\n //projects.add(p1);\n \n //create a file\n// try {\n// File f = new File(Config.baseDir + \"projects.txt\");\n// FileOutputStream fileOut;\n// if(f.exists()){\n// projects = ProjectHandler.getAllProjects(); \n// Files.delete(Paths.get(Config.baseDir + \"projects.txt\"));\n// //fileOut = new FileOutputStream(f, true);\n// } else {\n// projects = new ArrayList<Project>();\n// Files.createFile(Paths.get(Config.baseDir + \"projects.txt\"));\n// }\n// fileOut = new FileOutputStream(f);\n// projects.add(p1);\n// ObjectOutputStream out = new ObjectOutputStream(fileOut);\n// out.writeObject(projects);\n// out.close();\n// fileOut.close();\n//\n// } catch (FileNotFoundException e) {\n// e.printStackTrace();\n// } catch (IOException e) {\n// e.printStackTrace();\n// }\n// ProjectHandler.setCurrentProject(p1);\n// Project curr = ProjectHandler.getCurrentProject();\n// System.out.println(curr.getGitURL()+\" --- \"+curr.getModels());\n// ArrayList<Project> projectest = ProjectHandler.getAllProjects();\n// for(Project testp : projectest){\n// System.out.println(testp.getModels());\n// }\n }", "public static void main(String[] args) {\n String pathToTrain = \"train.csv\";\n String pathToTest = \"test.csv\";\n try {\n ArrayList<String> trainSentences = readCSV(pathToTrain);\n trainSentences.remove(0);\n ArrayList<String> testSentences = readCSV(pathToTest);\n testSentences.remove(0);\n\n ArrayList<String[]> trainWords = preprocess(trainSentences);\n NaiveBayesClassifier model = new NaiveBayesClassifier();\n model.fit(trainWords);\n\n ArrayList<String[]> testWords = preprocess(testSentences);\n double accuracy = evaluate(testWords, model);\n model.writeParams(\"params.json\");\n System.out.printf(\"Accuracy of the model is: %.4f%n\", accuracy);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) {\n\r\n\t\tFileReader myReader=new FileReader();\r\n\t\ttry {\r\n\t\t\tmyReader.readFile(\"D:/test.txt\");\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO Auto-generated catch block\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\r\n\t\r\n\t\t//This is for writing to the file\r\n\t\t\t\tPrintWriter writer;\r\n\t\t\t\t\r\n\t\t\t\t//Open File 'output.txt'\r\n\t\t\t\ttry {\r\n\t\t\t\t\twriter = new PrintWriter(\"output.txt\", \"UTF-8\");\r\n\t\t\t\t} catch (Exception 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\treturn;\r\n\t\t\t\t} \r\n\r\n\r\n//\t\t\t\tswitch (methodEmployed){\r\n//\t\t\t\t\tcase 1: //BiSection\r\n//\t\t\t\t\t\r\n//\t\t\t\t\tBisectionMethod(e,l,u,cE);\r\n//\t\t\t\t\t\r\n//\t\t\t\t\twriter.println(\"Report of BisectionSearch\");\r\n//\t\t\t\t\twriter.println(\"--------------------------------------\");\r\n//\t\t\t\t\twriter.println(\"App. Optimum Soln.=\" + String.valueOf(BisectionMethod.getXMean()));\r\n//\t\t\t\t\twriter.println(\"Abs. Range for Opt. Soln.=[\" + String.valueOf(BisectionMethod.getXLower())+\"-\"+String.valueOf(BisectionMethod.getXUpper())+\"]\");\r\n//\t\t\t\t\twriter.println(\"Z=\" + String.valueOf(BisectionMethod.getFunctionValue());\r\n//\t\t\t\t\tbreak;\r\n//\t\t\t\t\tcase 2: //GoldenSection\r\n//\t\t\t\t\tGoldenSectionMethod(e,l,u,cE);\r\n//\t\t\t\t\t\r\n//\t\t\t\t\twriter.println(\"Report of GoldenSectionSearch\");\r\n//\t\t\t\t\twriter.println(\"--------------------------------------\");\r\n//\t\t\t\t\twriter.println(\"App. Optimum Soln.=\" + String.valueOf(GoldenSectionMethod.getXMean()));\r\n//\t\t\t\t\twriter.println(\"Abs. Range for Opt. Soln.=[\" + String.valueOf(GoldenSectionMethod.getXLower())+\"-\"+String.valueOf(GoldenSectionMethod.getXUpper())+\"]\");\r\n//\t\t\t\t\twriter.println(\"Z=\" + String.valueOf(GoldenSectionMethod.getFunctionValue());\r\n//\t\t\t\t\tbreak;\r\n//\t\t\t\t\tcase 3: // NewtonMethod\r\n//\t\t\t\t\t\r\n//\t\t\t\t\tbreak;\r\n//\t\t\t\t\tcase 4: // SecantMethod\r\n//\t\t\t\t\t\r\n//\t\t\t\t\tbreak;\r\n//\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\twriter.close();\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"--------------------------------------\");\r\n\t\t\t\tSystem.out.println(\"RESULTS ARE WRITTEN TO 'output.txt' \");\r\n\r\n\t\r\n\t}", "public static void main(String[] args) throws IOException \n { \n StationDefinitionList tempStation = new StationDefinitionList(\n \"data/geoinfo.csv\");\n DataDefinitionList tempData = new DataDefinitionList(\n \"data/DataTranslation.csv\");\n DataDay.setDataDefinitionList(tempData);\n // tempStation.loadData(\"data/alldata_2011.csv\");\n // tempStation.loadData(\"data/alldata_2012.csv\");\n // tempStation.loadData(\"data/alldata_2013.csv\");\n // tempStation.loadData(\"data/alldata_2014.csv\");\n tempStation.loadData(\"data/alldata_2015.csv\");\n // tempStation.loadData(\"data/alldata_2016.csv\");\n reportStation(tempStation, tempData, \"TISH\");\n //System.out.println(\"done\");\n\n\n }", "public void runMethod() throws FileNotFoundException{\n int[] dataset=new int[]{10, 297, 593, 947, 1243, 1647, 1943, 2227, 2543, 2976};\n for(int n=0; n<dataset.length; n++){\n String fileName = (\"DataSet\"+dataset[n]);\n String[][] summaryData = toSummaryArray(toRawArray(fileName, dataset[n]));\n for(int j=0; j<3; j++){\n for(int i=0; i<5; i++){\n System.out.print(summaryData[i][j]+\",\");\n }\n System.out.print(\"\\n\");\n }\n }\n }", "public void analysis(String filename){\n\n // Scree Plot\n this.screePlot();\n\n // Open output file\n this.outputFilename = filename;\n String outputFilenameWithoutExtension = null;\n String extension = null;\n int pos = filename.indexOf('.');\n if(pos==-1){\n outputFilenameWithoutExtension = filename;\n if(this.fileOption==1){\n this.outputFilename += \".txt\";\n }\n else{\n this.outputFilename += \".xls\";\n }\n }\n else{\n extension = (filename.substring(pos)).trim();\n\n outputFilenameWithoutExtension = (filename.substring(0, pos)).trim();\n if(extension.equalsIgnoreCase(\".xls\")){\n if(this.fileOption==1){\n if(this.fileOptionSet){\n String message1 = \"Your entered output file type is .xls\";\n String message2 = \"\\nbut you have chosen a .txt output\";\n String message = message1 + message2;\n String headerComment = \"Your output file name extension\";\n String[] comments = {message, \"replace it with .txt [text file]\"};\n String[] boxTitles = {\"Retain\", \".txt\"};\n int defaultBox = 1;\n int opt = Db.optionBox(headerComment, comments, boxTitles, defaultBox);\n if(opt==2)this.outputFilename = outputFilenameWithoutExtension + \".txt\";\n }\n else{\n this.fileOption=2;\n }\n }\n }\n\n if(extension.equalsIgnoreCase(\".txt\")){\n if(this.fileOption==2){\n if(this.fileOptionSet){\n String message1 = \"Your entered output file type is .txt\";\n String message2 = \"\\nbut you have chosen a .xls output\";\n String message = message1 + message2;\n String headerComment = \"Your output file name extension\";\n String[] comments = {message, \"replace it with .xls [Excel file]\"};\n String[] boxTitles = {\"Retain\", \".xls\"};\n int defaultBox = 1;\n int opt = Db.optionBox(headerComment, comments, boxTitles, defaultBox);\n if(opt==2)this.outputFilename = outputFilenameWithoutExtension + \".xls\";\n }\n else{\n this.fileOption=1;\n }\n }\n }\n\n if(!extension.equalsIgnoreCase(\".txt\") && !extension.equalsIgnoreCase(\".xls\")){\n String message1 = \"Your extension is \" + extension;\n String message2 = \"\\n Do you wish to retain it:\";\n String message = message1 + message2;\n String headerComment = \"Your output file name extension\";\n String[] comments = {message, \"replace it with .txt [text file]\", \"replace it with .xls [MS Excel file]\"};\n String[] boxTitles = {\"Retain\", \".txt\", \".xls\"};\n int defaultBox = 1;\n int opt = Db.optionBox(headerComment, comments, boxTitles, defaultBox);\n switch(opt){\n case 1: this.fileOption=1;\n break;\n case 2: this.outputFilename = outputFilenameWithoutExtension + \".txt\";\n this.fileOption=1;\n break;\n case 3: this.outputFilename = outputFilenameWithoutExtension + \".xls\";\n this.fileOption=2;\n break;\n }\n }\n }\n\n if(this.fileOption==1){\n this.analysisText();\n }\n else{\n this.analysisExcel();\n }\n\n System.out.println(\"The analysis has been written to the file \" + this.outputFilename);\n }", "public static void main(String[] args){\n String testFiles = \"D:\\\\self\\\\algorithms\\\\assignment specification\\\\wordnet\\\\\";\n String digraphFile = \"digraph4.txt\";\n\t In inputFile = new In(testFiles+digraphFile);\n\t Digraph D = new Digraph(inputFile);\n\t \n\t SAP testAgent = new SAP(D);\n\t System.out.println(testAgent.D.toString());\n }", "public static void main(String args[]){\n\t\tDataSet testdataset = new DataSet();\n\t\tFile inputfile = new File(\"test.csv\");\n\t\ttestdataset.BuildDataSet(inputfile);\n\t\t\n\t\tSystem.out.println(\"AreaChart:: AreaChart()\");\n\t\tAreaChart testAreaChart = new AreaChart(testdataset);\n\t\tSystem.out.println(\"AreaChart::BarChart()- Test Passed\");\n\t\t\n\t\tSystem.out.println(\"AreaChart:: MakeChart()\");\n\t\ttestAreaChart.MakeChart();\n\t\tSystem.out.println(\"AreaChart::MakeChart()- Test Passed\");\n\t}", "static public void main(String[] args) throws IOException{\n\t\tString sample = \"h19x24\";\n\t\tString parentFolder = \"/media/kyowon/Data1/Dropbox/fCLIP/new24/\";\t\t\n\t\tString bedFileName = \"/media/kyowon/Data1/fCLIP/samples/sample3/bed/\" + sample + \".sorted.bed\";\n\t\tString dbFasta = \"/media/kyowon/Data1/RPF_Project/genomes/hg19.fa\";\n\t\tString parameterFileName = \"/media/kyowon/Data1/fCLIP/samples/sample3/bed/\" + sample + \".sorted.param\";\n\t\t\n\t\tString trainOutFileName = parentFolder + sample + \".train.csv\";\n\t\tString arffTrainOutFileName = parentFolder + sample + \".train.arff\";\n\t\t\n\t\tString cisOutFileName = parentFolder + sample + \".csv\";\n\t\tString transOutFileNameM = parentFolder + sample + \".pair.M.csv\";\n\t\tString transOutFileNameU = parentFolder + sample + \".pair.U.csv\";\n\t\tString transControlOutFileNameM = parentFolder + sample + \".pair.M.AntiSense.csv\";\n\t\tString transControlOutFileNameU = parentFolder + sample + \".pair.U.AntiSense.csv\";\n\t\tString rmskBed = \"/media/kyowon/Data1/fCLIP/Data/cat.rmsk.bed\";\n\t\tString siControlBed = \"/media/kyowon/Data1/fCLIP/RNAseq/siControl_R1_Aligned_Sorted.bed\";\n\t\tString siKDDroshaBed = \"/media/kyowon/Data1/fCLIP/RNAseq/siDrosha_R1_Aligned_Sorted.bed\";\n\t\tString siKDDicerBed = \"/media/kyowon/Data1/fCLIP/RNAseq/siDicer_R1_Aligned_Sorted.bed\";\n\t\t\n\t\tString cisBed5pFileName = cisOutFileName + \".5p.bed\";\n\t\tString cisBed3pFileName = cisOutFileName + \".3p.bed\";\n\t\t\n\t\tdouble unpairedScoreThreshold = 0.25; \n\t\tdouble pairedScoreThreshold = unpairedScoreThreshold/5;\n\t//\tdouble motifScoreThreshold = 0.15;\n\t\t\n\t\tint num3pPaired = 10;\n\t\tint num5pPaired = 20;\n\t\t\n\t\tString filteredTransOutFileName = transOutFileNameM + \".filtered.csv\";\n\t\t\n\t\tint blatHitThreshold = 100000000;\n\t\tint transPairSeqLength = FCLIP_Scorer.getFlankingNTNumber() *2 + 80;\n\t\t\n\t\tZeroBasedFastaParser fastaParser = new ZeroBasedFastaParser(dbFasta);\n\t\tMirGff3FileParser mirParser = new MirGff3FileParser(\"/media/kyowon/Data1/fCLIP/genomes/hsa_hg19.gff3\");\n\t\tAnnotationFileParser annotationParser = new AnnotationFileParser(\"/media/kyowon/Data1/fCLIP/genomes/hg19.refFlat.txt\");\n\t\tFCLIP_ScorerTrainer.train(parameterFileName, bedFileName, mirParser, annotationParser);\n\t\t\n\t\ttrain(trainOutFileName, arffTrainOutFileName, bedFileName, fastaParser, annotationParser, mirParser, parameterFileName, unpairedScoreThreshold, pairedScoreThreshold);\n\t\trunCis(cisOutFileName, arffTrainOutFileName, bedFileName, fastaParser, annotationParser, mirParser, parameterFileName, unpairedScoreThreshold, pairedScoreThreshold);\n\n\t\tScoredPositionOutputParser.generateBedFromCsv(cisOutFileName, cisBed5pFileName, cisBed3pFileName, false); // for fold change..\n\t//\tScoredPositionOutputParser.generateFastaForMotif(cisOutFileName, cisOutFileName + \".5p.motif.fa\", cisOutFileName + \".3p.motif.fa\",cisOutFileName + \".motif.m\", \"M\");\n\t\t\n\t\trunTrans(transOutFileNameM, transOutFileNameU, cisOutFileName, arffTrainOutFileName, blatHitThreshold, transPairSeqLength, false);\n\t\tCheckRepeat.generate(cisOutFileName, transOutFileNameM, cisBed5pFileName, cisBed3pFileName, rmskBed);\n\t\tCheckRepeat.generate(cisOutFileName, transOutFileNameU, cisBed5pFileName, cisBed3pFileName, rmskBed);\n\t\tScoredPairOutputParser.generateFastaForMotif(transOutFileNameM, transOutFileNameM + \".5p.motif.fa\", transOutFileNameM + \".3p.motif.fa\");\n\t\t//GenerateCircosLinkFiles.run(transOutFileNameM + \".rmsk.csv\", transOutFileNameM + \".link.txt\");\n\t//\tCheckCoverage.generate(cisOutFileName, transOutFileNameM, cisBed5pFileName, cisBed3pFileName, siKDDroshaBed, siControlBed);\n\t///\tCheckCoverage.generate(cisOutFileName, transOutFileNameM, cisBed5pFileName, cisBed3pFileName, siKDDicerBed, siControlBed);\n\t\t\n\t\trunTrans(transControlOutFileNameM, transControlOutFileNameU, cisOutFileName, arffTrainOutFileName, blatHitThreshold, transPairSeqLength, true);\t\t\n\t\tCheckRepeat.generate(cisOutFileName, transControlOutFileNameM, cisBed5pFileName, cisBed3pFileName, rmskBed);\n\t\tCheckRepeat.generate(cisOutFileName, transControlOutFileNameU, cisBed5pFileName, cisBed3pFileName, rmskBed);\n\t\tScoredPairOutputParser.generateFastaForMotif(transControlOutFileNameM, transControlOutFileNameM + \".5p.motif.fa\", transControlOutFileNameM + \".3p.motif.fa\");\n\t//\tGenerateCircosLinkFiles.run(transControlOutFileNameM + \".rmsk.csv\", transControlOutFileNameM + \".link.txt\");\n\t\t//CheckCoverage.generate(cisOutFileName, transControlOutFileNameM, cisBed5pFileName, cisBed3pFileName, siKDDroshaBed, siControlBed);\n\t//\tCheckCoverage.generate(cisOutFileName, transControlOutFileNameM, cisBed5pFileName, cisBed3pFileName, siKDDicerBed, siControlBed);\n\t\t\n\t\tfilterTransPairs(transOutFileNameM, filteredTransOutFileName, num3pPaired, num5pPaired);\n\t\tCheckRepeat.generate(cisOutFileName, filteredTransOutFileName, cisBed5pFileName, cisBed3pFileName, rmskBed);\n\t\tScoredPairOutputParser.generateFastaForMotif(filteredTransOutFileName, filteredTransOutFileName + \".5p.motif.fa\", filteredTransOutFileName + \".3p.motif.fa\");\n\t\t//GenerateCircosLinkFiles.run(filteredTransOutFileName + \".rmsk.csv\", filteredTransOutFileName + \".link.txt\");\n\t///\tCheckCoverage.generate(cisOutFileName, filteredTransOutFileName, cisBed5pFileName, cisBed3pFileName, siKDDroshaBed, siControlBed);\n\t//\tCheckCoverage.generate(cisOutFileName, filteredTransOutFileName, cisBed5pFileName, cisBed3pFileName, siKDDicerBed, siControlBed);\n\t\t\n\t\t\n\t\t// generate background for drosha and dicer..\n\t\t\n\t\t\n\t\t// motif different conditioin?? \n\t\t\n\t\t\t\t\n\t\t//GenerateDepthsForEncodeDataSets.generate(outFileName, outFileName + \".encode.csv\", annotationParser);\n\t\t\n\t\t\n\t}", "public static void main(String[] args) throws FileNotFoundException {\n\t\tString file = \"/home/mllab/Desktop/CS140/Grading_Scripts/exam02-a52/report.txt\";\n\t\tout = new PrintStream(new FileOutputStream(new File(file), true));\n\t\ttestQ1();\n\t\tout.println(\"--------------------\");\n\t\tout.println(numWrong[0] + \" tests 1-\" + testNum + \" failed\");\n\t\tout.println(\"lost \" + (4.0*numWrong[0]/q1Count) + \" points\");\n\t\tdouble grade = 10.0 - 4.0*numWrong[0]/q1Count;\n\t\ttestQ2();\n\t\tout.println(\"--------------------\");\n\t\tout.println(numWrong[1] + \" tests \" + (q1Count+1)+ \"-\" + testNum + \" failed\");\n\t\tout.println(\"lost \" + (3.0*(numWrong[1])/q2Count) + \" points\");\n\t\tgrade = grade - 3.0*numWrong[1]/q2Count;\n\t\ttestQ3();\n\t\tout.println(\"--------------------\");\n\t\tout.println(numWrong[2] + \" tests \" + (q2Count+q1Count+1)+ \"-\" + testNum + \" failed\");\n\t\tout.println(\"lost \" + (3.0*(numWrong[2])/q3Count) + \" points\");\n\t\tgrade = grade - 3.0*numWrong[2]/q3Count;\n\t\tout.println(\"--------------------\");\n\t\tout.println(\"Grade = \" + grade);\n\t}", "public static void main(String[] args) {\n\t\t String astanaFile = \"C:/Users/S.M.Didar/Dropbox/Didar DBPC/PhD Research/Winter 2015/ICSE 2016/Experiment/ExpV4/mbostock,d3/\"; \r\n\t\t String hpFile = \"C:/Users/S.M.Didar/Dropbox/Didar DBPC/PhD Research/Winter 2015/ICSE 2016/Experiment/ExpV4/mbostock,d3/HP/\"; \r\n\t\t String fileName = \"weeklyRate.xls\"; \r\n\t\t String sheetName = \"RRVal\"; \r\n\t\t \r\n\t\t \r\n\t\t readExcelFile (astanaFile, fileName, sheetName, astanaData,80); \r\n\t\t readExcelFile (hpFile , fileName, sheetName, hpData,80); \r\n\t\t\r\n//\t\t System.out.println(astanaData.size()+\"ggggggggggggggggggggg\");\r\n//\t\t for (int i=0;i<astanaData.size();i++){\r\n//\t\t\tSystem.out.println(astanaData.get(i).RRVal); \r\n//\t\t\tSystem.out.println(astanaData.get(i).RRLevel); \r\n//\t\t }\r\n\t\t \r\n\t\t \r\n//\t\t for (int i=0;i<hpData.size();i++){\r\n//\t\t\t\tSystem.out.println(hpData.get(i).RRVal); \r\n//\t\t\t\tSystem.out.println(hpData.get(i).RRLevel); \r\n//\t\t\t }\r\n\t\t \r\n\t\t \r\n\t\t precisioncalc (); \r\n\t\t \r\n\t\t \r\n\t\t resultsCalc (astanaFile, hpPrecision, \"HPAccuracy\"); \r\n\t\t resultsCalc (astanaFile, astanaPrecision, \"AstanaAccuracy\" ); \r\n\r\n\t}", "@Test\n public void testWizardReport() {\n testReporterConfig(Reporter.ALL_2017_4_24, \"WizardReport.txt\");\n }", "public static void main(String[] args)throws IOException {\r\n\t\t\r\n\t\t String inputFolder = \"C:/Users/Nekromantik/Desktop/321\";\r\n\t\t String inputfile = \"C:/Users/Nekromantik/Desktop/222/disagreements.txt\";\r\n\t\t \r\n\t\t String outputfile = \"C:/Users/Nekromantik/Desktop/222/result.txt\";\r\n\t\t \r\n\t\t Eva_help2 test = new Eva_help2();\r\n\t\t test.generate(inputfile, inputFolder, outputfile);\r\n\t\t\r\n\t}", "public void wekaCalculate()\n\t{\n\t\tfor (int categoryStep = 0; categoryStep < 6; categoryStep++)\n\t\t{\n\t\t\tString trainString = \"Train\";\n\t\t\tString testString = \"Test\";\n\t\t\tString categoryString;\n\t\t\tString resultString = \"Results\";\n\t\t\tString textString;\n\t\t\tString eventString;\n\n\t\t\tswitch (categoryStep)\n\t\t\t{\n\t\t\tcase 0: categoryString = \"Cont.arff\"; break;\n\t\t\tcase 1: categoryString = \"Dona.arff\"; break;\n\t\t\tcase 2: categoryString = \"Offi.arff\"; break;\n\t\t\tcase 3: categoryString = \"Advi.arff\"; break;\n\t\t\tcase 4: categoryString = \"Mult.arff\"; break;\n\t\t\tdefault: categoryString = \"Good.arff\";\n\t\t\t}\n\t\t\t\n\t\t\tswitch (categoryStep)\n\t\t\t{\n\t\t\tcase 0: textString = \"Cont.txt\"; break;\n\t\t\tcase 1: textString = \"Dona.txt\"; break;\n\t\t\tcase 2: textString = \"Offi.txt\"; break;\n\t\t\tcase 3: textString = \"Advi.txt\"; break;\n\t\t\tcase 4: textString = \"Mult.txt\"; break;\n\t\t\tdefault: textString = \"Good.txt\";\n\t\t\t}\n\t\t\t\n\t\t\tfor (int eventStep = 0; eventStep < 15; eventStep++)\n\t\t\t{\n\t\t\t\tString trainingData;\n\t\t\t\tString testData;\n\t\t\t\tString resultText;\n\n\t\t\t\tswitch (eventStep)\n\t\t\t\t{\n\t\t\t\tcase 0: eventString = \"2011Joplin\"; break;\n\t\t\t\tcase 1: eventString = \"2012Guatemala\"; break; \n\t\t\t\tcase 2: eventString = \"2012Italy\"; break;\n\t\t\t\tcase 3: eventString = \"2012Philipinne\"; break;\n\t\t\t\tcase 4: eventString = \"2013Alberta\";\tbreak;\n\t\t\t\tcase 5: eventString = \"2013Australia\"; break;\n\t\t\t\tcase 6: eventString = \"2013Boston\"; break;\t\t\t\t\n\t\t\t\tcase 7: eventString = \"2013Manila\"; break;\n\t\t\t\tcase 8: eventString = \"2013Queens\"; break;\n\t\t\t\tcase 9: eventString = \"2013Yolanda\"; break;\n\t\t\t\tcase 10: eventString = \"2014Chile\"; break;\n\t\t\t\tcase 11: eventString = \"2014Hagupit\"; break;\n\t\t\t\tcase 12: eventString = \"2015Nepal\"; break;\n\t\t\t\tcase 13: eventString = \"2015Paris\"; break;\n\t\t\t\tdefault: eventString = \"2018Florida\"; \t\t\t\t\n\t\t\t\t}\n\n\t\t\t\ttrainingData = eventString;\n\t\t\t\ttrainingData += trainString;\n\t\t\t\ttrainingData += categoryString;\n\n\t\t\t\ttestData = eventString;\n\t\t\t\ttestData += testString;\n\t\t\t\ttestData += categoryString;\n\t\t\t\t\n\t\t\t\t\n\n\t\t\t\tresultText = eventString;\n\t\t\t\tresultText += resultString;\n\t\t\t\tresultText += textString;\n\t\t\t\t\n\n\t\t\t\ttry {\n\t\t\t\t\tConverterUtils.DataSource loader1 = new ConverterUtils.DataSource(trainingData);\n\t\t\t\t\tConverterUtils.DataSource loader2 = new ConverterUtils.DataSource(testData);\n\n\n\t\t\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(resultText));\n\t\t\t\t\tInstances trainData = loader1.getDataSet();\n\t\t\t\t\ttrainData.setClassIndex(trainData.numAttributes() - 1);\n\n\t\t\t\t\tInstances testingData = loader2.getDataSet();\n\t\t\t\t\ttestingData.setClassIndex(testingData.numAttributes() - 1);\n\n\t\t\t\t\tClassifier cls1 = new NaiveBayes();\t\t\t\t\t\n\t\t\t\t\tcls1.buildClassifier(trainData);\t\t\t\n\t\t\t\t\tEvaluation eval1 = new Evaluation(trainData);\n\t\t\t\t\teval1.evaluateModel(cls1, testingData);\t\n\t\t\t\t\tbw.write(\"=== Summary of Naive Bayes ===\");\n\t\t\t\t\tbw.write(eval1.toSummaryString());\n\t\t\t\t\tbw.write(eval1.toClassDetailsString());\n\t\t\t\t\tbw.write(eval1.toMatrixString());\n\t\t\t\t\tbw.write(\"\\n\");\n\n\t\t\t\t\tthis.evalNaiveBayesList.add(eval1);\n\n\t\t\t\t\tClassifier cls2 = new SMO();\n\t\t\t\t\tcls2.buildClassifier(trainData);\n\t\t\t\t\tEvaluation eval2 = new Evaluation(trainData);\n\t\t\t\t\teval2.evaluateModel(cls2, testingData);\n\t\t\t\t\tbw.write(\"=== Summary of SMO ===\");\n\t\t\t\t\tbw.write(eval2.toSummaryString());\n\t\t\t\t\tbw.write(eval2.toClassDetailsString());\n\t\t\t\t\tbw.write(eval2.toMatrixString());\n\n\t\t\t\t\tthis.evalSMOList.add(eval2);\n\n\t\t\t\t\tbw.close();\n\t\t\t\t} catch (Exception e) {\t\t\t\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Test\n\tpublic void armarGananciasDeLosResultantes() {\n\t\t/*\n\t\t * me salieron 24 arboles, que me interesan los campos \n\t\t * NodeID_24 : para saber que hoja del arbol fue \n\t\t * PredictedProbability_2_24 : para saber que probabilidad de baja mas 2 fue \n\t\t * SampleAssignment_24 : para saber si fue tomado para test o train tengoq ue correr el script siguient para persistirlo en la DB\n\t\t * \n\t\t * los nombres de las variables van como anteriorlmente , el inicial no\n\t\t * tiene subindice, pero se lo cambi oy le pongo 0 cosa de que arranque\n\t\t * en 0\nIF (A_default_prob >= 0.025 AND clase_int=2) A_default_ganancia=7800. \nEXECUTE. \nRECODE A_default_ganancia (SYSMIS=-200). \nEXECUTE.\n\nSAVE TRANSLATE /TYPE=ODBC \n /CONNECT='DSN=dmkd-dmf;' \n /ENCRYPTED \n /MISSING=RECODE \n /SQL='CREATE TABLE historico_201503_default_tree_result (numero_de_cliente double , foto_mes double , A_default_node double , A_default_prob double, A_default_ganancia double )' \n /REPLACE \n /TABLE='SPSS_TEMP' \n /KEEP=numero_de_cliente, foto_mes, A_default_node, A_default_prob ,A_default_ganancia\n /SQL='INSERT INTO historico_201503_default_tree_result (numero_de_cliente, foto_mes, A_default_node, A_default_prob,A_default_ganancia) SELECT numero_de_cliente, foto_mes, A_default_node, A_default_prob,A_default_ganancia FROM SPSS_TEMP' \n /SQL='DROP TABLE SPSS_TEMP'. \nEXECUTE.\nDATASET CLOSE.\nEXECUTE.\n\n\nPredictedProbability_2_24\n\t\t * \n\t\t */\n\t\t// de 0 a 24\n\t\tString separator = System.getProperty(\"line.separator\");\n\t\tString outFolder = ArbolFileSources.userFolder + \"/Dropbox/julio_box/educacion/maestria_explotacion_datos_uba/materias/cuat_2_dm_finanzas/entregable/historia/\";\n\t\tString timeStampFolder = UtilidadesGenerales.getTimeStamp(null, null);\n\t\tStringBuilder build = new StringBuilder();\n\t\tfor (int i = 0; i < 25; i++) {\n\t\t\t\n\t\t\tString nombreProba = \"PredictedProbability_2_\"+i;\n\t\t\tString nombreGanancia= \"ganancia_\"+i;\n\t\t\tString nombreNodo= \"NodeID_\"+i;\n\t\t\tString nombreTrain= \"SampleAssignment_\"+i;\n\t\t\tString nombreTabla = \"corridaCiega_\"+i;\n\t\t\t\n\t\t\t/* recode de ganancia */\n\t\t\tbuild.append(\"IF (PredictedProbability_2_\").append(i).append(\" >= 0.025 AND clase_int=2 ) ganancia_\").append(i).append(\"=7800.\").append(separator);\n\t\t\tbuild.append(\"EXECUTE.\").append(separator);\n\t\t\tbuild.append(\"RECODE ganancia_\").append(i).append(\"(SYSMIS=-200).\").append(separator);\n\t\t\tbuild.append(\"EXECUTE.\").append(separator);\n\t\t\t\n\t\t\t \n\t\t\t/* save sql */\n\t\t\tbuild.append(\"SAVE TRANSLATE /TYPE=ODBC\").append(separator);\n\t\t\tbuild.append(\"/CONNECT='DSN=dmkd-dmf;'\").append(separator);\n\t\t\tbuild.append(\"/ENCRYPTED \").append(separator);\n\t\t\tbuild.append(\"/MISSING=RECODE \").append(separator);\n\t\t\tbuild.append(\"/SQL='CREATE TABLE \").append(nombreTabla).append(\" (numero_de_cliente double , foto_mes double , '+\").append(separator);\n\t\t\t\n\t\t\tbuild.append(\"' \").append(nombreProba).append(\" double , '+\").append(separator);\n\t\t\tbuild.append(\"' \").append(nombreGanancia).append(\" double , '+\").append(separator);\n\t\t\tbuild.append(\"' \").append(nombreNodo).append(\" double , '+\").append(separator);\n\t\t\tbuild.append(\"' \").append(nombreTrain).append(\" double ) '\").append(separator);\n\t\t\t\n \n\t\t\tbuild.append(\"/REPLACE \").append(separator);\n\t\t\tbuild.append(\"/TABLE='SPSS_TEMP' \").append(separator);\n\t\t\tbuild.append(\"/KEEP=numero_de_cliente, foto_mes, \").append(separator);\n\t\t\tbuild.append(nombreProba).append(\" , \").append(separator);\n\t\t\tbuild.append(nombreGanancia).append(\" , \").append(separator);\n\t\t\tbuild.append(nombreNodo).append(\" , \").append(separator);\n\t\t\tbuild.append(nombreTrain).append(\" \").append(separator);\n\t\t\t\n\t\t\tbuild.append(\"/SQL='INSERT INTO \").append(nombreTabla).append(\" (numero_de_cliente, foto_mes, '+\").append(separator);\n\t\t\tbuild.append(\"' \").append(nombreProba).append(\" , '+\").append(separator);\n\t\t\tbuild.append(\"' \").append(nombreGanancia).append(\" , '+\").append(separator);\n\t\t\tbuild.append(\"' \").append(nombreNodo).append(\" , '+\").append(separator);\n\t\t\tbuild.append(\"' \").append(nombreTrain).append(\" '+\").append(separator);\n\t\t\tbuild.append(\"' ) SELECT numero_de_cliente, foto_mes, '+\").append(separator);\n\t\t\tbuild.append(\"' \").append(nombreProba).append(\" , '+\").append(separator);\n\t\t\tbuild.append(\"' \").append(nombreGanancia).append(\" , '+\").append(separator);\n\t\t\tbuild.append(\"' \").append(nombreNodo).append(\" , '+\").append(separator);\n\t\t\tbuild.append(\"' \").append(nombreTrain).append(\" '+\").append(separator);\n\t\t\tbuild.append(\"' FROM SPSS_TEMP'\").append(separator);\n\t\t\t\n\t\t\tbuild.append(\"/SQL='DROP TABLE SPSS_TEMP'.\").append(separator); \n\t\t\tbuild.append(\"EXECUTE.\").append(separator).append(separator);\n\t\t\t\n\t\t\t\n\t\t}\n\t\tUtilidadesGenerales.writeToFile(build.toString(), \"UTF-8\", outFolder + timeStampFolder + \"_syntax_corridaCiega_.txt\");\n\t}", "protected void doClassificationReport(ClassificationAlgorithm algorithm)\n\t{\n\t\t// Test report name\n\t\tString testReportFilename = \"TestClassificationReport.txt\";\n\t\t// Train report name\n\t\tString trainReportFilename = \"TrainClassificationReport.txt\";\n\t\t// Test report file\n\t\tFile testReportFile = new File(reportDirectory, testReportFilename);\n\t\t// Train report file\n\t\tFile trainReportFile = new File(reportDirectory, trainReportFilename);\n\t\t// Test file writer\n\t\tFileWriter testFile = null;\n\t\t// Train file writer\n\t\tFileWriter trainFile = null;\n\t\t// Number of conditions\n\t\tint conditions = 0;\n\t\t// Classifier\n\t\tIClassifier classifier = algorithm.getClassifier();\n\n\t\tint[][] confusionMatrixTrain = classifier.getConfusionMatrix(algorithm.getTrainSet());\n\t\tint[][] confusionMatrixTest = classifier.getConfusionMatrix(algorithm.getTestSet());\n\n\t\tint[] numberInstancesTrain = new int[confusionMatrixTrain.length];\n\t\tint[] numberInstancesTest = new int[confusionMatrixTest.length];\n\t\tint correctedClassifiedTrain = 0, correctedClassifiedTest = 0;\n\n\t\tfor(int i = 0; i < confusionMatrixTrain.length; i++)\n\t\t{\n\t\t\tcorrectedClassifiedTrain += confusionMatrixTrain[i][i];\n\t\t\tcorrectedClassifiedTest += confusionMatrixTest[i][i];\n\n\t\t\tfor(int j = 0; j < confusionMatrixTrain.length; j++)\n\t\t\t{\n\t\t\t\tnumberInstancesTrain[i] += confusionMatrixTrain[i][j];\n\t\t\t\tnumberInstancesTest[i] += confusionMatrixTest[i][j];\n\t\t\t}\n\t\t}\n\n\n\t\tDecimalFormat df = new DecimalFormat(\"0.00\");\n\t\tDecimalFormat df4 = new DecimalFormat(\"0.0000\");\n\n\t\ttry {\n\t\t\ttestReportFile.createNewFile();\n\t\t\ttrainReportFile.createNewFile();\n\t\t\ttestFile = new FileWriter (testReportFile);\n\t\t\ttrainFile = new FileWriter (trainReportFile);\n\n\t\t\t// Dataset metadata\n\t\t\tIMetadata metadata = algorithm.getTrainSet().getMetadata();\n\n\t\t\t// Get the classifier\n\t\t\tList<Rule> classificationRules = ((RuleBase) classifier).getClassificationRules();\n\n\t\t\t// Obtain the number of conditions\n\t\t\tconditions = ((RuleBase) classifier).getConditions();\n\n\t\t\t// Obtain the number of classes\n\t\t\tCategoricalAttribute catAttribute = (CategoricalAttribute) metadata.getAttribute(metadata.getClassIndex());\n\t\t\tint numClasses = catAttribute.getCategories().size();\n\n\t\t\t// Train data\n\t\t\ttrainFile.write(\"File name: \" + ((FileDataset) algorithm.getTrainSet()).getFileName());\n\t\t\ttrainFile.write((\"\\nRuntime (s): \" + (((double)(endTime-initTime)) / 1000.0)));\n\t\t\ttrainFile.write(\"\\nMemory Usage(bytes): \" + (afterUsedMem-beforeUsedMem));\n\t\t\ttrainFile.write(\"\\nNumber of rules: \" + (classificationRules.size()+1));\n\t\t\t//trainFile.write(\"\\nNumber of conditions: \"+ conditions);\n\t\t\t//trainFile.write(\"\\nAverage number of conditions per rule: \" + (double)conditions/((double)classificationRules.size()+1.0));\n\t\t\ttrainFile.write(\"\\nAccuracy: \" + df4.format((correctedClassifiedTrain / (double) algorithm.getTrainSet().getInstances().size())));\n\n\t\t\t// Write the geometric mean\n\t\t\t//trainFile.write(\"\\nGeometric mean: \" + df4.format(mediaGeoTrain));\n\t\t\t//trainFile.write(\"\\nCohen's Kappa rate: \" + df4.format(kappaRateTrain));\n\t\t\t//trainFile.write(\"\\nAUC: \" + df4.format(aucTrain));\n\n\t\t\ttrainFile.write(\"\\n\\n#Percentage of correct predictions per class\");\n\n\t\t\t// Test data\n\t\t\ttestFile.write(\"File name: \" + ((FileDataset) algorithm.getTestSet()).getFileName());\n\t\t\ttestFile.write((\"\\nRuntime (s): \" + (((double)(endTime-initTime)) / 1000.0)));\n\t\t\ttrainFile.write(\"\\nMemory Usage(bytes): \" + (afterUsedMem-beforeUsedMem));\n\t\t\t//\ttestFile.write(\"\\nNumber of different attributes: \" + (metadata.numberOfAttributes()-1));\n\t\t\ttestFile.write(\"\\nNumber of rules: \" + (classificationRules.size()+1));\n\t\t\t//\ttestFile.write(\"\\nNumber of conditions: \"+ conditions);\n\t\t\t//\ttestFile.write(\"\\nAverage number of conditions per rule: \" + (double)conditions/((double)classificationRules.size()+1.0));\n\t\t\ttestFile.write(\"\\nAccuracy: \" + df4.format((correctedClassifiedTest / (double) algorithm.getTestSet().getInstances().size())));\n\n\t\t\t// Write the geometric mean\n\t\t\t//testFile.write(\"\\nGeometric mean: \" + df4.format(mediaGeoTest));\n\t\t\t//testFile.write(\"\\nCohen's Kappa rate: \" + df4.format(kappaRateTest));\n\t\t\t//testFile.write(\"\\nAUC: \" + df4.format(aucTest));\n\n\t\t\ttestFile.write(\"\\n\\n#Percentage of correct predictions per class\");\n\n\t\t\t// Check if the report directory name is in a file\n\t\t\tString aux = \"\";\n\t\t\tif(getReportDirName().split(\"/\").length>1)\n\t\t\t\taux = getReportDirName().split(\"/\")[0]+\"/\";\n\t\t\telse\n\t\t\t\taux = \"./\";\n\n\t\t\t// Global report for train\n\t\t\tString nameFileTrain = aux +getGlobalReportName() + \"-train.txt\";\n\t\t\tFile fileTrain = new File(nameFileTrain);\n\t\t\tBufferedWriter bwTrain;\n\n\t\t\t// Global report for test\n\t\t\tString nameFileTest = aux +getGlobalReportName() + \"-test.txt\";\n\t\t\tFile fileTest = new File(nameFileTest);\n\t\t\tBufferedWriter bwTest;\n\n\t\t\t// If the global report for train exist\n\t\t\tif(fileTrain.exists())\n\t\t\t{\n\t\t\t\tbwTrain = new BufferedWriter (new FileWriter(nameFileTrain,true));\n\t\t\t\tbwTrain.write(System.getProperty(\"line.separator\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbwTrain = new BufferedWriter (new FileWriter(nameFileTrain));\n\t\t\t\tbwTrain.write(\"Dataset \t\t\t\t\t\t\t|| Accuracy || Execution time(s) || Memory Usage (bytes)\\n\");\t\t\t}\n\n\t\t\t// If the global report for test exist\n\t\t\tif(fileTest.exists())\n\t\t\t{\n\t\t\t\tbwTest = new BufferedWriter (new FileWriter(nameFileTest,true));\n\t\t\t\tbwTest.write(System.getProperty(\"line.separator\"));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tbwTest = new BufferedWriter (new FileWriter(nameFileTest));\n\n\t\t\t\tbwTest.write(\"Dataset \t\t\t\t\t\t\t\t|| Accuracy || Execution time(s) || Memory Usage (bytes)\\n\");\n\n\t\t\t}\n\n\t\t\t//Write the train dataset name\n\t\t\tbwTrain.write(((FileDataset) algorithm.getTrainSet()).getFileName() + \"||\");\n\t\t\t//Write the test dataset name\n\t\t\tbwTest.write(((FileDataset) algorithm.getTestSet()).getFileName() + \"||\");\n\t\t\t//Write the percentage of correct predictions\n\t\t\tbwTrain.write(((correctedClassifiedTrain / (double) algorithm.getTrainSet().getInstances().size())) + \",\");\n\n\t\t\t//bwTrain.write(kappaRateTrain + \",\");\n\t\t\t//bwTrain.write(aucTrain + \",\");\n\n\t\t\tfor(int i=0; i<numClasses; i++)\n\t\t\t{\n\t\t\t\tString result = new String();\n\n\t\t\t\tresult = \"\\n Class \" + metadata.getAttribute(metadata.getClassIndex()).show(i) + \":\";\n\t\t\t\tif(numberInstancesTrain[i] == 0)\n\t\t\t\t{\n\t\t\t\t\tresult += \" 100.00\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresult += \" \" + df.format((confusionMatrixTrain[i][i] / (double) numberInstancesTrain[i]) * 100) + \"%\";\n\t\t\t\t}\n\n\t\t\t\ttrainFile.write(result);\n\t\t\t}\n\n\t\t\ttrainFile.write(\"\\n#End percentage of correct predictions per class\");\n\n\n\t\t\t bwTrain.write((((double)(endTime-initTime)) / 1000.0) + \"\");\n\n\t\t\ttrainFile.write(\"\\n\\n#Classifier\\n\");\n\n\t\t\ttrainFile.write(classifier.toString(metadata));\n\n\t\t\t// Write the Percentage of correct predictions\n\t\t\tbwTest.write(((correctedClassifiedTest / (double) algorithm.getTestSet().getInstances().size())) + \",\");\n\t\t\t//bwTest.write(kappaRateTest + \",\");\n\t\t\t//bwTest.write(aucTest + \",\");\n\n\t\t\tfor(int i=0; i<numClasses; i++)\n\t\t\t{\n\t\t\t\tString result = new String();\n\n\t\t\t\tresult = \"\\n Class \" + metadata.getAttribute(metadata.getClassIndex()).show(i) +\":\";\n\t\t\t\tif(numberInstancesTest[i] == 0)\n\t\t\t\t{\n\t\t\t\t\tresult += \" 100.00\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tresult += \" \" + df.format((confusionMatrixTest[i][i] / (double) numberInstancesTest[i]) *100) + \"%\";\n\t\t\t\t}\n\t\t\t\ttestFile.write(result);\n\t\t\t}\n\n\t\t\ttestFile.write(\"\\n#End percentage of correct predictions per class\");\n\n\t\t\t//bwTest.write(mediaGeoTest + \",\");\n\t\t\t//bwTest.write((classificationRules.size()+1) + \",\");\n\t\t\t//bwTest.write(conditions + \",\");\n\t\t\t//bwTest.write((double)conditions/((double)classificationRules.size()+1.0) + \",\");\n\t\t\t//bwTest.write(algorithm.getEvaluator().getNumberOfEvaluations()+\",\");\n\t\t\tbwTest.write((((double)(endTime-initTime)) / 1000.0) + \"\");\n\n\t\t\ttestFile.write(\"\\n\\n#Classifier\\n\");\n\n\t\t\ttestFile.write(classifier.toString(metadata));\n\n\t\t\ttestFile.write(\"\\n#Test Classification Confusion Matrix\\n\");\n\n\t\t\ttestFile.write(\"\\t\\t\\tPredicted\\n\\t\\t\\t\");\n\n\t\t\tfor(int i = 0; i < metadata.numberOfClasses(); i++)\n\t\t\t\ttestFile.write(\"C\"+ i + \"\\t\");\n\n\t\t\ttestFile.write(\"|\\nActual\");\n\n\t\t\tfor(int i = 0; i < metadata.numberOfClasses(); i++)\n\t\t\t{\n\t\t\t\tif(i != 0)\n\t\t\t\t\ttestFile.write(\"\\t\");\n\n\t\t\t\ttestFile.write(\"\\tC\" + i + \"\\t\");\n\n\t\t\t\tfor(int j = 0; j < metadata.numberOfClasses(); j++)\n\t\t\t\t\ttestFile.write(confusionMatrixTest[i][j] + \"\\t\");\n\n\t\t\t\ttestFile.write(\"|\\tC\" + i + \" = \" + metadata.getAttribute(metadata.getClassIndex()).show(i) + \"\\n\");\n\t\t\t}\n\n\t\t\ttrainFile.write(\"\\n#Train Classification Confusion Matrix\\n\");\n\n\t\t\ttrainFile.write(\"\\t\\t\\tPredicted\\n\\t\\t\\t\");\n\n\t\t\tfor(int i = 0; i < metadata.numberOfClasses(); i++)\n\t\t\t\ttrainFile.write(\"C\"+ i + \"\\t\");\n\n\t\t\ttrainFile.write(\"|\\nActual\");\n\n\t\t\tfor(int i = 0; i < metadata.numberOfClasses(); i++)\n\t\t\t{\n\t\t\t\tif(i != 0)\n\t\t\t\t\ttrainFile.write(\"\\t\");\n\n\t\t\t\ttrainFile.write(\"\\tC\" + i + \"\\t\");\n\n\t\t\t\tfor(int j = 0; j < metadata.numberOfClasses(); j++)\n\t\t\t\t\ttrainFile.write(confusionMatrixTrain[i][j] + \"\\t\");\n\n\t\t\t\ttrainFile.write(\"||\\tC\" + i + \" = \" + metadata.getAttribute(metadata.getClassIndex()).show(i) + \"\\n\");\n\t\t\t}\n\n\t\t\t// Close the files\n\t\t\tbwTest.close();\n\t\t\tbwTrain.close();\n\t\t\ttestFile.close();\n\t\t\ttrainFile.close();\n\t\t}\n\t\tcatch (IOException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args) {\n\n String fileEdgeList = \"../DataSource/PANCANsigEdgeList.csv\";\n String fileGtTrainingMatrix = \"../DataSource/CrossMatrixDriver/PANCAN.Drivercallpertumor.4468tumors.training.10.csv\";\n// String fileGtTestingMatrix = \"../DataSource/CrossMatrixDriver/PANCAN.Drivercallpertumor.4468tumors.testing.10.csv\";\n String fileGeTrainingMatrix = \"../DataSource/CrossMatrixDriver/PANCAN.GeM.4468tumors.training.10.csv\";\n String fileGeTestingMatrix = \"../DataSource/CrossMatrixDriver/PANCAN.GeM.4468tumors.testing.10.csv\";\n String fileInferDriver = \"../DataSource/CrossMatrixDriver/PANCAN.Drivercallpertumor.4468tumors.InferDriver.10.withTumorID.csv\";\n// String fileDriverSGATable = \"../DataSource/CrossMatrixDriver/PANCAN.Drivercallpertumor.4468tumors.DriverSGATable.10.csv\";\n \n \n DataReader dataObj = new DataReader(fileEdgeList, fileGtTrainingMatrix, fileGeTrainingMatrix);\n\n int reRun = 0;\n double T = 0.5;\n do {\n reRun += 1;\n\n EstimateParams paramObj = new EstimateParams(dataObj.edgeList, dataObj.driverSGAs, dataObj.targetDEGs, dataObj.driverSGATable, dataObj.targetDEGTable);\n InferDriverActivation actObj = new InferDriverActivation(paramObj.mapEdgeParam, paramObj.mapSGAParam,\n dataObj.targetDEGTable, dataObj.driverSGAs, dataObj.targetDEGs, dataObj.mapSgaDegs);\n\n\n actObj.thresholding(T);\n \n actObj.updateInferDriverTable( dataObj.driverSGATable);\n \n double change = actObj.compareMatrix(dataObj.driverSGATable);\n\n System.out.println(\"Current T is \" + T);\n System.out.println(\"Change is \" + change);\n System.out.println(\"This is the \" + reRun + \"th run\");\n if (change < 0.001 || T > 1) {\n System.out.println(\"Total times of run is \" + reRun + \". Final cut shreshold is \" + T);\n \n// dataObj.readInGtMatrix(fileGtTestingMatrix);\n dataObj.readInGeMatrix(fileGeTestingMatrix);\n InferDriverActivation actObjTesting = new InferDriverActivation(paramObj.mapEdgeParam, paramObj.mapSGAParam,\n dataObj.targetDEGTable, dataObj.driverSGAs, dataObj.targetDEGs, dataObj.mapSgaDegs);\n \n actObjTesting.outputInferActivation(fileInferDriver, dataObj.tumorNames);\n// dataObj.outputDriverSGATable(fileDriverSGATable); //output contains tumorName, since tumor name is defined in dataObj, so no need to pass in\n\n break; \n \n } else {\n dataObj.updateDriverSGATable(actObj.inferDriverTable);\n T += 0.05;\n \n }\n\n } while (true);\n }", "public void getPredictions() throws IOException, InterruptedException{\n //splitColsDataFiles();\n for(String learner:listLearners){\n File modelsFolder = new File(\"models/\"+learner);\n File[] IPFolders = modelsFolder.listFiles();\n for (File nodeFolder : IPFolders) {\n if (nodeFolder.isDirectory()) {\n File[] filesInFolder = nodeFolder.listFiles();\n ArrayList<String> filesINFolderAL = new ArrayList<String>();\n for(int i=0;i<filesInFolder.length;i++){\n filesINFolderAL.add(filesInFolder[i].getName());\n }\n if(filesINFolderAL.contains(model) && filesINFolderAL.contains(\"data.properties\")){\n System.out.println(\"Generating data for: \" + nodeFolder.getPath());\n // read properties file\n // get indices of variables\n // paste appropriate cols in models/temp\n // change commands below with appropriate data\n Properties dataProps = loadProps(nodeFolder.getPath()+\"/data.properties\");\n ArrayList<Integer> indices = new ArrayList<Integer>();\n String featuresS = dataProps.getProperty(\"sampled_variables\");\n if(featuresS!=null){\n String[] featuresArray = featuresS.split(\" \");\n for(int i=0;i<featuresArray.length;i++){\n indices.add(i, Integer.parseInt(featuresArray[i]));\n }\n // the order of indices is important\n Collections.sort(indices);\n\n String pasteTrainTempCommand = \"paste -d',' \";\n for(int i=0;i<indices.size();i++){\n pasteTrainTempCommand += \" models/temp/tr_\" + (indices.get(i)+1) + \".csv\";\n }\n pasteTrainTempCommand += \" models/temp/tr_targets.csv > models/temp/tr_temp.csv\";\n System.out.println(pasteTrainTempCommand);\n Process pasteTrainTemp_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", pasteTrainTempCommand});\n pasteTrainTemp_process.waitFor();\n\n\n String pasteTestTempCommand = \"paste -d',' \";\n for(int i=0;i<indices.size();i++){\n pasteTestTempCommand += \" models/temp/te_\" + (indices.get(i)+1) + \".csv\";\n }\n pasteTestTempCommand += \" models/temp/te_targets.csv > models/temp/te_temp.csv\";\n System.out.println(pasteTestTempCommand);\n Process pasteTestTemp_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", pasteTestTempCommand});\n pasteTestTemp_process.waitFor();\n \n // Add a new case when adding a new learner\n if(learner.equals(\"gpfunction\") || learner.equals(\"ruletree\") || learner.equals(\"rulelist\")){ // JAVA\n String predictTrain_command = \"java -jar learners/\" + learner + \".jar -predict models/temp/tr_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTrain_\" + model ;\n Process predictTrain_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTrain_command});\n predictTrain_process.waitFor();\n String predictTest_command = \"java -jar learners/\" + learner + \".jar -predict models/temp/te_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTest_\" + model ;\n Process predictTest_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTest_command});\n predictTest_process.waitFor();\n }else if(learner.equals(\"mplcs\")){// C OR C++\n String predictTrain_command = \"learners/\" + learner + \" -predict models/temp/tr_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTrain_\" + model+\".csv\" ;\n Process predictTrain_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTrain_command});\n predictTrain_process.waitFor();\n String predictTest_command = \"learners/\" + learner + \" -predict models/temp/te_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTest_\" + model+\".csv\" ;\n Process predictTest_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTest_command});\n predictTest_process.waitFor();\n }if(learner.equals(\"lccb\")){ // Python\n String predictTrain_command = \"python learners/\" + learner + \".py -predict models/temp/tr_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTrain_\" + model+\".csv\" ;\n Process predictTrain_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTrain_command});\n predictTrain_process.waitFor();\n String predictTest_command = \"python learners/\" + learner + \".py -predict models/temp/te_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTest_\" + model+\".csv\" ;\n System.out.println(predictTest_command);\n Process predictTest_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTest_command});\n predictTest_process.waitFor();\n }if(learner.equals(\"SBBJ\")){ // JAVA\n String predictTrain_command = \"java -jar learners/\" + learner + \".jar -predict models/temp/tr_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTrain_\" + model+\".csv\" ;\n Process predictTrain_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTrain_command});\n predictTrain_process.waitFor();\n String predictTest_command = \"java -jar learners/\" + learner + \".jar -predict models/temp/te_temp.csv\"\n + \" -model \" + nodeFolder + \"/\" + model \n + \" -o \" + nodeFolder + \"/predsTest_\" + model+\".csv\" ;\n Process predictTest_process = Runtime.getRuntime().exec(new String[]{\"bash\" , \"-c\", predictTest_command});\n predictTest_process.waitFor();\n }\n \n }\n }\n }\n }\n }\n }", "public static void main(String[] args) {\n String fileName = \"data1.txt\";\n \n \n //Load the data from the dataset file\n dataSet = getDataSet(fileName);\n \n //Setting up the output file\n String outputFileName = \"\";\n if (fileName.indexOf(\".\") > 0) {\n outputFileName = fileName.substring(0, fileName.lastIndexOf(\".\"));\n }\n \n createFile(outputFileName+\".csv\");\n \n //log the time the algorithm started\n long startTime = System.currentTimeMillis();\n \n //Placeholder of the fittest individual\n fittestIndividual = new Individual(GENE_SIZE, NUM_RULES, COND_LEN);\n fittestIndividual.generateRulebase(); \n \n //Setup the mating pool\n matingPool = setupArray(POP_SIZE, NUM_RULES, GENE_SIZE, COND_LEN);\n \n //used to run the GA multiple times without doing it manually\n //set to 1 because we want to run the GA once\n for (int a = 0; a < 1; a++) {\n currentBest = new Individual(GENE_SIZE, NUM_RULES, COND_LEN);\n currentBest.generateRulebase();\n\n //Generate a population\n generatePopulation();\n\n //Initial calculation of the fitness\n calculateFitness(population);\n\n for (int i = 0; i < GENERATION; i++) {\n average = 0; //reset the average\n currentBestArray[i] = currentBest.getFitness();\n \n tournamentSelect(population);\n\n //Calculate the fitness of the mating pool\n calculateFitness(matingPool);\n\n //Perfrom crossover on the mating pool\n crossover(matingPool);\n\n //Mutation\n mutation(matingPool);\n\n //Calculate the fitness of the mating pool\n calculateFitness(matingPool);\n\n //Evaluate the current population\n for (Individual individual : matingPool) {\n if (individual.getFitness() > currentBest.getFitness()) {\n currentBest = new Individual(individual);\n }\n average = average + individual.getFitness();\n }\n \n\n //Replace the population with the new generation\n for (int j = 0; j < POP_SIZE; j++) {\n population[j] = new Individual(matingPool[j]);\n }\n \n averageArray[i] = average / POP_SIZE;\n }\n \n //Check whether the current best is fitter than the global fittest individual\n if (currentBest.fitness > fittestIndividual.fitness) {\n fittestIndividual = new Individual(currentBest);\n //copy the fittest individuals performance\n fittestArray = Arrays.copyOf(currentBestArray, currentBestArray.length);\n }\n }\n\n System.out.println(\"Best fitness generated for the dataset: \" + fittestIndividual.fitness);\n \n //output the rules\n printRules(fittestIndividual.getRulebase());\n \n //Save the performance data into the output file\n for (int i = 0; i < fittestArray.length; i++) {\n addToFile(i, fittestArray[i], averageArray[i]);\n }\n \n //close the file\n close();\n \n //Evaluate the fitness agaisnt the dataset\n calculateFitness(fittestIndividual);\n double accuracyPercentage = ((double) 100 / dataSet.size()) * fittestIndividual.fitness;\n System.out.format(\"%.2f%% accuracy on the datase set.\\n\", accuracyPercentage);\n \n //Log the duration it took\n long duration = System.currentTimeMillis() - startTime;\n System.out.println(\"Completed in \" + String.format(\"%02d min, %02d.%02d sec\",\n TimeUnit.MILLISECONDS.toMinutes(duration),\n TimeUnit.MILLISECONDS.toSeconds(duration)\n - TimeUnit.MINUTES.toSeconds(TimeUnit.MILLISECONDS.toMinutes(duration)),\n TimeUnit.MILLISECONDS.toMillis(duration) - TimeUnit.SECONDS.toMillis(TimeUnit.MILLISECONDS.toSeconds(duration))\n ));\n }", "public static void main(String[] args) {\n String userPath = \"..\" + File.separator + \"Solution\";\n // String userPath = \"/home/matan/temp/203\";\n String scoreMapFile = \"scoreMap.csv\";\n FileOutputStream fos = null;\n boolean addHeader = false;\n Integer groupNo = null;\n int port = 7777;\n if (args.length < 3) {\n System.err.println(\"No arguments received, Using default mode. Assume user folder ../Solution/ and port 7777\");\n System.err.println(\"Run Example:\\n../ID1_ID2 6478 scores.csv 14336 yes\");\n System.err.println(\"To avoid header just don't use the fifth parameter as such:\\n../ID1_ID2 6478 scores.csv 14336\\n\\n\");\n } else {\n userPath = args[0];\n port = Integer.valueOf(args[1]);\n scoreMapFile = args[2];\n if (args.length > 3) {\n groupNo = Integer.valueOf(args[3]);\n }\n if (args.length > 4) {\n addHeader = true;\n }\n }\n\n try {\n File f = new File(scoreMapFile);\n if (!f.exists()) {\n f.createNewFile();\n }\n fos = new FileOutputStream(f, true);\n } catch (IOException e) {\n System.err.println(\"Failed to open output file\");\n System.exit(-1);\n }\n\n TestSuite ts = new TestSuiteSpl171Ass3(userPath, port, groupNo);\n\n Map<String, Integer> scoreMap = ts.runSuite();\n try {\n writeScoreMap(scoreMap, fos, groupNo, addHeader, ts);\n } catch (IOException e) {\n System.err.println(\"Failed to print to output file\");\n try {\n fos.close();\n } catch (IOException ignore) { }\n }\n }", "public static void main(String[] args) throws Exception {\n DataSet houseVotes = DataParser.parseData(HouseVotes.filename, HouseVotes.columnNames, HouseVotes.dataTypes, HouseVotes.ignoreColumns, HouseVotes.classColumn, HouseVotes.discretizeColumns);\n DataSet breastCancer = DataParser.parseData(BreastCancer.filename, BreastCancer.columnNames, BreastCancer.dataTypes, BreastCancer.ignoreColumns, BreastCancer.classColumn, HouseVotes.discretizeColumns);\n DataSet glass = DataParser.parseData(Glass.filename, Glass.columnNames, Glass.dataTypes, Glass.ignoreColumns, Glass.classColumn, Glass.discretizeColumns);\n DataSet iris = DataParser.parseData(Iris.filename, Iris.columnNames, Iris.dataTypes, Iris.ignoreColumns, Iris.classColumn, Iris.discretizeColumns);\n DataSet soybean = DataParser.parseData(Soybean.filename, Soybean.columnNames, Soybean.dataTypes, Soybean.ignoreColumns, Soybean.classColumn, Soybean.discretizeColumns);\n \n /*\n * The contents of the DataSet are not always random.\n * You can shuffle them using Collections.shuffle()\n */\n \n Collections.shuffle(houseVotes);\n Collections.shuffle(breastCancer);\n Collections.shuffle(glass);\n Collections.shuffle(iris);\n Collections.shuffle(soybean);\n /*\n * Lastly, you want to split the data into a regular dataset and a testing set.\n * DataSet has a function for this, since it gets a little weird.\n * This grabs 10% of the data in the dataset and sets pulls it out to make the testing set.\n * This also means that the remaining 90% in DataSet can serve as our training set.\n */\n\n DataSet houseVotesTestingSet = houseVotes.getTestingSet(.1);\n DataSet breastCancerTestingSet = breastCancer.getTestingSet(.1);\n DataSet glassTestingSet = glass.getTestingSet(.1);\n DataSet irisTestingSet = iris.getTestingSet(.1);\n DataSet soybeanTestingSet = soybean.getTestingSet(.1);\n \n //KNN\n //House Votes\n System.out.println(HouseVotes.class.getSimpleName());\n KNN knn = new KNN(houseVotes, houseVotesTestingSet, HouseVotes.classColumn, 3);\n String[] knnHouseVotes = new String[houseVotesTestingSet.size()];\n for(int i = 0; i < houseVotesTestingSet.size(); i++) {\n knnHouseVotes[i] = knn.classify(houseVotesTestingSet.get(i));\n }\n for(int i = 0; i < houseVotesTestingSet.size(); i++) {\n if(knnHouseVotes[i].equals(houseVotesTestingSet.get(i)[HouseVotes.classColumn].value())) {\n System.out.println(\"KNN: Correct (\" + knnHouseVotes[i] + \")\");\n } else {\n System.out.println(\"KNN: Incorrect (\" + knnHouseVotes[i] + \", actually \" + houseVotesTestingSet.get(i)[HouseVotes.classColumn].value() + \")\");\n }\n }\n \n //Breast Cancer\n System.out.println(BreastCancer.class.getSimpleName());\n knn = new KNN(breastCancer, breastCancerTestingSet, BreastCancer.classColumn, 3);\n String[] knnBreastCancer = new String[breastCancerTestingSet.size()];\n for(int i = 0; i < breastCancerTestingSet.size(); i++) {\n knnBreastCancer[i] = knn.classify(breastCancerTestingSet.get(i));\n }\n for(int i = 0; i < breastCancerTestingSet.size(); i++) {\n if(knnBreastCancer[i].equals(breastCancerTestingSet.get(i)[BreastCancer.classColumn].value())) {\n System.out.println(\"KNN: Correct (\" + knnBreastCancer[i] + \")\");\n } else {\n System.out.println(\"KNN: Incorrect (\" + knnBreastCancer[i] + \", actually \" + breastCancerTestingSet.get(i)[BreastCancer.classColumn].value() + \")\");\n }\n }\n \n //Glass\n System.out.println(Glass.class.getSimpleName());\n knn = new KNN(glass, glassTestingSet, Glass.classColumn, 3);\n String[] knnGlass = new String[glassTestingSet.size()];\n for(int i = 0; i < glassTestingSet.size(); i++) {\n knnGlass[i] = knn.classify(glassTestingSet.get(i));\n }\n for(int i = 0; i < glassTestingSet.size(); i++) {\n if(knnGlass[i].equals(glassTestingSet.get(i)[Glass.classColumn].value())) {\n System.out.println(\"KNN: Correct (\" + knnGlass[i] + \")\");\n } else {\n System.out.println(\"KNN: Incorrect (\" + knnGlass[i] + \", actually \" + glassTestingSet.get(i)[Glass.classColumn].value() + \")\");\n }\n }\n \n //Iris\n System.out.println(Iris.class.getSimpleName());\n knn = new KNN(iris, irisTestingSet, Iris.classColumn, 3);\n String[] knnIris = new String[irisTestingSet.size()];\n for(int i = 0; i < irisTestingSet.size(); i++) {\n knnIris[i] = knn.classify(irisTestingSet.get(i));\n }\n for(int i = 0; i < irisTestingSet.size(); i++) {\n if(knnIris[i].equals(irisTestingSet.get(i)[Iris.classColumn].value())) {\n System.out.println(\"KNN: Correct (\" + knnIris[i] + \")\");\n } else {\n System.out.println(\"KNN: Incorrect (\" + knnIris[i] + \", actually \" + irisTestingSet.get(i)[Iris.classColumn].value() + \")\");\n }\n }\n \n //Soybean\n System.out.println(Soybean.class.getSimpleName());\n knn = new KNN(soybean, soybeanTestingSet, Soybean.classColumn, 3);\n String[] knnSoybean = new String[soybeanTestingSet.size()];\n for(int i = 0; i < soybeanTestingSet.size(); i++) {\n knnSoybean[i] = knn.classify(soybeanTestingSet.get(i));\n }\n for(int i = 0; i < soybeanTestingSet.size(); i++) {\n if(knnSoybean[i].equals(soybeanTestingSet.get(i)[Soybean.classColumn].value())) {\n System.out.println(\"KNN: Correct (\" + knnSoybean[i] + \")\");\n } else {\n System.out.println(\"KNN: Incorrect (\" + knnSoybean[i] + \", actually \" + soybeanTestingSet.get(i)[Soybean.classColumn].value() + \")\");\n }\n }\n \n \n /*\n * Lets setup ID3:\n * DataSet, TestSet, column with the class categorization. (republican, democrat in this case)\n */\n\n System.out.println(HouseVotes.class.getSimpleName());\n ID3 id3 = new ID3(houseVotes, houseVotesTestingSet, HouseVotes.classColumn);\n String[] id3HouseVotes = new String[houseVotesTestingSet.size()];\n for(int i = 0; i < houseVotesTestingSet.size(); i++) {\n id3HouseVotes[i] = id3.classify(houseVotesTestingSet.get(i));\n }\n for(int i = 0; i < houseVotesTestingSet.size(); i++) {\n if(id3HouseVotes[i].equals(houseVotesTestingSet.get(i)[HouseVotes.classColumn].value())) {\n System.out.println(\"ID3: Correct (\" + id3HouseVotes[i] + \")\");\n } else {\n System.out.println(\"ID3: Incorrect (\" + id3HouseVotes[i] + \", actually \" + houseVotesTestingSet.get(i)[HouseVotes.classColumn].value() + \")\");\n }\n }\n\n System.out.println(BreastCancer.class.getSimpleName());\n id3 = new ID3(breastCancer, breastCancerTestingSet, BreastCancer.classColumn);\n String[] id3BreastCancer = new String[breastCancerTestingSet.size()];\n for(int i = 0; i < breastCancerTestingSet.size(); i++) {\n id3BreastCancer[i] = id3.classify(breastCancerTestingSet.get(i));\n }\n for(int i = 0; i < breastCancerTestingSet.size(); i++) {\n if(id3BreastCancer[i].equals(breastCancerTestingSet.get(i)[BreastCancer.classColumn].value())) {\n System.out.println(\"ID3: Correct (\" + id3BreastCancer[i] + \")\");\n } else {\n System.out.println(\"ID3: Incorrect (\" + id3BreastCancer[i] + \", actually \" + breastCancerTestingSet.get(i)[BreastCancer.classColumn].value() + \")\");\n }\n }\n\n System.out.println(Glass.class.getSimpleName());\n id3 = new ID3(glass, glassTestingSet, Glass.classColumn);\n String[] id3Glass = new String[glassTestingSet.size()];\n for(int i = 0; i < glassTestingSet.size(); i++) {\n id3Glass[i] = id3.classify(glassTestingSet.get(i));\n }\n for(int i = 0; i < glassTestingSet.size(); i++) {\n if(id3Glass[i].equals(glassTestingSet.get(i)[Glass.classColumn].value())) {\n System.out.println(\"ID3: Correct (\" + id3Glass[i] + \")\");\n } else {\n System.out.println(\"ID3: Incorrect (\" + id3Glass[i] + \", actually \" + glassTestingSet.get(i)[Glass.classColumn].value() + \")\");\n }\n }\n\n System.out.println(Iris.class.getSimpleName());\n id3 = new ID3(iris, irisTestingSet, Iris.classColumn);\n String[] id3Iris = new String[irisTestingSet.size()];\n for(int i = 0; i < irisTestingSet.size(); i++) {\n id3Iris[i] = id3.classify(irisTestingSet.get(i));\n }\n for(int i = 0; i < irisTestingSet.size(); i++) {\n if(id3Iris[i].equals(irisTestingSet.get(i)[Iris.classColumn].value())) {\n System.out.println(\"ID3: Correct (\" + id3Iris[i] + \")\");\n } else {\n System.out.println(\"ID3: Incorrect (\" + id3Iris[i] + \", actually \" + irisTestingSet.get(i)[Iris.classColumn].value() + \")\");\n }\n }\n\n System.out.println(Soybean.class.getSimpleName());\n id3 = new ID3(soybean, soybeanTestingSet, Soybean.classColumn);\n String[] id3Soybean = new String[soybeanTestingSet.size()];\n for(int i = 0; i < soybeanTestingSet.size(); i++) {\n id3Soybean[i] = id3.classify(soybeanTestingSet.get(i));\n }\n for(int i = 0; i < soybeanTestingSet.size(); i++) {\n if(id3Soybean[i].equals(soybeanTestingSet.get(i)[Soybean.classColumn].value())) {\n System.out.println(\"ID3: Correct (\" + id3Soybean[i] + \")\");\n } else {\n System.out.println(\"ID3: Incorrect (\" + id3Soybean[i] + \", actually \" + soybeanTestingSet.get(i)[Soybean.classColumn].value() + \")\");\n }\n }\n }", "public void CreateTestResultFile()\n\t{ \n\t\tDate dNow = new Date( );\n\t\tSimpleDateFormat ft =new SimpleDateFormat (\"MMddYYYY\");\n\t\t\n\t\ttry \n\t\t{\n\t\t\tFileOutputStream fos = new FileOutputStream(System.getProperty(\"user.dir\")+\"//PG HealthCheck List_\"+ft.format(dNow)+\".xls\");\n\t HSSFWorkbook workbook = new HSSFWorkbook();\n\t HSSFSheet worksheet = workbook.createSheet(\"PG Functionality - Country\");\n\t HSSFRow row1 = worksheet.createRow(0);\n\t row1.createCell(0).setCellValue(\"Availability of Data\");\n\t HSSFRow row = worksheet.createRow(1);\n\t row.createCell(0).setCellValue(\"Testcase\");\n\t row.createCell(1).setCellValue(\"TestRunStatus\");\n\t row.createCell(2).setCellValue(\"Remarks\");\n\t workbook.write(fos);\n\t fos.close();\n\t \t \n\t } \n\t\tcatch (Exception e)\n\t {\n\t \te.printStackTrace();\n\t }\n\t\t\t\n\t\t\n\t}", "public static void main(String[] args) throws IOException {\n\t\tint numSets = 10000;//10000;//500\r\n\t\tint numElements = 1000;//1000; //50\r\n\t\t\r\n//\t\tint[] betas = {2, 4, 8, 16, 32};\r\n//\t\tString[] probfiles = {\"scpnrg1.txt\", \"scpnrg2.txt\", \"scpnrg5.txt\"};\r\n//\t\tString[] probfiles = {\"scpnrh1.txt\", \"scpnrh3.txt\", \"scpnrh5.txt\"};\r\n\t\tint[] betas = {5};\r\n\t\tString[] probfiles = {\"scpnrg1.txt\", \"scpnrg5.txt\"};\r\n\t\tint numTimesRun = 1;\r\n\t\tint runningTime = 10;\r\n\t\tPrintWriter printWriter = new PrintWriter(new File(\"tuning_testIII.csv\"));\r\n\t\tfor(String dataset: probfiles){\r\n\t\t\tStringBuilder stringBuilder = new StringBuilder();\r\n\t\t\tfor(int beta: betas){\r\n\t\t\t\tfor(int i =0 ; i<numTimesRun; i++){\r\n\t\t\t\tDataObject data = new DataObject((\"src/\" + dataset), numSets);\r\n\t\t\t\tGRASP1 grasp = new GRASP1(numElements, numSets, data.getSets());\r\n\t\t\t\tint solution = grasp.run(runningTime, beta);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tstringBuilder.append(\"Profiles: \" + \";\" + dataset + \";\");\r\n\t\t\t\tstringBuilder.append(\"The beta value: \" + \";\" + beta + \";\");\r\n\t\t\t\tstringBuilder.append(\"ItrationCount\" + \";\" + grasp.itrationCount + \";\");\r\n\t\t\t\tstringBuilder.append(\"Solution value: \" + \";\" + solution + \"\\n\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tprintWriter.write(stringBuilder.toString());\r\n\t\t}\r\n\t\tprintWriter.close();\r\n\t\tSystem.out.println(\"done!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\");\r\n\r\n\t}", "public static void main(String[] args) throws IOException {\n\n SimpleDateFormat ft = new SimpleDateFormat(\"hh:mm:ss\");\n System.out.println(\"Started at \" + ft.format(new Date()));\n\n // Folder containing android apps to analyze\n final PluginId pluginId = PluginId.getId(\"idaDoctor\");\n final IdeaPluginDescriptor pluginDescriptor = PluginManager.getPlugin(pluginId);\n File experimentDirectory = new File(root_project.getBasePath());\n fileName = new File(pluginDescriptor.getPath().getAbsolutePath()+\"/resources/results.csv\");\n String smellsNeeded = args[0];\n\n FILE_HEADER = new String[StringUtils.countMatches(smellsNeeded, \"1\") + 1];\n\n DataTransmissionWithoutCompressionRule dataTransmissionWithoutCompressionRule = new DataTransmissionWithoutCompressionRule();\n DebuggableReleaseRule debbugableReleaseRule = new DebuggableReleaseRule();\n DurableWakeLockRule durableWakeLockRule = new DurableWakeLockRule();\n InefficientDataFormatAndParserRule inefficientDataFormatAndParserRule = new InefficientDataFormatAndParserRule();\n InefficientDataStructureRule inefficientDataStructureRule = new InefficientDataStructureRule();\n InefficientSQLQueryRule inefficientSQLQueryRule = new InefficientSQLQueryRule();\n InternalGetterSetterRule internaleGetterSetterRule = new InternalGetterSetterRule();\n LeakingInnerClassRule leakingInnerClassRule = new LeakingInnerClassRule();\n LeakingThreadRule leakingThreadRule = new LeakingThreadRule();\n MemberIgnoringMethodRule memberIgnoringMethodRule = new MemberIgnoringMethodRule();\n NoLowMemoryResolverRule noLowMemoryResolverRule = new NoLowMemoryResolverRule();\n PublicDataRule publicDataRule = new PublicDataRule();\n RigidAlarmManagerRule rigidAlarmManagerRule = new RigidAlarmManagerRule();\n SlowLoopRule slowLoopRule = new SlowLoopRule();\n UnclosedCloseableRule unclosedCloseableRule = new UnclosedCloseableRule();\n\n String[] smellsType = {\"DTWC\", \"DR\", \"DW\", \"IDFP\", \"IDS\", \"ISQLQ\", \"IGS\", \"LIC\", \"LT\", \"MIM\", \"NLMR\", \"PD\", \"RAM\", \"SL\", \"UC\"};\n\n FILE_HEADER[0] = \"Class\";\n\n int headerCounter = 1;\n\n for (int i = 0; i < smellsNeeded.length(); i++) {\n if (smellsNeeded.charAt(i) == '1') {\n FILE_HEADER[headerCounter] = smellsType[i];\n headerCounter++;\n }\n }\n\n CSVFormat csvFileFormat = CSVFormat.DEFAULT.withRecordSeparator(NEW_LINE_SEPARATOR);\n FileWriter fileWriter = new FileWriter(fileName);\n try (CSVPrinter csvFilePrinter = new CSVPrinter(fileWriter, csvFileFormat)) {\n csvFilePrinter.printRecord((Object[]) FILE_HEADER);\n\n for (File project : experimentDirectory.listFiles()) {\n\n if (!project.isHidden()) {\n\n // Method to convert a directory into a set of java packages.\n ArrayList<PackageBean> packages = FolderToJavaProjectConverter.convert(project.getAbsolutePath());\n\n for (PackageBean packageBean : packages) {\n\n for (ClassBean classBean : packageBean.getClasses()) {\n\n List record = new ArrayList();\n\n System.out.println(\"-- Analyzing class: \" + classBean.getBelongingPackage() + \".\" + classBean.getName());\n\n record.add(classBean.getBelongingPackage() + \".\" + classBean.getName());\n\n if (smellsNeeded.charAt(0) == '1') {\n if (dataTransmissionWithoutCompressionRule.isDataTransmissionWithoutCompression(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(1) == '1') {\n if (debbugableReleaseRule.isDebuggableRelease(RunAndroidSmellDetection.getAndroidManifest(project))) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(2) == '1') {\n if (durableWakeLockRule.isDurableWakeLock(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(3) == '1') {\n if (inefficientDataFormatAndParserRule.isInefficientDataFormatAndParser(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(4) == '1') {\n if (inefficientDataStructureRule.isInefficientDataStructure(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(5) == '1') {\n if (inefficientSQLQueryRule.isInefficientSQLQuery(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(6) == '1') {\n if (internaleGetterSetterRule.isInternalGetterSetter(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(7) == '1') {\n if (leakingInnerClassRule.isLeakingInnerClass(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(8) == '1') {\n if (leakingThreadRule.isLeakingThread(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(9) == '1') {\n if (memberIgnoringMethodRule.isMemberIgnoringMethod(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(10) == '1') {\n if (noLowMemoryResolverRule.isNoLowMemoryResolver(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(11) == '1') {\n if (publicDataRule.isPublicData(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(12) == '1') {\n if (rigidAlarmManagerRule.isRigidAlarmManager(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(13) == '1') {\n if (slowLoopRule.isSlowLoop(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n\n if (smellsNeeded.charAt(14) == '1') {\n if (unclosedCloseableRule.isUnclosedCloseable(classBean)) {\n record.add(\"1\");\n } else {\n record.add(\"0\");\n }\n }\n csvFilePrinter.printRecord(record);\n }\n }\n }\n }\n }\n System.out.println(\"CSV file was created successfully!\");\n System.out.println(\"Finished at \" + ft.format(new Date()));\n }", "@Test\r\n\tpublic void generateFile() {\n\t\tfor (int i = 1; i <= 5; i++) {\r\n\t\t\t// String filePath = \"C://Users//AtifKhan//Desktop//sample-\" + i +\r\n\t\t\t// \".csv\";\r\n\t\t\tString filePath = \"C://Users//olcay tarazan//Desktop//sample-\" + i + \".csv\";\r\n\t\t\tint numberOfDataLines = 400;\r\n\t\t\ttry {\r\n\t\t\t\tgenerateCsvFile(filePath, numberOfDataLines);\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tSystem.out.println(\"File generated : sample-\" + i + \".csv \");\r\n\t\t}\r\n\t}", "public void test() {\n String dirname = getVariableAsString(\"_PROJECT_DIR\"); \n\n String web_site = getVariableAsString(\"web_site\"); \n \n getContext().setVariable(\"dirname\", dirname);\n getContext().setVariable(\"check_detail\", web_site);\n \n String filename = dirname + \"\\\\result\\\\hreflist.csv\"; \n if(web_site.equals(\"doda\")){\n filename = dirname + \"\\\\result\\\\doda.csv\";\n getContext().setVariable(\"result2\", filename);\n }else if(web_site.equals(\"rikunabi\")){\n filename = dirname + \"\\\\result\\\\rikunabi.csv\";\n }\n String outputname = dirname + \"\\\\result\\\\hreflist.txt\"; \n\n try {\n getContext().setVariable(\"aaa\", \"aaa\");\n BufferedReader br = new BufferedReader(new FileReader(new File(filename)));\n getContext().setVariable(\"aaa\", \"bbb\");\n // PrintWriter pw = new PrintWriter(new BufferedWriter(new FileWriter(outputname)));\n PrintWriter pw = new PrintWriter(new FileWriter(new File(outputname)));\n getContext().setVariable(\"aaa\", \"ccc\");\n \n String line = \"\";\n boolean first = true;\n // int i=0;//test\n while ((line = br.readLine()) != null) {\n // i=i+1;//test\n // if(i==5)break;//test\n String array[] = line.split(\",\"); \n if (first) {\n first = false; \n } else {\n pw.println(array[0]); \n }\n }\n br.close();\n pw.close();\n\n } catch (FileNotFoundException e) {\n getContext().setVariable(\"result\", \"99\");\n } catch (IOException e) {\n getContext().setVariable(\"result\", \"999\");\n}\n }", "public static void generateReport()\n\t{\n\t\tlong time=System.currentTimeMillis();\n\t\tString reportPath=System.getProperty(\"user.dir\")+\"//automationReport//Report\"+time+\".html\";\n\t\t\n\t\thtmlreporter=new ExtentHtmlReporter(reportPath);\n\t\textent=new ExtentReports();\n\t\textent.attachReporter(htmlreporter);\n\t\t\n\t\tString username=System.getProperty(\"user.name\");\n\t\tString osname=System.getProperty(\"os.name\");\n\t\tString browsername=CommonFunction.readPropertyFile(\"Browser\");\n\t\tString env=CommonFunction.readPropertyFile(\"Enviornment\");\n\t\t\n\t\t\n\t\textent.setSystemInfo(\"User Name\", username);\n\t\textent.setSystemInfo(\"OS Name\", osname);\n\t\textent.setSystemInfo(\"Browser Name\", browsername);\n\t\textent.setSystemInfo(\"Enviornment\", env);\n\t\t\n\t\t\n\t\thtmlreporter.config().setDocumentTitle(\"Automation Report\");\n\t\thtmlreporter.config().setTheme(Theme.STANDARD);\n\t\thtmlreporter.config().setChartVisibilityOnOpen(true);\n \n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public static void main(String args[]) {\n CsvGrader mycg = new CsvGrader();\n //\tmycg.generateGradeDistCutTime(\"answers.csv\",\"answers.properties\",\"questionLocations.txt\",\"Event1Data\",60);\n //mycg.generateTrajectoryDistances(\"Event1Data60.csv\", \"questionLocations.txt\", \"distanceArea\", 60);\n //mycg.generateTrajectoryDistancesAndTime(\"Event1Data60.csv\", \"questionLocations.txt\", \"SURFACE\", 60);\n //int dbin = 20;\n //int tbin = 1800;\n //mycg.generateSurfacePercentages(\"SURFACE.csv\",\"s\"+dbin+\"x\"+tbin+\"\",dbin,tbin);\n //mycg.generateTrajectorySpeeds(\"Event1Data60.csv\", \"trajspeeds\");\n\n //mycg.generateAverageSpeeds(\"trajectory_points.csv\",\"averageSpeeds\");\n //mycg.generateTimeOfFirstQuestion(\"Event1Data60.csv\",\"firstQuestionTimes\");\n //mycg.generateRadarData(\"Event1Data60.csv\",\"trajectory_points.csv\",\"questionLocations.txt\",\"radarData\",60,1.92,2500);\n //mycg.generateAverageDistanceTraveledPerQuestion(\"Event1Data60.csv\",\"trajectory_points.csv\",\"AverageDistanceTraveledPerQuestion3\",1377334800000l);\n //mycg.printNumberOfTeamTypes(\"Event1Data60.csv\", \"trajectory_points.csv\", 1.92, 2500);\n //mycg.printNumberOfAnswerTypes(\"Event1Data60.csv\", \"trajectory_points.csv\",\"questionLocations.txt\",60, 1.92, 2500);\n /*for(int i= 1; i < 5; i++) {\n mycg.generateTrajectoryDistancesAndTimeForAnswerType(\"Event1Data60.csv\", \"questionLocations.txt\", \"scatter\", 60, i);\n }*/\n }", "public static void main(String[] args) {\r\n\t\t\r\n\t\t\t\tdata = null;\t\t //clear the memory\r\n\t\t\t\tread(\"core_dataset.csv\");\t\t//read back the data\r\n\t\t\t\twrite(\"young_employee.csv\"); //write the data to another file\r\n\t\t\t}", "public void generateReport(List<XmlSuite> xmlSuites, List<ISuite>suites, \r\n\t\tString outputDirectory){//creating a method that takes three arguments,\r\n\t//to generate a report, arguments list requirements, \r\n\t//using a mechanism called List, which gets the array input\r\n\t//script will go back to xml suites, and look for \"suites\" which are the classes we created\r\n\t//we will create an xml file to contain all the classes within our test cases\r\n\t//PASS, FAIL, or SKIP will be string outputs; String outputDirectory\r\n\t//XML Suite: big time testing based on testing type\r\n\t//ISuite: pages we are working on; classes created to perform action; under test folder\r\n\t\r\n\textent = new ExtentReports(outputDirectory + File.separator\r\n\t\t\t+ \"Extent.html\", true);\r\n\t//creating an object for extent report, creating a virtual object to save all output to save all results\r\n\t//as a string, file seperator is not needed, it doesn't matter how u received the result\r\n\t//seperate them and consolidate the results\r\n\t//telling you how to save the file name, html is easy to open on any device and lightweight\r\n\t//outputDirectory: SKIP, PASS, FAIL\r\n\t//the reason for boolean option: if yu receive results, generate report//if yu dont then dont generate\r\n\tfor(ISuite suite : suites){//for loop is created\r\n\t\t//map obtains a key value, not duplicate, and then maps it to one location, which is the\r\n\t\t//extent report\r\n\t\t//an interface in java, between key value and location (between status and extent report)\r\n\t\t//will make sure how to map and seperate results under each class\r\n\t\tMap<String, ISuiteResult>result = suite.getResults();\r\n\t\r\n\tfor(ISuiteResult r : result.values()){\r\n\t\tITestContext context =r.getTestContext();//for each of the classes, create log status\r\n\t\t//test context: script that we are running, results from it\r\n\t\t//: is a conditional operator, which lists the conditions, which lists out the conditions\r\n\t\t//script should be able to run \r\n\t\t//one suite, or multiple suites in one shot\r\n\t\t//making context\r\n\t\t\r\n\t\t\r\n\t\tbuildTestNo(context.getPassedTests(), LogStatus.PASS);\r\n\t\tbuildTestNo(context.getFailedTests(), LogStatus.FAIL);\r\n\t\t//retrieving status using results/context\r\n\t\tbuildTestNo(context.getSkippedTests(), LogStatus.SKIP);\r\n\t\t\t\r\n\t}\r\n}\r\nextent.flush();//take results and place on html file\r\nextent.close();\r\n\r\n}", "public static void main(String[] args) {\n\t\t\r\n\t\thtmlReporter = new ExtentHtmlReporter(\"C:\\\\Users\\\\Suresh Mylam\\\\eclipse-workspace\\\\TestNG_Listners\\\\Reports\\\\TestReport.html\");\r\n\t\textent = new ExtentReports();\r\n\t\textent.attachReporter(htmlReporter);\r\n\t\ttest= extent.createTest(\"TEst123\");\r\n\t\ttest.pass(\"pass\");\r\n\t\ttest.fail(\"fail\");\r\n\t\ttest.info(\"info\");\r\n\t\textent.flush();\r\n\t\tSystem.out.println(\"Done\");\r\n\r\n\t}", "@Test\n public void testImprimirStatistics()\n {\n //this.linealRegressionCalculator.printStatistics();\n }", "public static void main(String[] args) throws Exception {\n\t\tString matlabLocation = \"/usr/local/MATLAB/R2012a/bin/matlab\";\n\t\tMatlabProxyFactoryOptions options = new MatlabProxyFactoryOptions.Builder()\n\t\t\t\t.setProxyTimeout(30000L).setMatlabLocation(matlabLocation)\n\t\t\t\t.setHidden(true).build();\n\n\t\tMatlabProxyFactory factory = new MatlabProxyFactory(options);\n\t\tMatlabProxy proxy = factory.getProxy();\n\n\t\tSAXBuilder builder = new SAXBuilder();\n\t\tString inputCorpusDir = \"../data/ACL2015/testData\";\n\t\tDocument doc = builder.build(inputCorpusDir + \"/\"\n\t\t\t\t+ \"GuidedSumm_topics.xml\");\n\t\tElement root = doc.getRootElement();\n\t\tList<Element> corpusList = root.getChildren();\n\n\t\tString outputSummaryDir = \"../data/ACL2015/Output\";\n\t\tString confFilePath = \"../data/ACL2015/ROUGE/conf.xml\";\n\t\t\n\n\t\tint iterTime = 3;\n\t\t\t\t\n\t\t///////////////////////////////////////////////\t\n\t\t\n\t\tint[] numberClusters_DCNN = {7, 8};\n\t\t\n\n\t\t//////////////////////////////////////////////////////\n\t\tPrintWriter out_DCNN_Spe_H_Har_H_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_H_Har_H_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_H_Har_H_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Har_H_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Har_H_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_H_Har_H_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_H_Har_H_110.close();\n\t\t\n\t\t/////////////////////////////////////////////\n\t\t\n\t\tPrintWriter out_DCNN_Spe_H_Har_C_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_H_Har_C_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_H_Har_C_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Har_C_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Har_C_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_H_Har_C_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_H_Har_C_110.close();\n\t\t\n\t\t////////////////////////////////////\n\t\tPrintWriter out_DCNN_Spe_C_Gre_H_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_C_Gre_H_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_C_Gre_H_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_C_Gre_H_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_C_Gre_H_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_C_Gre_H_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_C_Gre_H_110.close();\n\t\t\n\t\t//////////////////////////////\n\t\tPrintWriter out_DCNN_Spe_C_Gre_C_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_C_Gre_C_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_C_Gre_C_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_C_Gre_C_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_C_Gre_C_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_C_Gre_C_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_C_Gre_C_110.close();\n\t\t////////////////////////////////\n\t\tPrintWriter out_DCNN_Spe_H_Gre_H_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_H_Gre_H_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_H_Gre_H_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Gre_H_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Gre_H_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_H_Gre_H_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_H_Gre_H_110.close();\n\t\t\n\t\t////////////////////////\n\t\tPrintWriter out_DCNN_Spe_H_Gre_C_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_H_Gre_C_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_H_Gre_C_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Gre_C_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_Gre_C_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_H_Gre_C_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_H_Gre_C_110.close();\n\t\t\n\t\t////////////////////////////\n\t\tPrintWriter out_DCNN_Spe_H_LGC_C_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_H_LGC_C_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_H_LGC_C_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_LGC_C_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_H_LGC_C_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_H_LGC_C_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_H_LGC_C_110.close();\n\t\t\n\t\t///////////////////////\n\t\t\n\t\tPrintWriter out_DCNN_Spe_C_LGC_C_110 = FileOperation.getPrintWriter(new File(\n\t\t\t\toutputSummaryDir), \"experiment_result_DCNN_Spe_C_LGC_C_110\");\n\t\tfor (int j = 0; j < numberClusters_DCNN.length; j++) {\n\t\t\tint numberCluster = numberClusters_DCNN[j];\n\t\t\tdouble averageMetric_1 = 0.0;\n\t\t\tdouble averageMetric_2 = 0.0;\n\t\t\tdouble averageMetric_SU4 = 0.0;\n\n\t\t\tfor (int k = 0; k < iterTime; k++) {\n\t\t\t\tfor (int i = 0; i < corpusList.size(); i++) {\n\t\t\t\t\tSystem.out.println(\"Corpus id is \" + i);\n\t\t\t\t\tElement topic = corpusList.get(i);\n\t\t\t\t\tList<Element> docSets = topic.getChildren();\n\t\t\t\t\tElement docSetA = docSets.get(1);\n\t\t\t\t\tString corpusName = docSetA.getAttributeValue(\"id\");\n\t\t\t\t\tAbstractiveGenerator sg = new AbstractiveGenerator();\n\t\t\t\t\tsg.DCNN_Spe_C_LGC_C_110(inputCorpusDir + \"/\" +topic.getAttributeValue(\"id\"), outputSummaryDir, corpusName, numberCluster, proxy);\n\t\t\t\t\t \n\t\t\t\t}\n\n\t\t\t\tHashMap map_1 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-1\");\n\t\t\t\tDouble met_1 = (Double) map_1.get(\"ROUGE-1\");\n\t\t\t\tSystem.out.println(\"ROUGE-1\" + \" \" + numberCluster + \" \" + met_1);\n\t\t\t\taverageMetric_1 += met_1;\n\n\t\t\t\tHashMap map_2 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-2\");\n\t\t\t\tDouble met_2 = (Double) map_2.get(\"ROUGE-2\");\n\t\t\t\tSystem.out.println(\"ROUGE-2\" + \" \" + numberCluster + \" \" + met_2);\n\t\t\t\taverageMetric_2 += met_2;\n\n\t\t\t\tHashMap map_SU4 = RougeEvaluationWrapper.runRough(confFilePath,\n\t\t\t\t\t\t\"ROUGE-SU4\");\n\t\t\t\tDouble met_SU4 = (Double) map_SU4.get(\"ROUGE-SU4\");\n\t\t\t\tSystem.out.println(\"ROUGE-SU4\" + \" \" + numberCluster + \" \" + met_SU4);\n\t\t\t\taverageMetric_SU4 += met_SU4;\n\n\t\t\t}\n\n\t\t\tSystem.out.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_C_LGC_C_110.println(\"Average ROUGE-1\" + \" \" + numberCluster + \" : \" + averageMetric_1\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\t\t\tout_DCNN_Spe_C_LGC_C_110.println(\"Average ROUGE-2\" + \" \" + numberCluster + \" : \" + averageMetric_2\n\t\t\t\t\t/ iterTime);\n\n\t\t\tSystem.out.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \"\n\t\t\t\t\t+ averageMetric_SU4 / iterTime);\n\t\t\tout_DCNN_Spe_C_LGC_C_110.println(\"Average ROUGE-SU4\" + \" \" + numberCluster + \" : \" + averageMetric_SU4\n\t\t\t\t\t/ iterTime);\n\t\t}\n\t\tout_DCNN_Spe_C_LGC_C_110.close();\n\t\t\n\t\t\n\t\tproxy.disconnect();\n\t}", "public static void main(String args[]) throws FileNotFoundException {\n\t\tSampling sampleCondition1 = new Sampling(\"src/tests/R2.txt\", \"src/tests/S2.txt\", 1, 1, \"4\", \"4\");\n\t\tSampling sampleCondition2 = new Sampling(\"src/tests/R2.txt\", \"src/tests/S2.txt\", 1, 1, \"4\", \"4\");\n\t\t\n\t\t\n\t\tSelectivityCalculator xo1 = new SelectivityCalculator();\n\t\tSelectivityCalculator xo2 = new SelectivityCalculator();\n\t\t\n\t\txo1.Calculator(sampleCondition1.SampleS);\n\t\txo2.Calculator(sampleCondition2.SampleS);\n\t\t\n\t\tdouble res1 = xo1.selectivityCalculator(sampleCondition1.SampleR, sampleCondition1.SampleS, 1);\n\t\tdouble res2 = xo2.selectivityCalculator(sampleCondition2.SampleR, sampleCondition2.SampleS, 2);\n\t\t\n\t\tSystem.out.println(res1);\n\t\tSystem.out.println(res2);\n//\t\tSystem.out.println(sample.SampleR.size());\n//\t\tSystem.out.println(value.size());\n//\t\tSystem.out.println(value.toString());\n\t}", "public static void main(String[] args) {\n\t\tUtility utility = new Utility();\n\t\t\n\t\t// build trainingset\n\t\tSystem.out.println(\"Training System....\");\n\t\tArrayList<Student> trainingSet = utility.readStudentfile(\"porto_math_train.csv\");\n\t\tArrayList<Variable> variableSets = Student.getAllVar();\n\n\t\tTree tree = new Tree();\n\t\tNode decisionTree = tree.buildTree2(trainingSet, variableSets);\n\n\t\tutility .printNode(decisionTree);\n\n\t\t// testing DT\n\t\tSystem.out.println(\"\\tTesting System (trainingSet)....\");\n\t\tutility.testTree2(trainingSet, decisionTree);\n\t\t\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"\\tTesting System (testSet)....\");\n\t\tArrayList<Student> testSet = utility.readStudentfile(\"porto_math_test.csv\");\n\t\tutility.testTree2(testSet, decisionTree);\t\t\n\t}", "public static void main(String[] args) {\r\n\r\n try {\r\n \r\n String outFile = \"H:\\\\Nexrad_Viewer_Test\\\\Hutchins\\\\gis\\\\WFUS53-KPAH-152129.txt\";\r\n convertFile(outFile);\r\n \r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "@Test\n\tpublic void testWriteToFile() {\n\t\tArrayList<ArrayList<String>> risultatoAnalisi = \n\t\t\t\tnew ArrayList<ArrayList<String>>();\n\t\toutput.setAnalysisResult(risultatoAnalisi);\n\t\tString percorso = \"\";\n\t\toutput.setOutputFileFolder(percorso);\n\t\ttry {\n\t\t\toutput.writeToFile();\n\t\t} catch (IOException e) {\n\t\t\tfail(\"Problem when writing to specified path.\");\n\t\t}\n\t\tassertTrue(new File(percorso + \"analysis.txt\").exists());\n\t\t/*\n\t\t * Ora passo un path corretto e controllo che venga creato il fiile\n\t\t */\n\t\tpercorso = \"test-dir\";\n\t\toutput.setOutputFileFolder(percorso);\n\t\ttry {\n\t\t\toutput.writeToFile();\n\t\t} catch (IOException e) {\n\t\t\tfail(\"Problem when writing to specified path.\");\n\t\t}\n\t\tassertTrue(new File(percorso + File.separator + \"analysis.txt\").exists());\n\t\t/*\n\t\t * Ripeto il test con valori da scrivere\n\t\t */\n\t\tArrayList<String> datiCasuali = new ArrayList<String>();\n\t\tdatiCasuali.add(\"27\");\n\t\trisultatoAnalisi.add(datiCasuali);\n\t\tdatiCasuali.add(\"12\");\n\t\trisultatoAnalisi.add(datiCasuali);\n\t\tdatiCasuali.add(\"3245543\");\n\t\trisultatoAnalisi.add(datiCasuali);\n\t\toutput.setAnalysisResult(risultatoAnalisi); \n\t\tpercorso = \"\";\n\t\toutput.setOutputFileFolder(percorso);\t\t\n\t\ttry {\n\t\t\toutput.writeToFile();\n\t\t} catch (IOException e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t\tfail(\"Problem when writing to specified path.\");\n\t\t}\n\t\tassertTrue(new File(percorso + \"analysis.txt\").exists());\n\t}", "public static void main(String[] args) {\n String path = \"D:\\\\workplace\\\\IDEA\\\\ECIPCSweb\\\\excel\\\\grade\";\n getFile(path);\n }", "public static void main(String [] args) {\n\n String priorDirectory = \"pathway_lists\"; //Directory of prior knowledge files, we assume that every file in here is a prior knowledge file\n boolean priorMatrices = true; //Are priors in the form of a matrix or a sif file?\n String dataFile = \"\"; //Filename of the dataset to analyze\n String runName = \"\"; //Name of the run to produce output directory\n int ns = 20; //Number of subsamples to test\n int numLambdas = 40; //Number of lambda values to test\n double low = 0.05; //Low end of lambda range to do knee point analysis\n double high = 0.95; //High end of lambda range to do knee point analysis\n boolean loocv = false; //Do we do leave-one-out cross validation instead of ns subsamples\n boolean makeScores = false; //Should we make edge score matrices?\n boolean fullCounts = false; //Do we want to output counts for edges across subsamples / lambda parameters\n int index = 0;\n List<String> toRemove = new ArrayList<String>();\n try {\n while (index < args.length) {\n if (args[index].equals(\"-ns\")) {\n ns = Integer.parseInt(args[index + 1]);\n index += 2;\n } else if (args[index].equals(\"-nl\")) {\n numLambdas = Integer.parseInt(args[index + 1]);\n index += 2;\n } else if(args[index].equals(\"-llow\")){\n low = Double.parseDouble(args[index+1]);\n index+=2;\n }else if (args[index].equals(\"-lhigh\")){\n high = Double.parseDouble(args[index+1]);\n index+=2;\n } else if(args[index].equals(\"-run\")) {\n runName = args[index+1];\n index+=2;\n }\n else if(args[index].equals(\"-fullCounts\"))\n {\n fullCounts = true;\n index++;\n }\n else if (args[index].equals(\"-priors\")) {\n priorDirectory = args[index + 1];\n index += 2;\n } else if (args[index].equals(\"-sif\")) {\n priorMatrices = false;\n index++;\n } else if (args[index].equals(\"-data\")) {\n dataFile = args[index + 1];\n index += 2;\n }\n else if(args[index].equals(\"-rm\"))\n {\n int count = index + 1;\n while(count < args.length && !args[count].startsWith(\"-\"))\n {\n toRemove.add(args[count]);\n count++;\n }\n index = count;\n } else if (args[index].equals(\"-loocv\")) {\n loocv = true;\n index++;\n }\n else if(args[index].equals(\"-makeScores\"))\n {\n makeScores = true;\n index++;\n }\n else if(args[index].equals(\"-v\"))\n {\n verbose = true;\n index++;\n }\n else\n index++;\n }\n }\n catch(ArrayIndexOutOfBoundsException e)\n {\n System.err.println(\"Command line arguments not specified properly at argument: \" + args[index]);\n e.printStackTrace();\n System.exit(-1);\n }\n catch(NumberFormatException e)\n {\n System.err.println(\"Expected a number for element: \" + args[index]);\n e.printStackTrace();\n System.exit(-1);\n }\n catch(Exception e)\n {\n System.err.println(\"Double check command line arguments\");\n e.printStackTrace();\n System.exit(-1);\n }\n\n //Create lambda range to test based on input parameters\n double [] initLambdas = new double[numLambdas];\n for(int i = 0; i < numLambdas;i++)\n {\n initLambdas[i] = low + i*(high-low)/numLambdas;\n }\n\n //Load in the dataset\n DataSet d = null;\n try {\n d = MixedUtils.loadDataSet2(dataFile);\n }\n catch(Exception e)\n {\n System.err.println(\"Error loading in data file\");\n e.printStackTrace();\n System.exit(-1);\n }\n\n if(verbose)\n {\n System.out.println(\"Removing Variables... \" + toRemove);\n }\n //Remove variables specified by the user\n for(String s:toRemove)\n {\n d.removeColumn(d.getVariable(s));\n }\n\n //Add dummy discrete variable to the dataset if only a continuous dataset is provided\n boolean addedDummy = false;\n if(d.isContinuous())\n {\n System.out.print(\"Data is only continuous, adding a discrete variable...\");\n Random rand = new Random();\n DiscreteVariable temp= new DiscreteVariable(\"Dummy\",2);\n d.addVariable(temp);\n int column = d.getColumn(d.getVariable(temp.getName()));\n for(int i = 0; i < d.getNumRows();i++)\n {\n d.setInt(i,column,rand.nextInt(temp.getNumCategories()));\n }\n System.out.println(\"Done\");\n addedDummy = true;\n }\n if(verbose)\n {\n System.out.println(\"Full Dataset: \" + d);\n System.out.println(\"Is DataSet Mixed? \" + d.isMixed());\n }\n try{\n File x = new File(runName);\n if(x.exists())\n {\n if(x.isDirectory())\n {\n System.err.println(\"Please specify a run name that does not have an existing directory\");\n System.exit(-1);\n }\n else\n {\n System.err.println(\"Please specify a run name that isn't a file\");\n System.exit(-1);\n }\n\n }\n x.mkdir();\n\n\n //Loading in prior knowledge files\n File f = new File(priorDirectory);\n if(!f.isDirectory())\n {\n System.err.println(\"Prior sources directory does not exist\");\n System.exit(-1);\n }\n HashMap<Integer,String> fileMap = new HashMap<Integer,String>();\n int numPriors = f.listFiles().length;\n SparseDoubleMatrix2D[] priors = new SparseDoubleMatrix2D[numPriors];\n\n //Load in each prior from the directory, accounting for whether its a matrix or an sif file\n //Add accounting for whether a dummy variable was added to the data\n for(int i = 0;i < f.listFiles().length;i++)\n {\n fileMap.put(i,f.listFiles()[i].getName());\n String currFile = f.listFiles()[i].getPath();\n if(!priorMatrices)\n {\n PrintStream out = new PrintStream(\"temp.txt\");\n createPrior(f.listFiles()[i],out,d.getVariableNames());\n currFile = \"temp.txt\";\n }\n if(addedDummy)\n {\n addLines(new File(currFile));\n priors[i] = new SparseDoubleMatrix2D(realDataPriorTest.loadPrior(new File(\"temp_2.txt\"),d.getNumColumns()));\n }\n else\n {\n priors[i] = new SparseDoubleMatrix2D(realDataPriorTest.loadPrior(new File(currFile),d.getNumColumns()));\n }\n }\n //Delete maintenance files\n File t = new File(\"temp.txt\");\n t.deleteOnExit();\n t = new File(\"temp_2.txt\");\n if(t.exists())\n t.deleteOnExit();\n\n\n\n //Generate subsample indices\n int [][] samps = genSubs(d,ns,loocv);\n System.out.println(\"Done\");\n //Generate lambda parameters to test based on knee points and initial lambdas\n System.out.print(\"Generating Lambda Params...\");\n mgmPriors m = new mgmPriors(ns,initLambdas,d,priors,samps,verbose);\n System.out.println(\"Done\");\n\n\n //Set piMGM to output edge scores subsampled data after computing optimal lambda parameters)\n if(makeScores) {\n m.makeEdgeScores();\n }\n\n //Run piMGM\n System.out.print(\"Running piMGM...\");\n Graph g = m.runPriors();\n System.out.println(\"Done\");\n System.out.print(\"Printing Results...\");\n\n //Print all result files, edge scores, and full edge counts (across subsamples and params)\n printAllResults(g,m,runName,fileMap);\n if(makeScores)\n {\n double [][] scores = m.edgeScores;\n printScores(scores,d,runName);\n }\n if(fullCounts)\n {\n TetradMatrix tm = m.fullCounts;\n printCounts(tm,d,runName);\n }\n System.out.println(\"Done\");\n }\n catch(Exception e)\n {\n System.err.println(\"Unknown Error\");\n e.printStackTrace();\n System.exit(-1);\n }\n\n }", "void generateMgiCrisprAlleleReport();", "public static void main (String[] args) throws FileNotFoundException\n {\n System.out.println (\"So, you have an idea for a project.\");\n\n DecisionTree expert = new DecisionTree(\"projectplan-input.txt\");\n expert.evaluate();\n }", "public void execute(String[] args) {\n\t\t\n\t\ttry {\n\t\t\t\n\t\t\tString formula = args[0];\n\t\t\tString C12_File = args[1];\n\t\t\tString C13_File = args[2];\n\t\t\tString N15_File = args[3];\n\t\t\tString sampled_element = args[4];\n\t\t\tint charge = new Integer(args[5]);\n\t\t\tdouble ppm = new Double(args[6]);\n\t\t\tboolean single_check = false;\n\t\t\tdouble ppm_val = ppm;\n\t\t\t//for (double ppm_val = 10; ppm_val <= 100; ppm_val = ppm_val + 10) {\n\t\t\t_ppm = ppm_val;\n\t\t\t\n\t\t\t\n\t\t\tString H2_OutFile = \"C:\\\\Users\\\\tshaw\\\\Desktop\\\\METABOLOMICS\\\\MISSILE\\\\Drew_MISSILE_Exp1_DataFitting\\\\Supplementary\\\\\" + formula + \"\\\\\" + formula + \"_Sampling_H2.txt\";\n\t\t\tString C12_OutFile = \"C:\\\\Users\\\\tshaw\\\\Desktop\\\\METABOLOMICS\\\\MISSILE\\\\Drew_MISSILE_Exp1_DataFitting\\\\Supplementary\\\\\" + formula + \"\\\\\" + formula + \"_Sampling_C12.txt\";\n\t\t\tString C13_OutFile = \"C:\\\\Users\\\\tshaw\\\\Desktop\\\\METABOLOMICS\\\\MISSILE\\\\Drew_MISSILE_Exp1_DataFitting\\\\Supplementary\\\\\" + formula + \"\\\\\" + formula + \"_Sampling_C13.txt\";\n\t\t\tString N15_OutFile = \"C:\\\\Users\\\\tshaw\\\\Desktop\\\\METABOLOMICS\\\\MISSILE\\\\Drew_MISSILE_Exp1_DataFitting\\\\Supplementary\\\\\" + formula + \"\\\\\" + formula + \"_Sampling_N15.txt\";\n\t\t\t\n\t\t\tdouble big_step = 0.05;\n\t\t\t\n\t\t\tint _charge = charge;\n\t\t\t\n\t\t\t//String formula = \"C100N29O36H147\"; // this looks the best\n\n\t\t\t//String formula = \"C100N29O28H274\";\n\t\t\t//String formula = \"C100N29O26S1H274\";\n\t\t\t//String formula = \"C100N29O24S2H274\"; // pretty close too\n\t\t\t//String formula = \"C100N29O34SH147\"; //\n\t\t\t//String formula = \"O9H290C100S9N29\"; // another candidate\n\t\t\t//String formula = \"C100N29O33S5H36\"; //\n\t\t\t//String formula = \"C100N29O21S7H163\";\n\t\t\t\n\t\t\t//\n\n\t\t\t//printTime();\n\t\t\t//IsotopePattern reference_pattern = getPeakInfo(\"C:\\\\Users\\\\tshaw\\\\Desktop\\\\METABOLOMICS\\\\MISSILE\\\\DataFitting\\\\C24H49NO7P_C12.peak\");\n\t\t\t//IsotopePattern reference_pattern = getPeakInfo(\"C:\\\\Users\\\\tshaw\\\\Desktop\\\\METABOLOMICS\\\\MISSILE\\\\DataFitting\\\\unknown_C12.peak\");\n\t\t\tIsotopePattern reference_pattern = getPeakInfo(C12_File);\n\t\t\t\n\t\t\treference_pattern = IsotopePatternManipulator.normalize(reference_pattern);\n\t\t\t\n\t\t\tdouble C12 = 0.9893;\n\t\t\tdouble N14 = 0.99632;\n\t\t\tdouble H1 = 0.999885;\n\t\t\t\n\t\t\tdouble simulated_C12 = -1;\n\t\t\tdouble simulated_N15 = -1;\n\t\t\tdouble simulated_C13 = -1;\n\t\t\tdouble simulated_H2 = -1;\n\t\t\tIsotopePattern query_pattern = null;\n\t\t\t\n\t\t\tif (single_check) {\n\t\t\t\tquery_pattern = calculate_pattern(formula, C12, N14, H1, _charge);\n\t\t\t\t\n\t\t\t\tfor (int i = 0; i < query_pattern.getNumberOfIsotopes(); i++) {\n\t\t\t\t\tIsotopeContainer container = query_pattern.getIsotope(i);\n\t\t\t\t\tSystem.out.println(container.getMass() + \"\\t\" + container.getIntensity());\n\t\t\t\t}\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\t\n\t\t\tboolean check_C12 = false;\n\t\t\tboolean check_C13 = false;\n\t\t\tboolean check_H2 = false;\n\t\t\tboolean check_N15 = false;\n\t\t\tif (sampled_element.equals(\"C12\")) {\n\t\t\t\tcheck_C12 = true;\n\t\t\t}\n\t\t\tif (sampled_element.equals(\"C13\")) {\n\t\t\t\tcheck_C13 = true;\n\t\t\t}\n\t\t\tif (sampled_element.equals(\"N15\")) {\n\t\t\t\tcheck_N15 = true;\n\t\t\t}\n\t\t\tdouble step = 0.001;\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\tif (check_H2) {\n\t\t\t\t\t\n\t\t\t\tboolean doOnce = true;\n\t\t\t\tdouble smallest = 0;\n\t\t\t\tdouble largest = 1;\n\t\t\t\tdouble prevIndex = 0;\n\t\t\t\tfor (double H1_sample = 0; H1_sample <= 1; H1_sample += big_step) {\n\t\t\t\t\t\n\t\t\t\t\tquery_pattern = calculate_pattern(formula, C12, N14, H1_sample, _charge);\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Number of isotopes: \" + query_pattern.getNumberOfIsotopes());\n\t\t\t\t\tIsotopePatternSimilarity similarity = new IsotopePatternSimilarity();\n\t\t\t\t\tdouble similarity_score = similarity.compare(reference_pattern, query_pattern);\n\t\t\t\t\tif (similarity_score > 0) {\n\t\t\t\t\t\tif (doOnce) {\n\t\t\t\t\t\t\tsmallest = prevIndex;\n\t\t\t\t\t\t\tdoOnce = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlargest = H1_sample;\n\t\t\t\t\t}\n\t\t\t\t\tprevIndex = H1_sample;\n\t\t\t\t}\n\t\t\t\tlargest = largest + big_step;\n\t\t\t\tif (largest <= (1 - big_step)) {\n\t\t\t\t\tlargest += big_step;\n\t\t\t\t\tif (largest >= 1) {\n\t\t\t\t\t\tlargest = 1.0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdouble max_score = 0;\n\t\t\t\tfor (double H1_sample = 0; H1_sample < smallest; H1_sample += step) {\n\t\t\t\t\tSystem.out.println(H1_sample + \"\\t\" + 0.0);\n\t\t\t\t}\n\t\t\t\tfor (double H1_sample = smallest; H1_sample <= largest; H1_sample += step) {\n\t\t\t\t\n\t\t\t\t\tquery_pattern = calculate_pattern(formula, C12, N14, H1_sample, _charge);\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Number of isotopes: \" + query_pattern.getNumberOfIsotopes());\n\t\t\t\t\tIsotopePatternSimilarity similarity = new IsotopePatternSimilarity();\n\t\t\t\t\tdouble similarity_score = similarity.compare(reference_pattern, query_pattern);\n\t\t\t\t\tif (max_score < similarity_score) {\n\t\t\t\t\t\tmax_score = similarity_score;\n\t\t\t\t\t\tsimulated_H2 = H1_sample;\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.println(similarity_score);\n\t\t\t\t\tSystem.out.println(H1_sample + \"\\t\" + similarity_score);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tfor (double H1_sample = largest + step; H1_sample <= 1.0; H1_sample += step) {\n\t\t\t\t\tSystem.out.println(H1_sample + \"\\t\" + 0.0);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif (check_C13) {\n\t\t\t\treference_pattern = getPeakInfo(C13_File);\n\t\t\t\treference_pattern = IsotopePatternManipulator.normalize(reference_pattern);\n\t\t\t\t\n\t\t\t\tboolean doOnce = true;\n\t\t\t\tdouble smallest = 0;\n\t\t\t\tdouble largest = 1;\n\t\t\t\tdouble prevIndex = 0;\n\t\t\t\tfor (double C12_sample = 0; C12_sample <= 1; C12_sample += big_step) {\n\t\t\t\t\t\n\t\t\t\t\tquery_pattern = calculate_pattern(formula, C12_sample, N14, H1, _charge);\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Number of isotopes: \" + query_pattern.getNumberOfIsotopes());\n\t\t\t\t\tIsotopePatternSimilarity similarity = new IsotopePatternSimilarity();\n\t\t\t\t\tdouble similarity_score = similarity.compare(reference_pattern, query_pattern);\n\t\t\t\t\tif (similarity_score > 0) {\n\t\t\t\t\t\tif (doOnce) {\n\t\t\t\t\t\t\tsmallest = prevIndex;\n\t\t\t\t\t\t\tdoOnce = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlargest = C12_sample;\n\t\t\t\t\t}\n\t\t\t\t\tprevIndex = C12_sample;\n\t\t\t\t}\n\t\t\t\tlargest = largest + big_step;\n\t\t\t\tif (largest <= 1 - big_step) {\n\t\t\t\t\tlargest += big_step;\n\t\t\t\t\tif (largest >= 1) {\n\t\t\t\t\t\tlargest = 1.0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdouble max_score = 0;\n\t\t\t\tfor (double C12_sample = 0; C12_sample < smallest; C12_sample += step) {\n\t\t\t\t\tSystem.out.println(C12_sample + \"\\t\" + 0.0);\n\t\t\t\t}\n\t\t\t\tfor (double C12_sample = smallest; C12_sample <= largest; C12_sample += step) {\n\t\t\t\t\n\t\t\t\t\tquery_pattern = calculate_pattern(formula, C12_sample, N14, H1, _charge);\n\t\t\t\t\t\n\t\t\t\t\tIsotopePatternSimilarity similarity = new IsotopePatternSimilarity();\n\t\t\t\t\tdouble similarity_score = similarity.compare(reference_pattern, query_pattern);\n\t\t\t\t\tif (max_score < similarity_score) {\n\t\t\t\t\t\tmax_score = similarity_score;\n\t\t\t\t\t\tsimulated_C13 = C12_sample;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println((1 - C12_sample) + \"\\t\" + similarity_score);\n\t\t\t\t}\n\t\t\t\tfor (double C12_sample = largest + step; C12_sample <= 1.0; C12_sample += step) {\n\t\t\t\t\tSystem.out.println(C12_sample + \"\\t\" + 0.0);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\tif (check_N15) {\n\t\t\t\treference_pattern = getPeakInfo(N15_File);\n\t\t\t\treference_pattern = IsotopePatternManipulator.normalize(reference_pattern);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tboolean doOnce = true;\n\t\t\t\tdouble smallest = 0;\n\t\t\t\tdouble largest = 1;\n\t\t\t\tdouble prevIndex = 0;\n\t\t\t\tfor (double N14_sample = 0; N14_sample < smallest; N14_sample += step) {\n\t\t\t\t\tSystem.out.println(N14_sample + \"\\t\" + 0.0);\n\t\t\t\t}\n\t\t\t\tfor (double N14_sample = 0; N14_sample <= 1; N14_sample += big_step) {\n\t\t\t\t\t\n\t\t\t\t\tquery_pattern = calculate_pattern(formula, C12, N14_sample, H1, _charge);\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Number of isotopes: \" + query_pattern.getNumberOfIsotopes());\n\t\t\t\t\tIsotopePatternSimilarity similarity = new IsotopePatternSimilarity();\n\t\t\t\t\tdouble similarity_score = similarity.compare(reference_pattern, query_pattern);\n\t\t\t\t\tif (similarity_score > 0) {\n\t\t\t\t\t\tif (doOnce) {\n\t\t\t\t\t\t\tsmallest = prevIndex;\n\t\t\t\t\t\t\tdoOnce = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlargest = N14_sample;\n\t\t\t\t\t}\n\t\t\t\t\tprevIndex = N14_sample;\n\t\t\t\t}\n\t\t\t\tlargest = largest + big_step;\n\t\t\t\tif (largest <= 1 - big_step) {\n\t\t\t\t\tlargest += big_step;\n\t\t\t\t\tif (largest >= 1) {\n\t\t\t\t\t\tlargest = 1.0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tdouble max_score = 0;\n\t\t\t\tfor (double N14_sample = smallest; N14_sample <= largest; N14_sample += step) {\n\t\t\t\t//double N14_sample = 0.01;\n\t\t\t\t\tquery_pattern = calculate_pattern(formula, C12, N14_sample, H1, _charge);\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Number of isotopes: \" + query_pattern.getNumberOfIsotopes());\n\t\t\t\t\tIsotopePatternSimilarity similarity = new IsotopePatternSimilarity();\n\t\t\t\t\tdouble similarity_score = similarity.compare(reference_pattern, query_pattern);\n\t\t\t\t\tif (max_score < similarity_score) {\n\t\t\t\t\t\tmax_score = similarity_score;\n\t\t\t\t\t\tsimulated_N15 = N14_sample;\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.println(similarity_score);\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(N14_sample + \"\\t\" + similarity_score);\n\t\t\t\t}\n\t\t\t\tfor (double N14_sample = largest + step; N14_sample <= 1.0; N14_sample += step) {\n\t\t\t\t\tSystem.out.println(N14_sample + \"\\t\" + 0.0);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (check_C12) {\n\t\t\t\treference_pattern = getPeakInfo(C12_File);\n\t\t\t\treference_pattern = IsotopePatternManipulator.normalize(reference_pattern);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tboolean doOnce = true;\n\t\t\t\tdouble smallest = 0;\n\t\t\t\tdouble largest = 1;\n\t\t\t\tdouble prevIndex = 0;\n\t\t\t\tfor (double C12_sample = 0; C12_sample <= 1; C12_sample += big_step) {\n\t\t\t\t\t\n\t\t\t\t\tquery_pattern = calculate_pattern(formula, C12_sample, N14, H1, _charge);\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Number of isotopes: \" + query_pattern.getNumberOfIsotopes());\n\t\t\t\t\tIsotopePatternSimilarity similarity = new IsotopePatternSimilarity();\n\t\t\t\t\tdouble similarity_score = similarity.compare(reference_pattern, query_pattern);\n\t\t\t\t\tif (similarity_score > 0) {\n\t\t\t\t\t\tif (doOnce) {\n\t\t\t\t\t\t\tsmallest = prevIndex;\n\t\t\t\t\t\t\tdoOnce = false;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlargest = C12_sample;\n\t\t\t\t\t}\n\t\t\t\t\tprevIndex = C12_sample;\n\t\t\t\t}\n\t\t\t\tlargest = largest + big_step;\n\t\t\t\tif (largest <= 1 - big_step) {\n\t\t\t\t\tlargest += big_step;\n\t\t\t\t\tif (largest >= 1) {\n\t\t\t\t\t\tlargest = 1.0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tdouble max_score = 0;\n\t\t\t\tfor (double C12_sample = 0; C12_sample < smallest; C12_sample += step) {\n\t\t\t\t\tSystem.out.println(C12_sample + \"\\t\" + 0.0);\n\t\t\t\t}\n\t\t\t\tfor (double C12_sample = smallest; C12_sample <= largest; C12_sample += step) {\n\t\t\t\t\n\t\t\t\t\tquery_pattern = calculate_pattern(formula, C12_sample, N14, H1, _charge);\n\t\t\t\t\t\n\t\t\t\t\t//System.out.println(\"Number of isotopes: \" + query_pattern.getNumberOfIsotopes());\n\t\t\t\t\tIsotopePatternSimilarity similarity = new IsotopePatternSimilarity();\n\t\t\t\t\tdouble similarity_score = similarity.compare(reference_pattern, query_pattern);\n\t\t\t\t\tif (max_score < similarity_score) {\n\t\t\t\t\t\tmax_score = similarity_score;\n\t\t\t\t\t\tsimulated_C12 = C12_sample;\n\t\t\t\t\t}\n\t\t\t\t\t//System.out.println(similarity_score);\n\t\t\t\t\t//out.write(C12_sample + \"\\t\" + similarity_score + \"\\n\");\n\t\t\t\t\tSystem.out.println(C12_sample + \"\\t\" + similarity_score);\n\t\t\t\t}\n\t\t\t\tfor (double C12_sample = largest + step; C12_sample <= 1.0; C12_sample += step) {\n\t\t\t\t\tSystem.out.println(C12_sample + \"\\t\" + 0.0);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (sampled_element.equals(\"C12\")) {\n\t\t\t\tSystem.out.println(\"Simulated Result: \" + formula + \"\\tcharge:\" + _charge + \"\\tC12:\" + simulated_C12);\n\t\t\t} else if (sampled_element.equals(\"C13\")) {\n\t\t\t\tdouble result = (1 - simulated_C13);\n\t\t\t\tif (result < 0) {\n\t\t\t\t\tresult = 0;\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"Simulated Result: \" + formula + \"\\tcharge:\" + _charge + \"\\tC13:\" + result);\n\t\t\t} else if (sampled_element.equals(\"N15\")) {\n\t\t\t\tdouble result = (1 - simulated_N15);\n\t\t\t\tif (result < 0) {\n\t\t\t\t\tresult = 0;\n\t\t\t\t}\n\t\t\t\tSystem.out.println(\"Simulated Result: \" + formula + \"\\tcharge:\" + _charge + \"\\tN15:\" + result);\n\t\t\t}\n\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args) throws IOException {\n System.out.println(\"------------------------------------------------\");\n System.out.println(\"FilmTrust Dataset Testing.\");\n System.out.println(\"------------------------------------------------\");\n\n double duration = System.currentTimeMillis();\n filmTrust = new Network(new File(\"src//data//ratings.txt\"),\n new File(\"src//data//trust.txt\"));\n\n filmTrust.connect();\n duration = System.currentTimeMillis() - duration;\n System.out.println(\"FilmTrust connected in \" + duration / 1000 + \" seconds.\");\n System.out.println(\"------------------------------------------------\");\n System.out.println(\"Data Statistics:\");\n filmTrust.showStatistics();\n System.out.println(\"------------------------------------------------\");\n\n duration = System.currentTimeMillis();\n\n if (metaPath.equals(\"TrTeTr\")) {\n System.out.println(\"PathSim using Trustor -> Trustee -> Trustor :\");\n String predictionFileName = similaritMatrixFileName+metaPath+ \".csv\";\n FileWriter pFile = new FileWriter(new File(predictionFileName));\n \n\n Set<Integer> trustorUsers = filmTrust.getTrustorUsers(); \n \n for (int userId : trustorUsers) { \n ArrayList<TrustorUser> similarTrustors = filmTrust.PathSimTrustor(userId, metaPath); \n writeSimilarityToFile(similarTrustors, userId, pFile);\n \n }// for trustor users \n \n pFile.close();\n System.out.println(\"\"); \n System.out.println(\"End of TrTeTr path\");\n } // if TrTeTr\n \n else if (metaPath.equals(\"TrTeTrTeTr\")) {\n System.out.println(\"PathSim using Trustor -> Trustee -> Trustor -> Trustee -> Trustor :\");\n String predictionFileName = similaritMatrixFileName+metaPath + \".csv\";\n FileWriter pFile = new FileWriter(new File(predictionFileName));\n\n Set<Integer> trustorUsers = filmTrust.getTrustorUsers(); \n\n int counter = 0,processStatus=0, size = trustorUsers.size();\n for (int userId : trustorUsers) {\n \n ArrayList<TrustorUser> similarTrustors = filmTrust.PathSimTrustor(userId, metaPath);\n writeSimilarityToFile(similarTrustors, userId, pFile); \n \n }// for \n\n pFile.close();\n System.out.println(\"End of TrTeTrTeTr path\");\n } // if TrTeTrTeTr\n \n else if (metaPath.equals(\"TrTrTeTrTr\")) {\n System.out.println(\"PathSim using Trustor -> Trustor -> Trustee -> Trustor -> Trustor :\");\n String predictionFileName = similaritMatrixFileName+metaPath + \".csv\";\n FileWriter pFile = new FileWriter(new File(predictionFileName)); \n \n Set<Integer> trustorUsers = filmTrust.getTrustorUsers();\n\n\n for (int userId : trustorUsers) { \n ArrayList<TrustorUser> similarTrustors = filmTrust.PathSimTrustor(userId, metaPath);\n writeSimilarityToFile(similarTrustors, userId, pFile);\n }\n pFile.close();\n System.out.println(\"End of TrTrTeTrTr path\");\n } // if TrTrTeTrTr\n \n else if (metaPath.equals(\"TeTrTe\")) {\n System.out.println(\"PathSim using Trustee -> Trustor -> Trustee :\");\n String predictionFileName = similaritMatrixFileName+metaPath + \".csv\";\n FileWriter pFile = new FileWriter(new File(predictionFileName));\n\n Set<Integer> trusteeUsers = filmTrust.getTrusteeUsers();\n\n for (int userId : trusteeUsers) { \n ArrayList<TrusteeUser> similarTrustees = filmTrust.PathSimTrustee(userId, metaPath);\n writeSimilarityToFile(similarTrustees, userId, pFile); \n }\n pFile.close();\n System.out.println(\"End of TeTrTe path\");\n } // if TeTrTe\n \n else if (metaPath.equals(\"TeTrTeTrTe\")) {\n System.out.println(\"PathSim using Trustee -> Trustor -> Trustee -> Trustor -> Trustee:\"); \n String predictionFileName = similaritMatrixFileName+metaPath + \".csv\";\n FileWriter pFile = new FileWriter(new File(predictionFileName));\n\n Set<Integer> trusteeUsers = filmTrust.getTrusteeUsers();\n for (int userId : trusteeUsers) { \n ArrayList<TrusteeUser> similarTrustees = filmTrust.PathSimTrustee(userId, metaPath);\n writeSimilarityToFile(similarTrustees, userId, pFile);\n }\n\n pFile.close();\n System.out.println(\"End of TeTrTeTrTe path\");\n } // if TeTrTeTrTe \n \n else if (metaPath.equals(\"TeTeTrTeTe\")) {\n System.out.println(\"PathSim using Trustee -> Trustee -> Trustor -> Trustee -> Trustee:\"); \n String predictionFileName = similaritMatrixFileName+metaPath + \".csv\";\n FileWriter pFile = new FileWriter(new File(predictionFileName));\n\n Set<Integer> trusteeUsers = filmTrust.getTrusteeUsers();\n\n for (int userId : trusteeUsers) { \n ArrayList<TrusteeUser> similarTrustees = filmTrust.PathSimTrustee(userId, metaPath);\n writeSimilarityToFile(similarTrustees, userId, pFile);\n }\n\n pFile.close();\n System.out.println(\"End of TeTeTrTeTe path\");\n } // if TeTeTrTeTe\n \n else if (metaPath.equals(\"UrImUr\")) {\n System.out.println(\"PathSim using User -> Item -> User :\");\n String predictionFileName = similaritMatrixFileName+metaPath + \".csv\";\n FileWriter pFile = new FileWriter(new File(predictionFileName));\n\n Set<Integer> ratingUsers = filmTrust.getRatingUsers();\n \n for (int userId : ratingUsers) {\n filmTrust.resetDataOfUsers();\n ArrayList<RatingUser> similarRatingUsers = filmTrust.PathSimRatingUser(userId, metaPath);\n writeSimilarityToFile(similarRatingUsers, userId, pFile);\n }\n pFile.close();\n System.out.println(\"End of UrImUr path\");\n }// if UrImUr\n else if (metaPath.equals(\"TrImTr\")) {\n System.out.println(\"PathSim using Trustor -> Item -> Trustor :\"); \n String predictionFileName = similaritMatrixFileName+metaPath + \".csv\";\n FileWriter pFile = new FileWriter(new File(predictionFileName));\n \n Set<Integer> trustorUsers = filmTrust.getTrustorUsers();\n\n for (int userId : trustorUsers) { \n ArrayList<TrustorUser> similarTrustors = filmTrust.PathSimTrustor(userId, metaPath);\n writeSimilarityToFile(similarTrustors, userId, pFile);\n }\n pFile.close();\n System.out.println(\"End of TrImTr path\");\n }// if TrImTr\n \n else if (metaPath.equals(\"TeImTe\")) {\n System.out.println(\"PathSim using Trustee -> Item -> Trustee :\"); \n String predictionFileName = similaritMatrixFileName+metaPath + \".csv\";\n FileWriter pFile = new FileWriter(new File(predictionFileName));\n\n Set<Integer> trusteeUsers = filmTrust.getTrusteeUsers();\n\n for (int userId : trusteeUsers) { \n ArrayList<TrusteeUser> similarTrustees = filmTrust.PathSimTrustee(userId, metaPath);\n writeSimilarityToFile(similarTrustees, userId, pFile);\n }\n pFile.close();\n System.out.println(\"End of TeImTe path\");\n }// if TrImTr\n else if(metaPath.equals(\"Test\")){\n System.out.println(\"sperating users:\");\n HashMap<Integer, RatingUser> ratingUsersItems = filmTrust.getRatingUsersItems(); \n HashMap<Integer, RatedItem> ratedItemsUsers = filmTrust.getRatedItemsUsers();\n \n System.out.println(\"cold users...\");\n String seperatedUsers = \"filmtrust-coldusers\";\n String seperatedFileName = seperatedUsers + \".txt\";\n FileWriter pFile = new FileWriter(new File(seperatedFileName));\n \n writeColdUsersToFile(ratingUsersItems, pFile); \n pFile.close();\n \n System.out.println(\"heavy users...\");\n seperatedUsers = \"filmtrust-heavyusers\";\n seperatedFileName = seperatedUsers + \".txt\";\n pFile = new FileWriter(new File(seperatedFileName)); \n writeHeavyUsersToFile(ratingUsersItems, pFile); \n pFile.close(); \n \n System.out.println(\"opinionated users...\");\n seperatedUsers = \"filmtrust-opinionatedusers\";\n seperatedFileName = seperatedUsers + \".txt\";\n pFile = new FileWriter(new File(seperatedFileName)); \n writeOpinionatedUsersToFile(ratingUsersItems, pFile); \n pFile.close(); \n \n System.out.println(\"niche items...\"); \n seperatedUsers = \"filmtrust-nicheitems\";\n seperatedFileName = seperatedUsers + \".txt\";\n pFile = new FileWriter(new File(seperatedFileName)); \n writeNicheItemsToFile(ratedItemsUsers, pFile); \n pFile.close();\n \n System.out.println(\"controversial items...\"); \n seperatedUsers = \"filmtrust-controversialitems\";\n seperatedFileName = seperatedUsers + \".txt\";\n pFile = new FileWriter(new File(seperatedFileName)); \n writeControversialItemsToFile(ratedItemsUsers, pFile); \n pFile.close();\n \n System.out.println(\"End of seperation\");\n }//test\n\n duration = System.currentTimeMillis() - duration;\n\n System.out.println(\"------------------------------------------------\");\n System.out.println(\"calculations done in \" + duration / 1000 + \" seconds.\");\n\n }", "public void evaluate(String trainFile, double percentTrain, String testFile, String featureDefFile) {\n/* 799 */ List<RankList> train = new ArrayList<>();\n/* 800 */ List<RankList> validation = new ArrayList<>();\n/* 801 */ int[] features = prepareSplit(trainFile, featureDefFile, percentTrain, normalize, train, validation);\n/* 802 */ List<RankList> test = null;\n/* */ \n/* */ \n/* 805 */ if (!testFile.isEmpty()) {\n/* */ \n/* 807 */ test = readInput(testFile);\n/* 808 */ if (normalize) {\n/* 809 */ normalize(test, features);\n/* */ }\n/* */ } \n/* 812 */ RankerTrainer trainer = new RankerTrainer();\n/* 813 */ Ranker ranker = trainer.train(this.type, train, validation, features, this.trainScorer);\n/* */ \n/* 815 */ if (test != null) {\n/* */ \n/* 817 */ double rankScore = evaluate(ranker, test);\n/* 818 */ System.out.println(this.testScorer.name() + \" on test data: \" + SimpleMath.round(rankScore, 4));\n/* */ } \n/* 820 */ if (modelFile.compareTo(\"\") != 0) {\n/* */ \n/* 822 */ System.out.println(\"\");\n/* 823 */ ranker.save(modelFile);\n/* 824 */ System.out.println(\"Model saved to: \" + modelFile);\n/* */ } \n/* */ }", "public static void main(String[] args) {\n\t\tString filepath = \"D:/JavaWorkSpaces/fhy/WebRoot/template/防护员信息表-Template.xls\";\n\t\tfilepath = \"C:/Users/Administrator/Downloads/防护员信息表数据导入模板 (2).xls\";\n\t\tfilepath = \"H:/个人资料/研发产品/04.工务段防护员管理系统/云梦线路车间_2018-12-12_日计划.xls\";\n\t\tfilepath = \"H:/个人资料/研发产品/04.工务段防护员管理系统/襄北线路车间2019-02-13日计划.xls\";\n\t\t//filepath = \"H:/个人资料/研发产品/04.工务段防护员管理系统/襄北线路车间2019-02-18至2019-02-18日计划.xls\";\n\t\t// filepath =\n\t\t// \"D:/JavaWorkSpaces/fhy/WebRoot/template/评价指标数据表-Template.xls\";\n\t\ttry {\n\t\t\t// filepath =\n\t\t\t// \"D:/JavaWorkSpaces/fhy/WebRoot/template/防护员信息表-Template.xls\";\n\t\t\t// filepath = \"H:/个人资料/研发产品/04.工务段防护员管理系统/客户提供数据/防护员信息表数据导入模板.xls\";\n\t\t\t// importData(filepath);\n\t\t\t// impl.importPjzbData(filepath,\"2\");\n\t\t\tFhyScoreImpl.importQgcjkData(filepath, \"admin\");\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void main(String[] args) throws Exception {\n\t\t\r\n\t\tSparkConf conf = new SparkConf().setAppName(\"HERS\");\r\n\t\t conf.set(\"org.apache.spark.serializer.KryoSerializer\",\r\n\t\t \"spark_serializer\");\r\n\t\tSparkContext sc = new SparkContext(conf);\r\n\t\tSQLContext sqlContext = new org.apache.spark.sql.SQLContext(sc);\r\n\t\t\r\n\t\t\r\n\t\tString sourcePath_calCERT = Property.getProperty(\"resultPath_calCERT\");\r\n\t\tString sourcePath_cheers = Property.getProperty(\"resultPath_cheers\");\r\n\t\tString resultFilePath = Property.getProperty(\"result_Path_Purposed\");\r\n\t\tString temp_folder = Property.getProperty(\"temp_folder_Purposed\");\r\n\t\t\r\n\t\t/*\r\n\t\tString sourcePath_calCERT = \"C:\\\\CEC_Documents\\\\HERS\\\\Curated\\\\calCERT\\\\Clean\\\\curated_calCERT.csv\";\r\n\t\tString sourcePath_cheers = \"C:\\\\CEC_Documents\\\\HERS\\\\Curated\\\\cheers\\\\Clean\\\\curated_cheers.csv\";\r\n\t\tString resultFilePath = \"C:\\\\CEC_Documents\\\\HERS\\\\Purpose\\\\Purpose.csv\";\r\n\t\tString temp_folder = \"C:\\\\CEC_Documents\\\\HERS\\\\Purpose\\\\temp\";\r\n\t\t*/\r\n\t\t//String[] columnSequence = {\"Registration_Number\",\"EnforcementAgency\",\"City\",\"ZipCode\",\"InstallerCompany\",\"RaterCompany\",\"AuthorCompany\",\"A07\",\"F05\",\"F06\",\"G02\",\"G03\",\"Condenser_Desired_Temperature\",\"Evaporator_Desired_Temperature\",\"Data_Source\"};\r\n\t\t\r\n\t\tDataFrame df_calCERT = Resources.createDF(sourcePath_calCERT, \"\\t\", sqlContext);\r\n\t\tDataFrame df_cheers = Resources.createDF(sourcePath_cheers, \"\\t\", sqlContext).select(\"Registration_Number\",\"EnforcementAgency\",\"City\",\"ZipCode\",\"InstallerCompany\",\"RaterCompany\",\"AuthorCompany\",\"A07\",\"F05\",\"F06\",\"G02\",\"G03\",\"Condenser_Desired_Temperature\",\"Evaporator_Desired_Temperature\",\"Data_Source\");\r\n\t\t\r\n\t\tDataFrame purposedDF = df_calCERT.unionAll(df_cheers);\r\n\t\t//purposedDF.show();\r\n\t\tFileSystem fs = FileSystem.get(sc.hadoopConfiguration());\r\n\t\t fs.delete(new Path(temp_folder), true);\r\n\t\t purposedDF.repartition(1).write().format(\"com.databricks.spark.csv\").option(\"delimiter\", \"\\t\")\r\n\t\t\t\t\t.option(\"header\", \"true\").save(temp_folder);\r\n\t\t fs.rename(new Path(temp_folder+\"/part-00000\"),\r\n\t\t\t\t\tnew Path(resultFilePath));\r\n\t\t fs.delete(new Path(temp_folder), true);\r\n\r\n\t}", "public static void main2(String[] args) throws Exception{\n\nBHCurve BH2=new BHCurve(\"ttt\");\n\t\t\n\t\tCurve cv2=new Curve(BH2,600,600);\n\t\tcv2.show(true);\n\t\tVect v=new Vect(1030);\n\t\t\n\t\tfor(int i=0;i<v.length;i++)\n\t\t\tutil.pr(BH2.getH(i*1.8/1030));\n\t\n\t\t/*String bh = System.getProperty(\"user.dir\") + \"\\\\bh.xls\";\n\t\tBH2.writexls(bh);\n\t*/\n\t}", "public static void main(String[] args) {\n\t\tdouble testCasePenalty = 0.2;\n\n\t\t// Number of test cases failed.\n\t\tint numTestCasesFailed = 0;\n\n\t\t// Final fractional score\n\t\tdouble finalFractionalScore = 0.0;\n\n\t\tMap<String, String> env = System.getenv();\n\n\t\t// Printing to Standard Error (which will show up in logs)\n\t\t// for debugging.\n\t\tSystem.err.println(\"This is an example standard error\");\n\n\t\t// Print Evnivornment variables\n\t\tSystem.out.println(\"Environment variables:\");\n \tfor (String envName : env.keySet()) {\n \t\tSystem.out.format(\"%s=%s%n\",\n envName,\n env.get(envName));\n \t}\n\n\t\tString feedback;\n\t\tSystem.out.println(\"cwd: \" + System.getProperty(\"user.dir\"));\n\t\ttry {\n\t\t\tBufferedReader assignmentSolution = new BufferedReader(new FileReader(args[0]));\n\t\t\tBufferedReader learnerSolution = new BufferedReader(new FileReader(args[1]));\n\n\t\t\tString input;\n\t\t\tString output;\n\n\t\t\tfor (input = assignmentSolution.readLine(), output = learnerSolution.readLine();\n\t\t\t\tinput != null && output != null;\n\t\t\t\tinput = assignmentSolution.readLine(), output = learnerSolution.readLine()) {\n\t\t\t\tif (!input.equals(output)) {\n\t\t\t\t\tnumTestCasesFailed++;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (input != null || output != null) {\n\t\t\t\tfinalFractionalScore = 0.0;\n\t\t\t\tfeedback = \"Invalid output. The number of lines produced by your code are not valid.\";\n\t\t\t} else if (numTestCasesFailed > 0) {\n\t\t\t\t// We're penalizing testCasePenalty for each test case failed.\n\t\t\t\tdouble totalPenalty = Math.min(1.0, (testCasePenalty * numTestCasesFailed));\n\n\t\t\t\tfinalFractionalScore = 1.0 - totalPenalty;\n\t\t\t\tfeedback = \"Your solution failed \" + numTestCasesFailed + \" test cases. Please try again!\";\n\t\t\t} else {\n\t\t\t\tfinalFractionalScore = 1.0;\n\t\t\t\tfeedback = \"Congrats! All test cases passed!\";\n\t\t\t}\n\n\t\t\tassignmentSolution.close();\n\t\t\tlearnerSolution.close();\n\n\t\t} catch(IOException io) {\n\t\t\tSystem.err.println(\"Got an exception!\");\n\t\t\tSystem.err.println(io.getMessage());\n\t\t\tio.printStackTrace(System.err);\n\t\t\tfeedback = io.getMessage();\n\t\t}\n\n\t\ttry {\n\t\t\t// feedback.json file is required and needs to be updated as a last step of the grading.\n\t\t\t// This file needs to be in /shared/ folder. Coursera's autograder infrastructure \n\t\t\t// uses this as evaluation, and shown to the learners appropriately.\n\t\t\tString feedbackfile = \"/shared/feedback.json\";\n\t\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(feedbackfile));\n\t\t\tString feedbackUpdated = feedback + \" (GrID V2 feedback)\";\n\t\t\t// Construct jsonFeedback in the format expected by Coursera's infrastructure.\n\t\t\t// fractionalScore must be between 0.0 to 1.0.\n\n\t\t\t// Providing rich feedback in a separate file is possible and is completely optional.\n\t\t\t// Currently supported rich feedback types are : HTML and TXT.\n\t\t\t// If the grader is producing rich feedback, it's type need to be specified feedback.json\n\t\t\t// richFeedbackType field is optional, if it provided, then the grader is expected\n\t\t\t// to provide corresponding rich feedback file in the /shared/ folder.\n\t\t\t// The following example demonstrates using HTMl rich feedback.\n\t\t\tString jsonFeedback = \"{\" +\n\t\t\t\t\"\\\"fractionalScore\\\":\" + finalFractionalScore + \",\" + // Required field.\n\t\t\t\t\"\\\"feedback\\\":\" + \"\\\"\" + feedbackUpdated + \"\\\"\" + \",\" + // Required field.\n\t\t\t\t\"\\\"feedbackType\\\":\" + \"\\\"HTML\\\"\" + \t// Optional field.\n\t\t\t \"}\";\n\t\t\tSystem.out.println(\"Feedback: \");\n\t\t\tSystem.out.println(jsonFeedback);\n\t\t\twriter.write(jsonFeedback);\n\t\t\twriter.close();\t\n\n\t\t\t// Like feedback.json, htmlFeedback.html should exist /shared/ folder if the json feedback\n\t\t\t// above has the field richFeedbackType is set to \"HTML\" (similarly txtFeedback.txt for \"TXT\" type).\n\t\t\t// Most importantly if there is richFeedback learner will not see \"feedback\" provided in the json, however\n\t\t\t// this field is required for backward compatibility, but the value can be empty. \n\t\t\tString richFeedbackFilePath = \"/shared/htmlFeedback.html\";\n\t\t\t// This example obviously is producing static feedback to demonstrate the idea, but this\n\t\t\t// would be dynamic and different based on the student submission correctness.\n\t\t\tBufferedWriter richWriter = new BufferedWriter(new FileWriter(richFeedbackFilePath));\n\t\t\tString richFeedback = \"<html><head><title> Rich Feedback</title></head><body><h1>Rich Feedback</h1><ul><li><font color=green>Green feedback</font></li><li><font color=red>Red feedback</font></li></ul></body></html>\";\n\t\t\trichWriter.write(richFeedback);\n\t\t\trichWriter.close();\n } catch(IOException io) {\n System.err.println(\"Got an exception writing feedback to file!\");\n System.err.println(io.getMessage());\n io.printStackTrace(System.err);\n feedback = io.getMessage();\n }\n\t}", "public void executeSteps() {\n\t\tLogger.getLogger(\"org\").setLevel(Level.OFF);\r\n\t\tLogger.getLogger(\"akka\").setLevel(Level.OFF);\r\n\t\tSystem.setProperty(\"hadoop.home.dir\", \"C:\\\\spark\\\\bin\");\r\n\t\tSparkSession sparkSession = SparkSession\r\n\t\t\t\t.builder().master(\"local[2]\")\r\n\t\t\t\t.getOrCreate();\r\n\t\t\r\n\t\tString path = \"data/gender-classifier.csv\";\r\n\t\t\r\n\t\t// Read the file as a training dataset\r\n\t\tDataset<Row> csv = sparkSession.read().\r\n\t\t\t\tformat(\"csv\").\r\n\t\t\t\toption(\"header\",\"true\").\r\n\t\t\t\toption(\"ignoreLeadingWhiteSpace\",false). // you need this\r\n\t\t\t\toption(\"ignoreTrailingWhiteSpace\",false).load(path);\r\n\t\t\r\n\r\n\t\tSystem.out.println(\"Dataset<Row> csv: \"+csv.columns().length+\" : \"+csv.count());\r\n\t\tcsv.show(10);\r\n\t\t\r\n\t\t// drop the columns which are mostly empty\r\n\t\tString[] dropCol = {\"id\",\"member_id\",\"url\",\"desc\",\"zip_code\",\"addr_state\",\"earliest_cr_line\",\"issue_d\",\"last_pymnt_d\",\r\n\t\t\t\t\"next_pymnt_d\",\"last_credit_pull_d\",\"application_type\",\r\n\t\t\t\t\"annual_inc_joint\",\"dti_joint\",\"verification_status_joint\",\"open_acc_6m\",\r\n\t\t\t\t\"open_act_il\",\"open_il_12m\",\"open_il_24m\",\"mths_since_rcnt_il\",\"total_bal_il\",\"il_util\",\"open_rv_12m\",\r\n\t\t\t\t\"open_rv_24m\",\"max_bal_bc\",\"all_util\",\"inq_fi\",\"total_cu_tl\",\"inq_last_12m\",\r\n\t\t\t\t\"revol_bal_joint\",\"sec_app_earliest_cr_line\",\"sec_app_inq_last_6mths\",\"sec_app_mort_acc\",\r\n\t\t\t\t\"sec_app_open_acc\",\"sec_app_revol_util\",\"sec_app_open_act_il\",\"sec_app_num_rev_accts\",\r\n\t\t\t\t\"sec_app_chargeoff_within_12_mths\",\"sec_app_collections_12_mths_ex_med\",\r\n\t\t\t\t\"sec_app_mths_since_last_major_derog\",\"hardship_flag\",\"hardship_type\",\"hardship_reason\",\"hardship_status\",\r\n\t\t\t\t\"deferral_term\",\"hardship_amount\",\"hardship_start_date\",\r\n\t\t\t\t\"hardship_end_date\",\"payment_plan_start_date\",\"hardship_length\",\"hardship_dpd\",\"hardship_loan_status\",\r\n\t\t\t\t\"orig_projected_additional_accrued_interest\",\"hardship_payoff_balance_amount\",\"hardship_last_payment_amount\",\r\n\t\t\t\t\"disbursement_method\",\"debt_settlement_flag\",\"debt_settlement_flag_date\",\r\n\t\t\t\t\"settlement_status\",\"settlement_date\",\"settlement_amount\",\"settlement_percentage\",\"settlement_term\",\"pymnt_plan\",\r\n\t\t\t\t\"mths_since_last_record\",\"mths_since_last_major_derog\",\"mths_since_recent_bc_dlq\",\r\n\t\t\t\t\"mths_since_recent_inq\",\"mths_since_recent_revol_delinq\",\"mths_since_last_delinq\"};\r\n\t\tfor(String column: dropCol) {\r\n\t\t\tcsv = csv.drop(column);\r\n\t\t}\r\n\t\tSystem.out.println(\"Droping columns csv: \"+csv.columns().length+\" : \"+csv.count());\r\n\t\tcsv.show(10);\r\n\r\n\t\t// drop the rows containing any null or NaN values\r\n\t\tcsv = csv.na().drop();\r\n\t\tSystem.out.println(\"Droping Rows containing null csv: \"+csv.columns().length+\" : \"+csv.count());\r\n\t\tcsv.show(10);\r\n\t\t\r\n\t\t//TO SELECT ONLY A SAMPLE OF DATA TO WORK WITH\r\n\t\tcsv = csv.sample(true, 0.03).limit(10000);\r\n\t\tSystem.out.println(csv.count());\r\n\t\t\r\n\t\t// transform the String data into categorical variables\r\n\t\tStringIndexer indexer1 = new StringIndexer()\r\n\t\t\t\t.setInputCol(\"grade\")\r\n\t\t\t\t.setOutputCol(\"grade1\");\r\n\t\tStringIndexer indexer2 = new StringIndexer()\r\n\t\t\t\t.setInputCol(\"sub_grade\")\r\n\t\t\t\t.setOutputCol(\"sub_grade1\");\r\n\t\tStringIndexer indexer3 = new StringIndexer()\r\n\t\t\t\t.setInputCol(\"emp_title\")\r\n\t\t\t\t.setOutputCol(\"emp_title1\");\r\n\t\tStringIndexer indexer4 = new StringIndexer()\r\n\t\t\t\t.setInputCol(\"emp_length\")\r\n\t\t\t\t.setOutputCol(\"emp_length1\");\r\n\t\tStringIndexer indexer5 = new StringIndexer()\r\n\t\t\t\t.setInputCol(\"home_ownership\")\r\n\t\t\t\t.setOutputCol(\"home_ownership1\");\r\n\t\tStringIndexer indexer6 = new StringIndexer()\r\n\t\t\t\t.setInputCol(\"verification_status\")\r\n\t\t\t\t.setOutputCol(\"verification_status1\");\r\n\t\tStringIndexer indexer7 = new StringIndexer()\r\n\t\t\t\t.setInputCol(\"loan_status\")\r\n\t\t\t\t.setOutputCol(\"loan_status1\");\r\n\t\tStringIndexer indexer8 = new StringIndexer()\r\n\t\t\t\t.setInputCol(\"purpose\")\r\n\t\t\t\t.setOutputCol(\"purpose1\");\r\n\t\tStringIndexer indexer9 = new StringIndexer()\r\n\t\t\t\t.setInputCol(\"title\")\r\n\t\t\t\t.setOutputCol(\"title1\");\r\n\t\tStringIndexer indexer10 = new StringIndexer()\r\n\t\t\t\t.setInputCol(\"initial_list_status\")\r\n\t\t\t\t.setOutputCol(\"initial_list_status1\");\r\n\t\tStringIndexer indexer11 = new StringIndexer()\r\n\t\t\t\t.setInputCol(\"term\")\r\n\t\t\t\t.setOutputCol(\"term1\");\r\n\t\tList<StringIndexer> stringIndexer = Arrays.asList(indexer1, indexer2, indexer3, \r\n\t\t\t\tindexer4, indexer5, indexer6, indexer7, indexer8, indexer9, indexer10, indexer11);\r\n\t\tfor(StringIndexer indexer:stringIndexer) {\r\n\t\t\tcsv = indexer.fit(csv).transform(csv);\r\n\t\t}\r\n\t\tSystem.out.println(\"Before Transforming csv: \"+csv.columns().length+\" : \"+csv.count());\r\n\t\tcsv.show(10);\r\n\t\t\r\n\t\tString[] dropCol1 = {\"grade\",\"initial_list_status\",\"title\",\"purpose\",\"loan_status\",\"verification_status\",\r\n\t\t\t\t\"home_ownership\",\"emp_length\",\"emp_title\",\"sub_grade\",\"term\"};\r\n\t\tfor(String col: dropCol1) {\r\n\t\t\tcsv = csv.drop(col);\r\n\t\t}\r\n\t\tSystem.out.println(\"After Transforming csv: \"+csv.columns().length+\" : \"+csv.count());\r\n\t\tcsv.show(10);\r\n\r\n\t\t\r\n\t\t//Label - int_rate_final - process to convert it to a double variable\r\n\t\tsparkSession.udf().register(\"toPerSplit\", percentageSplitTest, DataTypes.StringType);\r\n\t\tcsv = csv.withColumn(\"int_rate_split\", callUDF(\"toPerSplit\", csv.col(\"int_rate\"))).drop(\"int_rate\");\r\n\t\tcsv = csv.withColumn(\"revol_util_split\", callUDF(\"toPerSplit\", csv.col(\"revol_util\"))).drop(\"revol_util\");\r\n\t\tSystem.out.println(\"After splitting csv: \"+csv.columns().length+\" : \"+csv.count());\r\n\t\tcsv.show(10);\r\n\r\n\t\t// Converting String to double values\r\n\t\tString[] columns = csv.columns();\r\n\t\tfor(String column:columns) {\r\n\t\t\tcsv = csv.withColumn(column+\"_final\", csv.col(column).cast(DataTypes.DoubleType)).drop(column);\r\n\t\t}\r\n\t\tSystem.out.println(\"After Converting to double csv: \"+csv.columns().length+\" : \"+csv.count());\r\n\t\tcsv.show(10);\r\n\t\t\r\n\t\t// Modeling \r\n\t\t// Create the feature vector using VectorAssembler\r\n\t\tDataset<Row> featureCsv = csv.drop(\"int_rate_split_final\");\r\n\t\tSystem.out.println(\"featureCsv: \");\r\n\t\tfeatureCsv.show(10);\r\n\r\n\t\tString[] inputCols = featureCsv.columns();\r\n\t\tVectorAssembler assembler = new\r\n\t\t\t\tVectorAssembler().setInputCols(inputCols).setOutputCol(\"features\");\r\n\r\n\t\tDataset<Row> featureVector = assembler.transform(csv);\r\n\t\tSystem.out.println(\"featureVector: \");\r\n\t\tfeatureVector.show(10);\r\n\r\n\t\t// Create the final dataset with \"features\" and \"label\"\r\n\t\tDataset<Row> target = featureVector.select(featureVector.col(\"features\"), \r\n\t\t\t\tfeatureVector.col(\"int_rate_split_final\")).withColumnRenamed(\"int_rate_split_final\", \"label\");\r\n\t\tSystem.out.println(\"target: \");\r\n\t\ttarget.show(10);\r\n\r\n\t\t// Summary Statistics and Correlation Analysis \r\n\t\t// Correlation Analysis\r\n\t\tRow r1 = Correlation.corr(target, \"features\").head();\r\n\t\tSystem.out.println(\"Pearson correlation matrix:\\n\" + r1.get(0).toString());\r\n\t\t\r\n\t\t// Split data into Training and testing\r\n\t\tDataset<Row>[] dataSplit = target.randomSplit(new double[] { 0.7, 0.3 });\r\n\t\tDataset<Row> trainingData = dataSplit[0];\r\n\t\tDataset<Row> testData = dataSplit[1];\r\n\r\n\t\tSystem.out.println(\"trainingData: \");\r\n\t\ttrainingData.show(10);\r\n\t\tSystem.out.println(\"testData: \");\r\n\t\ttestData.show(10);\r\n\r\n\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t// Run the Grid Search to find the best parameters\r\n\t\tdouble[] regParam = new double[] {0.01,0.02,0.03,0.04,0.05,0.06,0.07,0.08,0.09,0.1,0.11,0.12,0.13,0.14,0.15};\r\n\t\tdouble[] elasticParam = new double[] {0.3,0.4,0.5,0.6,0.7,0.8};\r\n\r\n// Commented out this part as it takes lot of computation power and time. Might be difficult to run.\r\n\t\t// for(double reg:regParam) {\r\n\t\t// \tfor(double elastic:elasticParam) {\r\n\t\t// \t\t//Define the model\r\n\t\t// \t\tLinearRegression lr = new LinearRegression()\r\n\t\t// \t\t\t\t.setMaxIter(10)\r\n\t\t// \t\t\t\t.setRegParam(reg)\r\n\t\t// \t\t\t\t.setElasticNetParam(elastic);\r\n\t\t// \t\t// Fit the model\r\n\t\t// \t\tLinearRegressionModel lrModel = lr.fit(trainingData);\r\n\t\t// \t\t// See the summary\r\n\t\t// \t\tLinearRegressionTrainingSummary trainingSummary = lrModel.summary();\r\n\t\t// \t\t//Print the model characteristics\r\n\t\t// \t\tSystem.out.println(\"Linear Model => regParam: \"+reg+\" elasticParam: \"+elastic);\r\n\t\t// \t\tSystem.out.println(\"RMSE: \" + trainingSummary.rootMeanSquaredError());\r\n\t\t// \t\tSystem.out.println(\"r2: \" + trainingSummary.r2());\t\t\t\r\n\t\t// \t}\r\n\t\t// }\r\n\r\n\t\tSystem.out.println(\"==============================================>\");\r\n\t\t\r\n\t\t// Testing models using Best Parameters as per R2 and RMSE\r\n\t\tLinearRegression lr = new LinearRegression()\r\n\t\t\t\t.setMaxIter(10)\r\n\t\t\t\t.setRegParam(0.02)\r\n\t\t\t\t.setElasticNetParam(0.5);\r\n\r\n\t\tLinearRegressionModel lrModel = lr.fit(trainingData);\r\n\r\n\t\tDataset<Row> results = lrModel.transform(testData);\r\n\r\n\t\t// Print the coefficients and intercept for logistic regression\r\n\t\tSystem.out.println(\"Coefficients: \"\r\n\t\t\t\t+ lrModel.coefficients() + \" Intercept: \" + lrModel.intercept());\r\n\r\n\t\tRegressionEvaluator evaluator = new RegressionEvaluator()\r\n\t\t\t\t.setMetricName(\"rmse\")\r\n\t\t\t\t.setLabelCol(\"label\")\r\n\t\t\t\t.setPredictionCol(\"prediction\");\r\n\t\tDouble rmse = evaluator.evaluate(results);\r\n\t\tSystem.out.println(\"Root-mean-square error for the Best Fit Model using RegParam(0.02) and ElasticNetParam(0.5) => \" + rmse);\r\n\r\n\t\tSystem.out.println(\"==============================================>\");\r\n\r\n\t\t// Testing the normal Regression with out any regularisation parameters\r\n\t\tLinearRegression lr2 = new LinearRegression()\r\n\t\t\t\t.setMaxIter(10);\r\n\r\n\t\tLinearRegressionModel lrModel2 = lr2.fit(trainingData);\r\n\r\n\t\tLinearRegressionTrainingSummary trainingSummary2 = lrModel2.summary();\r\n\r\n\t\tSystem.out.println(\"Linear Model => default params ===> \");\r\n\r\n\t\t// Print the coefficients and intercept for linear regression\r\n\t\tSystem.out.println(\"Coefficients: \"\r\n\t\t\t\t+ lrModel2.coefficients() + \" Intercept: \" + lrModel2.intercept());\r\n\r\n\t\tSystem.out.println(\"RMSE: \" + trainingSummary2.rootMeanSquaredError());\r\n\t\tSystem.out.println(\"r2: \" + trainingSummary2.r2());\r\n\r\n\t\tDataset<Row> results2 = lrModel2.transform(testData);\r\n\r\n\t\tRegressionEvaluator evaluator2 = new RegressionEvaluator()\r\n\t\t\t\t.setMetricName(\"rmse\")\r\n\t\t\t\t.setLabelCol(\"label\")\r\n\t\t\t\t.setPredictionCol(\"prediction\");\r\n\t\tDouble rmse2 = evaluator2.evaluate(results2);\r\n\t\tSystem.out.println(\"Root-mean-square error for the Model with default values\" + rmse2);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n SimpleDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd HH-mm-ss\");\n System.setProperty(\"current.date\", dateFormat.format(new Date()));\n // set path\n if (args.length > 1) path = args[1];\n // лучше называть каталог с результатами осмысленно :)\n File cfgFile = new File(args[0]);\n PropertyConfigurator.configure(cfgFile.getAbsolutePath());\n \n File[] files = getFilesInDir(path);\n for (File file : files) {\n // среднее считать - за сколько поколений в среднем достигается максимальнй фитнес - проще в расчетах писать и пихать в файл\n try {\n read(file.getAbsolutePath());\n System.out.println(\"Stats: \" + stats.size());\n }catch (IOException ex) { log.info(ex); }\n }\n \n System.out.println(\"bestFitness: \" + bestFitness);\n System.out.println(\"bestFile : \" + bestFile);\n System.out.println(\"bestUrgent : \" + bestUrgent);\n \n for (Integer id : stats.keySet()) {\n Stat stat = stats.get(id);\n //System.out.println(stat);\n //System.out.println(id + \". SumFit: \" + stat.sumFit() + \". SumUrg: \" + stat.sumUrgent());\n //System.out.println(id + \". AvgFit: \" + stat.avgFit() + \". avgUrg: \" + stat.avgUrgent());\n log.info(stat.avgFit() + \" \" + stat.avgUrgent() + \" \" + stat.id());\n }\n }", "public void run(int runIndex, String fullPath) throws ClassNotFoundException, IOException, JMException {\n long seed = (long) 100;//can be randomly seeded.\n RandomGenerator RG = new RandomGenerator(seed);\n\n MetricsUtilPlus utils_ = new MetricsUtilPlus();\n Properties config = new Properties();\n\n String configFile = \"HF_Config_Benchmark/RealProblemSetting.txt\";\n String algorithms[] = {\"NSGAII\", \"SPEA2\", \"IBEA\", \"mIBEA\", \"GDE3\"};\n\n try {\n config.load(new FileInputStream(configFile));\n } catch (IOException e) {\n e.printStackTrace();\n System.err.println(\"Failed to load configuration file!\");\n System.exit(-1);\n }\n\n int totalEval = Integer.parseInt(config.getProperty(\"MaxEvaluations\"));\n int decisionPoints = Integer.parseInt(config.getProperty(\"DecisionPoints\"));//50 iterations\n\n int arcSize = Integer.parseInt(config.getProperty(\"ArchiveSize\"));\n populationSize = Integer.parseInt(config.getProperty(\"PopulationSize\"));\n \n arcSize=100;\n populationSize=100;\n totalEval=250*100;\n totalEval=1000*100;\n \n //arcSize=30;\n //populationSize=30;\n //totalEval=30*50;\n\n //int populationSize = popSize;\n int fixedSolutionEvl = (int) (totalEval / decisionPoints);\n \n System.out.println(\"CF; decision=\"+decisionPoints+\";fixed=\"+fixedSolutionEvl+\";total=\"+totalEval);\n\n MetricsUtil util = new MetricsUtil();\n\n int maxEvals = Integer.parseInt(config.getProperty(\"MaxEvaluations\"));\n\n String SolutionType = config.getProperty(\"SolutionType\");\n int popSize = Integer.parseInt(config.getProperty(\"PopulationSize\"));\n \n popSize=100;\n //popSize=30;\n\n Problem[] problemInstances = new Problem[problemCreator.getQtdProblem()];\n int[] numberOfVar = new int[problemCreator.getQtdProblem()];\n double[] mutationProb = new double[problemCreator.getQtdProblem()];\n Operator[] mutations = new Operator[problemCreator.getQtdProblem()];\n\n //reference point for hypervolume calculation\n /*HyperVolumeMinimizationProblem hyp = new HyperVolumeMinimizationProblem();*/\n /*double[] truePFhypervolume = new double[problemCreator.getQtdProblem()];*/\n for (int problemIndex = 0; problemIndex < problemCreator.getQtdProblem(); problemIndex++) {\n\n problemInstances[problemIndex] = problemCreator.getProblemInstance(problemIndex);\n numberOfVar[problemIndex] = problemInstances[problemIndex].getNumberOfVariables();\n mutationProb[problemIndex] = (Double) 1.0 / numberOfVar[problemIndex];\n HashMap parameters = new HashMap();\n parameters.put(\"probability\", mutationProb[problemIndex]);\n double mutationDistributionIndex = Double.parseDouble(config.getProperty(\"MutationDistributionIndex\"));\n parameters.put(\"distributionIndex\", mutationDistributionIndex);\n String mutationType = config.getProperty(\"MutationType\");\n mutations[problemIndex] = new PolynomialMutation(mutationProb[problemIndex], mutationDistributionIndex);\n }\n\n LLHInterface[] algorithm = new LLHInterface[problemCreator.getQtdProblem()];\n\n System.out.println(\"Run \" + runIndex + \"....\");\n\n choiceFunction CF = new choiceFunction();\n\n for (int instanceIndex = 6; instanceIndex < problemInstances.length; instanceIndex++) {\n numberOfObj=problemInstances[instanceIndex].getNumberOfObjectives();\n reference = new double[numberOfObj];\n Arrays.fill(reference,1.0);\n minimumValues = new double[numberOfObj];\n maximumValues = new double[numberOfObj];\n\n for (int i = 0; i < numberOfObj; i++) {\n reference[i] = 1.0;\n }\n\n int remainEval = totalEval;\n List<S> inputPop = null;\n ArrayList<Integer> heuristicList = new ArrayList<Integer>();\n\n int chosenHeuristic = -1;\n\n QualityIndicators quality = new QualityIndicators();\n double[][] algorithmEffortArray = new double[algorithms.length][2];\n double[][] ROIArray = new double[algorithms.length][2];\n double[][] hyperVolumeArray = new double[algorithms.length][2];\n double[][] uniformDistributionArray = new double[algorithms.length][2];\n\n // for the purpose of computing hypervolume.\n initialiseExtremeValues();\n\n long[] elapsedTime = new long[algorithms.length];\n long[] lastInvokeTime = new long[algorithms.length];\n long[] executionTimeArray = new long[algorithms.length];\n for (int i = 0; i < algorithms.length; i++) {\n elapsedTime[i] = 0;\n }\n\n //initialise population for each instance which is used for each algorithm\n List<S> initialPopulation = ProblemCreator.generateInitialPopulation(problemInstances[instanceIndex], popSize);\n \n List[] resultSolutions = new List[algorithms.length];\n List[] inputSolutions = new List[algorithms.length];\n\n for (int i = 0; i < algorithms.length; i++) {\n inputSolutions[i] = new ArrayList(popSize);\n // at the beginning, all inputsolutions are set as the initialPopulation\n inputSolutions[i] = initialPopulation;\n resultSolutions[i] = new ArrayList(popSize);\n }\n LLHInterface eachAlgorithm = null;\n AlgorithmCreator ac = new AlgorithmCreator(problemInstances[instanceIndex]);\n System.out.println(problemInstances[instanceIndex].getName() + \" \" + problemInstances[instanceIndex].getNumberOfObjectives() + \" \" + problemInstances[instanceIndex].getNumberOfVariables());\n ac.setMaxEvaluationsAndPopulation(totalEval, populationSize);\n //Initialise the choice function matrix and get the initial algorithm\n for (int algorithmIndex = 0; algorithmIndex < algorithms.length; algorithmIndex++) {\n //initialise last invoke time (the start time of calling this algorithm) of each algorithm;\n heuristicList.add(algorithmIndex);\n lastInvokeTime[algorithmIndex] = System.currentTimeMillis();\n\n eachAlgorithm=ac.create(algorithmIndex, remainEval);\n\n long startTime = System.currentTimeMillis();\n\n try {\n resultSolutions[algorithmIndex] = eachAlgorithm.execute(/*initialPopulation*/inputSolutions[algorithmIndex], fixedSolutionEvl);\n } catch (Exception e) {\n e.printStackTrace();\n }\n //record the execution time of each algorithm\n long executionTime = System.currentTimeMillis() - startTime;\n executionTimeArray[algorithmIndex] = executionTime;\n\n remainEval -= fixedSolutionEvl;\n\n //iteration += 2;\n inputSolutions[algorithmIndex] = resultSolutions[algorithmIndex];\n //After executed the algorithm, compute the elapsed time. The end time of called this algorithm\n\n }// end algorithmIndex, executing each algorithm for initialisation the choice function matrix\n\n //update elapsed time of since the heuristic was last called.\n for (int i = 0; i < algorithms.length; i++) {\n elapsedTime[i] = System.currentTimeMillis() - lastInvokeTime[i];\n }\n\n // find worst points and best points for all the three populations\n for (int i = 0; i < algorithms.length; i++) {\n updateExtremeValues(resultSolutions[i]);\n }\n\n for (int i = 0; i < algorithms.length; i++) {\n algorithmEffortArray[i][0] = i;\n algorithmEffortArray[i][1] = quality.getAlgorithmEffort(executionTimeArray[i], fixedSolutionEvl);\n\n ROIArray[i][0] = i;\n ROIArray[i][1] = quality.getRatioOfNonDominatedIndividuals(resultSolutions[i]);\n\n hyperVolumeArray[i][0] = i;\n\n hyperVolumeArray[i][1] = computeScaledHypervolume(resultSolutions[i]);\n //hyperVolumeArray[i][1] = quality.getHyperVolume(resultSolutions[i],realReference);\n\n uniformDistributionArray[i][0] = i;\n uniformDistributionArray[i][1] = quality.getUniformDistribution(resultSolutions[i]);\n\n }\n\n int numberOfMeasures = 4;\n int alpha = 30;//alpha =100;//if turbine number is 30\n\n chosenHeuristic = CF.getMaxChoiceFunction(algorithmEffortArray, 0, ROIArray, 1, hyperVolumeArray, 1,\n uniformDistributionArray, 1, numberOfMeasures, alpha, elapsedTime);\n //start time of the chosen heuristic\n lastInvokeTime[chosenHeuristic] = System.currentTimeMillis();\n\n //the result population of the chosen heuristic is served as the input population\n inputPop = resultSolutions[chosenHeuristic];\n\n while (remainEval > 0) {\n algorithm[instanceIndex]=ac.create(chosenHeuristic, remainEval);\n\n long beginTime = System.currentTimeMillis();\n //execute the chosen algorithm\n heuristicList.add(chosenHeuristic);\n if (fixedSolutionEvl > remainEval) {\n fixedSolutionEvl = remainEval;\n }\n //warranty size. necessary for small pop\n Random rsn=new SecureRandom();\n while(inputPop.size() < populationSize){\n inputPop.add(inputPop.get(rsn.nextInt(inputPop.size())));\n }\n resultSolutions[chosenHeuristic] = algorithm[instanceIndex].execute(inputPop, fixedSolutionEvl);\n inputPop = resultSolutions[chosenHeuristic];\n \n remainEval -= fixedSolutionEvl;\n\n // update executionTimeArray\n executionTimeArray[chosenHeuristic] = System.currentTimeMillis() - beginTime;\n //update elapsed time of since the heuristic was last called.\n for (int i = 0; i < algorithms.length; i++) {\n elapsedTime[i] = System.currentTimeMillis() - lastInvokeTime[i];\n }\n\n algorithmEffortArray[chosenHeuristic][1] = quality.getAlgorithmEffort(executionTimeArray[chosenHeuristic], fixedSolutionEvl);\n\n ROIArray[chosenHeuristic][1] = quality.getRatioOfNonDominatedIndividuals(resultSolutions[chosenHeuristic]);\n\n updateExtremeValues(resultSolutions[chosenHeuristic]);\n hyperVolumeArray[chosenHeuristic][1] = computeScaledHypervolume(resultSolutions[chosenHeuristic]);\n //hyperVolumeArray[chosenHeuristic][1] = quality.getHyperVolume(resultSolutions[chosenHeuristic],realReference);\n\n uniformDistributionArray[chosenHeuristic][1] = quality.getUniformDistribution(resultSolutions[chosenHeuristic]);\n\n chosenHeuristic = CF.getMaxChoiceFunction(algorithmEffortArray, 0, ROIArray, 1, hyperVolumeArray, 1,\n uniformDistributionArray, 1, numberOfMeasures, alpha, elapsedTime);\n //start time of the chosen heuristic\n lastInvokeTime[chosenHeuristic] = System.currentTimeMillis();\n\n //heuristicList.add(chosenHeuristic);\t\t\n }//end while(remainEvl >0)\n \n String arrayListPath = fullPath+\"/\"+problemCreator.getProblemClass() + (instanceIndex + 1) + \"_ChosenHeuristic.txt\";\n utils_.printArrayListInteger(heuristicList, arrayListPath);\n List<S> obtainedSolutionSet = SolutionListUtils.getNondominatedSolutions(inputPop);\n new SolutionListOutput(obtainedSolutionSet)\n .setSeparator(\"\\t\")\n .setFunFileOutputContext(new DefaultFileOutputContext(fullPath+\"/\"+problemCreator.getProblemClass() + (instanceIndex + 1) + \"CF_FinalParetoFront\"\n + runIndex + \".txt\"))\n .print();\n //print out true front's hypervolume\n\n }//end each problem instance\n\n System.out.println(\"Finished\");\n\n }", "public static void main(String[] args){\n String alexisPath = \"/Users/alexis/ImageORC/ImageORC/images\";\n String raphaelPath = \"/Users/raphael/Documents/DUT-Info/S4/S4_Image/projet/ImageORC/images\";\n String pathDefault = alexisPath;\n if (args.length > 0 && args[0].equals(\"1\")){\n pathDefault = raphaelPath;\n }\n\n OCREngine ocrEngine = new OCREngine(pathDefault);\n\n try {\n ocrEngine.makeDecisionOnImageList();\n ocrEngine.logOCR(\"out/test.txt\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public static void main(String[] args) {\n String path = System.getProperty(\"user.dir\")+\"\\\\src\\\\test\\\\java\\\\FileHandling\\\\Data.xlsx\";\n //Xls_Reader xls = new Xls_Reader(path);\n\n // counting rows\n\n //counting cols\n\n //reading\n\n //writing\n\n }", "public void runIndividualSpreadsheetTests() {\r\n\r\n\t\t// Make a list of files to be analyzed\r\n\t\tString[] inputFiles = new String[] {\r\n//\t\t\t\t\"salesforecast_TC_IBB.xml\",\r\n//\t\t\t\t\"salesforecast_TC_2Faults.xml\",\r\n//\t\t\t\t\t\t\t\"salesforecast_TC_2FaultsHeavy.xml\",\r\n\t\t\t\t\"SemUnitEx1_DJ.xml\",\r\n\t\t\t\t\"SemUnitEx2_1fault.xml\",\r\n\t\t\t\t\"SemUnitEx2_2fault.xml\",\r\n//\t\t\t\t\"VDEPPreserve_1fault.xml\",\r\n//\t\t\t\t\"VDEPPreserve_2fault.xml\",\r\n//\t\t\t\t\t\t\t\"VDEPPreserve_3fault.xml\",\r\n//\t\t\t\t\"AZA4.xml\",\r\n//\t\t\t\t\"Consultant_form.xml\",\r\n//\t\t\t\t\"Hospital_Payment_Calculation.xml\",\r\n//\t\t\t\t\"Hospital_Payment_Calculation_v2.xml\",\r\n//\t\t\t\t\"Hospital_Payment_Calculation_C3.xml\",\r\n//\t\t\t\t\"11_or_12_diagnoses.xml\",\r\n//\t\t\t\t\"choco_loop.xml\",\r\n//\t\t\t\t\"Paper2.xml\",\r\n//\t\t\t\t\"Test_If.xml\",\r\n//\t\t\t\t\"Test_If2.xml\",\r\n\r\n\t\t};\r\n\r\n\t\tscenarios.add(new Scenario(executionMode.singlethreaded, pruningMode.on, PARALLEL_THREADS, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.levelparallel, pruningMode.on, 2, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.fullparallel, pruningMode.on, 1, CHOCO3));\r\n\t\tscenarios.add(new Scenario(executionMode.fullparallel, pruningMode.on, 2, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.fullparallel, pruningMode.on, 4, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.heuristic, pruningMode.on, 1, CHOCO3));\r\n\t\tscenarios.add(new Scenario(executionMode.heuristic, pruningMode.on, 2, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.heuristic, pruningMode.on, 4, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.heuristic, pruningMode.on, PARALLEL_THREADS, true));\r\n//\t\tscenarios.add(new Scenario(executionMode.hybrid, pruningMode.on, 1, CHOCO3));\r\n\t\tscenarios.add(new Scenario(executionMode.hybrid, pruningMode.on, 2, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.hybrid, pruningMode.on, 4, CHOCO3));\r\n//\t\tscenarios.add(new Scenario(executionMode.levelparallel, pruningMode.on, PARALLEL_THREADS, false));\r\n//\t\tscenarios.add(new Scenario(executionMode.fullparallel, pruningMode.on, PARALLEL_THREADS, false));\r\n//\t\tscenarios.add(new Scenario(executionMode.fullparallel, pruningMode.on, PARALLEL_THREADS, false));\r\n//\t\tscenarios.add(new Scenario(executionMode.heuristic,pruningMode.on,PARALLEL_THREADS*2));\r\n//\t\tscenarios.add(new Scenario(executionMode.heuristic,pruningMode.on,0));\r\n\r\n//\t\tinputFiles = new String[]{\"VDEPPreserve_3fault.xml\"};\r\n\r\n\r\n\t\t// Go through the files and run them in different scenarios\r\n\t\tfor (String inputfilename : inputFiles) {\r\n\t\t\trunScenarios(inputFileDirectory, inputfilename, logFileDirectory, scenarios);\r\n\t\t}\r\n\t}", "public static void main(String[] args) throws IOException {\n\n if(args.length == 2) {\n readInputDataFromCSV(args[0]);\n winningNumber = args[1];\n File currentDirectoryOfCSVFile = new File(args[0]); // take the path, where .csv file with input data is\n findLongCommSubs();\n formResultLongCommSubs();\n multipleSortOfFinalPlayerList();\n generateCsvFileWithFinalData(currentDirectoryOfCSVFile);\n } else{\n System.out.println(\"Not valid enter! Enter two variables (path to .csv file and the winning number)!\");\n }\n }", "public static void main (String [] args) throws Exception { \n//\t\tconf.setMapperClass(DadaMapper.class);\n//\t\tconf.setReducerClass(DataReducer.class);\n\t\t\n//\t\tConfiguration conf = new Configuration(); \n//\t\tconf.set(\"fs.default.name\", \"hdfs://zli:9000\"); \n//\t\tconf.set(\"hadoop.job.user\", \"hadoop\"); \t\t \n//\t\tconf.set(\"mapred.job.tracker\", \"zli:9001\");\n\t\t\n\t\tJob job = new Job(); \n\t\tjob.setJarByClass(NBModelTestJob.class);\n\t\tjob.getConfiguration().set(\"fs.defaultFS\", \"hdfs://NYSJHL101-142.opi.com:8020\"); \n\t\tjob.getConfiguration().set(\"hadoop.job.user\", \"hdfs\"); \t\t \n\t\tjob.getConfiguration().set(\"mapred.job.tracker\", \"NYSJHL101-144.opi.com:8021\");\n\t\tjob.getConfiguration().set(\"trainpath\", args[0]);\n\t\tFileInputFormat.addInputPath(job, new Path(args[1]));\n\t\tFileOutputFormat.setOutputPath(job, new Path(args[2]));\n\t\tFileSystem hdfs = FileSystem.get(job.getConfiguration());\n\t\t\t\t\n\t\tjob.setMapperClass(DataMapper.class);\n\t\tjob.setReducerClass(DataReducer.class);\n\t\tjob.setCombinerClass(DataCombiner.class);\n\t\tjob.setOutputKeyClass(Text.class);\n\t\tjob.setOutputValueClass(Text.class);\n\t\tjob.setNumReduceTasks(10);\n\t\t\n\t\tSystem.exit(job.waitForCompletion(true) ? 0 : 1);\n\t\t\n\t}", "public static void main(String[] args) {\n\t\tParseOSPAR po = new ParseOSPAR();\n\t\t\n//\t\tString folder = \"L:\\\\Priv\\\\Cin\\\\NRMRL\\\\CompTox\\\\javax\\\\web-test\\\\AA Dashboard\\\\Data\\\\OSPAR\";\n//\t\tString excelFileName = \"OSPAR0.xls\";\n//\t\tString outputfilename=\"OSPAR0.json\";\n//\t\tpo.createOSPARRecord(excelFileName, folder,outputfilename);\n//\t\tOSPARRecord or=po.parseExcelFile(sourceExcelFile);\n//\t\tSystem.out.println(or.Aquatox_QSAR);\n\t\t\n//\t\tpo.createOSPARRecords(folder);\n\t\t\n\t\tpo.createFiles();\n\t}", "public static void main(String[] args) throws IOException {\n\t\tString groundTruthPath = \"C:/Users/15T-J000/Desktop/Malware_Classes_Ground_Truth.csv\";\n\t\tString resultPath = \"C:/Users/15T-J000/Desktop/sysnumresult.csv\";\n\t\tString outPath = \"C:/Users/15T-J000/Desktop/correction.csv\";\n\t\t\n\t\tint[] eachResult = {16, 17}; // Don't count index and name column (-2)\n\t\t\n\t\tMapping mapping = new Mapping();\n\t\tmapping.read(groundTruthPath, resultPath);\n\t\tmapping.compare(outPath, 17);\n\n\t}", "public static void main(String[] args) throws IOException {\r\n\t\tString folderPath = \"F:\\\\2.true-false-timewindow\";\r\n\t\tfolderPath = \"f:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\1.true-false-selectivity\";\r\n\t\tfolderPath = \"f:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\2.true-false-timewindow\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\3.false-selectivity\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\4.false-timewindow\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\5.true-selectivity\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\6.true-timewindow\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\7.inconsistent-selectivity\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\8.inconsistent-timewindow\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Imprecise\\\\1.true-false-selectivity\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Imprecise\\\\3.true-false-uncertaintyinterval\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Imprecise\\\\2.true-false-timewindow\";\r\n\t\t\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Imprecise2.0\\\\a.1\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\imprecise3.0\\\\confidence\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\imprecise3.0\\\\true\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\imprecise3.0\\\\true-false\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\dpc\\\\half3\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\dpc\\\\half1\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\dpc\\\\half2\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\dpc\\\\obelix\\\\half5\";\t\t\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\dpc\\\\obelix\\\\half5-largerwindow\";\r\n\r\n\t\t\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\3.false-selectivity\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\4.false-timewindow\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\5.true-selectivity\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\6.true-timewindow\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\7.inconsistent-selectivity\";\r\n\t\tfolderPath = \"F:\\\\Dropbox\\\\research\\\\2nd\\\\Experiments\\\\2013\\\\Precise4.0\\\\8.inconsistent-timewindow\";\r\n\t\t\r\n\t\t\r\n\t\tGroupResultSet rSet = new GroupResultSet(folderPath);\r\n\t\trSet.printResults();\r\n\t\t//rSet.printAttribute(\"averageThroughput\");\r\n\t\trSet.printAttribute(\"Throughput\");\r\n\t\trSet.printAttribute(\"Number Of Runs Created\");\r\n\t\trSet.printAttribute(\"Time for compute confidence\");\r\n\t\trSet.printAttribute(\"Time on Create New Run Baseline\");\r\n\t\trSet.printAttribute(\"Time for sorting events in imprecise\");\r\n\t\trSet.printAttribute(\"Pattern matching time\");\r\n\t\trSet.printAttribute(\"Enumeration time\");\r\n\t\trSet.printAttribute(\"Time for compute confidence\");\r\n\t\trSet.printAttribute(\"Total Running Time\");\r\n\t\t\r\n\t}", "public static void main(String[] args) {\n\t\tString dataFileName = DATA_PATH + \"data1.csv\";\n\t\t//supply path and name of file where created data is going to be saved\n\t\tString newFileName = DATA_PATH + \"data1_subsetTest.csv\"; \n\n\t\tArrayList<String> subsetConditions= new ArrayList<String>();\n\t\tsubsetConditions.add(\"Gen:==:7,8:Numeric\");\n\t\tsubsetConditions.add(\"Site:!=:Env1:Factor\");\n\t\tsubsetConditions.add(\"Blk:!=:4:Numeric\");\n\t\t\n\t\tRJavaManager rJavaManager= new RJavaManager();\n\t\trJavaManager.initStar();\n\t\trJavaManager.getRJavaDataManipulationManager().subSet(dataFileName, newFileName, subsetConditions);\n\n\t}", "public static void main(String[] args) {\n\t\tTestingPerformanceCalculator obj= new TestingPerformanceCalculator(\"./data/gitInfoNew.txt\", \"data/Results/FinalResultSidTest1.txt\");\n\t\t//Read Gold set\n\t\tobj.goldStMap=obj.LoadGoldSet();\n\t\t//MiscUtility.showResult(10, obj.goldStMap);\n\t\t//Resd output file/ test result file\n\t\tobj.finalResult=obj.LoadTestingResult();\n\t\t//MiscUtility.showResult(20, obj.finalResult);\n\t\t\n\t\t\n\t\t//Create a ranked list\n\t\t//obj.produceRankedResult(10);\n\t\tArrayList<String> rankedFinalTestingResult=obj.produceRankedResult(10);\n\t\tContentWriter.writeContent(\"./data/testing1RankedResult.txt\", rankedFinalTestingResult);\n\t\t//call another class BLPerformanceCalc to compute\n\t\t\n\t\t\n\t}", "public static void main(String[] args) throws MissingFileNameArgumentException{\n FileReader file = null;\r\n BufferedReader buffer = null;\r\n Scanner bScan = null;\r\n Scanner scan = null;\r\n double total1 =0, total2= 0, total3 = 0, total4 = 0, total5 = 0;\r\n if(args.length == 0){\r\n throw new MissingFileNameArgumentException(\"Missing input file name\");\r\n }\r\n try{\r\n file = new FileReader(args[0]);\r\n buffer = new BufferedReader(file);\r\n bScan = new Scanner(buffer);\r\n //try scanning in the name from the buffer reader.\r\n try{\r\n String name = bScan.nextLine();\r\n String domain = bScan.nextLine();\r\n String license = bScan.nextLine();\r\n int year = bScan.nextInt();\r\n bScan.nextLine();\r\n printReportHeader(name, domain, license, year);\r\n while(bScan.hasNext()){\r\n String branch = bScan.nextLine();\r\n scan = new Scanner(branch);\r\n scan.useDelimiter(\",\");\r\n String id = scan.next();\r\n if(id.equals(\"Total:\")){\r\n\r\n total1 = Double.parseDouble(scan.next());\r\n total2 = Double.parseDouble(scan.next());\r\n total3 = Double.parseDouble(scan.next());\r\n total4 = Double.parseDouble(scan.next());\r\n total5 = Double.parseDouble(scan.next());\r\n printSeparatorLine();\r\n printBranchProfit(\"Totals:\", \"\", total1, total2, total3, total4, total5);\r\n printSeparatorLine();\r\n System.out.println();\r\n\r\n }\r\n else{\r\n String location = scan.next();\r\n total1 = Double.parseDouble(scan.next());\r\n total2 = Double.parseDouble(scan.next());\r\n total3 = Double.parseDouble(scan.next());\r\n total4 = Double.parseDouble(scan.next());\r\n total5 = Double.parseDouble(scan.next());\r\n printBranchProfit(id, location, total1, total2, total3, total4, total5);\r\n\r\n }\r\n }\r\n\r\n\r\n }\r\n //handling any NoSuchElement exceptions\r\n catch(NoSuchElementException exp){\r\n System.err.println(\"\\nNo such element or invalid input!!\\n\" + exp);\r\n\r\n }\r\n }\r\n //catching any IO exceptions\r\n catch(IOException exp){\r\n System.err.println(\"Error opening file!\\n\"+ exp);\r\n }\r\n //finally, close the scanner and the buffer\r\n finally{\r\n System.out.println();\r\n if(scan!= null){\r\n scan.close();\r\n }\r\n if(buffer!= null){\r\n try{\r\n buffer.close();\r\n }catch(IOException exp){\r\n //handles the IOException for trying to close the buffer reader.\r\n System.out.println(\"Error closing buffer!\" + exp);\r\n }\r\n }\r\n\r\n }\r\n }", "public static void main(String[] args) {\n\t\tString dataFileName = DATA_PATH + \"icecreamSummary2NA.csv\";\n\t\tString categoryName = \"numScoops\";\n\t\tString responseColumnName = \"Count3\";\n\t\tString groupingName = null; // NULL\n\t\tint groupingNameLevelsCount = 1; //3; //\n\t\tint[] result;\n\n//\t\t//EXAMPLE 2\n//\t\t//supply path and name of rda data\n//\t\tString dataFileName = DATA_PATH + \"icecreamSummary2NA.csv\";\n//\t\tString categoryName = \"numScoops\";\n//\t\tString responseColumnName = \"Count2\";\n//\t\tString groupingName = \"brand\"; //null; // NULL\n//\t\tint groupingNameLevelsCount = 4; //1; //\n//\t\tint[] result;\n\n\t\tRJavaManager rJavaManager= new RJavaManager();\n\t\trJavaManager.initStar();\n\t\tresult=rJavaManager.getRJavaDataManipulationManager().howManyLevelsHaveOneDatum(dataFileName, categoryName, responseColumnName, groupingName);\n\t\tfor (int i=0; i<groupingNameLevelsCount;i++) System.out.println(i + \":\" + result[i]);\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tString filePath = env.getProperty(\"export.file.path\");\n\t\t\t\tFileSystem fileSystem = FileSystems.getDefault();\n\t\t\t\tif (StringUtils.isNotEmpty(empId)) {\n\t\t\t\t\tfilePath += \"/\" + empId;\n\t\t\t\t}\n\t\t\t\tPath path = fileSystem.getPath(filePath);\n\t\t\t\t// path = path.resolve(String.valueOf(empId));\n\t\t\t\tif (!Files.exists(path)) {\n\t\t\t\t\tPath newEmpPath = Paths.get(filePath);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tFiles.createDirectory(newEmpPath);\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tlog.error(\"Error while creating path \" + newEmpPath);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfilePath += \"/\" + exportFileName;\n\t\t\t\ttry {\n\t\t\t\t\t// initialize FileWriter object\n\t\t\t\t\tlog.debug(\"filePath = \" + filePath + \", isAppend=\" + isAppend);\n\t\t\t\t\tfileWriter = new FileWriter(filePath, isAppend);\n\t\t\t\t\tString siteName = null;\n\n\t\t\t\t\t// initialize CSVPrinter object\n\t\t\t\t\tcsvFilePrinter = new CSVPrinter(fileWriter, csvFileFormat);\n\t\t\t\t\tif (!isAppend) {\n\t\t\t\t\t\t// Create CSV file header\n\t\t\t\t\t\tcsvFilePrinter.printRecord(CONSOLIDATED_REPORT_FILE_HEADER);\n\t\t\t\t\t}\n\t\t\t\t\tfor (ReportResult transaction : content) {\n\t\t\t\t\t\tif (StringUtils.isEmpty(siteName) || !siteName.equalsIgnoreCase(transaction.getSiteName())) {\n\t\t\t\t\t\t\tcsvFilePrinter.printRecord(\"\");\n\t\t\t\t\t\t\tcsvFilePrinter\n\t\t\t\t\t\t\t\t\t.printRecord(\"CLIENT - \" + projName + \" SITE - \" + transaction.getSiteName());\n\t\t\t\t\t\t}\n\t\t\t\t\t\tList record = new ArrayList();\n\t\t\t\t\t\tlog.debug(\"Writing transaction record for site :\" + transaction.getSiteName());\n\t\t\t\t\t\trecord.add(transaction.getSiteName());\n\t\t\t\t\t\trecord.add(transaction.getLocatinName());\n\t\t\t\t\t\trecord.add(transaction.getAssignedJobCount());\n\t\t\t\t\t\trecord.add(transaction.getCompletedJobCount());\n\t\t\t\t\t\trecord.add(transaction.getOverdueJobCount());\n\t\t\t\t\t\trecord.add(transaction.getTat());\n\t\t\t\t\t\tcsvFilePrinter.printRecord(record);\n\t\t\t\t\t}\n\t\t\t\t\tlog.info(exportFileName + \" CSV file was created successfully !!!\");\n\t\t\t\t\tstatusMap.put(exportFileName, \"COMPLETED\");\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tlog.error(\"Error in CsvFileWriter !!!\");\n\t\t\t\t\tstatusMap.put(exportFileName, \"FAILED\");\n\t\t\t\t} finally {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfileWriter.flush();\n\t\t\t\t\t\tfileWriter.close();\n\t\t\t\t\t\tcsvFilePrinter.close();\n\t\t\t\t\t} catch (IOException e) {\n\t\t\t\t\t\tlog.error(\"Error while flushing/closing fileWriter/csvPrinter !!!\");\n\t\t\t\t\t\tstatusMap.put(exportFileName, \"FAILED\");\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tlock.unlock();\n\t\t\t}", "public static void main(String[] args) throws IOException {\n int activeThreshold = 300;\n //Activity.selectActive(\"st\", 6, activeThreshold);\n //Activity.selectActive(\"ri\", 6, activeThreshold);\n //Activity.selectActive(\"dw\", 9, activeThreshold);\n\n //Interaction.analysis(\"st\", 6);\n //Interaction.analysis(\"ri\", 6);\n\n //BehaviourIndicators.analysis(\"st\", 6);\n //BehaviourIndicators.analysis(\"ri\", 6);\n //BehaviourIndicators.analysis(\"dw\", 9);\n\n Engagement.analysis(\"st\",6);\n Engagement.analysis(\"ri\",6);\n //todo the data files for DW have to be adjusted to the ones of the other two to be able to run it\n //Engagement.analysis(\"dw\",9);\n\n //Motivation.analysis(\"ri\", 6);\n //Motivation.analysis(\"st\", 6);\n }", "public static void main(String[] args) throws Exception {\n\t\tfor(int i=200;i<=1200;i+=200){\n\t\t\tString inputPath=\"\";\n\t\t\t\n\t\t\t/*inputPath=\"/home/Hadoop/桌面/files/\"+i+\"/result-std-logSize\";\n\t\t\tSystem.out.println(\"Level:\"+i+\",std-LogSize:\");\n\t\t\tvalue(inputPath);*/\n\t\t\t/*inputPath=\"/home/Hadoop/桌面/files/\"+i+\"/result-origin\";\n\t\t\tSystem.out.println(\"origin:\");\n\t\t\tvalue(inputPath);*/\n\t\t\t\n\t\t\tinputPath=\"/home/Hadoop/桌面/files/\"+i+\"/result-mixedTime-test1\";\n\t\t\tSystem.out.println(\"level\"+i+\", mixedTime:\");\n\t\t\tvalue(inputPath);\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t\t\n\t\t\t/*inputPath=\"/home/Hadoop/桌面/files/\"+i+\"/result-std-0\";\n\t\t\tSystem.out.println(\"std-0:\");\n\t\t\tvalue(inputPath);\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t\tinputPath=\"/home/Hadoop/桌面/files/\"+i+\"/result-std\";\n\t\t\tSystem.out.println(\"Level:\"+i+\",std:\");\n\t\t\tvalue(inputPath);\n\t\t\t\n\t\t\tinputPath=\"/home/Hadoop/桌面/files/\"+i+\"/result-square\";\n\t\t\tSystem.out.println(\"Level:\"+i+\",square:\");\n\t\t\tvalue(inputPath);\n\t\t\t\n\t\t\tinputPath=\"/home/Hadoop/桌面/files/\"+i+\"/result-line\";\n\t\t\tSystem.out.println(\"Level:\"+i+\",line:\");\n\t\t\tvalue(inputPath);\n\t\t\t*/\n\t\t\t\n\t\t}\n \n }", "@Test public void testWithExternalDataSet() throws IOException\n {\n final String homeDir = System.getProperty(\"user.home\");\n assumeNotNull(null != homeDir);\n final File inDir = new File(new File(homeDir), fixedDataSetDir);\n assumeTrue(inDir.isDirectory());\n final File outDir = new File(new File(homeDir), fixedDataSetOutDir);\n assertTrue(outDir.isDirectory());\n assertTrue(outDir.canWrite());\n // Ensure no old result files hanging around...\n final File basicResultFile = new File(outDir, ETVSimpleDriverNBulkInputs.OUTPUT_STATS_FILE_BASIC);\n basicResultFile.delete(); // Make sure no output file.\n assertFalse(\"output file should not yet exist\", basicResultFile.isFile());\n final File basicFilteredResultFile = new File(outDir, ETVSimpleDriverNBulkInputs.OUTPUT_STATS_FILE_FILTERED_BASIC);\n basicFilteredResultFile.delete(); // Make sure no output file.\n assertFalse(\"output filtered file should not yet exist\", basicFilteredResultFile.isFile());\n // Do the computation.\n ETVSimpleDriverNBulkInputs.doComputation(inDir, outDir);\n // Check results.\n assertTrue(\"output file should now exist\", basicResultFile.isFile());\n assertTrue(\"output filtered file should now exist\", basicFilteredResultFile.isFile());\n System.out.println(\"Written to \" + outDir);\n }", "public static void main(String[] argv) {\n\t\tFile file = new File(\"D:/dataset/\");\n\t\t\n\t\t\n\t\t\n\t\tdouble yuzhi=0.05;\n\t\tString y = String.valueOf(yuzhi);\n\t\t\t\t\t\n\t\tAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", \"\\r\\n\");\n\t\tFile[] lf = file.listFiles();\n\t\tfor (int i = 0; i < lf.length; i++) {\n\t\t\tSystem.out.println(lf[i].getName());\n\t\t\tString[] arg = {\n//\t\t\t\t\t\"-E\", \"weka.attributeSelection.CfsSubsetEval -L\",\n//\t\t\t\t\t\"-E\", \"weka.attributeSelection.SymmetricalUncertAttributeSetEval \",\n//\t\t\t\t\t\"-S\", \"weka.attributeSelection.BestFirst -S 8\",\n\t\t\t\t\t\"-c\", \"last\",\n//\t\t\t\t\t\"-y\", y,\n\n\t\t\t\t\t\"-i\", \"D:/dataset/\" + lf[i].getName(), \n\t\t\t\t\t\"-o\", \"D:/FASTminDrawL/\" + y+lf[i].getName()\n\t\t\t};\n\t\t\tAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", lf[i].getName());\n\t\t\tlong st =System.currentTimeMillis();\n\t\t\trunFilter(new FASTminDrawL(yuzhi), arg);\n\t\t\tlong end =System.currentTimeMillis();\n\t\t\tlong time=end-st;\n\t\t\tAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", time + \"\\r\\n\");\n\t\t}\n\t\n\t\n\t\tyuzhi=0.1;\n\t\ty = String.valueOf(yuzhi);\n\t\t\t\t\n\tAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", \"\\r\\n\");\n\tlf = file.listFiles();\n\tfor (int i = 0; i < lf.length; i++) {\n\t\tSystem.out.println(lf[i].getName());\n\t\tString[] arg = {\n//\t\t\t\t\"-E\", \"weka.attributeSelection.CfsSubsetEval -L\",\n//\t\t\t\t\"-E\", \"weka.attributeSelection.SymmetricalUncertAttributeSetEval \",\n//\t\t\t\t\"-S\", \"weka.attributeSelection.BestFirst -S 8\",\n\t\t\t\t\"-c\", \"last\",\n//\t\t\t\t\"-y\", y,\n\n\t\t\t\t\"-i\", \"D:/dataset/\" + lf[i].getName(), \n\t\t\t\t\"-o\", \"D:/FASTminDrawL/\" + y+lf[i].getName()\n\t\t};\n\t\tAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", lf[i].getName());\n\t\tlong st =System.currentTimeMillis();\n\t\trunFilter(new FASTminDrawL(yuzhi), arg);\n\t\tlong end =System.currentTimeMillis();\n\t\tlong time=end-st;\n\t\tAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", time + \"\\r\\n\");\n\t}\n\t\n\t\n\t\n\tyuzhi=0.2;\n\ty = String.valueOf(yuzhi);\n\t\t\t\nAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", \"\\r\\n\");\nlf = file.listFiles();\nfor (int i = 0; i < lf.length; i++) {\n\tSystem.out.println(lf[i].getName());\n\tString[] arg = {\n//\t\t\t\"-E\", \"weka.attributeSelection.CfsSubsetEval -L\",\n//\t\t\t\"-E\", \"weka.attributeSelection.SymmetricalUncertAttributeSetEval \",\n//\t\t\t\"-S\", \"weka.attributeSelection.BestFirst -S 8\",\n\t\t\t\"-c\", \"last\",\n//\t\t\t\"-y\", y,\n\n\t\t\t\"-i\", \"D:/dataset/\" + lf[i].getName(), \n\t\t\t\"-o\", \"D:/FASTminDrawL/\" + y+lf[i].getName()\n\t};\n\tAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", lf[i].getName());\n\tlong st =System.currentTimeMillis();\n\trunFilter(new FASTminDrawL(yuzhi), arg);\n\tlong end =System.currentTimeMillis();\n\tlong time=end-st;\n\tAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", time + \"\\r\\n\");\n}\n\t\n\nyuzhi=0.4;\ny = String.valueOf(yuzhi);\n\t\t\nAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", \"\\r\\n\");\nlf = file.listFiles();\nfor (int i = 0; i < lf.length; i++) {\nSystem.out.println(lf[i].getName());\nString[] arg = {\n//\t\t\"-E\", \"weka.attributeSelection.CfsSubsetEval -L\",\n//\t\t\"-E\", \"weka.attributeSelection.SymmetricalUncertAttributeSetEval \",\n//\t\t\"-S\", \"weka.attributeSelection.BestFirst -S 8\",\n\t\t\"-c\", \"last\",\n//\t\t\"-y\", y,\n\n\t\t\"-i\", \"D:/dataset/\" + lf[i].getName(), \n\t\t\"-o\", \"D:/FASTminDrawL/\" +y+ lf[i].getName()\n};\nAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", lf[i].getName());\nlong st =System.currentTimeMillis();\nrunFilter(new FASTminDrawL(yuzhi), arg);\nlong end =System.currentTimeMillis();\nlong time=end-st;\nAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", time + \"\\r\\n\");\n}\n\n\nyuzhi=0.6;\ny = String.valueOf(yuzhi);\n\t\t\nAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", \"\\r\\n\");\nlf = file.listFiles();\nfor (int i = 0; i < lf.length; i++) {\nSystem.out.println(lf[i].getName());\nString[] arg = {\n//\t\t\"-E\", \"weka.attributeSelection.CfsSubsetEval -L\",\n//\t\t\"-E\", \"weka.attributeSelection.SymmetricalUncertAttributeSetEval \",\n//\t\t\"-S\", \"weka.attributeSelection.BestFirst -S 8\",\n\t\t\"-c\", \"last\",\n//\t\t\"-y\", y,\n\n\t\t\"-i\", \"D:/dataset/\" + lf[i].getName(), \n\t\t\"-o\", \"D:/FASTminDrawL/\" + y+lf[i].getName()\n};\nAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", lf[i].getName());\nlong st =System.currentTimeMillis();\nrunFilter(new FASTminDrawL(yuzhi), arg);\nlong end =System.currentTimeMillis();\nlong time=end-st;\nAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", time + \"\\r\\n\");\n}\n\nyuzhi=0.8;\ny = String.valueOf(yuzhi);\n\t\t\nAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", \"\\r\\n\");\nlf = file.listFiles();\nfor (int i = 0; i < lf.length; i++) {\nSystem.out.println(lf[i].getName());\nString[] arg = {\n//\t\t\"-E\", \"weka.attributeSelection.CfsSubsetEval -L\",\n//\t\t\"-E\", \"weka.attributeSelection.SymmetricalUncertAttributeSetEval \",\n//\t\t\"-S\", \"weka.attributeSelection.BestFirst -S 8\",\n\t\t\"-c\", \"last\",\n//\t\t\"-y\", y,\n\n\t\t\"-i\", \"D:/dataset/\" + lf[i].getName(), \n\t\t\"-o\", \"D:/FASTminDrawL/\" + y+lf[i].getName()\n};\nAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", lf[i].getName());\nlong st =System.currentTimeMillis();\nrunFilter(new FASTminDrawL(yuzhi), arg);\nlong end =System.currentTimeMillis();\nlong time=end-st;\nAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", time + \"\\r\\n\");\n}\n\nyuzhi=1;\ny = String.valueOf(yuzhi);\n\t\t\nAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", \"\\r\\n\");\nlf = file.listFiles();\nfor (int i = 0; i < lf.length; i++) {\nSystem.out.println(lf[i].getName());\nString[] arg = {\n//\t\t\"-E\", \"weka.attributeSelection.CfsSubsetEval -L\",\n//\t\t\"-E\", \"weka.attributeSelection.SymmetricalUncertAttributeSetEval \",\n//\t\t\"-S\", \"weka.attributeSelection.BestFirst -S 8\",\n\t\t\"-c\", \"last\",\n//\t\t\"-y\", y,\n\n\t\t\"-i\", \"D:/dataset/\" + lf[i].getName(), \n\t\t\"-o\", \"D:/FASTminDrawL/\" + y+lf[i].getName()\n};\nAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", lf[i].getName());\nlong st =System.currentTimeMillis();\nrunFilter(new FASTminDrawL(yuzhi), arg);\nlong end =System.currentTimeMillis();\nlong time=end-st;\nAppendToFile.appendMethodA(\"D:/FASTminDrawL/T.txt\", time + \"\\r\\n\");\n}\n\n\n\t\n}", "public static void main(String[] args) throws IOException {\n\n\t\tString path = \"/Users/jingjiang/Google Drive/CoatesHire/DataCrawler/Contacts\";\n\t\tFile folder = new File(path);\n\t\tFile outcome = new File(path+\"all_cust.csv\");\n\t\tFileWriter fw = new FileWriter(outcome);\n\t\tint countRows = 0;\n\t\tfor(File file : folder.listFiles())\n\t\t{\n\t\t\tSystem.out.println(file.getName());\n\t\t\t\n\t\t\tif (file.getName().equalsIgnoreCase(\"all_cust.csv\") == true || file.getName().indexOf(\".csv\") < 0)\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tSystem.out.println(\"Hello\");\n\t\t\tFileReader fr = new FileReader(file);\n\t\t\tBufferedReader br = new BufferedReader(fr);\n\t\t\tString line = null;\n\t\t\twhile((line = br.readLine()) != null)\n\t\t\t{\n\t\t\t\tif (line.length() > 2)\n\t\t\t\t{\n\t\t\t\t\tcountRows++;\n\t\t\t\t\tfw.write(line + \"\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tbr.close();\n\t\t\tfr.close();\n\t\t}\n\n\t\tfw.flush();\n\t\tfw.close();\n\t\tSystem.out.println(\"countRows=\" + countRows);\n\t}", "static void getReport(String root) throws Exception {\n\t\tint k = 7;\n\t\twhile (k <= 7) {\n\t\t\tint i = 1;\n\t\t\twhile (i <= 10) {\n\t\t\t\tlong startTime = System.currentTimeMillis();\n\t\t\t\tif (k == 1) {\n\t\t\t\t\tSystem.out.println(root + \"M1/M1.1//Testbeds-\" + i);\n\t\t\t\t\tConfigManager.filePath = root + \"M1/M1.1//Testbeds-\" + i + \"/Generated/\";\n\t\t\t\t\tSemCPSMain main2 = new SemCPSMain();\n\t\t\t\t\tmain2.readConvertStandardFiles();\n\t\t\t\t\tmain2.generatePSLDataModel();\n\t\t\t\t\tmain2.executePSLAproach();\n\n\t\t\t\t} else {\n\n\t\t\t\t\tSystem.out.println(root + \"M\" + k + \"/Testbeds-\" + i);\n\t\t\t\t\tConfigManager.filePath = root + \"M\" + k + \"/Testbeds-\" + i + \"/Generated/\";\n\t\t\t\t\tSemCPSMain main = new SemCPSMain();\n\t\t\t\t\tmain.readConvertStandardFiles();\n\t\t\t\t\tmain.generatePSLDataModel();\n\t\t\t\t\tmain.executePSLAproach();\n\t\t\t\t}\n\t\t\t\tlong endTime = System.currentTimeMillis();\n\t\t\t\tlong totalTime = endTime - startTime;\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tFileWriter fw = new FileWriter(ConfigManager.getFilePath()+\"PSL/test/Precision/F1NoTraining.txt\",true);\n\t\t\t\tfw.write(\"Time:\" + totalTime);//appends the string to the file\n\t\t\t fw.close();\n\t\t\t\t\n\t\t\t\ti++;\n\t\t\t}\n\t\t\tk++;\n\t\t}\n\t}", "public static void main(String[] args) throws Exception {\n int numLinesToSkip = 0;\n String delimiter = \",\"; //这是csv文件中的分隔符\n RecordReader recordReader = new CSVRecordReader(numLinesToSkip,delimiter);\n recordReader.initialize(new FileSplit(new ClassPathResource(\"dataSet20170119.csv\").getFile()));\n\n //Second: the RecordReaderDataSetIterator handles conversion to DataSet objects, ready for use in neural network\n\n /**\n * 这是标签(类别)所在列的序号\n */\n int labelIndex = 0; //5 values in each row of the iris.txt CSV: 4 input features followed by an integer label (class) index. Labels are the 5th value (index 4) in each row\n //类别的总数\n int numClasses = 2; //3 classes (types of iris flowers) in the iris data set. Classes have integer values 0, 1 or 2\n\n //一次读取多少条数据。当数据量较大时可以分几次读取,每次读取后就训练。这就是随机梯度下降\n int batchSize = 2000; //Iris data set: 150 examples total. We are loading all of them into one DataSet (not recommended for large data sets)\n\n DataSetIterator iterator = new RecordReaderDataSetIterator(recordReader,batchSize,labelIndex,numClasses);\n //因为我在这里写的2000是总的数据量大小,一次读完,所以一次next就完了。如果分批的话要几次next\n DataSet allData = iterator.next();\n// allData.\n allData.shuffle();\n SplitTestAndTrain testAndTrain = allData.splitTestAndTrain(0.8); //Use 65% of data for training\n\n DataSet trainingData = testAndTrain.getTrain();\n DataSet testData = testAndTrain.getTest();\n //We need to normalize our data. We'll use NormalizeStandardize (which gives us mean 0, unit variance):\n //数据归一化的步骤,非常重要,不做可能会导致梯度中的几个无法收敛\n DataNormalization normalizer = new NormalizerStandardize();\n normalizer.fit(trainingData); //Collect the statistics (mean/stdev) from the training data. This does not modify the input data\n normalizer.transform(trainingData); //Apply normalization to the training data\n normalizer.transform(testData); //Apply normalization to the test data. This is using statistics calculated from the *training* set\n\n\n final int numInputs = 9202;\n int outputNum = 2;\n int iterations = 1000;\n long seed = 142;\n int numEpochs = 50; // number of epochs to perform\n\n log.info(\"Build model....\");\n MultiLayerConfiguration conf = new NeuralNetConfiguration.Builder()\n .seed(seed)\n .optimizationAlgo(OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT)\n .iterations(iterations)\n .activation(Activation.SIGMOID)\n .weightInit(WeightInit.ZERO) //参数初始化的方法,全部置零\n .learningRate(1e-3) //经过测试,这里的学习率在1e-3比较合适\n .regularization(true).l2(5e-5) //正则化项,防止参数过多导致过拟合。2阶范数乘一个比率\n .list()\n\n .layer(0, new OutputLayer.Builder(LossFunctions.LossFunction.NEGATIVELOGLIKELIHOOD)\n .activation(Activation.SIGMOID)\n .nIn(numInputs).nOut(outputNum).build())\n .backprop(true).pretrain(false)\n .build();\n\n //run the model\n MultiLayerNetwork model = new MultiLayerNetwork(conf);\n model.init();\n model.setListeners(new ScoreIterationListener(100));\n\n\n log.info(\"Train model....\");\n for( int i=0; i<numEpochs; i++ ){\n log.info(\"Epoch \" + i);\n model.fit(trainingData);\n\n //每个epoch结束后立马观察模型估计的效果,方便及早停止\n Evaluation eval = new Evaluation(numClasses);\n INDArray output = model.output(testData.getFeatureMatrix());\n eval.eval(testData.getLabels(), output);\n log.info(eval.stats());\n }\n\n }", "public void getAccuracy() throws IOException {\n\t\tList<String> in = FileHelper.readFiles(Constants.outputpath);\r\n\t\tList<String> testhscode=FileHelper.readFiles(Constants.testpath);\r\n\t\tList<String> hslist=new ArrayList<String>();\r\n\t\tfor(String code:testhscode){\r\n\t\t\thslist.add(code.split(\" \")[0]);\r\n\t\t}\r\n\t\tList<TreeMap<String,Double>> finallist=new ArrayList<TreeMap<String,Double>>();\r\n\t\tString[] label = in.get(0).split(\" \");\r\n\t\t\r\n\t\tfor (int i=1;i<in.size();i++){\r\n\t\t\tString[] probability=in.get(i).split(\" \");\r\n\t\t\tTreeMap<String,Double> tm=new TreeMap<String,Double>();\r\n//\t\t\tString hscode = probability[0];\r\n//\t\t\tSystem.out.println(hscode);\r\n//\t\t\thslist.add(hscode);\r\n\t\t\tfor(int j=1;j<probability.length;j++){\r\n\t\t\t\tDouble p = Double.valueOf(probability[j]);\r\n\t\t\t\ttm.put(label[j]+\"\", p);\r\n//\t\t\t\tSystem.out.println(label[j]+\" \"+ p);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfinallist.add(tm);\r\n\t\t}\r\n\t\tList<String> outputlist=new ArrayList<String>();\r\n\t\tint right=0;\r\n\t\tfor(int j=0;j<finallist.size();j++){\r\n\t\t\tTreeMap<String, Double> m = finallist.get(j);\r\n\t\t\t\r\n\t\t\tString hs = hslist.get(j);\r\n//\t\t\tSystem.out.println(hs);\r\n//\t\t\tSystem.out.println(j);\r\n//\t\t\tString hscode = hs;\r\n//\t\t\tSystem.out.println(hscode);\r\n\t\t\tString hscode = changeToHSCode(hs);\r\n\t\t\tStringBuffer sb=new StringBuffer();\r\n\t\t\tsb.append(hscode+\" \");\r\n\t\t\tList<Map.Entry<String,Double>> list = new ArrayList<Map.Entry<String,Double>>(m.entrySet());\r\n //然后通过比较器来实现排序\r\n Collections.sort(list,new Comparator<Map.Entry<String,Double>>() {\r\n //升序排序\r\n \t\tpublic int compare(Entry<String, Double> o1,\r\n Entry<String, Double> o2) {\r\n return o2.getValue().compareTo(o1.getValue());\r\n }});\r\n\t\t\t \r\n\t\t\t \r\n\t\t\tint point=0;\r\n\t\t\tint flag=0;\r\n\t\t\t for(Map.Entry<String,Double> mapping:list){ \r\n \tflag++;\r\n \t\r\n \tif(hs.equals(mapping.getKey())){\r\n \t\tpoint=1;\r\n \t\tright++;\r\n \t} \r\n \tsb.append(changeToHSCode(mapping.getKey())+\" \"+mapping.getValue()+\" \");\r\n// System.out.println(mapping.getKey()+\":\"+mapping.getValue()); \r\n \tif(flag==5)\r\n \t\t{\r\n \t\tsb.append(\",\"+point);\r\n \t\tbreak;\r\n \t\t}\r\n } \r\n\t\t\toutputlist.add(sb.toString());\r\n\t\t}\r\n\t\tSystem.out.println(\"准确率\"+(double)right/finallist.size());\r\n\t\tFileHelper.writeFile(outputlist,Constants.finaloutputpath);\r\n\t}", "public void score(List<String> modelFiles, String testFile, String outputFile) {\n/* 1180 */ List<List<RankList>> trainingData = new ArrayList<>();\n/* 1181 */ List<List<RankList>> testData = new ArrayList<>();\n/* */ \n/* */ \n/* 1184 */ int nFold = modelFiles.size();\n/* */ \n/* 1186 */ List<RankList> samples = readInput(testFile);\n/* 1187 */ System.out.print(\"Preparing \" + nFold + \"-fold test data... \");\n/* 1188 */ FeatureManager.prepareCV(samples, nFold, trainingData, testData);\n/* 1189 */ System.out.println(\"[Done.]\");\n/* */ try {\n/* 1191 */ BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(outputFile), \"UTF-8\"));\n/* 1192 */ for (int f = 0; f < nFold; f++) {\n/* */ \n/* 1194 */ List<RankList> test = testData.get(f);\n/* 1195 */ Ranker ranker = this.rFact.loadRankerFromFile(modelFiles.get(f));\n/* 1196 */ int[] features = ranker.getFeatures();\n/* 1197 */ if (normalize)\n/* 1198 */ normalize(test, features); \n/* 1199 */ for (RankList l : test) {\n/* 1200 */ for (int j = 0; j < l.size(); j++) {\n/* 1201 */ out.write(l.getID() + \"\\t\" + j + \"\\t\" + ranker.eval(l.get(j)) + \"\");\n/* 1202 */ out.newLine();\n/* */ } \n/* */ } \n/* */ } \n/* 1206 */ out.close();\n/* */ }\n/* 1208 */ catch (IOException ex) {\n/* */ \n/* 1210 */ throw RankLibError.create(\"Error in Evaluator::score(): \", ex);\n/* */ } \n/* */ }", "public static void main(String[] args) {\n\t\tFileUTL fUtl = new FileUTL();\n\t\tString fileAddres = \"C:\\\\Users\\\\lenovo\\\\Desktop\\\\医嘱和对应路径信息\\\\\";\n\t\tString filename = fileAddres+\"12个病人的医嘱信息-utf8.csv\";\n\t\tString splitSign = \",\";\n\t\tString dateSign = \"/\";\n\t\tfUtl.readFile(filename, splitSign, dateSign);\n\t}", "public static void main(String[] args) throws IOException {\n\t\tCsv2kml csv2kml = new Csv2kml();\n//\t\tcsv2kml.convertCSVToKML(\"/Users/shilo/Desktop/testkmlconvert.csv\", \"/Users/shilo/Desktop/\", \"kmltest1\");\t\t\n\t\tSystem.out.println(csv2kml.multiCSV(\"/Users/shilo/Downloads/Ex2/Ex2/data\"));\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public void setup_report() {\n try {\n output = new PrintWriter(new FileWriter(filename));\n } catch (IOException ioe) {}\n }", "public void evaluate(String trainFile, String validationFile, String testFile, String featureDefFile) {\n/* 710 */ List<RankList> train = readInput(trainFile);\n/* */ \n/* 712 */ List<RankList> validation = null;\n/* */ \n/* 714 */ if (!validationFile.isEmpty()) {\n/* 715 */ validation = readInput(validationFile);\n/* */ }\n/* 717 */ List<RankList> test = null;\n/* */ \n/* 719 */ if (!testFile.isEmpty()) {\n/* 720 */ test = readInput(testFile);\n/* */ }\n/* 722 */ int[] features = readFeature(featureDefFile);\n/* 723 */ if (features == null) {\n/* 724 */ features = FeatureManager.getFeatureFromSampleVector(train);\n/* */ }\n/* 726 */ if (normalize) {\n/* */ \n/* 728 */ normalize(train, features);\n/* 729 */ if (validation != null)\n/* 730 */ normalize(validation, features); \n/* 731 */ if (test != null) {\n/* 732 */ normalize(test, features);\n/* */ }\n/* */ } \n/* 735 */ RankerTrainer trainer = new RankerTrainer();\n/* 736 */ Ranker ranker = trainer.train(this.type, train, validation, features, this.trainScorer);\n/* */ \n/* 738 */ if (test != null) {\n/* */ \n/* 740 */ double rankScore = evaluate(ranker, test);\n/* 741 */ System.out.println(this.testScorer.name() + \" on test data: \" + SimpleMath.round(rankScore, 4));\n/* */ } \n/* 743 */ if (modelFile.compareTo(\"\") != 0) {\n/* */ \n/* 745 */ System.out.println(\"\");\n/* 746 */ ranker.save(modelFile);\n/* 747 */ System.out.println(\"Model saved to: \" + modelFile);\n/* */ } \n/* */ }", "public static void main(String[] args) {\n\t\tList<String> productionIssues = AllTestMethodNames.getTestSuiteProductionIssuesMethods(product);\n\t\tList<String> obsolete = AllTestMethodNames.getTestSuiteObsoleteMethods(product);\n\t\tproductionIssues.addAll(obsolete);\n\t\tList<String> productionIssuesAndObsoleteTestCases = productionIssues;\n\n\t\tList<String> logNew;\n\t\tList<String> logOld;\n\t\tLogAnalyzer tool;\n\n\t\tinitializeToolPaths();\n\t\tlogNew = LogAnalyzerReader.readJenkinsLogFromFile(LOG_ANALYZER_LOG_NEW);\n\t\tlogOld = LogAnalyzerReader.readJenkinsLogFromFile(LOG_ANALYZER_LOG_OLD);\n\t\ttool = new LogAnalyzer(logNew);\n\t\tcreateFullReport(tool, logOld, productionIssuesAndObsoleteTestCases);\n\n\t\t// generate xml file with test cases which were started during an automation run but never finished\n\t\t// createXMLWithUnfinishedTestCases(tool, productionIssuesAndObsoleteTestCases);\n\n\t\t// generate xml file with test cases which were not started at all because for instance test run failed before finishing. (eg Java Heap)\n\t\t// Place log contents of complete full recent run into C:\\Automation_artifacts\\LogAnalyzer\\LogAnalyzer-LogOld.log\n\t\t// createXMLWithTestCasesThatNeverStartedFromLog(tool, logOld, productionIssuesAndObsoleteTestCases);\n\n\t\t// Change to which group test cases belong to.\n\t\t// Options below will add additional group to the @Test(groups = {\"\"}) the test cases belong to or if non exist then it will add a new one. This will make the change in the\n\t\t// source code.\n\t\t// In the test case file each test case is separated by a new line, 2 test case file would be ex:\n\t\t// c158643\n\t\t// c256486\n\t\t// Uncomment the option you want below. Place testCaseList.txt file containing test cases needing update in C:\\Automation_artifacts\\LogAnalyzer\\ directory.\n\t\t// Update the product variable value above if its different than cpm\n\n\t\t// AllTestMethodNames.addTestCaseToObsoleteTestCasesGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.addTestCaseToProductionIssuesGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.addTestCaseToExternalExecGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.addTestCaseToDateTimeChangeGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\",product);\n\t\t// AllTestMethodNames.addTestCaseToCustomGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", \"EnterCustomGroupNameHere\", product); // enter your custom group name as the 2nd parameter.\n\n\t\t// Remove to which group test cases belong to.\n\t\t// AllTestMethodNames.removeTestCaseFromObsoleteTestCasesGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.removeTestCaseFromProductionIssuesGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.removeTestCaseFromExternalExecGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.removeTestCaseFromDateTimeChangeGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\", product);\n\t\t// AllTestMethodNames.removeTestCaseFromCustomGroup(LOG_ANALYZER_OUTPUT_PATH + \"testCaseList.txt\",\"EnterCustomGroupNameHere\", product ); // enter your custom group name as the 2nd parameter.\n\n\t}", "public static void main(String[] args)\n\t{\n\t\t// Input validation\n\t\tif(args.length < 3)\n\t\t{\n\t\t\tSystem.out.println(\"Error - Wrong input parameters\");\n\t\t\tSystem.out.println(\"Usage:\");\n\t\t\tSystem.out.println(\" in - Input file name\");\n\t\t\tSystem.out.println(\" ob - Output file name for best solution\");\n\t\t\tSystem.out.println(\" ow - Output file name for worst solution\");\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t\t// Argument extraction\n\t\tString inputFile = args[0];\n\t\tString outputFileBest = args[1];\n\t\tString outputFileWorst = args[2];\n\t\t\n\t\tDataSource sourceInput = null;\n\t\t\n\t\ttry \n\t\t{\n\t\t\t// Load the analysis data\n\t\t\tsourceInput = new DataSource(inputFile);\n\t\t\tInstances inputData = sourceInput.getDataSet();\n\t\t\tif (inputData.classIndex() == -1)\n\t\t\t\tinputData.setClassIndex(inputData.numAttributes() - 1);\n\t\t\t\n\t\t\t// Use the best method\n\t\t\tanalyzeData(inputData, BestClassifier, outputFileBest);\n\t\t\t\n\t\t\t// Use the worst method\n\t\t\tanalyzeData(inputData, WorstClassifier, outputFileWorst);\n\t\t} \n\t\tcatch (Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t\tSystem.exit(1);\n\t\t}\n\t}", "public void evaluate(String sampleFile, String validationFile, String featureDefFile, double percentTrain) {\n/* 761 */ List<RankList> trainingData = new ArrayList<>();\n/* 762 */ List<RankList> testData = new ArrayList<>();\n/* 763 */ int[] features = prepareSplit(sampleFile, featureDefFile, percentTrain, normalize, trainingData, testData);\n/* 764 */ List<RankList> validation = null;\n/* */ \n/* */ \n/* 767 */ if (!validationFile.isEmpty()) {\n/* */ \n/* 769 */ validation = readInput(validationFile);\n/* 770 */ if (normalize) {\n/* 771 */ normalize(validation, features);\n/* */ }\n/* */ } \n/* 774 */ RankerTrainer trainer = new RankerTrainer();\n/* 775 */ Ranker ranker = trainer.train(this.type, trainingData, validation, features, this.trainScorer);\n/* */ \n/* 777 */ double rankScore = evaluate(ranker, testData);\n/* */ \n/* 779 */ System.out.println(this.testScorer.name() + \" on test data: \" + SimpleMath.round(rankScore, 4));\n/* 780 */ if (modelFile.compareTo(\"\") != 0) {\n/* */ \n/* 782 */ System.out.println(\"\");\n/* 783 */ ranker.save(modelFile);\n/* 784 */ System.out.println(\"Model saved to: \" + modelFile);\n/* */ } \n/* */ }", "public void makeReport() throws IOException{\n File report = new File(\"Report.txt\");\n BufferedWriter reportWriter = new BufferedWriter(new FileWriter(report));\n BufferedReader bookReader = new BufferedReader(new FileReader(\"E-Books.txt\"));\n String current;\n while((current = bookReader.readLine()) != null ){\n String[] tokens = current.split(\",\");\n reportWriter.write(tokens[0].trim()+\" for \"+tokens[1].trim()+\" with redemption Code \"+tokens[2].trim()+\n \" is assigned to \"+tokens[4].trim()+\" who is in \"+tokens[5].trim()+\" grade.\");\n reportWriter.write(System.lineSeparator());\n reportWriter.flush();\n }\n reportWriter.close();\n bookReader.close();\n new reportWindow();\n }", "public static void main(String arg[]) throws IOException, InterruptedException {\n\n\t\tString fileName = new File(arg[0]).getName();\n\t final String path = \"C:\\\\Users\\\\alessandro\\\\Desktop\\\\Test\\\\\"+fileName+\".txt\";\n\n\t File file = new File(path);\n\t \n\t \n\t double archi, nodi,densitÓ;\n\n\t\tImmutableGraph graph1 = ArcListASCIIGraph.loadOffline(arg[0]);\n\t\t\t\n\t\t\tif(file.exists()){\n\t\t\tSystem.out.println(\"dentro if\");\n\t\t\t\tBufferedWriter bw = null;\n\t\t\t\t\tFileWriter fw = null;\n\t\t\t\t\tfw = new FileWriter(file.getAbsoluteFile(), true);\n\t\t\t\t\tbw = new BufferedWriter(fw);\n//\t\t\t\t\t dispersionCentrality disp = new dispersionCentrality();\n//\t\t\t\t\t Date primaDisp = new Date();\n//\t\t\t\t\t\tbw.write(\"Dispersion Index:\" +disp.dispersionCentrality(graph1)+\" tempo di esecuzione: \");\n//\t\t\t\t\t\tDate dopoDisp = new Date();\n//\t\t\t\t\t\tbw.write(dopoDisp.getTime()-primaDisp.getTime()+\" ms \\r\\n\");\n//\t\t\t\t\t\n//\t\t\t\t\t embeddednessIndex embe = new embeddednessIndex();\t\n//\n//\t\t\t\t\t Date primaEmb = new Date();\n//\t\t\t\t\t\tbw.write(\"Embeddedness Index: \"+embe.computeEmbeddedness(graph1)+\" tempo di esecuzione: \");\n//\t\t\t\t\t\tDate dopoEmb = new Date();\n//\t\t\t\t\t\tbw.write(dopoEmb.getTime()-primaEmb.getTime()+\" ms \\r\\n\");\n\t\t\t\t\t\n//\t\t\t\t\tdegreeCentrality degree = new degreeCentrality();\n//\t\t\t\t\tDate primaDegree = new Date();\n//\t\t\t\t\tbw.write(\"Index Degree centrality node: \"+degree.computeNodeDegree(graph1)+\" tempo dis esecuzione: \");\n//\t\t\t\t\tDate dopoDegree = new Date();\n//\t\t\t\t\tbw.write(dopoDegree.getTime()-primaDegree.getTime()+\" ms \\r\\n\");\n//\t\t\t\t\n//\t\t\t\t\tcenter cent = new center();\n//\t\t\t\t\tDate primaCenter = new Date();\n//\t\t\t\t\tbw.write(\"Center of Graph: \"+ cent.getcenter(graph1)+\" tempo di esecuzione: \");\n//\t\t\t\t\tDate dopoCenter = new Date();\n//\t\t\t\t\tbw.write(dopoCenter.getTime()-primaCenter.getTime()+\" ms \\r\\n\");\n//\t\t\t\t\tSystem.out.println(\"DONE\");\n//\t\t\t\t\tbw.close();\n\t\t\t\t\t\n\t\t\t\t\t deleteDuplicate delete = new deleteDuplicate();\n\t\t\t\t\t delete.stripDuplicatesFromFile(arg[0]);\n\t\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\telse{\n\t\t\tarchi=graph1.numArcs();\n\t\t\tnodi =graph1.numNodes();\n\t\t\tdensitÓ = archi/(nodi*(nodi-1));\n\t\t\t\n\t\tBufferedReader br = null;\n\t\tFileReader fr = null;\n\t\tfr = new FileReader(arg[0]);\n\t\tbr = new BufferedReader(fr);\n\t\t\n\t\tString sCurrentLine;\n\t\tString app;\n\n\t\tbr = new BufferedReader(new FileReader(arg[0]));\n\t\tint countLine = 0;\n\t\twhile ((sCurrentLine = br.readLine()) != null) {\n\t\t\tcountLine = countLine + 1;\n\t\t\tapp = sCurrentLine.replaceAll(\"[^0-9]+\", \" \");\n\t\tfor (String s : Arrays.asList(app.trim().split(\" \")))\n\t\t\t\tListanodi.add(Integer.valueOf(s));\n\n\t\t}\n\t\tif (br != null)\n\t\t\tbr.close();\n\n\t\tif (fr != null)\n\t\t\tfr.close();\n\t\tDirectedGraph<String, DefaultEdge> graph = createStringGraph(Listanodi);\n\t\tConnectivityInspector<String, DefaultEdge> inspector = new ConnectivityInspector<String, DefaultEdge>(\n\t\t\t\tgraph);\n\t\t\t\t\n\t\tKosarajuStrongConnectivityInspector<String,DefaultEdge>finder = new KosarajuStrongConnectivityInspector<String,DefaultEdge>( graph);\n\t\t\n\t\t\n\t\tBridge bridge= new Bridge();\n\t\tList<String> weaklyBridge =bridge.numberOfWeaklyBridge(graph, Listanodi, inspector.connectedSets().size());\n\t\tList<String> strongBridge =bridge.numberStrongBridge(graph, Listanodi, finder.stronglyConnectedSets().size());\n\t\t\n\t\tarticulationPoint artPoint = new articulationPoint();\n\t\tList<String> weaklyArtPoit = artPoint.numberOfWeaklyArticulationPoint(graph, Listanodi, inspector.connectedSets().size());\n\t\tList<String> strengthArtPoint = artPoint.numberOfStrongArticulationPoint(graph, Listanodi, finder.stronglyConnectedSets().size());\n\t\t\n\t\tBufferedWriter bw = null;\n\t\tFileWriter fw = null;\n\n\t\tcomponentiConnesse componenti = new componentiConnesse();\n\t\t\n\t\t\n\t\t double sum=0,average;\n\t\t List<Integer> temp = new ArrayList<Integer>();\n\t\t for(int i = 0; i<nodi ;i++){\n\t\t\ttemp.add(graph1.outdegree(i));\n\t\t\tsum= sum+graph1.outdegree(i); \n\t\t }\n\t\t average = sum/nodi;\n\t\t\n\t\t \n\t\t\n\t\t List<Double> ListOfneighbourdhood = new ArrayList<Double>();\n\t\t neighbourhood prova = new neighbourhood();\n\t\t ListOfneighbourdhood = prova.computeNeighbour(graph1, 10);\n\t\t\n\t\tcenter cent = new center();\n\t\t \n\t\t diameter d = new diameter();\n\t\t double diameter = d.effectiveDiamete(0.9, ListOfneighbourdhood);\n\t\t\n\t\t NeighbourhoodFunction n = new NeighbourhoodFunction();\n\t\tlong [] x = n.computeExact(graph1, 0, new ProgressLogger());\n\t\n\t\tdouble diametro =n.effectiveDiameter(0.9, n.compute(graph1,0,new ProgressLogger()));\n\t\t\n\t\tcloseness closeness = new closeness();\n\t\tbetweenness between = new betweenness();\n\t\tdegreeCentrality degree = new degreeCentrality();\n\t\tpageRankCentrality page = new pageRankCentrality();\n\t\t clusteringIndex cluster = new clusteringIndex();\n\t\t embeddednessIndex embe = new embeddednessIndex();\t\n\t\t dispersionCentrality disp = new dispersionCentrality();\t\t\n\n\t\t\n\t\ttry {\n\n\n\t\t\tfw = new FileWriter(path);\n\t\t\t\n\t\t\t\t\t\t\n\t\t\tbw = new BufferedWriter(fw);\n\t\t\t\n\t\t\t\n\t\t\tbw.write(\"Numero nodi: \"+nodi+\"\\r\\n\");\n\t\t\tbw.write(\"Numero archi: \"+archi+\"\\r\\n\");\n\t\t\tbw.write(\"Dimensione grafo: \"+ archi+\"\\r\\n\");\n\t\t\tbw.write(\"DensitÓ: \"+densitÓ+\"\\r\\n\");\n\t\t\tbw.write(\"Numero Componenti Connesse di un grafo: \"+componenti.computeWeakConnectedComponents(graph1)+\"\\r\\n\");\n\t\t\tbw.write(\"Numero Componenti Fortemente Connesse: \"+ componenti.computeStrongConnectedComponents(graph1)+\"\\r\\n\");\n\t\t\t\n\t\t\t bw.write(\"Numero Medio Grado Nodo: \"+ average+\"\\r\\n\");\n\t\t\t bw.write(\"Massimo: \"+ Collections.max(temp)+\"\\r\\n\");\n\t\t\t bw.write(\"Minimo:\"+ Collections.min(temp)+\"\\r\\n\");\n\t\t\t\n\t\t\t ParallelBreadthFirstVisit grafo = new ParallelBreadthFirstVisit(graph1, 0,false,null);\n\t\t\t for (int i=0 ; i< nodi ; i++){\n\t\t\t\t bw.write(\"Nodi visitati: \"+grafo.visit(i)+\"\\r\\n\");\n\n\t\t\t }\n\t\t\t \n\t\t\t bw.write(\"Lista vicinanza: \"+ListOfneighbourdhood+\"\\r\\n\");\n\t\t\t Date primaCenter = new Date();\n\t\t\t\tbw.write(\"Center of Graph: \"+ cent.getcenter(graph1)+\" tempo di esecuzione: \");\n\t\t\t\tDate dopoCenter = new Date();\n\t\t\t\tbw.write(dopoCenter.getTime()-primaCenter.getTime()+\" ms \\r\\n\");\n\t\t\t bw.write(\"effective diameter: \"+ diameter+\"\\r\\n\");\n\t\t\t\tfor ( int i=0 ; i< x.length;i++)\n\t\t\t\t\t bw.write(\"visitati i nodi x[\"+i+\"]: \"+x[i]+\"\\r\\n\" );\n\t\t\t bw.write(\"Diametro: \"+diametro+\"\\r\\n\");\n\t\t\t Date primaWBridge = new Date();\n\t\t\t bw.write(\"WeakBridge: \"+weaklyBridge+\" tempo di esecuzione: \");\n\t\t\t Date dopoWBridge = new Date();\n\t\t\t \n\t\t\tbw.write(dopoWBridge.getTime()-primaWBridge.getTime()+\" ms \\r\\n\");\n\t\t\t\n\t\t\tDate primaSBridge = new Date();\n\t\t\t bw.write(\"StrengtBridge: \"+strongBridge+\" tempo di esecuzione: \");\n\t\t\t Date dopoSBridge = new Date();\n\t\t\t\tbw.write(dopoSBridge.getTime()-primaSBridge.getTime()+\" ms \\r\\n\");\n\t\t\t\t\n\t\t\t\tDate primaWArt = new Date();\n\t\t\t bw.write(\"Weak ArticulationPoint: \"+weaklyArtPoit+\" tempo di esecuzione: \");\n\t\t\t Date dopoWArt = new Date();\n\t\t\t\tbw.write(dopoWArt.getTime()-primaWArt.getTime()+\" ms \\r\\n\");\n\n\t\t\t\tDate primaSArt = new Date();\n\t\t\t bw.write(\"Strengt ArticulationPoint: \"+strengthArtPoint+\" tempo di esecuzione: \");\n\t\t\t Date dopoSArt = new Date();\n\t\t\t\tbw.write(dopoSArt.getTime()-primaSArt.getTime()+\" ms \\r\\n\");\n\n\t\t\t \n\t\t\t bw.write(\"\\r\\n\\r\\n\\r\\n Indici di centralitÓ:\\r\\n\");\n\t\t\t\tDate primaCloseness = new Date();\n\t\t\t\tbw.write(\"Set Of Closeness: \"+closeness.computeCloseness(graph1)+\" tempo di esecuzione: \");\n\t\t\t\tDate dopoCloseness = new Date();\n\t\t\t\tbw.write(dopoCloseness.getTime()-primaCloseness.getTime()+\"ms \\r\\n\");\n\t\t\t\tDate primaBetweenness = new Date();\n\t\t\t\tbw.write(\"List of Betweenness: \"+ between.computeBetweenness(graph1)+\" tempo di esecuzione: \");\n\t\t\t\tDate dopoBetweenness = new Date();\n\t\t\t\tbw.write(dopoBetweenness.getTime()-primaBetweenness.getTime()+\"ms \\r\\n\");\n\t\t\t\t\n\t\t\t\tDate primaNBetweenness = new Date();\n\t\t\t\t\n\t\t\t\tbw.write(\"List of Normalized Betweenness: \"+between.normalize(between.computeBetweenness(graph1),nodi)+\" tempodiesecuzione: \");\n\t\t\t\tDate dopoNBetweenness= new Date();\n\t\t\t\tbw.write(dopoNBetweenness.getTime()-primaNBetweenness.getTime()+\"ms \\r\\n\");\n\n\t\t\t\tDate primaDegree = new Date();\n\t\t\t\tbw.write(\"Index of degree:\"+degree.computeDegreeCentrality(graph1)+\"\\r\\n\");\n\t\t\t\tDate dopoDegree = new Date();\n\t\t\t\tbw.write(dopoDegree.getTime()-primaDegree.getTime()+\"ms \\r\\n\");\n\t\t\t\t\n\t\t\t\tDate primaSDegree = new Date();\n\t\t\t\tbw.write(\"Index Degree centrality node: \"+degree.computeNodeDegree(graph1)+\" tempo dis esecuzione: \");\n\t\t\t\tDate dopoSDegree = new Date();\n\t\t\t\tbw.write(dopoSDegree.getTime()-primaSDegree.getTime()+\" ms \\r\\n\");\n\n\t\t\t\tDate primaPage = new Date();\n\t\t\t\tbw.write(\"Indice di Autovettore:\"+page.getPageRankIntex(page.computePageRankCentrality(graph1))+\" tempo di esecuzione: \");\n\t\t\t\tDate dopoPage = new Date();\n\t\t\t\tbw.write(dopoPage.getTime()-primaPage.getTime()+\"ms \\r\\n\");\n\n\t\t\t\tfor(int i=0 ; i<graph1.numNodes();i++)\n\t\t\t\tbw.write(\"Per il nodo:\"+i+\" il valore di Clustering Ŕ pari a :\"+cluster.clusterCoefficent(graph1, i)+\"\\r\\n\");\n\t\t\t\t\n\t\t\t\tDate primaCluster =new Date();\n\t\t\t\tbw.write(\"L'Indice di Clustering Ŕ pari a: \"+cluster.clusterIndex(graph1)+\" tempo di esecuzione: \");\n\t\t\t\tDate dopoCluster = new Date();\n\t\t\t\tbw.write(dopoCluster.getTime()-primaCluster.getTime()+\" ms \\r\\n\");\n\n\t\t\t\tDate primaEmb = new Date();\n\t\t\t\tbw.write(\"Embeddedness Index: \"+embe.computeEmbeddedness(graph1)+\" tempo di esecuzione: \");\n\t\t\t\tDate dopoEmb = new Date();\n\t\t\t\tbw.write(dopoEmb.getTime()-primaEmb.getTime()+\" ms \\r\\n\");\n\t\t\t\t\n\t\t\t\tDate primaDisp = new Date();\n\t\t\t\tbw.write(\"Dispersion Index:\" +disp.dispersionCentrality(graph1)+\" tempo di esecuzione: \");\n\t\t\t\tDate dopoDisp = new Date();\n\t\t\t\tbw.write(dopoDisp.getTime()-primaDisp.getTime()+\" ms \\r\\n\");\n\n\t\t\t\tSystem.out.println(\"Done\");\n\n\t\t} catch (IOException e) {\n\n\t\t\te.printStackTrace();\n\n\t\t} finally {\n\n\t\t\ttry {\n\n\t\t\t\tif (bw != null)\n\t\t\t\t\tbw.close();\n\n\t\t\t\tif (fw != null)\n\t\t\t\t\tfw.close();\n\n\t\t\t} catch (IOException ex) {\n\n\t\t\t\tex.printStackTrace();\n\n\t\t\t}\n\n\t\t}\n\t\t}\n\t}", "public static void main(String[] args) throws Exception {\n\t\t\n\t\tString magType = \"\";\n\t\tString resultsType = \"\";\n\t\tString timeZone = \"\";\n\t\tString pathToDataFile = \"\";\n\t\tString pathToResultsFile = \"\";\n\t\t\t\n\t\tString path = args[0];\n\t\t\n\t\ttry {\n\t\t\tFileReader fr = new FileReader(path);\n\t\t\tScanner sc = new Scanner(fr);\n\t\t\t\n\t\t\tmagType = sc.nextLine();\n\t\t\tresultsType = sc.nextLine();\n\t\t\ttimeZone = sc.nextLine();\n\t\t\tpathToDataFile = sc.nextLine();\n\t\t\tpathToResultsFile = sc.nextLine();\n\t\t\t\n\t\t\tsc.close();\n\t\t\tfr.close();\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(e.getMessage());\n\t\t}\n\t\t\t\n\t\t// choose between different types of magnetometer\n\t\tswitch(magType) { \n\t\tcase \"-pa\": // Pos1-aero\n\t\t\tPOSaero pa = new POSaero(timeZone);\n\t\t\tpa.getDataFromFile(pathToDataFile);\n\t\t\tpa.writeDataToFile(pathToResultsFile, resultsType, \"+00\");\t\n\t\t\tbreak;\n\t\tcase \"-pg\": // MMPOS \n\t\t\tMMPOS pg = new MMPOS(timeZone);\n\t\t\tpg.getDataFromFile(pathToDataFile);\n\t\t\tpg.writeDataToFile(pathToResultsFile, resultsType, \"+00\");\n\t\t\tbreak;\n\t\tcase \"-m\": // Minimag\n\t\t\tMinimag m = new Minimag(timeZone);\n\t\t\tm.getDataFromFile(pathToDataFile);\n\t\t\tm.writeDataToFile(pathToResultsFile, resultsType, \"+00\");\n\t\t\tbreak;\n\t\tcase \"-g\": // GEM\n\t\t\tGEM g = new GEM(timeZone);\n\t\t\tg.getDataFromFile(pathToDataFile);\n\t\t\tg.writeDataToFile(pathToResultsFile, resultsType, \"+00\");\n\t\t\tbreak;\n\t\tcase \"-mq\": // quantum (MVS)\n\t\t\tMVS mvs = new MVS(timeZone);\n\t\t\tmvs.getDataFromFile(pathToDataFile);\n\t\t\tmvs.writeDataToFile(pathToResultsFile, resultsType, \"+00\");\n\t\t\tbreak;\n\t\tcase \"-gs\": // Geoscan\n\t\t\tGeoscan gs = new Geoscan(timeZone);\n\t\t\tgs.getDataFromFile(pathToDataFile);\n\t\t\tgs.writeDataToFile(pathToResultsFile, resultsType, \"+00\");\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tSystem.out.println(\"Wrong type of magnetometer\");\n\t\t}\n\t}", "private void analysisText(){\n\n FileOutput fout = null;\n if(this.fileNumberingSet){\n fout = new FileOutput(this.outputFilename, 'n');\n }\n else{\n fout = new FileOutput(this.outputFilename);\n }\n\n // perform PCA if not already performed\n if(!pcaDone)this.pca();\n if(!this.monteCarloDone)this.monteCarlo();\n\n // output title\n fout.println(\"PRINCIPAL COMPONENT ANALYSIS\");\n fout.println(\"Program: PCA - Analysis Output\");\n for(int i=0; i<this.titleLines; i++)fout.println(title[i]);\n Date d = new Date();\n String day = DateFormat.getDateInstance().format(d);\n String tim = DateFormat.getTimeInstance().format(d);\n fout.println(\"Program executed at \" + tim + \" on \" + day);\n fout.println();\n if(this.covRhoOption){\n fout.println(\"Covariance matrix used\");\n }\n else{\n fout.println(\"Correlation matrix used\");\n }\n fout.println();\n\n // output eigenvalue table\n // field width\n int field1 = 10;\n int field2 = 12;\n int field3 = 2;\n\n fout.println(\"ALL EIGENVALUES\");\n\n fout.print(\"Component \", field1);\n fout.print(\"Unordered \", field1);\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"Proportion \", field2);\n fout.print(\"Cumulative \", field2);\n fout.println(\"Difference \");\n\n fout.print(\" \", field1);\n fout.print(\"index\", field1);\n fout.print(\" \", field2);\n fout.print(\"as % \", field2);\n fout.print(\"percentage \", field2);\n fout.println(\" \");\n\n\n\n for(int i=0; i<this.nItems; i++){\n fout.print(i+1, field1);\n fout.print((this.eigenValueIndices[i]+1), field1);\n fout.print(Fmath.truncate(this.orderedEigenValues[i], this.trunc), field2);\n fout.print(Fmath.truncate(this.proportionPercentage[i], this.trunc), field2);\n fout.print(Fmath.truncate(this.cumulativePercentage[i], this.trunc), field2);\n if(i<this.nItems-1){\n fout.print(Fmath.truncate((this.orderedEigenValues[i] - this.orderedEigenValues[i+1]), this.trunc), field2);\n }\n else{\n fout.print(\" \", field2);\n }\n fout.print(\" \", field3);\n\n fout.println();\n }\n fout.println();\n\n\n // Extracted components\n int nMax = this.greaterThanOneLimit;\n if(nMax<this.meanCrossover)nMax=this.meanCrossover;\n if(nMax<this.percentileCrossover)nMax=this.percentileCrossover;\n fout.println(\"EXTRACTED EIGENVALUES\");\n fout.print(\" \", field1);\n fout.print(\"Greater than unity\", 3*field2 + field3);\n fout.print(\"Greater than Monte Carlo Mean \", 3*field2 + field3);\n fout.println(\"Greater than Monte Carlo Percentile\");\n\n fout.print(\"Component \", field1);\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"Proportion \", field2);\n fout.print(\"Cumulative \", field2);\n fout.print(\" \", field3);\n\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"Proportion \", field2);\n fout.print(\"Cumulative \", field2);\n fout.print(\" \", field3);\n\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"Proportion \", field2);\n fout.print(\"Cumulative \", field2);\n fout.println(\" \");\n\n fout.print(\" \", field1);\n fout.print(\" \", field2);\n fout.print(\"as % \", field2);\n fout.print(\"percentage \", field2);\n fout.print(\" \", field3);\n\n fout.print(\" \", field2);\n fout.print(\"as % \", field2);\n fout.print(\"percentage \", field2);\n fout.print(\" \", field3);\n\n fout.print(\" \", field2);\n fout.print(\"as % \", field2);\n fout.print(\"percentage \", field2);\n fout.println(\" \");\n\n int ii=0;\n while(ii<nMax){\n fout.print(ii+1, field1);\n\n if(ii<this.greaterThanOneLimit){\n fout.print(Fmath.truncate(this.orderedEigenValues[ii], this.trunc), field2);\n fout.print(Fmath.truncate(this.proportionPercentage[ii], this.trunc), field2);\n fout.print(Fmath.truncate(this.cumulativePercentage[ii], this.trunc), (field2+field3));\n }\n\n if(ii<this.meanCrossover){\n fout.print(Fmath.truncate(this.orderedEigenValues[ii], this.trunc), field2);\n fout.print(Fmath.truncate(this.proportionPercentage[ii], this.trunc), field2);\n fout.print(Fmath.truncate(this.cumulativePercentage[ii], this.trunc), (field2+field3));\n }\n\n if(ii<this.percentileCrossover){\n fout.print(Fmath.truncate(this.orderedEigenValues[ii], this.trunc), field2);\n fout.print(Fmath.truncate(this.proportionPercentage[ii], this.trunc), field2);\n fout.print(Fmath.truncate(this.cumulativePercentage[ii], this.trunc));\n }\n fout.println();\n ii++;\n }\n fout.println();\n\n\n fout.println(\"PARALLEL ANALYSIS\");\n fout.println(\"Number of simulations = \" + this.nMonteCarlo);\n if(this.gaussianDeviates){\n fout.println(\"Gaussian random deviates used\");\n }\n else{\n fout.println(\"Uniform random deviates used\");\n }\n fout.println(\"Percentile value used = \" + this.percentile + \" %\");\n\n fout.println();\n fout.print(\"Component \", field1);\n fout.print(\"Data \", field2);\n fout.print(\"Proportion \", field2);\n fout.print(\"Cumulative \", field2);\n fout.print(\" \", field3);\n fout.print(\"Data \", field2);\n fout.print(\"Monte Carlo \", field2);\n fout.print(\"Monte Carlo \", field2);\n fout.println(\"Monte Carlo \");\n\n fout.print(\" \", field1);\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"as % \", field2);\n fout.print(\"percentage \", field2);\n fout.print(\" \", field3);\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"Eigenvalue \", field2);\n fout.print(\"Eigenvalue \", field2);\n fout.println(\"Eigenvalue \");\n\n fout.print(\" \", field1);\n fout.print(\" \", field2);\n fout.print(\" \", field2);\n fout.print(\" \", field2);\n fout.print(\" \", field3);\n fout.print(\" \", field2);\n fout.print(\"Percentile \", field2);\n fout.print(\"Mean \", field2);\n fout.println(\"Standard Deviation \");\n\n for(int i=0; i<this.nItems; i++){\n fout.print(i+1, field1);\n fout.print(Fmath.truncate(this.orderedEigenValues[i], this.trunc), field2);\n fout.print(Fmath.truncate(this.proportionPercentage[i], this.trunc), field2);\n fout.print(Fmath.truncate(this.cumulativePercentage[i], this.trunc), field2);\n fout.print(\" \", field3);\n fout.print(Fmath.truncate(this.orderedEigenValues[i], this.trunc), field2);\n fout.print(Fmath.truncate(this.randomEigenValuesPercentiles[i], this.trunc), field2);\n fout.print(Fmath.truncate(this.randomEigenValuesMeans[i], this.trunc), field2);\n fout.println(Fmath.truncate(this.randomEigenValuesSDs[i], this.trunc));\n }\n fout.println();\n\n // Correlation Matrix\n fout.println(\"CORRELATION MATRIX\");\n fout.println(\"Original component indices in parenthesis\");\n fout.println();\n fout.print(\" \", field1);\n fout.print(\"component\", field1);\n for(int i=0; i<this.nItems; i++)fout.print((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\", field2);\n fout.println();\n fout.println(\"component\");\n for(int i=0; i<this.nItems; i++){\n fout.print((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\", 2*field1);\n for(int j=0; j<this.nItems; j++)fout.print(Fmath.truncate(this.correlationMatrix.getElement(j,i), this.trunc), field2);\n fout.println();\n }\n fout.println();\n\n // Covariance Matrix\n fout.println(\"COVARIANCE MATRIX\");\n fout.println(\"Original component indices in parenthesis\");\n fout.println();\n fout.print(\" \", field1);\n fout.print(\"component\", field1);\n for(int i=0; i<this.nItems; i++)fout.print((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\", field2);\n fout.println();\n fout.println(\"component\");\n for(int i=0; i<this.nItems; i++){\n fout.print((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\", 2*field1);\n for(int j=0; j<this.nItems; j++)fout.print(Fmath.truncate(this.covarianceMatrix.getElement(j,i), this.trunc), field2);\n fout.println();\n }\n\n fout.println();\n\n // Eigenvectors\n fout.println(\"EIGENVECTORS\");\n fout.println(\"Original component indices in parenthesis\");\n fout.println(\"Vector corresponding to an ordered eigenvalues in each row\");\n fout.println();\n fout.print(\" \", field1);\n fout.print(\"component\", field1);\n for(int i=0; i<this.nItems; i++)fout.print((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\", field2);\n fout.println();\n fout.println(\"component\");\n for(int i=0; i<this.nItems; i++){\n fout.print((i+1) + \" (\" + (this.eigenValueIndices[i]+1) + \")\", 2*field1);\n for(int j=0; j<this.nItems; j++)fout.print(Fmath.truncate(this.orderedEigenVectorsAsRows[i][j], this.trunc), field2);\n fout.println();\n }\n fout.println();\n\n // Loading factors\n fout.println(\"LOADING FACTORS\");\n fout.println(\"Original indices in parenthesis\");\n fout.println(\"Loading factors corresponding to an ordered eigenvalues in each row\");\n fout.println();\n fout.print(\" \", field1);\n fout.print(\"component\", field1);\n for(int i=0; i<this.nItems; i++)fout.print((this.eigenValueIndices[i]+1) + \" (\" + (i+1) + \")\", field2);\n fout.print(\" \", field1);\n fout.print(\"Eigenvalue\", field2);\n fout.print(\"Proportion\", field2);\n fout.println(\"Cumulative %\");\n fout.println(\"factor\");\n for(int i=0; i<this.nItems; i++){\n fout.print((i+1) + \" (\" + (this.eigenValueIndices[i]+1) + \")\", 2*field1);\n for(int j=0; j<this.nItems; j++)fout.print(Fmath.truncate(this.loadingFactorsAsRows[i][j], this.trunc), field2);\n fout.print(\" \", field1);\n fout.print(Fmath.truncate(this.orderedEigenValues[i], this.trunc), field2);\n fout.print(Fmath.truncate(proportionPercentage[i], this.trunc), field2);\n fout.println(Fmath.truncate(cumulativePercentage[i], this.trunc));\n }\n fout.println();\n\n // Rotated loading factors\n fout.println(\"ROTATED LOADING FACTORS\");\n if(this.varimaxOption){\n fout.println(\"NORMAL VARIMAX\");\n }\n else{\n fout.println(\"RAW VARIMAX\");\n }\n\n String message = \"The ordered eigenvalues with Monte Carlo means and percentiles in parenthesis\";\n message += \"\\n (Total number of eigenvalues = \" + this.nItems + \")\";\n int nDisplay = this.nItems;\n Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();\n int screenHeight = screenSize.height;\n int nDisplayLimit = 20*screenHeight/800;\n if(nDisplay>nDisplay)nDisplay = nDisplayLimit;\n for(int i=0; i<nDisplay; i++){\n message += \"\\n \" + Fmath.truncate(this.orderedEigenValues[i], 4) + \" (\" + Fmath.truncate(this.randomEigenValuesMeans[i], 4) + \" \" + Fmath.truncate(this.randomEigenValuesPercentiles[i], 4) + \")\";\n }\n if(nDisplay<this.nItems)message += \"\\n . . . \";\n message += \"\\nEnter number of eigenvalues to be extracted\";\n int nExtracted = this.greaterThanOneLimit;\n nExtracted = Db.readInt(message, nExtracted);\n this.varimaxRotation(nExtracted);\n\n fout.println(\"Varimax rotation for \" + nExtracted + \" extracted factors\");\n fout.println(\"Rotated loading factors and eigenvalues scaled to ensure total 'rotated variance' matches unrotated variance for the extracted factors\");\n fout.println(\"Original indices in parenthesis\");\n fout.println();\n fout.print(\" \", field1);\n fout.print(\"component\", field1);\n for(int i=0; i<this.nItems; i++)fout.print((this.rotatedIndices[i]+1) + \" (\" + (i+1) + \")\", field2);\n fout.print(\" \", field1);\n fout.print(\"Eigenvalue\", field2);\n fout.print(\"Proportion\", field2);\n fout.println(\"Cumulative %\");\n fout.println(\"factor\");\n\n for(int i=0; i<nExtracted; i++){\n fout.print((i+1) + \" (\" + (rotatedIndices[i]+1) + \")\", 2*field1);\n for(int j=0; j<this.nItems; j++)fout.print(Fmath.truncate(this.rotatedLoadingFactorsAsRows[i][j], this.trunc), field2);\n fout.print(\" \", field1);\n fout.print(Fmath.truncate(rotatedEigenValues[i], this.trunc), field2);\n fout.print(Fmath.truncate(rotatedProportionPercentage[i], this.trunc), field2);\n fout.println(Fmath.truncate(rotatedCumulativePercentage[i], this.trunc));\n }\n fout.println();\n\n fout.println(\"DATA USED\");\n fout.println(\"Number of items = \" + this.nItems);\n fout.println(\"Number of persons = \" + this.nPersons);\n\n\n if(this.originalDataType==0){\n fout.printtab(\"Item\");\n for(int i=0; i<this.nPersons; i++){\n fout.printtab(i+1);\n }\n fout.println();\n for(int i=0; i<this.nItems; i++){\n fout.printtab(this.itemNames[i]);\n for(int j=0; j<this.nPersons; j++){\n fout.printtab(Fmath.truncate(this.scores0[i][j], this.trunc));\n }\n fout.println();\n }\n }\n else{\n fout.printtab(\"Person\");\n for(int i=0; i<this.nItems; i++){\n fout.printtab(this.itemNames[i]);\n }\n fout.println();\n for(int i=0; i<this.nPersons; i++){\n fout.printtab(i+1);\n for(int j=0; j<this.nItems; j++){\n fout.printtab(Fmath.truncate(this.scores1[i][j], this.trunc));\n }\n fout.println();\n }\n }\n\n fout.close();\n }", "public static void main(String[] args) {\n\t\tif (args.length != 2) {\n\t\t\tSystem.err.println(\"This program requires two parameters, not \"+args.length+\". The first is a training file and the second is a data file.\");\n\t\t\tSystem.exit(-1);\n\t\t}\n\t\tDecisionLearningTree dt = new DecisionLearningTree(args[0],args[1]);\n\t\tList<String> rs = dt.useBaselineClassifierOnData(); //dt.useTreeOnData();\n\t\tfor (String r : rs) {\n\t\t\tSystem.out.println(r);\n\t\t}\n\t\tSystem.out.println(\"==========================================================\");\n\t\tSystem.out.println(\"Reporting tree:\");\n\t\tdt.report();\t\t\n\t}", "public static void main(String[] args) throws Exception{\n\t\tString filepath = \"data/sorce.txt\";\n\t\tDataModel model = new FileDataModel(new File(filepath));\n\t\tRecommenderIRStatsEvaluator evaluator = new GenericRecommenderIRStatsEvaluator();\n\t\tRecommenderBuilder builder = new RecommenderBuilder(){\n\t\t\t@Override\n\t\t\tpublic Recommender buildRecommender(DataModel model)\n\t\t\t\t\tthrows TasteException {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\tUserSimilarity similarity = new EuclideanDistanceSimilarity(model);\n\t\t\t\tUserNeighborhood neighbor = new NearestNUserNeighborhood(80, similarity, model);\n\t\t\t\treturn \n\t\t\t\tnew GenericUserBasedRecommender(model, neighbor, similarity);\n//\t\t\t\tnew SlopeOneRecommender(model);\n\t\t\t\t}\n\t\t\t};\n\t\t\tlong startTime = System.currentTimeMillis();\n\t\t\tIRStatistics stats = evaluator.evaluate(builder, null, model, null, 20,GenericRecommenderIRStatsEvaluator.CHOOSE_THRESHOLD,1.0);\n\t\t\tlong endTime = System.currentTimeMillis();\n\t\t\tdouble precision = stats.getPrecision();\n\t\t\tdouble recall = stats.getRecall();\n\t\t\tdouble accuracy = 2*precision*recall/(precision+recall);\n\t\t\tSystem.out.println(precision+\"---\"+recall+\"---\"+new DecimalFormat(\"0.000000\").format(accuracy));\n\t\t\tSystem.out.println(\"程序运行时间:\"+(endTime-startTime)+\"ms\");\n\t\t}", "public void run() throws Exception {\r\n\r\n\r\n LibSVM svm = new LibSVM();\r\n String svmOptions = \"-S 0 -K 2 -C 8 -G 0\"; //Final result: [1, -7 for saveTrainingDataToFileHybridSampling2 ]\r\n svm.setOptions(weka.core.Utils.splitOptions(svmOptions));\r\n System.out.println(\"SVM Type and Keranl Type= \" + svm.getSVMType() + svm.getKernelType());//1,3 best result 81%\r\n // svm.setNormalize(true);\r\n\r\n\r\n// load training data from .arff file\r\n ConverterUtils.DataSource source = new ConverterUtils.DataSource(\"C:\\\\Users\\\\hp\\\\Desktop\\\\SVM implementation\\\\arffData\\\\balancedTrainingDataUSSMOTE464Random.arff\");\r\n System.out.println(\"\\n\\nLoaded data:\\n\\n\" + source.getDataSet());\r\n Instances dataFiltered = source.getDataSet();\r\n dataFiltered.setClassIndex(0);\r\n\r\n // gridSearch(svm, dataFiltered);\r\n Evaluation evaluation = new Evaluation(dataFiltered);\r\n evaluation.crossValidateModel(svm, dataFiltered, 10, new Random(1));\r\n System.out.println(evaluation.toSummaryString());\r\n System.out.println(evaluation.weightedAreaUnderROC());\r\n double[][] confusionMatrix = evaluation.confusionMatrix();\r\n for (int i = 0; i < 2; i++) {\r\n for (int j = 0; j < 2; j++) {\r\n System.out.print(confusionMatrix[i][j] + \" \");\r\n\r\n }\r\n System.out.println();\r\n }\r\n System.out.println(\"accuracy for crime class= \" + (confusionMatrix[0][0] / (confusionMatrix[0][1] + confusionMatrix[0][0])) * 100 + \"%\");\r\n System.out.println(\"accuracy for other class= \" + (confusionMatrix[1][1] / (confusionMatrix[1][1] + confusionMatrix[1][0])) * 100 + \"%\");\r\n System.out.println(\"accuracy for crime class= \" + evaluation.truePositiveRate(0) + \"%\");\r\n System.out.println(\"accuracy for other class= \" + evaluation.truePositiveRate(1) + \"%\");\r\n\r\n\r\n }", "public static void main(String[] args) {\n\t\tString filename = \"/home/niran/eclipse-workspace/DataMining/AggregateDiscretizeAndSample/src/Input.csv\";\n\t\tString outFilename = \"/home/niran/eclipse-workspace/DataMining/AggregateDiscretizeAndSample/Output.csv\";\n\t\tString delimiter = \",\";\n\t\tCSV csv = new CSV(filename, delimiter);\n\t\tcsv.readCSV();\n\t\tcsv.printCSV();\n\t\tAggregate a = new Aggregate(csv);\n\t\tcsv = a.doAggregate(1);\n\t\tcsv.printCSV();\n\t\tDiscretize d = new Discretize(csv);\n\t\tcsv = d.doDiscretize(1);\n\t\tcsv.printCSV();\n\t\tStratifiedSampling ss = new StratifiedSampling(csv);\n\t\tcsv = ss.doSample();\n\t\tcsv.printCSV();\n\t\tcsv.writeCSV(outFilename);\n\t}", "@Test\n public void shouldRunJob() {\n new DatasetChallenge(\"file:///tmp/yelp_academic_dataset_business.json.gz\").run(spark);\n }", "public static void main(String[] args) throws IOException {\n\t\tString outPath = \"/home/sujay/Documents/FilesFromJavaCode/output/\";\n\t\tString inPath = \"/home/sujay/Documents/FilesFromJavaCode/input/\";\n\n\t\t// folder name need to generate\n\t\t// (At run time, based on selected company or selected Account number)\n\t\tString floder = \"1116884005_FEB-2020\";\n\n\t\t// Output path to create new folder and copy the file(s)\n\t\tString destPath = outPath + floder;\n\n\t\t// Creating a File object\n\t\tFile file = new File(destPath);\n\n\t\t// Checking is particular folder exist or not\n\t\tif (!file.exists()) {\n\t\t\t// Creating the directory, if not exist\n\t\t\tfile.mkdir();\n\t\t}\n\n\t\t// from path mention from yml file and file name have to be declare\n\t\tFile from = null;\n\t\tFile dest = null;\n\t\tint fileNum = 1;\n\t\tfor (int i = 1; i <= fileNum; i++) {\n\t\t\tfrom = new File(inPath + \"example-\" + i + \".csv\");\n\t\t\tdest = new File(destPath + \"/example-\" + i + \".csv\");\n\t\t\t// File exists copy from source to destination path else send error message\n\t\t\tif (from.exists()) {\n\t\t\t\tcopyFileSourceToDestination(from, dest);\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"From File is not exist & throw an Exception\");\n\t\t\t}\n\t\t}\n\t\tZipFolder2 zipFolder = new ZipFolder2();\n\t\tzipFolder.generateZipFile(destPath,destPath);\n\t}", "static void createDataForGraph() {\n double x = 2;\n String fileName = \"./lab1part2docs/dataRec.csv\";\n createFile(fileName);\n writeToFile(\"k,halfCounter,oneCounter,x=\" + x + \"\\n\", fileName);\n for (int k = 1; k <= 10000; k++) {\n Raise.runBoth(x, k);\n writeToFile(k + \",\" + Raise.recHalfCounter + \",\" + Raise.recOneCounter + '\\n', fileName);\n Raise.recHalfCounter = 0;\n Raise.recOneCounter = 0;\n }\n System.out.println(\"Finished\");\n }", "public static void main(String[] args) throws IOException {\n\t\t\n\t\tString folder = \"/Users/haopeng/Dropbox/research/2nd/Usecase/Yanlei/\";\n\t\tString fileName = \"P0_2324.txt\";\n\t\t\n\t\tFileReader reader = new FileReader(folder + fileName, 20000000);\n\t\treader.parseFile();\n\t\t\n\t\t//reader.printValues(reader.getServerName(), \"ServerName\");\n\t\t//reader.printValues(reader.getCommand(), \"Command\");\n\t\t//reader.printValues(reader.getTimestamp(), \"Timestamp\"); \n\t\t//reader.printValues(reader.getPath(), \"Path\");\n\t\treader.printValues(reader.getMethod(), \"Method\");\n\t}", "private void convertScenarioResults(ArrayList<String> testcases, ArrayList<String> blocktests, String file, String testrun) {\n \t\t\ttry {\t\t\n \t\t\t\tFileWriter writer = new FileWriter(\"C:/JenkinsSlave/Results/Executed - \"+testrun+\".xml\");\n \t\t\t\tFile tr = new File(file+\".mxlog\");\t \n \t\t\t DocumentBuilder db;\n \t\t \tDocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\n \t\t\t\tdb = dbf.newDocumentBuilder();\n \t\t\t\tDocument doc = db.parse(tr);\n \t\t\t doc.getDocumentElement().normalize();\n \t\t\t XPath xpath = XPathFactory.newInstance().newXPath();\n \t\t\t XPathExpression xExpress = xpath.compile(\"//Str\");\n \t\t\t NodeList nl = (NodeList) xExpress.evaluate(doc, XPathConstants.NODESET);\n \t\t\t ArrayList<String> ciao = new ArrayList<String>();\n \t\t\t if(nl != null){\n \t\t\t \twriter.write(\"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\");\n \t\t\t\t\twriter.write(\"<testsuite>\\n\");\n \t\t\t\t int index=0;\n \t\t\t\t for(String testcase: testcases){\n \t\t\t\t \twriter.write(\"\\t<testcase classname=\\\"TC\\\" name=\\\"\"+testcase+\"\\\">\\n\");\n \t\t\t\t \tString testo=nl.item(index).getTextContent();\n \t\t\t\t \twhile(!testo.startsWith(\"Post \")){\n \t\t\t\t \t\tindex++;\n \t\t\t\t \t\ttesto=nl.item(index).getTextContent();\n \t\t\t\t \t}\n \t\t\t\t\t\t\tif(testo.substring(testo.lastIndexOf(\" \")+1).equals(\"passed.\")){\n \t\t\t\t\t\t\t\twriter.write(\"\\t</testcase>\\n\");\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\telse if(testo.substring(testo.lastIndexOf(\" \")+1).equals(\"failed.\")){\n \t\t\t\t\t\t\t\twriter.write(\"\\t\\t<failure>\\n\\t\\t\\tTest Case was evaluated as failed\\n\\t\\t</failure>\\n\");\n \t\t\t\t\t\t\t\twriter.write(\"\\t</testcase>\\n\");\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tindex++;\n \t\t\t\t \t}\n \t\t\t\t for(String block: blocktests){\n \t\t\t\t \twriter.write(\"\\t<testcase classname=\\\"TC\\\" name=\\\"\"+block+\"\\\">\\n\");\n \t\t\t\t \twriter.write(\"\\t\\t<error>\\n\\t\\t\\tTest Case not found\\n\\t\\t</error>\\n\");\n \t\t\t\t\t\twriter.write(\"\\t</testcase>\\n\");\n \t\t\t\t }\n \t\t\t\t\t\t\n \t\t\t\t\t\n \t\t\t\t\twriter.write(\"</testsuite>\\n\");\n \t\t\t\t\twriter.flush();\n \t\t\t\t\twriter.close();\n \t\t\t }else{\n \t\t\t \tContactPolarion(listener);\n \t\t\t }\n \t\t\t\t \n \t\t\t\t}catch(Exception e){\n \t\t\t\t\tContactPolarion(listener);\n \t\t\t\t\tlistener.getLogger().println(e.getMessage());\n \t\t\t\t}\n\t\t\t}", "public static void DatasetAndQueryToFiles(double d, double e) throws IOException {\r\n\t\tReadInDataset.readDATFile(\"C:/Users/pigko/Downloads/driftdataset/batch1.dat\");\r\n\t\tReadInDataset.readDATFile(\"C:/Users/pigko/Downloads/driftdataset/batch2.dat\");\r\n\t\tReadInDataset.readDATFile(\"C:/Users/pigko/Downloads/driftdataset/batch3.dat\");\r\n\t\tReadInDataset.readDATFile(\"C:/Users/pigko/Downloads/driftdataset/batch4.dat\");\r\n\t\tReadInDataset.readDATFile(\"C:/Users/pigko/Downloads/driftdataset/batch5.dat\");\r\n\t\tReadInDataset.readDATFile(\"C:/Users/pigko/Downloads/driftdataset/batch6.dat\");\r\n\t\tReadInDataset.findMinAndMax();\r\n\t\tReadInDataset.finalizeDataset();\r\n\t\tReadInDataset.writeToFile2(\"FinalDataset\"+\".arff\",ReadInDataset.finalDataset); //write down the used dataset\r\n\t\tquery=assignScoreToQueries(); //assign the scores to queries\r\n\t\ttrainQueries=takeTrainingQuerySet(query,d);\r\n\t\ttestQueries=takeTestingQuerySet(query,e,d);\r\n\t\tscoreToFile(Queries.NumberOfDimensions, trainQueries, \"TrainScoreSet.arff\"); //write down the queries with the scores\r\n\t\tscoreToFile(Queries.NumberOfDimensions, testQueries, \"TestScoreSet.arff\"); //write down the queries with the scores\r\n\t//\tqueryAndDataToCSV(); // this produces a graph with both queries and the dataset, not needded right now\r\n\t\twriteQueriesToCSV(testQueries, \"test\"); \r\n\t\twriteQueriesToCSV(trainQueries, \"train\"); \r\n\t}", "@Test\n public void test25() throws Throwable {\n try {\n CostMatrix costMatrix0 = Evaluation.handleCostOption(\" // can classifier handle the data?\\n\", (-1802));\n fail(\"Expecting exception: Exception\");\n \n } catch(Exception e) {\n //\n // Can't open file null.\n //\n }\n }", "public static void main(String[] args){\n \n String loginResponse = \"\";\n String jSessionID = \"\";\n String jsonData = \"\";\n String csvData = \"\";\n String writeToFileOutput = \"\";\n // Change the baseURL to your own jira server's address and port number\n // Note: adding \"rest/\" at the end may not be necessary in your \n // environment\n String baseURL = \"http://ec2-18-235-248-253.compute-1.amazonaws.com:2990/jira/rest/\";\n String loginURL = \"auth/1/session\";\n String biExportURL = \"getbusinessintelligenceexport/1.0/message\";\n // The analysisStartData and analysisEndDate specify an inclusive\n // period over time over which you want to extract issues that \n // have been either added or updated.\n String analysisStartDate = \"01-DEC-18\";\n String analysisEndDate = \"31-DEC-18\";\n // The loginUserName and loginPassWord are the credentials for a user\n // who has permission to view the issues that you wish to export.\n String loginUserName = \"admin\";\n String loginPassWord = \"admin\";\n boolean errorsOccurred = false;\n String exportDirectory = \"./downloads/\";\n \n if(!errorsOccurred)\n {\n loginResponse = loginToJira(baseURL, loginURL, loginUserName, loginPassWord);\n if(loginResponse == \"ERROR\") { errorsOccurred = true; }\n }\n if(!errorsOccurred)\n {\n jSessionID = parseJSessionID(loginResponse);\n if(jSessionID == \"ERROR\") { errorsOccurred = true; }\n }\n if(!errorsOccurred)\n {\n jsonData = getJsonData(baseURL, biExportURL, jSessionID, analysisStartDate, analysisEndDate);\n if(jsonData == \"ERROR\") { errorsOccurred = true; }\n }\n if(!errorsOccurred)\n {\n csvData = formatAsCSV(jsonData);\n if(csvData == \"ERROR\") { errorsOccurred = true; }\n }\n if(!errorsOccurred)\n {\n writeToFileOutput = writeToFile(csvData, exportDirectory);\n if(writeToFileOutput == \"ERROR\") { errorsOccurred = true; }\n }\n if(!errorsOccurred)\n {\n System.out.println(\"SUCCESS\");\n } else {\n System.out.println(\"FAILURE\");\n }\n }" ]
[ "0.8153445", "0.64745", "0.62991", "0.62346745", "0.6008048", "0.5967826", "0.5953829", "0.5943551", "0.5921406", "0.5888782", "0.58416873", "0.58371484", "0.5822153", "0.5819506", "0.57948023", "0.5768725", "0.5765001", "0.5751401", "0.575135", "0.5723467", "0.56845355", "0.56820637", "0.5673518", "0.56732804", "0.56606674", "0.5652929", "0.5637438", "0.5637102", "0.56193787", "0.5611293", "0.5604406", "0.55981964", "0.5581379", "0.55549985", "0.55526316", "0.5541015", "0.55409867", "0.5534524", "0.55336463", "0.55331504", "0.55312616", "0.5526117", "0.55194116", "0.551883", "0.55147105", "0.55056715", "0.5499193", "0.54958445", "0.5486982", "0.54825735", "0.5480055", "0.5473857", "0.54610044", "0.5450454", "0.5436897", "0.54330766", "0.5426863", "0.5420126", "0.5419229", "0.54156697", "0.54141796", "0.54008293", "0.5398434", "0.5397301", "0.5395575", "0.53849024", "0.53825825", "0.5380668", "0.5380027", "0.53799284", "0.5373072", "0.536523", "0.53591174", "0.53536", "0.5347132", "0.5344856", "0.533943", "0.53345406", "0.5328175", "0.53244454", "0.5322627", "0.53218234", "0.5321367", "0.5320122", "0.53126913", "0.53097606", "0.53045964", "0.52998954", "0.5298839", "0.5297256", "0.52967894", "0.5295931", "0.5293302", "0.5291795", "0.5289225", "0.5279744", "0.5277088", "0.5272304", "0.5270501", "0.5266315" ]
0.71677953
1
getter for local Handler
public Handler getHandler() { return this.serverHandler; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Handler getHandler();", "public Handler getHandler() {\r\n return handler;\r\n }", "public Handler getHandler() {\r\n return handler;\r\n }", "@Override\n\tpublic Handler getHandler() {\n\t\treturn mHandler;\n\t}", "public Handler getHandler() {\n return mHandler;\n }", "public String getHandler() {\n return handler;\n }", "public Handler getHandler() {\n return this.mHandler;\n }", "static synchronized Handler getHandler() {\n checkState();\n return sInstance.mHandler;\n }", "public Handler getHandler() {\n return null;\n }", "Handler getHandler() {\n return getEcologyLooper().getHandler();\n }", "@Override\n\tpublic Handler getHandler() {\n\t\t// TODO Auto-generated method stub\n\t\treturn mHandler;\n\t}", "@ClientConfig(JsonMode.Function)\n\r\n\tpublic Object getHandler () {\r\n\t\treturn (Object) getStateHelper().eval(PropertyKeys.handler);\r\n\t}", "HandlerHelper getHandlerHelper() {\n return handlerHelper;\n }", "public int getHandler() {\n\t\treturn 1;\n\t}", "public MainThreadExecutor getHandler() {\n return handler;\n }", "public Class<?> getHandler();", "default Handler asHandler() {\n return new HandlerBuffer(this);\n }", "protected Object getHandlerInternal(HttpServletRequest request) {\n String lookupPath = WebUtils.getLookupPathForRequest(request, this.alwaysUseFullPath);\n logger.debug(\"Looking up handler for: \" + lookupPath);\n return lookupHandler(lookupPath);\n }", "static Handler getCallbackHandler() {\n return sCallbackHandler;\n }", "Handler getHandler(final String handlerName);", "@JsonProperty(value = \"Handler\")\n public String getHandler() {\n return this.Handler;\n }", "private Handler getHandler(Request request) {\n return resolver.get(request.getClass().getCanonicalName()).create();\n }", "private synchronized Handler getCustomHandler( ) {\n if( (customHandler != null ) \n ||(customHandlerError) ) \n {\n return customHandler;\n }\n LogService logService = getLogService( );\n if( logService == null ) {\n return null;\n }\n String customHandlerClassName = null;\n try {\n customHandlerClassName = logService.getLogHandler( );\n\n customHandler = (Handler) getInstance( customHandlerClassName );\n // We will plug in our UniformLogFormatter to the custom handler\n // to provide consistent results\n if( customHandler != null ) {\n customHandler.setFormatter( new UniformLogFormatter(componentManager.getComponent(Agent.class)) );\n }\n } catch( Exception e ) {\n customHandlerError = true; \n new ErrorManager().error( \"Error In Initializing Custom Handler \" +\n customHandlerClassName, e, ErrorManager.GENERIC_FAILURE );\n }\n return customHandler;\n }", "public AsyncHandler getAsyncHandler() {\n return asyncHandler;\n }", "public Handler waitAndGetHandler() {\n waitUntilStarted();\n return getHandler();\n }", "public CommandHandler getHandler() {\n\t\treturn handler;\n\t}", "public NodeHandler getNodeHandler () {\n return nodeHandler;\n }", "BodyHandler getBodyHandler();", "public final String getHandlerId() {\n return prefix;\n }", "public InstructionHandle getHandlerStart() {\n return handlerPc;\n }", "public int getCurrentStateHandler() {\n return _currentStateHandler;\n }", "public InputHandler getInputHandler() {\n return inputHandler;\n }", "public InputHandler getInputHandler() {\n return inputHandler;\n }", "private Handler getConnectorHandler() {\n return connectorHandler;\n }", "static String getHandler(HttpServletRequest request) {\n String requestURI = request.getRequestURI();\n return requestURI.substring(getDividingIndex(requestURI) + 1);\n }", "protected Object lookupHandler(String urlPath, HttpServletRequest request) throws Exception\r\n\t{\n\t\tObject handler = super.lookupHandler(urlPath, request);\r\n\t\tif (handler == null)\r\n\t\t{ // 800, 如果uri直接查找不到,则匹配前面一个\r\n\t\t\tString path = urlPath.substring(0, urlPath.indexOf('/', 2));\r\n\t\t\thandler = super.lookupHandler(path, request);\r\n//\t\t\tSystem.out.println(\"path: \" + path + \":\" + handler);\r\n\t\t}\r\n\t\thandler = handler == null ? getRootHandler() : handler;\r\n//\t\tSystem.out.println(\"urlPath: \" + urlPath + \":\" + handler);\r\n\t\treturn handler;\r\n\t}", "public ContentHandler getContentHandler() {\n return _contentHandler;\n }", "public static UiHandler getUiHandler() {\n Stage stage = THREAD_LOCAL_STAGE.get();\n if (stage == null) {\n return null;\n } else {\n return stage.mUiHandler;\n }\n\n }", "@NotNull\n @Contract(pure = true)\n @SuppressWarnings(\"unused\")\n public static HandlerList getHandlerList() {\n return HANDLERS;\n }", "Handler<Q, R> handler();", "@Override\n\t\t\tpublic MessageHandler get() {\n\t\t\t\tProvider<FeedLoader> feedLoaderProvider = new Provider<FeedLoader>() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic FeedLoader get() {\n\t\t\t\t\t\treturn new FeedLoader();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\treturn new RetrieveFeedMessageHandler(feedLoaderProvider, dataSource, feedEntityHandler, feedItemEntityHandler, feedRequestEntityHandler, subscriptionEntityHandler);\n\t\t\t}", "public static synchronized INSURLHandler getINSURLHandler() {\n/* 50 */ if (insURLHandler == null) {\n/* 51 */ insURLHandler = new INSURLHandler();\n/* */ }\n/* 53 */ return insURLHandler;\n/* */ }", "ByteHandler getByteHandler();", "public ContentHandler getContentHandler()\n {\n return (contentHandler == base) ? null : contentHandler;\n }", "public Integer getHandlerId(){\n return SocketUtilities.byteArrayToInt(handlerId);\n }", "public IoHandler getHandler()\n {\n return new MRPClientProtocolHandler();\n }", "public static Handler getInstance() {\n Object object = sHandler;\n if (object != null) {\n return sHandler;\n }\n object = MainThreadAsyncHandler.class;\n synchronized (object) {\n Handler handler = sHandler;\n if (handler == null) {\n handler = Looper.getMainLooper();\n sHandler = handler = HandlerCompat.createAsync((Looper)handler);\n }\n return sHandler;\n }\n }", "@Override\n public HandlerList getHandlers() {\n return handlers;\n }", "@Override\n public HandlerList getHandlers() {\n return handlers;\n }", "public ExternalReferenceHandlerIF getExternalReferenceHandler() {\n return ref_handler;\n }", "public final static PlayerHandler getPlayerHandler() {\r\n\t\treturn playerHandler;\r\n\t}", "@Override\n public final HandlerList getHandlers(){\n return handlers;\n }", "public String getItemHandlerID() {\n return itemHandlerID;\n }", "public ExtendedEventHandler getEventHandler() {\n return eventHandler;\n }", "public RequestedVariableHandler getRequestedVariableHandler(){\n\t\treturn requestedVariableHandler;\n\t}", "DataHandler getDataHandler();", "public PacketHandler getHandler(String key) {\n PacketHandler h=(PacketHandler)mHandlers.get(key);\n if (h==null)\n h=getDefaultHandler();\n return h;\n }", "protected final Object lookupHandler(String urlPath) {\n Object handler = this.handlerMap.get(urlPath);\n if (handler != null) {\n return handler;\n }\n for (Iterator it = this.handlerMap.keySet().iterator(); it.hasNext(); ) {\n String registeredPath = (String) it.next();\n if (PathMatcher.match(registeredPath, urlPath)) {\n return this.handlerMap.get(registeredPath);\n }\n }\n // no match found\n return null;\n }", "public final static HandlerList getHandlerList(){\n return handlers;\n }", "CreateHandler()\n {\n }", "public static HandlerList getHandlerList() {\n return handlers;\n }", "public static HandlerList getHandlerList() {\n return handlers;\n }", "TransferHandler getTransferHandler() {\n return defaultTransferHandler;\n }", "public Handler getWriteHandler() {\n return writeHandler;\n }", "public UpdateHandler getUpdateHandler() {\n return updateHandler;\n }", "MqttHandler getService() {\n return MqttHandler.getInstance();\n }", "public String getTestHandlerKey() {\n return null;\n }", "EventCallbackHandler getCallbackHandler();", "@Override\n protected Handler createHandler(Looper looper) {\n return new CatchingWorkerHandler(looper);\n }", "protected synchronized ScriptHandler getScriptHandler(String request, String[] params) {\r\n \thandlerLock.lock();\r\n if (currentLoader != null || currentScriptHandler != null) {\r\n }\r\n if (params == null)\r\n currentScriptHandler = new ScriptHandler(request);\r\n else\r\n currentScriptHandler = new ScriptHandler(request, params);\r\n return currentScriptHandler;\r\n }", "@Override\n public String getHandlerName() {\n return \"UpdateHandler\";\n }", "@Override\n\tpublic Handler getId() {\n\t\treturn null;\n\t}", "private Handler getHandler() {\n\t\tsynchronized (waitingThreads) {\n\t\t\twhile (waitingThreads.isEmpty()) {\n\t\t\t\ttry {\n\t\t\t\t\twaitingThreads.wait(2000);\n\t\t\t\t} catch (InterruptedException ignore) {\n\t\t\t\t\t// should not happen\n\t\t\t\t}\n\n\t\t\t\tif (!waitingThreads.isEmpty()) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tHandler w = waitingThreads.remove(0);\n\t\t\treturn w;\n\t\t}\n\t}", "protected XPath getXPathHandler()\n\t{\n\t\treturn xPath;\n\t}", "public HandlerRegistry getHandlerRegistry() {\n\t\treturn null;\n\t}", "@Override\n\tpublic XmlHandler<ActivityResponse> getXmlHandler() {\n\t\treturn handler;\n\t}", "public HandlerDescription[] getHandlers() {\n return m_handlers;\n }", "ProcessContextHandler getProcessContextHandler() {\n return processContextHandler;\n }", "Map<String, Handler> handlers();", "public LocationSettingsHandler getLocationSettingsHandler(){\n return locationSettingsHandler;\n }", "public synchronized AuthenticationHandler getAuthenticationHandler()\n\t{\n\t\tif (this.authHandler != null)\n\t\t{\n\t\t\treturn this.authHandler;\n\t\t}\n\n\t\tif (getAuthenticationHandlerFactory() != null)\n\t\t{\n\t\t\t// The user has plugged in a factory. let's use it.\n\t\t\tthis.authHandler = getAuthenticationHandlerFactory().create();\n\t\t\tif (this.authHandler == null)\n\t\t\t\tthrow new NullPointerException(\"AuthenticationHandlerFactory returned a null handler\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// A placeholder.\n\t\t\tthis.authHandler = new DummyAuthenticationHandler();\n\t\t}\n\t\t\n\t\t// Return the variable, which can be null\n\t\treturn this.authHandler;\n\t}", "@NotNull\n @Contract(pure = true)\n @Override\n public HandlerList getHandlers() {\n return HANDLERS;\n }", "@Override\n public List<MHandler> getHandlers()\n {\n return null;\n }", "public HandlerExecutionChain getHandler(HttpServletRequest request) {\n\t\tString url = request.getServletPath();\n\t\tSystem.out.println(url+\" 123\");\n\t\tController ctl = (Controller) ApplicationContext.getBean(url);\n\t\tHandlerExecutionChain chain = new HandlerExecutionChain();\n\t\tchain.setHandler(ctl);\n\t\treturn chain;\n\t}", "public IMigrationHandler getHandler(String taskId)\n\t{\n\t\treturn null;\n\t}", "public InputHandler getInputHandler() {\n\t\treturn getInputHandler(\"i\");\n\t}", "public GhRequest getRequest() {\r\n return localRequest;\r\n }", "public GhRequest getRequest() {\r\n return localRequest;\r\n }", "public MessageHandlerChain<MessageType> getHandlerChain();", "public static ViewerHandlerInterface getViewerHandler() {\n\t\treturn new ViewerHandler();\n\t}", "public RequestAction geRequestHandler(String request){\n RequestAction requestHandler =requestHandlerMap.get(request);\n if(requestHandler ==null)\n return requestHandlerMap.get(\"notSupported\");\n return requestHandler;\n }", "public RequestHandler getRequestHandlerInstance() {\n Object obj;\n try {\n obj = klass.newInstance();\n } catch (Exception e) {\n throw new RuntimeException(\"Problem during the Given class instanciation please check your contribution\", e);\n }\n if (obj instanceof RequestHandler) {\n RequestHandler rh = (RequestHandler) obj;\n rh.init(properties);\n return rh;\n }\n\n throw new RuntimeException(\"Given class is not a \" + RequestHandler.class + \" implementation\");\n }", "ByteHandler getInstance();", "public Handler getHandler(Handler.Callback callback) {\n return new Handler(this.mService.mHandlerThread.getLooper(), callback);\n }", "public String getIconHandler()\n {\n return iconHandler;\n }", "public synchronized UDPDatagramHandler getUDPDatagramHandler() {\r\n\t\treturn handler;\r\n\t}", "ResponseHandler getInstance() {\n \t\treturn this;\n \t}", "public ContentHandler getContentHandler() {\n return m_ch;\n }", "public interface Handler {\n void handleRequest(String s);\n}", "protected GwtLogHandler getLogHandler() {\n\t\treturn null;\n\t}" ]
[ "0.8217379", "0.78965396", "0.78965396", "0.77025306", "0.76820433", "0.7624469", "0.761036", "0.75523615", "0.7551513", "0.7469211", "0.7465906", "0.73209625", "0.72563756", "0.71790355", "0.69336843", "0.69073874", "0.6833888", "0.6760494", "0.67246747", "0.66895914", "0.6675278", "0.6659179", "0.66537887", "0.6561631", "0.65585196", "0.6457932", "0.64077073", "0.63290906", "0.6328525", "0.6322803", "0.6289698", "0.6280552", "0.6265307", "0.6254682", "0.62399614", "0.6189663", "0.6174565", "0.6172863", "0.61220187", "0.6119327", "0.6115858", "0.6105906", "0.61057633", "0.6071309", "0.6052516", "0.60373867", "0.5995013", "0.5984489", "0.5984489", "0.5983227", "0.59739566", "0.59681743", "0.59654236", "0.59234273", "0.5918001", "0.5896582", "0.5885263", "0.5869777", "0.5818954", "0.5806258", "0.5798744", "0.5798744", "0.5796633", "0.5791689", "0.5772222", "0.57719046", "0.57630277", "0.5762242", "0.5750094", "0.5740013", "0.57049817", "0.56940377", "0.56926197", "0.5692039", "0.56807387", "0.5676061", "0.5672753", "0.5653222", "0.56365097", "0.56282", "0.562336", "0.5617433", "0.56160045", "0.5613609", "0.56071025", "0.5602215", "0.55770755", "0.55770755", "0.5561559", "0.5557434", "0.5557196", "0.5551356", "0.5546202", "0.5541894", "0.5540674", "0.55325973", "0.5529534", "0.55127484", "0.5506857", "0.54948395" ]
0.7377561
11
Add the known body to the list
public void goBackToPlay(CelestialBody celestialBody) { M_PlayerData.getInstance().addKnownBody(celestialBody); // Set the currently visited planet to this one M_PlayerData.getInstance().setCurrPlanet(celestialBody); SceneManager.setCurrScene(new PlayScene()); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected abstract void addBodyImpl( Body body );", "public CelestialBody add(CelestialBody body)\n throws UnhandledCelestialBodyException;", "public final void addBody( Body body )\n {\n if ( !this.bodies.contains( body ) )\n {\n this.bodies.add( body );\n addBodyImpl( body );\n }\n }", "public void createContentList(String body) throws ParseException {\n try {\n HeaderFactoryExt headerFactory = new HeaderFactoryImpl();\n String delimiter = this.getContentTypeHeader().getParameter(BOUNDARY);\n\n if (delimiter == null) {\n this.contentList = new LinkedList();\n ContentImpl content = new ContentImpl(body, delimiter);\n content.setContentTypeHeader(this.getContentTypeHeader());\n this.contentList.add(content);\n return;\n }\n\n String[] fragments = body.split(\"--\" + delimiter + \"\\r\\n\");\n\n if (logger.isDebugEnabled()) {\n logger.debug(\"nFragments = \" + fragments.length);\n logger.debug(\"delimiter = \" + delimiter);\n logger.debug(\"body = \" + body);\n }\n \n for (int i = 0; i < fragments.length; i++) \n {\n \tString nextPart = fragments[i];\n\n // NOTE - we are not hanlding line folding for the sip header here.\n\n if (nextPart == null) {\n return;\n }\n StringBuffer strbuf = new StringBuffer(nextPart);\n while (strbuf.length() > 0\n && (strbuf.charAt(0) == '\\r' || strbuf.charAt(0) == '\\n'))\n strbuf.deleteCharAt(0);\n\n if (strbuf.length() == 0)\n continue;\n nextPart = strbuf.toString();\n int position = nextPart.indexOf(\"\\r\\n\\r\\n\");\n int off = 4;\n if (position == -1) {\n position = nextPart.indexOf(\"\\n\");\n off = 2;\n }\n if (position == -1)\n throw new ParseException(\"no content type header found in \" + nextPart, 0);\n String rest = nextPart.substring(position + off);\n\n if (rest == null)\n throw new ParseException(\"No content [\" + nextPart + \"]\", 0);\n // logger.debug(\"rest = [[\" + rest + \"]]\");\n String headers = nextPart.substring(0, position);\n ContentImpl content = new ContentImpl(rest, boundary);\n\n String[] headerArray = headers.split(\"\\r\\n\");\n for (int j = 0; j < headerArray.length; j++) \n {\n \tString hdr = headerArray[j];\n\n Header header = headerFactory.createHeader(hdr);\n if (header instanceof ContentTypeHeader) {\n content.setContentTypeHeader((ContentTypeHeader) header);\n } else if (header instanceof ContentDispositionHeader) {\n content.setContentDispositionHeader((ContentDispositionHeader) header);\n } else {\n throw new ParseException(\"Unexpected header type \" + header.getName(), 0);\n }\n contentList.add(content); \n\t\t\t\t} \n\t\t\t} \n } catch (StringIndexOutOfBoundsException ex) {\n throw new ParseException(\"Invalid Multipart mime format\", 0);\n }\n }", "public synchronized void addBodyPart(BodyPart part) throws MessagingException {\n/* 327 */ parse();\n/* 328 */ super.addBodyPart(part);\n/* */ }", "org.hl7.fhir.CodeableConcept addNewBodySite();", "protected void bodyAdded (ClusterRecord clrec, BodyObject body)\n {\n }", "public void attachToBody(Body body);", "public void addBody(Body body) {\n body.addToWorld(this, latestId++);\n bodies.add(body);\n }", "private void addBody()\n throws PaginatedResultSetXmlGenerationException\n {\n addPreamble();\n addRecords();\n addPostamble();\n }", "public void setBody(Body body) {\n this.body = body;\n }", "public void setBody(String body)\n {\n this.body = body;\n }", "public void setBody(Object body) {\n this.body = body;\n }", "public synchronized void addBodyPart(BodyPart part, int index) throws MessagingException {\n/* 347 */ parse();\n/* 348 */ super.addBodyPart(part, index);\n/* */ }", "public void setBody(String body) {\n this.body = body;\n }", "public void setBody(String body) {\r\n this.body = body;\r\n }", "protected boolean canAddBody (ClusterRecord clrec, BodyObject body)\n {\n return true;\n }", "public void addBody(Body body) throws SAXException, WingException,\n UIException, SQLException, IOException, AuthorizeException\n {\n \tif(this.editFile!=null)\n {\n editFile.addBody(body);\n return;\n }\n else if(editBitstreamPolicies!=null && isAdvancedFormEnabled){\n editBitstreamPolicies.addBody(body);\n return;\n }\n else if(editPolicy!=null && isAdvancedFormEnabled){\n editPolicy.addBody(body);\n return;\n }\n \n // Get a list of all files in the original bundle\n\t\tItem item = submission.getItem();\n\t\tCollection collection = submission.getCollection();\n\t\tString actionURL = contextPath + \"/handle/\"+collection.getHandle() + \"/submit/\" + knot.getId() + \".continue\";\n\t\tboolean disableFileEditing = (submissionInfo.isInWorkflow()) && !ConfigurationManager.getBooleanProperty(\"workflow\", \"reviewer.file-edit\");\n\t\tBundle[] bundles = item.getBundles(\"ORIGINAL\");\n\t\tBitstream[] bitstreams = new Bitstream[0];\n\t\tif (bundles.length > 0)\n\t\t{\n\t\t\tbitstreams = bundles[0].getBitstreams();\n\t\t}\n\t\t\n\t\t// Part A: \n\t\t// First ask the user if they would like to upload a new file (may be the first one)\n \tDivision div = body.addInteractiveDivision(\"submit-upload\", actionURL, Division.METHOD_MULTIPART, \"primary submission\");\n \tdiv.setHead(T_submission_head);\n \taddSubmissionProgressList(div);\n \t\n \t\n \tList upload = null;\n \tif (!disableFileEditing)\n \t{\n \t\t// Only add the upload capabilities for new item submissions\n\t \tupload = div.addList(\"submit-upload-new\", List.TYPE_FORM);\n\t upload.setHead(T_head); \n\t \n\t File file = upload.addItem().addFile(\"file\");\n\t file.setLabel(T_file);\n\t file.setHelp(T_file_help);\n\t file.setRequired();\n\t \n\t // if no files found error was thrown by processing class, display it!\n\t if (this.errorFlag==org.dspace.submit.step.UploadWithEmbargoStep.STATUS_NO_FILES_ERROR)\n\t {\n file.addError(T_file_error);\n }\n\n // if an upload error was thrown by processing class, display it!\n if (this.errorFlag == org.dspace.submit.step.UploadWithEmbargoStep.STATUS_UPLOAD_ERROR)\n {\n file.addError(T_upload_error);\n }\n\n // if virus checking was attempted and failed in error then let the user know\n if (this.errorFlag == org.dspace.submit.step.UploadWithEmbargoStep.STATUS_VIRUS_CHECKER_UNAVAILABLE)\n {\n file.addError(T_virus_checker_error);\n }\n\n // if virus checking was attempted and a virus found then let the user know\n if (this.errorFlag == org.dspace.submit.step.UploadWithEmbargoStep.STATUS_CONTAINS_VIRUS)\n {\n file.addError(T_virus_error);\n }\n\t \t\n\t Text description = upload.addItem().addText(\"description\");\n\t description.setLabel(T_description);\n\t description.setHelp(T_description_help);\n\n\n // if AdvancedAccessPolicy=false: add simpleForm in UploadWithEmbargoStep\n if(!isAdvancedFormEnabled){\n AccessStepUtil asu = new AccessStepUtil(context);\n // if the item is embargoed default value will be displayed.\n asu.addEmbargoDateSimpleForm(item, upload, errorFlag);\n asu.addReason(null, upload, errorFlag);\n }\n\n\t Button uploadSubmit = upload.addItem().addButton(\"submit_upload\");\n\t uploadSubmit.setValue(T_submit_upload);\n\n \t}\n\n make_sherpaRomeo_submission(item, div);\n \n // Part B:\n // If the user has already uploaded files provide a list for the user.\n if (bitstreams.length > 0 || disableFileEditing)\n\t\t{\n\t Table summary = div.addTable(\"submit-upload-summary\",(bitstreams.length * 2) + 2,7);\n\t summary.setHead(T_head2);\n\t \n\t Row header = summary.addRow(Row.ROLE_HEADER);\n\t header.addCellContent(T_column0); // primary bitstream\n\t header.addCellContent(T_column1); // select checkbox\n\t header.addCellContent(T_column2); // file name\n\t header.addCellContent(T_column3); // size\n\t header.addCellContent(T_column4); // description\n\t header.addCellContent(T_column5); // format\n\t header.addCellContent(T_column6); // edit button\n\t \n\t for (Bitstream bitstream : bitstreams)\n\t {\n\t \tint id = bitstream.getID();\n\t \tString name = bitstream.getName();\n\t \tString url = makeBitstreamLink(item, bitstream);\n\t \tlong bytes = bitstream.getSize();\n\t \tString desc = bitstream.getDescription();\n\t \tString algorithm = bitstream.getChecksumAlgorithm();\n\t \tString checksum = bitstream.getChecksum();\n\n\t \t\n\t \tRow row = summary.addRow();\n\n\t // Add radio-button to select this as the primary bitstream\n Radio primary = row.addCell().addRadio(\"primary_bitstream_id\");\n primary.addOption(String.valueOf(id));\n \n // If this bitstream is already marked as the primary bitstream\n // mark it as such.\n if(bundles[0].getPrimaryBitstreamID() == id) {\n primary.setOptionSelected(String.valueOf(id));\n }\n\t \t\n\t \tif (!disableFileEditing)\n\t \t{\n\t \t\t// Workflow users can not remove files.\n\t\t CheckBox remove = row.addCell().addCheckBox(\"remove\");\n\t\t remove.setLabel(\"remove\");\n\t\t remove.addOption(id);\n\t \t}\n\t \telse\n\t \t{\n\t \t\trow.addCell();\n\t \t}\n\t \t\n\t row.addCell().addXref(url,name);\n\t row.addCellContent(bytes + \" bytes\");\n\t if (desc == null || desc.length() == 0)\n {\n row.addCellContent(T_unknown_name);\n }\n\t else\n {\n row.addCellContent(desc);\n }\n\t \n BitstreamFormat format = bitstream.getFormat();\n\t if (format == null)\n\t {\n\t \trow.addCellContent(T_unknown_format);\n\t }\n\t else\n\t {\n int support = format.getSupportLevel();\n\t \tCell cell = row.addCell();\n\t \tcell.addContent(format.getMIMEType());\n\t \tcell.addContent(\" \");\n\t \tswitch (support)\n\t \t{\n\t \tcase 1:\n\t \t\tcell.addContent(T_supported);\n\t \t\tbreak;\n\t \tcase 2:\n\t \t\tcell.addContent(T_known);\n\t \t\tbreak;\n\t \tcase 3:\n\t \t\tcell.addContent(T_unsupported);\n\t \t\tbreak;\n\t \t}\n\t }\n\t \n\t Button edit = row.addCell().addButton(\"submit_edit_\"+id);\n\t edit.setValue(T_submit_edit);\n\n if(isAdvancedFormEnabled){\n Button policy = row.addCell().addButton(\"submit_editPolicy_\"+id);\n policy.setValue(T_submit_policy);\n }\n\n Row checksumRow = summary.addRow();\n\t checksumRow.addCell();\n\t Cell checksumCell = checksumRow.addCell(null, null, 0, 6, null);\n\t checksumCell.addHighlight(\"bold\").addContent(T_checksum);\n\t checksumCell.addContent(\" \");\n\t checksumCell.addContent(algorithm + \":\" + checksum);\n\t }\n\t \n\t if (!disableFileEditing)\n\t {\n\t \t// Workflow users can not remove files.\n\t\t Row actionRow = summary.addRow();\n\t\t actionRow.addCell();\n\t\t Button removeSeleceted = actionRow.addCell(null, null, 0, 6, null).addButton(\"submit_remove_selected\");\n\t\t removeSeleceted.setValue(T_submit_remove);\n\t }\n\t \n\t upload = div.addList(\"submit-upload-new-part2\", List.TYPE_FORM);\n\n\t\t}\n\n // Part C:\n // add standard control/paging buttons\n addControlButtons(upload);\n }", "public static void addToWatchList(PhysicsBody body)\n {\n watchList.add(body);\n }", "public List<Atom> getBody ()\r\n\t{\r\n\t\treturn _body;\r\n\t}", "public void setBodyPartList(ArrayList<BodyPart> parts){\n\t\tthis.parts = parts;\n\t}", "public void setBody(BodyType _body) {\n this.body = _body;\n }", "public void setBodyElelemtList(List<BodyDecl> list) {\n setChild(list, 2);\n }", "public void setBody_(String body_) {\n this.body_ = body_;\n }", "public DocumentBodyBlock list(DocumentBodyList list) {\n this.list = list;\n return this;\n }", "public void addBody(CollisionBody body) {\n collisionBodies.add(body);\n }", "public void setBodyParams(List<ModuleArgumentItem> bodyParams) {\n this.bodyParams = bodyParams;\n }", "void addMessageBody(ByteBuffer msgBody);", "protected abstract Body newBodyImpl();", "public void setBody(String newValue);", "public void addBodyElelemt(BodyDecl node) {\n List<BodyDecl> list = getBodyElelemtList();\n list.addChild(node);\n }", "void setBody(final Body body);", "@Override\n\tpublic void setBody(Object body) {\n\t\tsuper.setBody(body);\n\t}", "public StacLink body(Object body) {\n this.body = body;\n return this;\n }", "public void setBody(byte[] body) {\n\t\tthis.body = body;\n\t}", "@Override\n\tpublic void parseBody() throws MessageParseException {\n\n\t}", "public void setBody(String body)\n\t{\n\t\tm_sBody=body;\t\n\t}", "@Override\n\tpublic void setBody(java.lang.String body) {\n\t\t_news_Blogs.setBody(body);\n\t}", "public void setBody(AgentBody newBody) {\n\t\tbody = newBody;\n\t}", "public void setBody(byte[] body) {\n\t\t\tthis.body = body;\n\t\t}", "public List<SignatureNode> getBody() {\n return body;\n }", "public abstract Body getBody();", "public LinkedList<Location> getBody() {\n return this.body;\n }", "public void insert(String TITLE,String BODY)\n {\n ContentValues initialValues = new ContentValues();\n\n initialValues.put(\"TITLE\", TITLE);\n initialValues.put(\"BODY\", BODY);\n\n db.insert(\"LISTS\", null, initialValues);\n }", "public void addElts(NoteToken note){\r\n NotesList.add(note);\r\n }", "protected abstract void removeBodyImpl( Body body );", "public void setBody(String v) \n {\n \n if (!ObjectUtils.equals(this.body, v))\n {\n this.body = v;\n setModified(true);\n }\n \n \n }", "void setBody (DBody body);", "public void addBodies(ArrayList<CollisionBody> bodies){\n for(CollisionBody body: bodies){\n addBody(body);\n }\n }", "private void parseItems(List<FlickrPhoto> items, JSONObject jsonBody) throws IOException, JSONException {\n Gson gson = new Gson(); // got gson parsing\n JSONObject photosJsonObject =jsonBody.getJSONObject(\"photos\");\n JSONArray photosJsonArray =photosJsonObject.getJSONArray(\"photo\");\n\n for (int i = 0; i< photosJsonArray.length(); i++){\n JSONObject photoJsonObject = photosJsonArray.getJSONObject(i);\n FlickrPhoto item = gson.fromJson(photoJsonObject.toString(), FlickrPhoto.class);\n int index = item.getDescription().indexOf(getTravelTrackerSignaturePrefixStringWithNL());\n if (index < 0 ) {\n index = item.getDescription().indexOf(getTravelTrackerSignaturePrefixString());\n }\n if (index >= 0 ) {\n item.setDescription(item.getDescription().substring(0, index));\n }\n items.add(item);\n }\n }", "public String getBody(){\n return body;\n }", "public String getBody(){\n return bodiesText;\n }", "private boolean parseBody() {\n return true;\n }", "public String getBody() {\r\n return body;\r\n }", "void writeBody(ObjectOutputStream stream) throws IOException {\n stream.writeObject(body);\n }", "public BodyWrapper(ObjectName oname, AbstractBody body) {\n this.objectName = oname;\n this.id = body.getID();\n this.body = body;\n this.nodeUrl = body.getNodeURL();\n this.isReifiedObjectSerializable = body.getReifiedObject() instanceof Serializable;\n this.notifications = new ConcurrentLinkedQueue<Notification>();\n this.launchNotificationsThread();\n }", "private void structureListElement() {\n postBodyHTMLContent = postBodyHTMLContent.replaceAll(Data.LI_OPENING_REGEX_MATCHER, \"- \");\n\n // replace closing tag </li> with </br> to separate with other list item\n postBodyHTMLContent = postBodyHTMLContent.replaceAll(Data.LI_CLOSING_REGEX_MATCHER, \"<br>\");\n }", "public static void addList() {\n\t}", "@Override\n public int doAfterBody() throws JspTagException {\n outValue = new ArrayList();\n // FIXME: It would be nice if the following if-test could be true only for\n // bodies that are actually empty (not the ones that just generate a \n // zero-length string).\n if (!getBodyContent().getString().equals(\"\")) {\n outValue.add(getBodyContent().getString());\n }\n \n return SKIP_BODY;\n }", "java.lang.String getBody();", "BODY createBODY();", "synchronized boolean addBody(RealTurtleBody body, Point2i position) {\n\t\tassert (body != null);\n\t\tassert (position != null);\n\t\tif (!this.bodies.containsKey(body.getTurtleId())) {\n\t\t\tif (this.grid.putTurtle(position.x(), position.y(), body)) {\n\t\t\t\tthis.bodies.put(body.getTurtleId(), body);\n\t\t\t\tbody.setPhysicalState(\n\t\t\t\t\t\tposition.x(), position.y(),\n\t\t\t\t\t\tbody.getHeadingAngle(),\n\t\t\t\t\t\t0f);\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "public final Body newBody()\n {\n Body body = newBodyImpl();\n \n //addBody(body);\n \n return ( body );\n }", "public Body getBody() {\n return body;\n }", "LinkedListCelest<celestialBody> createList() {\n\t\tLinkedListCelest<celestialBody> b = new LinkedListCelest<celestialBody>();\r\n\t\tfilehandler f = new filehandler();\r\n\t\tf.openfile(f.path);\r\n\t\tf.GetAtt();\r\n\t\tb.pixeldist = f.distance;\r\n\t\tfor(int i = 2; i< f.g.size(); i++) {\r\n\t\t\tcelestialBody j = new celestialBody();\r\n\t\t\tString [] arr = f.g.get(i).split(\",\");\r\n\t\t\tfor(int g=0; g< arr.length; g++) {\r\n\t\t\t\tswitch(g) {\r\n\t\t\t\tcase 1:j.setName(arr[0]);\r\n\t\t\t\tcase 2: j.setMass(Double.parseDouble(arr[1]));\r\n\t\t\t\tcase 3: j.setXC(Integer.parseInt(arr[2]));\r\n\t\t\t\tcase 4: j.setYC(Integer.parseInt(arr[3]));\r\n\t\t\t\tcase 5: j.setXV(Double.parseDouble(arr[4]));\r\n\t\t\t\tcase 6: j.setYV( Double.parseDouble(arr[5]));\r\n\t\t\t\tcase 7: j.setPixels( Integer.parseInt(arr[6]));\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\tb.add(j);\r\n\t\t//b.pixeldist = f.distance;\r\n\t\t}\r\n\t\t\r\n\t\treturn b;\r\n\t}", "public void addBody(Body body) throws WingException, SQLException, AuthorizeException\n\t{\n\t\tString idsString = parameters.getParameter(\"schemaIDs\", null);\n\t\t\n\t\tArrayList<MetadataSchema> schemas = new ArrayList<MetadataSchema>();\n\t\tfor (String id : idsString.split(\",\"))\n\t\t{\n\t\t\tMetadataSchema schema = MetadataSchema.find(context,Integer.valueOf(id));\n\t\t\tschemas.add(schema);\n\t\t}\n \n\t\t// DIVISION: metadata-schema-confirm-delete\n \tDivision deleted = body.addInteractiveDivision(\"metadata-schema-confirm-delete\",contextPath+\"/admin/metadata-registry\",Division.METHOD_POST,\"alert alert-danger\");\n \tdeleted.setHead(T_head);\n \tdeleted.addPara(T_para1);\n \tPara warning = deleted.addPara();\n \twarning.addHighlight(\"bold\").addContent(T_warning);\n \twarning.addContent(T_para2);\n \t\n \tTable table = deleted.addTable(\"schema-confirm-delete\",schemas.size() + 1, 3);\n Row header = table.addRow(Row.ROLE_HEADER);\n header.addCell().addContent(T_column1);\n header.addCell().addContent(T_column2);\n header.addCell().addContent(T_column3);\n \t\n \tfor (MetadataSchema schema : schemas) \n \t{\n \t\tRow row = table.addRow();\n \t\trow.addCell().addContent(schema.getSchemaID());\n \trow.addCell().addContent(schema.getNamespace());\n \trow.addCell().addContent(schema.getName());\n\t }\n \tPara buttons = deleted.addPara();\n \tbuttons.addButton(\"submit_confirm\").setValue(T_submit_delete);\n \tbuttons.addButton(\"submit_cancel\").setValue(T_submit_cancel);\n \t\n \tdeleted.addHidden(\"administrative-continue\").setValue(knot.getId());\n }", "public static void addPhysicsBody(PhysicsBody body)\n {\n world.addRigidBody(body.body);\n bodies.add(body);\n }", "public void setBodyPositions(ArrayList<Integer> bodyPositions) {\n\t\tthis.bodyPositions = bodyPositions;\n\t}", "public String getBody()\n {\n return body;\n }", "String getBody();", "String getBody();", "String getBody();", "String getBody();", "Body getBody();", "public String getBody() {\n return body;\n }", "public String getBody() {\n return body;\n }", "public String getBody() {\n return body;\n }", "public Builder body(final Body body) {\n this.body = body;\n return this;\n }", "public void addAll(List<ImageContent> items) {\n _data = items;\n }", "public Object getBody() {\n return body;\n }", "public void setTypeOfBody(String typeOfBody) {\n\t\tthis.typeOfBody = typeOfBody;\n\t}", "public void setBodyDeclList(List<BodyDecl> list) {\n setChild(list, 1);\n }", "public CelestialBody update(CelestialBody body);", "private void setBody(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n body_ = value;\n }", "public void addBodyDecl(BodyDecl node) {\n List<BodyDecl> list = (parent == null || state == null) ? getBodyDeclListNoTransform() : getBodyDeclList();\n list.addChild(node);\n }", "public void setBody (String body) {\n\t\tresetText(body);\n\t}", "public String getBody_() {\n return body_;\n }", "@Override\n public void addAll(List<Note> given) {\n for (Note n : given) {\n this.addNote(n);\n }\n }", "@SuppressWarnings({\"unchecked\", \"cast\"}) public List<BodyDecl> getBodyElelemtList() {\n return (List<BodyDecl>)getChild(2);\n }", "public void add(String text) {\n list.add(text);\n }", "public void expectedBodiesReceived(Object... bodies) {\n List bodyList = new ArrayList();\n for (Object body : bodies) {\n bodyList.add(body);\n }\n expectedBodiesReceived(bodyList);\n }", "public void setBody(ASTNode body) {\n this.body = body;\n }", "public org.chartacaeli.model.Body[] getBody() {\n org.chartacaeli.model.Body[] array = new org.chartacaeli.model.Body[0];\n return this.bodyList.toArray(array);\n }", "public java.lang.String getBody() {\n return body_;\n }", "public void setBody(ClassBodyNode body);", "public void setBody(String body) {\n this.body = body;\n String params[] = body.split(\"&\");\n for (String param : params) {\n String keyValue[] = param.split(\"=\");\n parameters.put(keyValue[0], keyValue[1]);\n }\n\n }", "public void addBodyMods(BodyMods bodyMods) {\n bodyMods.setBody(this);\n this.bodyModss.add(bodyMods);\n }", "public String getBody() {\r\n\t\treturn mBody;\r\n\t}", "public void setBody(byte[] content) {\n this.body = content;\n }", "ch.crif_online.www.webservices.crifsoapservice.v1_00.PublicationList addNewPublicationList();", "private void clearBody() {\n \n body_ = getDefaultInstance().getBody();\n }" ]
[ "0.7514656", "0.6836305", "0.6796697", "0.66743845", "0.63527745", "0.6315481", "0.6314213", "0.6233754", "0.6224379", "0.61850667", "0.6143105", "0.61174756", "0.6107501", "0.60843915", "0.6079971", "0.6079067", "0.60401064", "0.6026037", "0.6004466", "0.59564775", "0.5870268", "0.5862141", "0.58514905", "0.58339304", "0.58283585", "0.57516205", "0.5747149", "0.57433015", "0.5700197", "0.56778735", "0.56760967", "0.56582224", "0.56526715", "0.5608253", "0.55693924", "0.556846", "0.55374956", "0.55230004", "0.5518798", "0.55169845", "0.55138206", "0.5500188", "0.5493082", "0.54854685", "0.54747933", "0.54418164", "0.54396105", "0.5393616", "0.53719836", "0.5368958", "0.53584456", "0.5344923", "0.5327458", "0.53153455", "0.53134733", "0.5298317", "0.52830935", "0.52736765", "0.52661186", "0.52557653", "0.5235638", "0.5228571", "0.52142966", "0.52108455", "0.5206895", "0.5205965", "0.52032465", "0.51935655", "0.51916856", "0.5191497", "0.5191497", "0.5191497", "0.5191497", "0.51788574", "0.5174165", "0.5174165", "0.5174165", "0.51740956", "0.51444495", "0.5144163", "0.5143318", "0.5138157", "0.51357776", "0.5129944", "0.51284677", "0.5122023", "0.51178783", "0.5106656", "0.51045525", "0.5100039", "0.5091143", "0.50904", "0.5088829", "0.5085564", "0.5082366", "0.5073965", "0.5057147", "0.5054039", "0.5048496", "0.5036626", "0.50209564" ]
0.0
-1
Get the scene instance
private void setupPlayerControls() { ExtendableScene currScene = SceneManager.getSceneParent(); // Controls for the player // Delegated to player controller currScene.setOnKeyPressed(PlayerController.get()::onKeyPressed); currScene.setOnKeyReleased(PlayerController.get()::onKeyReleased); // All mouse movement events (for turret rotation) view.getPane().setOnMouseMoved(view::changeMouseEvent); view.getPane().setOnMouseDragged(view::changeMouseEvent); // Setup player shooting view.getPane().setOnMousePressed(view::createBullet); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static Scene getScene(){\n return scene;\n }", "public static Scene getScene() {\n\t\tif (scene == null) {\n\t\t\tinitScene();\n\t\t}\n\t\treturn scene;\n\n\t}", "public Scene retrieveScene()\n {\n return gameStage.getScene();\n }", "public Scene getScene()\n {\n return scene;\n }", "public final Scene getScene() {\n return activeScene;\n }", "public static Scene getScene() {\n\t\treturn null;\r\n\t}", "public static Scene getScene() {\n\t\treturn gameThree;\n\t}", "public static Scene getCurrent() {\n//\t\tBugger.log(\"Get current scene...\");\n\t\tif (_current != null)\n\t\t\treturn _current;\n\t\telse\n\t\t\t_current = new Scene();\n\t\treturn _current;\n\t}", "public Scene getScene(){\n\t\treturn this.scene;\n\t}", "public Scene getCurrentScene()\r\n\t{\r\n\t\treturn _CurrentScene;\r\n\t}", "public Scene getScene() {\n return null;\n }", "public Scene getMainMenuScene() {\n return scene;\n }", "public final Scene getActiveScene() {\n return activeScene;\n }", "public String getScene() {\n\t\treturn scene;\n\t}", "public Scene getScene() {\n\t\tgenerate();\n\t\tScene scene = new Scene(_layout,GameController.WINDOW_WIDTH,GameController.WINDOW_HEIGHT);\n\t\tscene.getStylesheets().add(\"DarkTheme.css\");\n\t\treturn scene;\n\t}", "@Override\r\n\tpublic SceneBase getInitialScene() {\n\t\treturn new SceneTest();\r\n\t}", "public void createScene();", "public Scene() {}", "public Scene getScene(String name)\r\n\t{\r\n\t\t// Find the scene with the given name.\r\n\t\tfor (Scene scene : _Scenes)\r\n\t\t{\r\n\t\t\tif (scene.getName().equals(name)) { return scene; }\r\n\t\t}\r\n\r\n\t\t// No scene with that name was found, return null.\r\n\t\treturn null;\r\n\t}", "public final Scene getScene(int number) {\n return scenes.get(number - 1);\n }", "public WorldScene makeScene() {\n // WorldCanvas c = new WorldCanvas(300, 300);\n WorldScene s = new WorldScene(this.width, this.height);\n s.placeImageXY(newImg, this.width / 2, this.height / 2);\n return s;\n }", "public static StackPane getGamePane() {\n\t\tif (gamePane == null) {\n\t\t\tinitScene();\n\t\t}\n\t\treturn gamePane;\n\t}", "public final Scene getFirstScene() {\n if (scenes.size() > 0) {\n return scenes.get(0);\n } else {\n return null;\n }\n }", "@Override\n\tpublic Scene onLoadScene() {\n\t\tmEngine.registerUpdateHandler(new FPSLogger());\n\t\tScene scene=new Scene();\n\t\tAutoParallaxBackground autoParallaxBackground=new AutoParallaxBackground(0, 0, 0, 5);\n\t\tautoParallaxBackground.attachParallaxEntity(new ParallaxEntity(-10.0f, new Sprite(0, 0, mTextureRegion)));\n\t\tscene.setBackground(autoParallaxBackground);\n\t\t//Position of the Sprite in the region\n\t\tAnimatedSprite banana=new AnimatedSprite(200,200,bananaRegion);\n\t\tbanana.animate(100);\n\t\tscene.attachChild(banana);\n\t\treturn scene;\n\t}", "public boolean isScene() {\r\n\t\treturn scene;\r\n\t}", "public final Scene getScene(String id) {\n for (Scene scene : scenes) {\n if (scene.getName().equals(id)) {\n return scene;\n }\n }\n\n return null;\n }", "public Scene getPrimaryScene() {\n VBox myBox = new VBox(15);\r\n myBox.setAlignment(Pos.CENTER);\r\n\r\n // Creating an Image object and something to hold the image (ImageViewer)\r\n // so we can view it later\r\n Image image = new Image(imageNames[0], 400, 400, true, true);\r\n ImageView imView = new ImageView(image);\r\n\r\n // Creating buttons\r\n Button myButton = new Button(\"Click to Change Memes\");\r\n Button sceneButton = new Button(\"Click to Leave\");\r\n\r\n // Setting what the change meme button will do when someone presses it\r\n myButton.setOnAction(e -> {\r\n Random rand = new Random();\r\n int randInt = rand.nextInt(imageNames.length);\r\n imView.setImage(new Image(imageNames[randInt], 400, 400, true, true));\r\n });\r\n // Alternative way to write above code using an anonymous inner class\r\n // myButton.setOnAction(new EventHandler<Event>() {\r\n // public void handle(Event e) {\r\n // Random rand = new Random();\r\n // int randInt = rand.nextInt(imageNames.length);\r\n // imView.setImage(new Image(imageNames[randInt], 400, 400, true, true));\r\n // }\r\n // })\r\n\r\n // Setting what the leave button will do\r\n sceneButton.setOnAction(e -> {\r\n Scene secondaryScene = getSecondaryScene();\r\n primaryStage.setScene(secondaryScene);\r\n primaryStage.show();\r\n });\r\n\r\n // Adding our ImageViewer and Buttons onto the VBox\r\n myBox.getChildren().addAll(imView, myButton, sceneButton);\r\n // Actually instantiating the scene with the VBox containing everything\r\n Scene primaryScene = new Scene(myBox, 450, 450);\r\n // Returning the scene\r\n return primaryScene;\r\n }", "protected Scene createView() {\n\t\treturn null;\n\t}", "public void Scene() {\n Scene scene = new Scene(this.root);\n this.stage.setScene(scene);\n this.stage.show();\n }", "public Scene createScene() {\n root = new Group();\n key = new Group();\n Scene scene = new Scene(root, 500, 500, Color.WHITE);\n addRootNode();\n setupKey();\n getAlreadyConnectedPeers();\n return scene;\n }", "public static Scene scene4() {\n\t\tScene finalScene = new Scene().initAmbient(new Vec(1.0))\r\n\t\t\t\t.initCamera(/* Camera Position = */new Point(0.0, 2.0, 6.0), \r\n\t\t\t\t\t\t/* Towards Vector = */ new Vec(0.0, -0.1 ,-1.0),\r\n\t\t\t\t\t\t/* Up vector = */new Vec(0.0, 1.0, 0.0), \r\n\t\t\t\t\t\t/*Distance to plain =*/ 2.0)\r\n\t\t\t\t.initName(\"scene4\").initAntiAliasingFactor(1)\r\n\t\t\t\t.initRenderRefarctions(true).initRenderReflections(true).initMaxRecursionLevel(6);\r\n // Add Surfaces to the scene.\r\n\t\t\r\n\t\t// (2) Add two domes to make it look like we split a sphere in half. \r\n\t\tShape domeShape = new Dome(new Point(2.0, 0.0, -10.0), 5.0, new Vec(1.0, 0.0, 0.0));\r\n\t\tMaterial domeMat = Material.getRandomMaterial();\r\n\t\tSurface domeSurface = new Surface(domeShape, domeMat);\r\n\t\tfinalScene.addSurface(domeSurface);\r\n\t\t\r\n\t\tdomeShape = new Dome(new Point(-2.0, 0.0, -10.0), 5.0, new Vec(-1.0, 0.0, 0.0));\r\n\t\tdomeSurface = new Surface(domeShape, domeMat);\r\n\t\tfinalScene.addSurface(domeSurface);\r\n\t\t\r\n\t\t// Add light sources:\r\n\t\tCutoffSpotlight cutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 75.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(0.0, 6.0, -10.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(.5,0.5,0.5));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\t\r\n\t\treturn finalScene;\r\n\t}", "public Scene getSecondaryScene() {\n VBox myBox2 = new VBox(15);\r\n myBox2.setAlignment(Pos.CENTER);\r\n\r\n // Creating a button that redirects back to the first scene\r\n Button sceneButton = new Button(\"Aww, you left?! Why?? Click to go back!\");\r\n // Actually specifying what pressing the button will do\r\n sceneButton.setOnAction(e -> {\r\n Scene primaryScene = getPrimaryScene();\r\n primaryStage.setScene(primaryScene);\r\n primaryStage.show();\r\n });\r\n\r\n // Creating an Image object and an ImageViewer to hold the image\r\n Image image = new Image(\"sad.gif\", 400, 400, true, true);\r\n ImageView imView = new ImageView(image);\r\n\r\n // Adding our ImageViewer and Buttons onto the VBox\r\n myBox2.getChildren().addAll(imView, sceneButton);\r\n // Actually instantiating the scene with the VBox containing everything\r\n Scene secondaryScene = new Scene(myBox2, 450, 450);\r\n // Returning the scene\r\n return secondaryScene;\r\n }", "public Scene scene() {\n AnchorPane anchorPane = new AnchorPane();\n\n Pane track = raceTrack.trackpainting();\n\n AnchorPane.setTopAnchor(track, 40.0);\n AnchorPane.setLeftAnchor(track, 40.0);\n\n determineStartingLocation(carOne, carTwo, carThree);\n\n carPosition(carOne);\n carPosition(carTwo);\n carPosition(carThree);\n\n AnchorPane.setTopAnchor(btnStartRace, 480.0);\n AnchorPane.setLeftAnchor(btnStartRace, 740.0);\n\n AnchorPane.setTopAnchor(btnEndRace, 480.0);\n AnchorPane.setLeftAnchor(btnEndRace, 730.0);\n\n AnchorPane.setTopAnchor(txtWarning, 600.0);\n AnchorPane.setLeftAnchor(txtWarning, 610.0);\n\n anchorPane.setBackground(\n new Background(new BackgroundFill(Color.rgb(0, 132, 0),\n CornerRadii.EMPTY, Insets.EMPTY)));\n\n anchorPane.getChildren().addAll(track, carOne, carTwo, carThree, btnStartRace, btnEndRace, txtWarning);\n\n Scene scene = new Scene(anchorPane, 1580, 1030);\n return scene;\n }", "@Override\n public Scene getScene() {\n \t\treturn balancer;\n }", "public static Scene scene2() {\n\t\tScene finalScene = new Scene().initAmbient(new Vec(1.0))\r\n\t\t\t\t.initCamera(/* Camera Position = */new Point(0.0, 2.0, 6.0), \r\n\t\t\t\t\t\t/* Towards Vector = */ new Vec(0.0, -0.1 ,-1.0),\r\n\t\t\t\t\t\t/* Up vector = */new Vec(0.0, 1.0, 0.0), \r\n\t\t\t\t\t\t/*Distance to plain =*/ 2.0)\r\n\t\t\t\t.initName(\"scene2\").initAntiAliasingFactor(1)\r\n\t\t\t\t.initAmbient(new Vec(0.4))\r\n\t\t\t\t.initRenderRefarctions(true).initRenderReflections(true).initMaxRecursionLevel(6);\r\n // Add Surfaces to the scene.\r\n\t\t// (1) A plain that represents the ground floor.\r\n\t\tShape plainShape = new Plain(new Vec(0.0,1.0,0.0), new Point(0.0, -1.0, 0.0));\r\n\t\tMaterial plainMat = Material.getMetalMaterial();\r\n\t\tSurface plainSurface = new Surface(plainShape, plainMat);\r\n\t\tfinalScene.addSurface(plainSurface);\r\n\r\n\t\t// (2) We will also add spheres to form a triangle shape (similar to a pool game).\r\n\t\tfor (int depth = 0; depth < 4; depth++) {\r\n\t\t\tfor(int width=-1*depth; width<=depth; width++) {\r\n\t\t\t\tShape sphereShape = new Sphere(new Point((double)width, 0.0, -1.0*(double)depth), 0.5);\r\n\t\t\t\tMaterial sphereMat = Material.getRandomMaterial();\r\n\t\t\t\tSurface sphereSurface = new Surface(sphereShape, sphereMat);\r\n\t\t\t\tfinalScene.addSurface(sphereSurface);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t// Add lighting condition:\r\n\t\tDirectionalLight directionalLight=new DirectionalLight(new Vec(0.5,-0.5,0.0),new Vec(0.7));\r\n\t\tfinalScene.addLightSource(directionalLight);\r\n\r\n\t\t\r\n\t\treturn finalScene;\r\n\t}", "public Scene getUI(UIController uicontroller);", "public MenuScene getMenu() { return menu; }", "private Window getWindow() {\r\n return root.getScene().getWindow();\r\n }", "static public RSMLGUI getInstance() {return instance;}", "public static Scene scene3() {\n\t\tScene finalScene = new Scene().initAmbient(new Vec(1.0))\r\n\t\t\t\t.initCamera(/* Camera Position = */new Point(0.0, 2.0, 6.0), \r\n\t\t\t\t\t\t/* Towards Vector = */ new Vec(0.0, -0.1 ,-1.0),\r\n\t\t\t\t\t\t/* Up vector = */new Vec(0.0, 1.0, 0.0), \r\n\t\t\t\t\t\t/*Distance to plain =*/ 2.0)\r\n\t\t\t\t.initName(\"scene3\").initAntiAliasingFactor(1)\r\n\t\t\t\t.initRenderRefarctions(true).initRenderReflections(true).initMaxRecursionLevel(6);\r\n // Add Surfaces to the scene.\r\n\t\t// (1) A plain that represents the ground floor.\r\n\t\tShape plainShape = new Plain(new Vec(0.0,1.0,0.0), new Point(0.0, -1.0, 0.0));\r\n\t\tMaterial plainMat = Material.getMetalMaterial();\r\n\t\tSurface plainSurface = new Surface(plainShape, plainMat);\r\n\t\tfinalScene.addSurface(plainSurface);\r\n\t\t\r\n\t\t// (2) We will also add spheres to form a triangle shape (similar to a pool game). \r\n\t\tfor (int depth = 0; depth < 4; depth++) {\r\n\t\t\tfor(int width=-1*depth; width<=depth; width++) {\r\n\t\t\t\tShape sphereShape = new Sphere(new Point((double)width, 0.0, -1.0*(double)depth), 0.5);\r\n\t\t\t\tMaterial sphereMat = Material.getRandomMaterial();\r\n\t\t\t\tSurface sphereSurface = new Surface(sphereShape, sphereMat);\r\n\t\t\t\tfinalScene.addSurface(sphereSurface);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// Add light sources:\r\n\t\tCutoffSpotlight cutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 45.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(4.0, 4.0, -3.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(1.0,0.6,0.6));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\tcutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 30.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(-4.0, 4.0, -3.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(0.6,1.0,0.6));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\tcutoffSpotlight = new CutoffSpotlight(new Vec(0.0, -1.0, 0.0), 30.0);\r\n\t\tcutoffSpotlight.initPosition(new Point(0.0, 4.0, 0.0));\r\n\t\tcutoffSpotlight.initIntensity(new Vec(0.6,0.6,1.0));\r\n\t\tfinalScene.addLightSource(cutoffSpotlight);\r\n\t\tDirectionalLight directionalLight=new DirectionalLight(new Vec(0.5,-0.5,0.0),new Vec(0.2));\r\n\t\tfinalScene.addLightSource(directionalLight);\r\n\t\t\r\n\t\treturn finalScene;\r\n\t}", "public static Settings getScene(final Stage stage) {\n settingStage = stage;\n return settingsScene;\n }", "public static Scene scene8() {\r\n\t\t// Define basic properties of the scene\r\n\t\tScene finalScene = new Scene().initAmbient(new Vec(1.0))\r\n\t\t\t\t.initCamera(/* Camera Position = */new Point(0.0, 2.0, 6.0),\r\n\t\t\t\t\t\t/* Towards Vector = */ new Vec(0.0, -0.1 ,-1.0),\r\n\t\t\t\t\t\t/* Up vector = */new Vec(0.0, 1.0, 0.0),\r\n\t\t\t\t\t\t/*Distance to plain =*/ 1.5)\r\n\t\t\t\t.initName(\"scene8\").initAntiAliasingFactor(1)\r\n\t\t\t\t.initBackgroundColor(new Vec(0.81,0.93,1))\r\n\t\t\t\t.initRenderRefarctions(true).initRenderReflections(true).initMaxRecursionLevel(3);\r\n\t\t// Add Surfaces to the scene.\r\n\r\n\t\tShape plainShape = new Plain(new Vec(0.0,-1,0.0), new Point(0.0, -1, 0.0));\r\n\t\tMaterial plainMat = Material.getMetalMaterial().initKa(new Vec(0.2)).initReflectionIntensity(0.1);\r\n\t\tSurface plainSurface = new Surface(plainShape, plainMat);\r\n\t\tfinalScene.addSurface(plainSurface);\r\n\r\n\t\tShape transparentSphere = new Sphere(new Point(0, 10, -25), 10);\r\n\t\tMaterial transparentSphereMat = Material.getGlassMaterial(false)\r\n\t\t\t\t.initRefractionIndex(0).initReflectionIntensity(0.4).initKs(new Vec(1.0)).initKd(new Vec(0));\r\n\t\tSurface transparentSphereSurface = new Surface(transparentSphere, transparentSphereMat);\r\n\t\tfinalScene.addSurface(transparentSphereSurface);\r\n\r\n\t\tdouble[] radiuses = new double[] { 0.3, 0.8, 1, 1.5, 2, 1.4, 0.2, 0.9, 1.2, 2.1 };\r\n\r\n\t\tfor (int i = -10; i < 10; i+=3) {\r\n\t\t\tint sphereCenterZ = -5 + (int)(Math.random() * 3);\r\n\t\t\tint radiusIndex = (int)(Math.random() * 10);\r\n\t\t\tdouble radius = radiuses[radiusIndex];\r\n\t\t\tShape distantSphere1 = new Sphere(new Point(i, radiuses[radiusIndex] - 1, sphereCenterZ), radius);\r\n\t\t\tMaterial distantSphere1Mat = Material.getRandomMaterial();\r\n\t\t\tSurface distantSphere1Surface = new Surface(distantSphere1, distantSphere1Mat);\r\n\t\t\tfinalScene.addSurface(distantSphere1Surface);\r\n\t\t}\r\n\r\n\t\t// Add light sources:\r\n\t\tLight dirLight = new DirectionalLight(new Vec(-4.0, -1.0, -2.5), new Vec(0.3));\r\n\t\tfinalScene.addLightSource(dirLight);\r\n\r\n\t\tdirLight = new DirectionalLight(new Vec(-4.0, -1.0, -2.5), new Vec(0.3));\r\n\t\tfinalScene.addLightSource(dirLight);\r\n\r\n\t\treturn finalScene;\r\n\t}", "public static Scene scene7() {\r\n\t\tPoint cameraPosition = new Point(-3.0, 1.0, 6.0);\r\n\t\tScene finalScene = new Scene().initAmbient(new Vec(1.0))\r\n\t\t\t\t.initCamera(/* Camera Position = */cameraPosition,\r\n\t\t\t\t\t\t/* Towards Vector = */ new Vec(0.0, -0.1 ,-1.0),\r\n\t\t\t\t\t\t/* Up vector = */new Vec(0.0, 1.0, 0.0),\r\n\t\t\t\t\t\t/*Distance to plain =*/ 2.0)\r\n\t\t\t\t.initName(\"scene7\").initAntiAliasingFactor(1)\r\n\t\t\t\t.initBackgroundColor(new Vec(0.01,0.19,0.22))\r\n\t\t\t\t.initRenderRefarctions(true).initRenderReflections(true).initMaxRecursionLevel(3);\r\n\r\n\t\tShape plainShape = new Plain(new Vec(0.0,-4.3,0.0), new Point(0.0, -4.3, 0.0));\r\n\t\tMaterial plainMat = Material.getMetalMaterial()\r\n\t\t\t\t.initKa(new Vec(0.11,0.09,0.02)).initReflectionIntensity(0.1);\r\n\t\tSurface plainSurface = new Surface(plainShape, plainMat);\r\n\t\tfinalScene.addSurface(plainSurface);\r\n\r\n\t\tShape transparentSphere = new Sphere(new Point(1.5, 0, -3.5), 4);\r\n\t\tMaterial transparentSphereMat = Material.getGlassMaterial(true)\r\n\t\t\t\t.initRefractionIntensity(0.8).initRefractionIndex(1.35).initReflectionIntensity(0.4);\r\n\t\tSurface transparentSphereSurface = new Surface(transparentSphere, transparentSphereMat);\r\n\t\tfinalScene.addSurface(transparentSphereSurface);\r\n\r\n\t\tPoint sunPosition = new Point(0, 3, -45);\r\n\t\tShape sunDome = new Dome(sunPosition, 8, new Vec(0, 1, 0));\r\n\t\tMaterial sunDomeMat = Material.getMetalMaterial().initKa(new Vec(0.95,0.84,0.03));\r\n\t\tSurface sunDomeSurface = new Surface(sunDome, sunDomeMat);\r\n\t\tfinalScene.addSurface(sunDomeSurface);\r\n\r\n\t\tVec sunDirection = cameraPosition.sub(sunPosition);\r\n\t\tLight sunLight = new DirectionalLight(sunDirection, new Vec(0.95,0.84,0.03));\r\n\t\tfinalScene.addLightSource(sunLight);\r\n\r\n\t\treturn finalScene;\r\n\t}", "public ModelScene getStartPoint() {\r\n\t\treturn scenes.get(startPoint);\r\n\t}", "public final List<Scene> getScenes() {\n return Collections.unmodifiableList(scenes);\n }", "public void setScene(Scene scene){\n this.scene = scene;\n }", "public WorldScene makeScene() {\n WorldScene scene = new WorldScene(this.width * GamePiece.GAMEPIECE_SIZE,\n this.height * GamePiece.GAMEPIECE_SIZE);\n WorldImage row = new EmptyImage();\n for (int i = 0; i < this.width; i++) {\n WorldImage column = new EmptyImage();\n for (int j = 0; j < this.height; j++) {\n column = new AboveImage(column, this.board.get(i).get(j)\n .drawPiece(this.board.get(powerRow).get(powerCol), this.radius));\n }\n row = new BesideImage(row, column);\n }\n scene.placeImageXY(row, (this.width * GamePiece.GAMEPIECE_SIZE) / 2,\n (this.height * GamePiece.GAMEPIECE_SIZE) / 2);\n return scene;\n }", "public WorldScene makeScene() {\r\n WorldScene scene = this.getEmptyScene();\r\n //make the image to draw \\/ \\/\r\n WorldImage cell = new EmptyImage();\r\n\r\n if (this.allCellsFlooded()) {\r\n cell = this.drawWin();\r\n }\r\n else if (this.currTurn >= this.maxTurn) {\r\n cell = this.drawLose();\r\n }\r\n else {\r\n cell = this.drawBoard();\r\n }\r\n\r\n //place the image on the scene \\/ \\/\r\n scene.placeImageXY(cell, 100, 200);\r\n\r\n return scene;\r\n }", "public Stage retrieveStage()\n {\n return gameStage;\n }", "void createScene(){\n\t\tmainScene = new Scene(mainPane);\r\n\t\t\r\n\t\t//If keyEvent is not focussed on a node on the scene, you can attach\r\n\t\t//a keyEvent to a scene to be consumed by the screen itself.\r\n\t\tCloser closer = new Closer();\r\n\t\tmainScene.setOnKeyPressed(closer);\r\n\t}", "public void Load() {\n\t\tsceneLoaded = false;\n\n\t\tfor (int i = 0 ; i < gameObjects.size();i++) {\n\t\t\tGameObject gO = gameObjects.get(i);\n\t\t\tEngine.Instance.AddObject(gO);\n\n\t\t}\n\t\tEngine.Instance.currentScenes.add(this);\n\t\tsceneLoaded = true;\n\t}", "public Scene(String name) {\r\n\t\tthis.name = name;\r\n\t}", "public static EffectPane getEffectPane() {\n\t\tif (effectPane == null) {\n\t\t\tinitScene();\n\t\t}\n\t\treturn effectPane;\n\t}", "public Stage getWindow() {\n return primaryStage;\n }", "@Override\n\tpublic void onShowScene() {\n\t\t\n\t}", "public Stage getStage() {\n com.guidebee.game.engine.scene.Stage stage = internalGroup.getStage();\n if (stage != null) {\n return (Stage) stage.getUserObject();\n }\n\n return null;\n }", "private void loadScene() throws IOException {\n FXMLLoader loader = new FXMLLoader(getClass().getResource(\"CurriculumDisplaySE.fxml\"));\n loader.setController(this);\n Parent root = loader.load();\n scene = new Scene(root);\n }", "public static SlideshowEditor getInstance()\n {\n if (instance == null) {\n instance = new SlideshowEditor();\n }\n return instance;\n }", "public static GameEngine getInstance() {\n return INSTANCE;\n }", "public static Main getInstance() {\n return instance;\n }", "public static MainView getInstance() {\n\t\tif (spielInstanz == null) {\n\t\t\tSystem.err.println(\"Noch keine Spiel-Instanz erstellt!\");\n\t\t\tSystem.exit(-1);\n\t\t} // if\n\t\treturn spielInstanz;\n\t}", "public static Main getInstance() {\r\n return instance;\r\n }", "public GameObject getGameObject()\n {\n return this.gameObject;\n }", "final public Class<? extends com.org.multigear.mginterface.scene.Scene> getMainRoom() {\r\n\t\treturn mMainRoom;\r\n\t}", "@Override\n\tpublic SceneType getSceneType() {\n\t\treturn SceneType.SCENE_SPLASH;\n\t}", "public WorldScene makeScene() {\n WorldScene ws = new WorldScene(ForbiddenIslandWorld.ISLAND_SIZE,\n ForbiddenIslandWorld.ISLAND_SIZE);\n for (Cell c : this.board) {\n ws.placeImageXY(c.drawCell(waterHeight), c.x * 10, c.y * 10);\n }\n for (Target t : this.helicopterpieces) {\n ws.placeImageXY(t.drawPiece(), t.x * 10, t.y * 10);\n }\n ws.placeImageXY(this.player.drawPerson(), player.x * 10, player.y * 10);\n ws.placeImageXY(this.player2.drawPerson2(), player2.x * 10, player2.y * 10);\n return ws;\n }", "public void startScene()\r\n\t{\r\n\t\tthis.start();\r\n\t}", "public static InventoryPane getInventoryPane() {\n\t\tif (inventoryPane == null) {\n\t\t\tinitScene();\n\t\t}\n\t\treturn inventoryPane;\n\t}", "private void initScene() {\n scene = new idx3d_Scene() {\n\n @Override\n public boolean isAdjusting() {\n return super.isAdjusting() || isAnimating() || isInStartedPlayer() || AbstractCube7Idx3D.this.isAdjusting();\n }\n\n @Override\n public void prepareForRendering() {\n validateAlphaBeta();\n validateScaleFactor();\n validateCube();\n validateStickersImage();\n validateAttributes(); // must be done after validateStickersImage!\n super.prepareForRendering();\n }\n @Override\n\t\tpublic /*final*/ void rotate(float dx, float dy, float dz) {\n super.rotate(dx, dy, dz);\n fireStateChanged();\n }\n };\n scene.setBackgroundColor(0xffffff);\n\n scaleTransform = new idx3d_Group();\n scaleTransform.scale(0.018f);\n\n for (int i = 0; i < locationTransforms.length; i++) {\n scaleTransform.addChild(locationTransforms[i]);\n }\n alphaBetaTransform = new idx3d_Group();\n alphaBetaTransform.addChild(scaleTransform);\n scene.addChild(alphaBetaTransform);\n\n scene.addCamera(\"Front\", idx3d_Camera.FRONT());\n scene.camera(\"Front\").setPos(0, 0, -4.9f);\n scene.camera(\"Front\").setFov(40f);\n\n scene.addCamera(\"Rear\", idx3d_Camera.FRONT());\n scene.camera(\"Rear\").setPos(0, 0, 4.9f);\n scene.camera(\"Rear\").setFov(40f);\n scene.camera(\"Rear\").roll((float) Math.PI);\n\n //scene.environment.ambient = 0x0;\n //scene.environment.ambient = 0xcccccc;\n scene.environment.ambient = 0x777777;\n //scene.addLight(\"Light1\",new idx3d_Light(new idx3d_Vector(0.2f,-0.5f,1f),0x888888,144,120));\n //scene.addLight(\"Light1\",new idx3d_Light(new idx3d_Vector(1f,-1f,1f),0x888888,144,120));\n // scene.addLight(\"Light2\",new idx3d_Light(new idx3d_Vector(1f,1f,1f),0x222222,100,40));\n //scene.addLight(\"Light2\",new idx3d_Light(new idx3d_Vector(-1f,1f,1f),0x222222,100,40));\n // scene.addLight(\"Light3\",new idx3d_Light(new idx3d_Vector(-1f,2f,1f),0x444444,200,120));\n scene.addLight(\"KeyLight\", new idx3d_Light(new idx3d_Vector(1f, -1f, 1f), 0xffffff, 0xffffff, 100, 100));\n scene.addLight(\"FillLightRight\", new idx3d_Light(new idx3d_Vector(-1f, 0f, 1f), 0x888888, 50, 50));\n scene.addLight(\"FillLightDown\", new idx3d_Light(new idx3d_Vector(0f, 1f, 1f), 0x666666, 50, 50));\n\n if (sharedLightmap == null) {\n sharedLightmap = scene.getLightmap();\n } else {\n scene.setLightmap(sharedLightmap);\n }\n }", "@Override\n\tpublic SceneObject getController() {\n\t\treturn null;\n\t}", "public static Stage getMainStage(){\r\n return mainStage;\r\n }", "public WorldScene makeScene() {\n WorldScene w = new WorldScene(width * scale, height * scale);\n for (Vertex v : vertices) {\n Color color = generateColor(v);\n w.placeImageXY(new RectangleImage(scale, scale, OutlineMode.SOLID, color),\n (v.x * scale) + (scale * 1 / 2), (v.y * scale) + (scale * 1 / 2));\n }\n for (Edge e : walls) {\n if (e.to.x == e.from.x) {\n w.placeImageXY(\n new RectangleImage(scale, scale / 10, OutlineMode.SOLID, Color.black),\n (e.to.x * scale) + (scale * 1 / 2),\n ((e.to.y + e.from.y) * scale / 2) + (scale * 1 / 2));\n }\n else {\n w.placeImageXY(\n new RectangleImage(scale / 10, scale, OutlineMode.SOLID, Color.black),\n ((e.to.x + e.from.x) * scale / 2) + (scale * 1 / 2),\n (e.to.y * scale) + (scale * 1 / 2));\n }\n }\n return w;\n }", "public static Camera getInstance() {\r\n return instance;\r\n }", "public Set<Scene> getSceneList(){\n\t\treturn this.sceneList;\n\t}", "public static Stage getMainStage() {\n return mainStage;\n }", "public Render(Scene scene1) {\n scene = scene1;\n }", "@Override\npublic void populateScene() {\n\t\n}", "public static Scoreboard getInstance() { return scoreboard; }", "public static GameManager getInstance() {\n return ourInstance;\n }", "public static SingletonTextureFactory getInstance(){\n\t\treturn instance;\n\t}", "public static Scene getScene(GUIManager guiManager) {\r\n\t\tUserSettings userSettings = GUIManager.getUserSettings();\r\n\r\n\t\tGridPane mainGrid = new GridPane();\r\n\t\tmainGrid.setAlignment(Pos.CENTER);\r\n\t\tmainGrid.setHgap(10);\r\n\t\tmainGrid.setVgap(10);\r\n\t\tmainGrid.setPadding(MenuControls.scaleByResolution(25));\r\n\t\tLoadingPane loadingPane = new LoadingPane(mainGrid);\r\n\r\n\t\tLabel titleLabel = new Label(\"Multiplayer\");\r\n\t\ttitleLabel.setStyle(\"-fx-font-size: 26px;\");\r\n\r\n\t\tGridPane topGrid = new GridPane();\r\n\t\ttopGrid.setAlignment(Pos.CENTER);\r\n\t\ttopGrid.setHgap(10);\r\n\t\ttopGrid.setVgap(10);\r\n\t\ttopGrid.setPadding(MenuControls.scaleByResolution(25));\r\n\r\n\t\t// Create the username label and text field\r\n\t\tLabel usernameLabel = new Label(\"Username\");\r\n\t\tTextField usernameText = new TextField();\r\n\t\tusernameText.setId(\"UsernameTextField\");\r\n\t\tusernameText.setText(userSettings.getUsername());\r\n\t\ttopGrid.add(usernameLabel, 0, 0);\r\n\t\ttopGrid.add(usernameText, 1, 0);\r\n\r\n\t\tGridPane selectionGrid = new GridPane();\r\n\t\tselectionGrid.setAlignment(Pos.CENTER);\r\n\t\tselectionGrid.setHgap(10);\r\n\t\tselectionGrid.setVgap(10);\r\n\t\tselectionGrid.setPadding(MenuControls.scaleByResolution(25));\r\n\r\n\t\t// Create the toggle group\r\n\t\tfinal ToggleGroup group = new ToggleGroup();\r\n\r\n\t\t// Create the automatic radio button\r\n\t\tRadioButton automatic = new RadioButton();\r\n\t\tautomatic.setToggleGroup(group);\r\n\t\tautomatic.setSelected(true);\r\n\r\n\t\t// Create the search label\r\n\t\tLabel automaticLabel = new Label(\"Search LAN for a Server\");\r\n\t\tautomaticLabel.setOnMouseClicked((event) -> automatic.fire());\r\n\t\tselectionGrid.add(automatic, 0, 0);\r\n\t\tselectionGrid.add(automaticLabel, 1, 0);\r\n\r\n\t\t// Create the manual radio button, label and text field\r\n\t\tRadioButton manual = new RadioButton();\r\n\t\tmanual.setToggleGroup(group);\r\n\t\tLabel ipLabel = new Label(\"Manually Enter IP Address\");\r\n\t\tipLabel.setOnMouseClicked((event) -> manual.fire());\r\n\t\tTextField ipText = new TextField(\"127.0.0.1\");\r\n\t\tGridPane manualField = new GridPane();\r\n\t\tmanualField.add(ipLabel, 0, 0);\r\n\t\tmanualField.add(ipText, 0, 1);\r\n\t\tselectionGrid.add(manual, 0, 1);\r\n\t\tselectionGrid.add(manualField, 1, 1);\r\n\r\n\t\t// Add opacity styling to the form\r\n\t\tautomaticLabel.setStyle(\"-fx-opacity: 1.0;\");\r\n\t\tipLabel.setStyle(\"-fx-opacity: 0.5;\");\r\n\t\tipText.setStyle(\"-fx-opacity: 0.5;\");\r\n\r\n\t\tgroup.selectedToggleProperty().addListener((observable, oldValue, newValue) -> {\r\n\t\t\tif (automatic.isSelected()) {\r\n\t\t\t\tautomaticLabel.setStyle(\"-fx-opacity: 1.0;\");\r\n\t\t\t\tipLabel.setStyle(\"-fx-opacity: 0.5;\");\r\n\t\t\t\tipText.setStyle(\"-fx-opacity: 0.5;\");\r\n\t\t\t} else {\r\n\t\t\t\tautomaticLabel.setStyle(\"-fx-opacity: 0.5;\");\r\n\t\t\t\tipLabel.setStyle(\"-fx-opacity: 1.0;\");\r\n\t\t\t\tipText.setStyle(\"-fx-opacity: 1.0;\");\r\n\t\t\t}\r\n\t\t});\r\n\r\n\t\t// Add listeners for focusing and editing on the text field, changing the selection to manual\r\n\t\tipText.focusedProperty().addListener((observable, oldValue, newValue) -> manual.setSelected(true));\r\n\t\tipText.editableProperty().addListener((observable, oldValue, newValue) -> manual.setSelected(true));\r\n\r\n\t\t// Create the set of buttons for connecting and going back\r\n\t\tMenuOption[] connect = {new MenuOption(\"Connect\", true, (event) -> {\r\n\t\t\tloadingPane.startLoading();\r\n\t\t\tuserSettings.setUsername(usernameText.getText());\r\n\t\t\tguiManager.notifySettingsObservers();\r\n\r\n\t\t\t(new Thread(() -> {\r\n\t\t\t\tif (automatic.isSelected()) {\r\n\t\t\t\t\t// Search the local network for servers\r\n\t\t\t\t\tDiscoveryClientAnnouncer client = new DiscoveryClientAnnouncer();\r\n\t\t\t\t\tString ipPort = client.findServer().split(\":\")[0];\r\n\r\n\t\t\t\t\tif (ipPort.equals(\"\")) {\r\n\t\t\t\t\t\t// Could not find a LAN server\r\n\t\t\t\t\t\tPlatform.runLater(() -> {\r\n\t\t\t\t\t\t\t(new AlertBox(\"No LAN server\", \"Could not find any local servers. Please try again or enter the server IP address manually.\")).showAlert(true);\r\n\t\t\t\t\t\t\tloadingPane.stopLoading();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\t// Found a LAN server, so try to connect to it\r\n\t\t\t\t\t\tPlatform.runLater(() -> {\r\n\t\t\t\t\t\t\tguiManager.setIpAddress(ipPort);\r\n\t\t\t\t\t\t\tint error = guiManager.establishConnection();\r\n\t\t\t\t\t\t\tif (error == 0)\r\n\t\t\t\t\t\t\t\tguiManager.transitionTo(Menu.MULTIPLAYER_GAME_TYPE);\r\n\t\t\t\t\t\t\telse if (error == 6)\r\n\t\t\t\t\t\t\t\tloadingPane.stopLoading();\r\n\t\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\t\t(new AlertBox(\"No LAN server\", \"Could not find any local servers. Please try again or enter the server IP address manually.\")).showAlert(true);\r\n\t\t\t\t\t\t\t\tloadingPane.stopLoading();\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} else {\r\n\t\t\t\t\t// Manual is selected, so try to connect to the server\r\n\t\t\t\t\t(new Thread(() -> {\r\n\t\t\t\t\t\tPlatform.runLater(() -> {\r\n\t\t\t\t\t\t\t// If localhost is selected, use the LAN IP instead\r\n\t\t\t\t\t\t\tif (ipText.getText().equals(\"127.0.0.1\") || ipText.getText().equals(\"localhost\"))\r\n\t\t\t\t\t\t\t\tguiManager.setIpAddress(IPAddress.getLAN());\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tguiManager.setIpAddress(ipText.getText());\r\n\r\n\t\t\t\t\t\t\t// Try to establish a connection\r\n\t\t\t\t\t\t\tif (guiManager.establishConnection() == 0)\r\n\t\t\t\t\t\t\t\tguiManager.transitionTo(Menu.MULTIPLAYER_GAME_TYPE);\r\n\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\tloadingPane.stopLoading();\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t})).start();\r\n\t\t\t\t}\r\n\t\t\t})).start();\r\n\t\t}), new MenuOption(\"Back\", false, (event) -> guiManager.transitionTo(Menu.MAIN_MENU))};\r\n\r\n\t\t// Turn the array into a grid pane\r\n\t\tGridPane connectGrid = MenuOptionSet.optionSetToGridPane(connect);\r\n\t\t// Add the options grid and the button grid to the main grid\r\n\t\tmainGrid.add(MenuControls.centreInPane(titleLabel), 0, 0);\r\n\t\tmainGrid.add(topGrid, 0, 1);\r\n\t\tmainGrid.add(selectionGrid, 0, 2);\r\n\t\tmainGrid.add(connectGrid, 0, 3);\r\n\r\n\t\tipText.setOnKeyPressed((event) -> {\r\n\t\t\tif (event.getCode().equals(KeyCode.ENTER))\r\n\t\t\t\tfor (Node n : connectGrid.getChildren())\r\n\t\t\t\t\tif (n instanceof Button && ((Button) n).getText().equals(\"Connect\"))\r\n\t\t\t\t\t\t((Button) n).fire();\r\n\t\t});\r\n\r\n\t\t// Create a new scene using the main grid\r\n\t\treturn guiManager.createScene(loadingPane);\r\n\t}", "public static Physics getInstance(){\n return instance;\n }", "public static Game getInstance() {\n\t\tif (game == null)\n\t\t\tgame = new Game();\n\t\treturn game;\n\t}", "public static World getInstance() {\n return instance;\n }", "public static SpriteStore get() {\n\t\treturn single;\n\t}", "public Scene createScene() {\n\t\tmyRoot = new AnchorPane();\n\t\tmyTabs = new TabPane();\n\t\tButton newTab = new Button(CREATE_NEW_TAB);\n\t\tnewTab.setOnAction(event -> createNewTab());\n\t\t\n\t\tTabMainScreen mainScreen = new TabMainScreen(myResources.getString(WORKSPACE) + (myTabs.getTabs().size()));\n\t\tTabHelp help1 = new TabHelp(myResources.getString(BASIC_COMMANDS), HELP_TAB_TEXT1);\n\t\tTabHelp help2 = new TabHelp(myResources.getString(EXTENDED_COMMANDS), HELP_TAB_TEXT2);\n\t\t\n\t\tmyTabs.getTabs().addAll(mainScreen.getTab(myStage), help1.getTab(), help2.getTab());\n\t\t\n\t\tAnchorPane.setTopAnchor(myTabs, TABS_OFFSET);\n\t\tAnchorPane.setTopAnchor(newTab, NEWTAB_OFFSET);\n\t\t\n\t\tmyRoot.getChildren().addAll(myTabs, newTab);\n\t\n\t\tmyScene = new Scene(myRoot, windowHeight, windowWidth, Color.WHITE);\n\t\treturn myScene;\n\t}", "protected void buildScene() {\n Geometry cube1 = buildCube(ColorRGBA.Red);\n cube1.setLocalTranslation(-1f, 0f, 0f);\n Geometry cube2 = buildCube(ColorRGBA.Green);\n cube2.setLocalTranslation(0f, 0f, 0f);\n Geometry cube3 = buildCube(ColorRGBA.Blue);\n cube3.setLocalTranslation(1f, 0f, 0f);\n\n Geometry cube4 = buildCube(ColorRGBA.randomColor());\n cube4.setLocalTranslation(-0.5f, 1f, 0f);\n Geometry cube5 = buildCube(ColorRGBA.randomColor());\n cube5.setLocalTranslation(0.5f, 1f, 0f);\n\n rootNode.attachChild(cube1);\n rootNode.attachChild(cube2);\n rootNode.attachChild(cube3);\n rootNode.attachChild(cube4);\n rootNode.attachChild(cube5);\n }", "public void setHomeScene(Scene scene) {\r\n scene1 = scene;\r\n }", "protected Scene buildScene() throws FileNotFoundException, NoSuchObjectException {\n SplitPane split = new SplitPane();\n Scene myGameScene = new Scene(split, 800, 600);\n split.setDividerPositions(0.35f, 0.6f);\n attachStyle(myGameScene, \"GameView\");\n\n Pane leftPane = getPane(myGameResourceBundle.getString(\"LeftPaneCss\"));\n buildLeftSplitPane(leftPane);\n SplitPane.setResizableWithParent(leftPane, Boolean.FALSE);\n Pane rightPane = getPane(myGameResourceBundle.getString(\"RightPaneCss\"));\n Entity player = getPlayerEntity();\n background = new ImageView(new Image(new FileInputStream(levelInfoParser.getBackgroundImage())));\n cameraView = new CameraView(player, myGameScene.heightProperty(), myGameScene.widthProperty());\n buildRightSplitPane(rightPane);\n cameraView.bindBackgroundImage(background);\n ImageView playerDisplay = cameraView.createPlayerDisplay(player);\n setUpGameOver(player);\n rightPane.getChildren().add(playerDisplay);\n split.getItems().addAll(leftPane, rightPane);\n SplitPane.setResizableWithParent(leftPane, Boolean.FALSE);\n myGameScene.setOnKeyPressed(e -> handleKeyPressed(e));\n cameraView.handleCamera(rightPane, playerDisplay,background);\n myGameScene.setOnKeyReleased(e->handleKeyReleased(e));\n rightPane.requestFocus();\n rightPane.setFocusTraversable(true);\n return myGameScene;\n }", "GameObject getObject();", "public Pane<T> currentPane() {\n return currentPane(System.currentTimeMillis());\n }", "public static Stage getPrimaryStage() {\r\n return primaryStage;\r\n }", "public static Stage getPrimaryStage() {\r\n return primaryStage;\r\n }", "public static Stage getPrimaryStage()\n {\n return Main.primaryStage;\n }", "public gameScene_Model(Stage primaryStage){\n this.primaryStage = primaryStage;\n background = new MyStage();\n this.scene = new Scene(background,600,800);\n animal = new Animal(\"file:src/FroggerApp/Images_File/froggerUp.png\");\n }", "@Override\n\tpublic Scene giveScene() {\n\t\tLabel SignIn=new Label(\"SIGN IN\");\n\t\tLabel UserName=new Label(\"Username\");\n\t\tLabel Password=new Label(\"Password\");\n\t\tTextField Username=new TextField();\n\t\tTextField PassWord=new TextField();\n\t\tButton SubmitButton=new Button(\"SUBMIT\");\n\t\tButton BackButton=new Button(\"BACK\");\n\t\tBackButton.setOnAction(new EventHandler<ActionEvent>() {\t\n\t\t\t@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\tmyGame.setPrimaryStage(myGame.GetLoginPageScene());\n\t\t\t}\n\t\t});\t\n\t\tSignIn.setId(\"SignInLabel\");\n\t\tUserName.setId(\"UserLabel\");\n\t\tPassword.setId(\"PasswordLabel\");\n\t\tUsername.setId(\"UserText\");\n\t\tPassWord.setId(\"PasswordText\");\n\t\tSubmitButton.setId(\"SubmitButton\");\n\t\tBackButton.setId(\"BackButton\");\n\t\tVBox SignInPageVb=new VBox(50,SignIn,UserName,Username,Password,PassWord,BackButton,SubmitButton);\n\t\tSignInPageVb.setTranslateY(100);\n\t\tSignInPageVb.setAlignment(Pos.TOP_CENTER);\n\t\tStackPane MainPageStackpane=new StackPane(SignInPageVb);\n\t\tMainPageStackpane.getStylesheets().add(getClass().getResource(\"SignInPage.css\").toString());\n\t\tmyScene= new Scene(MainPageStackpane,500,1000);\n\t\tmyScene.setFill(Color.BLACK);\n\t\tSubmitButton.setOnAction(new EventHandler<ActionEvent>() {\t\n\t\t\t@Override\n\t\t\tpublic void handle(ActionEvent event) {\n\t\t\t\tPlayer newPLayer = myGame.getMyDataBase().login(Username.getText(), PassWord.getText());\n\t\t\t\t//System.out.println(newPLayer);\n\t\t\t\tif (newPLayer != null) {\n\t\t\t\t\tmyGame.setCurrentPlayer(newPLayer);\n\t\t\t\t\tmyGame.setPrimaryStage(myGame.GetMainPageScene());\n\t\t\t\t}else {\n\t\t\t\t\tif(NoPlayer==null) {\n\t\t\t\t\t\tNoPlayer=new Label(\"Invalid User/Password\");\n\t\t\t\t\t\tSignInPageVb.getChildren().add(NoPlayer);\n\t\t\t\t\t}//System.out.println(\"katta\");\n\t\t\t\t//myGame.setPrimaryStage(myGame.GetGamePlayScene());\n\t\t\t\t}\n\t\t\t}\n\t\t});\t\n\n\t\treturn myScene;\n\t}", "@FXML\n private void startGame(){\n AnchorPane anchorPane = new AnchorPane();\n Scene gameScene = new Scene(anchorPane, 800, 600);\n Stage gameStage = new Stage();\n GameView gameView = new GameView(anchorPane, gameScene, gameStage);\n gameView.gameStart();\n }", "private GVRSceneObject asyncSceneObject(GVRContext context,\n String textureName) throws IOException {\n return new GVRSceneObject(context, new GVRAndroidResource(context,\n \"sphere.obj\"), new GVRAndroidResource(context, textureName));\n }", "public int getMapSceneId() {\n\t\treturn mapSceneId;\n\t}", "public interface IScene \n{\n\t\n\tpublic void loadScene(Craftix cx);\n\n\tpublic void renderScene();\n\n\tpublic void otherSetup();\n\t\n\tpublic void cleanUpScene();\n}", "public Window getWindow() {\n\t\treturn selectionList.getScene().getWindow();\n\t}" ]
[ "0.83439034", "0.82874864", "0.81015486", "0.78535235", "0.78521687", "0.779576", "0.77667147", "0.76805", "0.76015115", "0.7502247", "0.7223748", "0.7199764", "0.7175365", "0.714338", "0.69775164", "0.68129915", "0.6755902", "0.6685325", "0.65937597", "0.6589774", "0.6521347", "0.6466161", "0.6456824", "0.643207", "0.64309245", "0.6381012", "0.63243115", "0.6301089", "0.62393093", "0.62288064", "0.6209535", "0.61842483", "0.61827374", "0.617337", "0.6160159", "0.61437887", "0.61303526", "0.6108142", "0.6097314", "0.6018287", "0.6015965", "0.59724766", "0.5961728", "0.5952535", "0.5945585", "0.59220845", "0.5920097", "0.59001136", "0.586945", "0.58357024", "0.58194184", "0.58009654", "0.57931185", "0.5791699", "0.5767553", "0.57584935", "0.5756397", "0.5741731", "0.5731337", "0.57307464", "0.57301635", "0.5727613", "0.5726167", "0.57246083", "0.57105124", "0.5703478", "0.57028747", "0.56949335", "0.5683263", "0.5679101", "0.56612945", "0.56461245", "0.5628753", "0.56271636", "0.5618169", "0.5613001", "0.56096417", "0.5607308", "0.55923647", "0.5591829", "0.55896586", "0.55779773", "0.5566161", "0.55621165", "0.5555418", "0.5551587", "0.5550289", "0.5543223", "0.55381143", "0.55267054", "0.5524321", "0.5522551", "0.5522551", "0.5521984", "0.5520776", "0.5518112", "0.5491115", "0.5486592", "0.54600745", "0.5454601", "0.5453993" ]
0.0
-1
Animation timer for player movement
private void setupAnimationTimer() { new AnimationTimer() { @Override public void handle(long l) { view.movePlayer(); view.updateView(); } }.start(); // Timeline for UI stuff uiTimeline = new Timeline(); KeyFrame keyStart = new KeyFrame( Duration.seconds(0), e -> view.updateUI((1160 / distance) * 0.005) ); KeyFrame keyEnd = new KeyFrame(Duration.millis(5)); uiTimeline.getKeyFrames().addAll(keyStart, keyEnd); uiTimeline.setCycleCount(Timeline.INDEFINITE); uiTimeline.setAutoReverse(false); countdownTimer = new Timeline( new KeyFrame( Duration.seconds(distance - (1160 / distance) * 0.005), e -> journeyComplete() ) ); // Timeline for asteroids Timeline asteroidTimer = new Timeline( new KeyFrame(Duration.millis(2000), e -> model.AsteroidPool.spawn()) ); asteroidTimer.setCycleCount(Timeline.INDEFINITE); asteroidTimer.play(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void walking(final Player p){\n timerListener = new ActionListener()\n {\n public void actionPerformed(ActionEvent e)\n {\n //test to see if the player is currently jumping\n if(jumpState != 2){\n //if the player is not jumping this if else statement will\n //change the character from leg out to leg in position\n if(jumpState == 1){\n //sets the image to have the leg in\n jumpState = 0;\n }\n else{\n //sets the image to have the leg out\n jumpState = 1;\n }\n\n }\n\n }\n };\n //creates the timer for continous animation of walkListener\n walker = new Timer(getWalkSpeed(), timerListener);\n //starts timer for walk animation\n walker.start();\n ActionListener walkIncListener = new ActionListener()\n {\n public void actionPerformed(ActionEvent e)\n {\n if (getWalkSpeed() > WALK_SPEED_MIN)\n {\n System.out.println(\"1\");\n walker.stop();\n incWalkSpeed(getWalkSpeedInc());\n walker = new Timer(getWalkSpeed(), timerListener);\n walker.start();\n }\n else\n {\n walkInc.stop();\n System.out.println(\"2\");\n }\n\n }\n };\n walkInc = new Timer(WALK_SPEED, walkIncListener);\n //starts timer for walk animation\n walker.start();\n ActionListener dead = new ActionListener()\n {\n public void actionPerformed(ActionEvent e)\n {\n if(p.isAlive() == false){\n walker.stop();\n }\n }\n };\n Timer kill = new Timer(100, dead);\n kill.start();\n\n }", "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 abstract void animation(double seconds);", "private void update()\n{\n // Get seconds elapsed\n int elapsedTime = (int)(System.currentTimeMillis() - _startTime);\n \n // Get play start time\n int playStartTime = getPlayStartTime()>=0? getPlayStartTime() : 0;\n\n // Increment time by time elapsed\n setTime(playStartTime + elapsedTime);\n \n // If not looping and time is beyond max, stop animator\n if(!getLoops() && (getPlayStartTime() + elapsedTime >= getMaxTime()))\n stop();\n}", "@Override\r\n public void actionPerformed(ActionEvent e) {\r\n if (e.getSource() instanceof Timer) {\r\n if (animatedPos == canvas.size() - 1)\r\n animatedDir = -1;\r\n if (animatedPos == 0)\r\n animatedDir = 1;\r\n animatedPos += animatedDir;\r\n repaint();\r\n }\r\n }", "public void updateAnimation() {\n\t\tif (anim < 1000) {\n\t\t\tanim++;\n\t\t} else anim = 0;\n\t}", "@Override\n public void update(float delta) {\n\tif (player.getState() == PlayerState.JUMPING) {\n\t walkingStateTime = 0;\n\t jumpingStateTime += delta;\n\t} else if (player.getState() == PlayerState.WALKING) {\n\t jumpingStateTime = 0;\n\t walkingStateTime += delta;\n\t} else if (player.getState() == PlayerState.IDLE) {\n\t walkingStateTime = 0;\n\t jumpingStateTime = 0;\n\t}\n\t\n }", "@Override\n\tpublic void update() {\n\n\t\ttimer++;\n\t\tupdatePlayer();\n\t\tupdateScreen();\n\t\tupdateLives();\n\n\t}", "public void play()\n{\n // If timer is null, create it\n if(_timer==null)\n _timer = new javax.swing.Timer(getInterval(), new ActionListener() {\n public void actionPerformed(ActionEvent e) { update(); }});\n\n // If animator not running, start timer\n if(!isRunning()) {\n \n // Record time animator was at and time started\n _playStartTime = getTime();\n _startTime = System.currentTimeMillis();\n \n // Start timer\n _timer.start();\n \n // Send animatorStarted notification\n for(Listener listener : getListeners(Listener.class)) listener.animatorStarted(this);\n }\n}", "@Override\n\tpublic void update() {\n\t\tkeyFrame++;\n\t\tif(keyFrame > 60)\n\t\t\tsetDead(true);\n\t\tif(move)\n\t\t\tif(!isDead())\n\t\t\t\tpositionY += getSpeed();\n\t}", "public void circle(int time){\n int[][] ordinance = {{0,-1},{1,0},{0,1},{-1,0}}; \n tMovement = new Timer(time,new ActionListener(){\n private int ordinanceInd = 0;\n private int distance = 1;\n private int[][] moveOrdinance = ordinance; \n\n @Override \n public void actionPerformed(ActionEvent e){\n //update velocity values\n xVel = distance*moveOrdinance[ordinanceInd][0];\n yVel = distance*moveOrdinance[ordinanceInd][1]; \n\n //update image display fields\n if (ordinanceInd == 2){\n direction = Player.SOUTH;\n } else if (ordinanceInd == 1){\n direction = Player.WEST; \n } else if (ordinanceInd == 3){\n direction = Player.EAST; \n } else{\n direction = Player.NORTH; \n }\n displayVal = direction;\n\n //change direction\n ordinanceInd = (ordinanceInd+1)%4;\n }\n\n });\n \n tMovement.setInitialDelay(1);\n tMovement.start();\n tState.start();\n }", "public void play(){\n\t\tif(timer == null){ return; }\n\t\t//1000ms in a second, so divided by frames per second gives ms interval \n\t\ttimer.setDelay(1000/fps);\n\t\ttimer.start();\n\t}", "public void frameForward()\n{\n stop();\n setTime(getTime() + getInterval());\n}", "public void move(float deltaTime) {\n }", "private void move(){\n \n currentAnimation = idleDown;\n \n if(playerKeyInput.allKeys[VK_W]){\n int ty = (int) (objectCoordinateY - speed + bounds.y) / 16;\n \n if(!collisionDetection((int) (objectCoordinateX + bounds.x)/16, ty)){\n objectCoordinateY -= speed;\n currentAnimation = upWalk;\n }\n } \n \n if(playerKeyInput.allKeys[VK_S]){\n int ty = (int) (objectCoordinateY + speed + bounds.y + bounds.height) / 16;\n if(!collisionDetection((int) (objectCoordinateX + bounds.x)/16, ty)){\n objectCoordinateY += speed;\n currentAnimation = downWalk;\n }\n } \n \n if(playerKeyInput.allKeys[VK_A]){\n int tx = (int) (objectCoordinateX - speed + bounds.x) / 16;\n if(!collisionDetection(tx, (int) (objectCoordinateY + bounds.y)/16)){\n objectCoordinateX -= speed;\n currentAnimation = sideWalkLeft;\n }\n } \n \n if(playerKeyInput.allKeys[VK_D]){\n int tx = (int) (objectCoordinateX + speed + bounds.x + bounds.width) / 16;\n if(!collisionDetection(tx, (int) (objectCoordinateY + bounds.y)/16)){\n objectCoordinateX += speed;\n currentAnimation = sideWalkRight;\n }\n } \n \n if(playerKeyInput.allKeys[VK_E]){\n currentAnimation = pickUp;\n } \n }", "public void tick(){\n camera.tick(player);\n handler.tick();\n }", "public void anim() {\n // start the timer\n t.start();\n }", "public AnimationTimer createTimer() {\n return new AnimationTimer() {\n @Override\n public void handle(long now) {\n if (!levelController.getLevelControllerMethods().getGamePaused()) {\n levelController.getBubbles().forEach(Monster.this::checkCollision);\n move();\n }\n\n setChanged();\n notifyObservers();\n }\n };\n\n }", "public abstract void move(int elapsedTime);", "private void idleAnimation(){\n timer++;\n if( timer > 4 ){\n setImage(loadTexture());\n animIndex++;\n timer= 0;\n if(animIndex > maxAnimIndex ){\n animIndex = 0;\n }\n }\n }", "protected abstract float getFrameTimeNormalAnimation();", "public void createTimer() {\n timer = new AnimationTimer() {\n @Override\n public void handle(long now) {\n if (animal.changeScore()) {\n setNumber(animal.getPoints());\n }\n if (animal.getStop()) {\n System.out.println(\"Game Ended\");\n background.stopMusic();\n stop();\n background.stop();\n\n ArrayList list = null;\n try {\n list = scoreFile.sortFile(animal.getPoints());\n } catch (IOException e) {\n e.printStackTrace();\n }\n popUp(list);\n }\n }\n };\n }", "public void makeTimer(){\n\t\n\t\tframeIndex = 0;\n\t\n\t\t//Create a new interpolator\n\t\tInterpolator lint = new Interpolator();\n\t\n\t\t//interpolate between all of the key frames in the list to fill the array\n\t\tframes = lint.makeFrames(keyFrameList);\n\t\n\t\t//timer delay is set in milliseconds, so 1000/fps gives delay per frame\n\t\tint delay = 1000/fps; \n\t\n\t\n\t\tActionListener taskPerformer = new ActionListener() {\n\n\t\t\tpublic void actionPerformed(ActionEvent evt) {\n\t\t\t\tif(frameIndex == frames.length){ frameIndex = 0;}\n\n\t\t\t\tframes[frameIndex].display();\n\t\t\t\tframes[frameIndex].clearDisplay();\n\t\t\t\tframeIndex++;\n\t\t\t}\n\t\t};\n\n\t\ttimer = new Timer(delay, taskPerformer);\t\n\t}", "@Override\n public void run() {\n long startTime = System.currentTimeMillis();\n\n //Animation loop.\n while (Thread.currentThread() == animatorThread) {\n //Advance the animation frame.\n frameNumber++;\n repaint();\n //Delay depending on how far we are behind.\n try {\n startTime += delay;\n Thread.sleep(Math.max(0,\n startTime - System.currentTimeMillis()));\n } catch (InterruptedException e) {\n break;\n }\n }\n }", "public void run() {\n\t// Remember the starting time\n\tlong tm = System.currentTimeMillis();\n\twhile (Thread.currentThread() == animator) {\n\t // Display the next frame of animation.\n\t repaint();\n\n\t // Delay depending on how far we are behind.\n\t try {\n\t\ttm += delay;\n\t\tThread.sleep(Math.max(0, tm - System.currentTimeMillis()));\n\t } catch (InterruptedException e) {\n\t\tbreak;\n\t }\n\n\t // Advance the frame\n\t frame++;\n\t}\n }", "@Override\r\n public void update() {\r\n // Animate sprite\r\n if (this.spriteTimer++ >= 4) {\r\n this.spriteIndex++;\r\n this.spriteTimer = 0;\r\n }\r\n if (this.spriteIndex >= this.animation.length) {\r\n this.destroy();\r\n } else {\r\n this.sprite = this.animation[this.spriteIndex];\r\n }\r\n }", "private void checkMovement()\n {\n if (frames % 600 == 0)\n {\n \n ifAllowedToMove = true;\n \n \n }\n \n }", "public void startTimer() {\n animationTimer = new AnimationTimer() {\n @Override\n public void handle(final long now) {\n videoController.update(now);\n if (videoController.isClosed()) {\n stopTimer();\n return;\n }\n roomController.update(now);\n timeLogController.update(now);\n }\n };\n timeLogController.clearInformationArea();\n animationTimer.start();\n }", "public void circleOpp(int time){\n int[][] ordinance = {{0,1},{-1,0},{0,-1},{1,0}}; \n \n tMovement = new Timer(time,new ActionListener(){\n private int ordinanceInd = 0;\n private int distance = 1;\n private int[][] moveOrdinance = ordinance; \n\n @Override \n public void actionPerformed(ActionEvent e){\n //update velocity values\n xVel = distance*moveOrdinance[ordinanceInd][0];\n yVel = distance*moveOrdinance[ordinanceInd][1]; \n\n //update image display fields\n if (ordinanceInd == 0){\n direction = Player.SOUTH;\n } else if (ordinanceInd == 3){\n direction = Player.WEST; \n } else if (ordinanceInd == 1){\n direction = Player.EAST; \n } else{\n direction = Player.NORTH; \n }\n displayVal = direction;\n\n //change direction\n ordinanceInd = (ordinanceInd+1)%4;\n }\n\n });\n \n tMovement.setInitialDelay(1);\n tMovement.start();\n tState.start();\n }", "@Override\n public void update() {\n animate();\n if (alive == false) {\n afterKill();\n return;\n }\n if (alive) {\n calculateMove();\n }\n }", "public void update(){\n if(player.getPlaying()) {\n // update player animation.\n player.update();\n // update background animation.\n bg.update();\n // checks if skater has finished falling animation to end the game.\n if (player.animate instanceof FallAnimate && player.animate.getDone()) {\n player.setPlaying(false);\n player.setFall(false);\n System.out.println(\"End \" + player.getPlaying());\n }\n // checks if player has reached required points.\n if(player.getScore() > TARGETSCORE){\n player.setPlaying(false);\n levelCompleted = true;\n levelReset = System.nanoTime();\n }\n // increment jumpcounter while crouched.\n if (player.animate instanceof CrouchingAnimate && (jumpCounter <= 25)) {\n jumpCounter++;\n }\n // Creating Bananas:\n long bananaElapsed = (System.nanoTime() - bananaStartTime) / 1000000;\n if(bananaElapsed > 10500 && MainActivity.difficulty != 0){\n bananas.add(new Banana(BitmapFactory.decodeResource(getResources(),\n R.drawable.bigbanana), WIDTH + 10, (int) (HEIGHT * 0.85), 40, 40, 1));\n bananaStartTime = System.nanoTime();\n }\n //collision detection:\n for (int i = 0; i < bananas.size(); i++) {\n bananas.get(i).update();\n if (collision(bananas.get(i), player)) {\n bananas.remove(i);\n player.setFall(true);\n player.setPlaying(false);\n break;\n }\n // removing bananas when off screen\n if (bananas.get(i).getX() < -100) {\n bananas.remove(i);\n break;\n }\n }\n // Creating Cones:\n long coneElapsed = (System.nanoTime() - coneStartTime) / 1000000;\n if (coneElapsed > 5000) {\n cones.add(new TallBricks(BitmapFactory.decodeResource(getResources(),\n R.drawable.tallbricks), WIDTH + 10, (int) (HEIGHT * 0.59), 100, 161, 1));\n coneStartTime = System.nanoTime();\n }\n // update and check collisions.\n for (int i = 0; i < cones.size(); i++) {\n\n cones.get(i).update();\n if (collision(cones.get(i), player) && MainActivity.difficulty == 0) {\n cones.remove(i);\n player.forceSetScore(-500);\n break;\n }\n\n if (collision(cones.get(i), player) && MainActivity.difficulty != 0) {\n cones.remove(i);\n player.setFall(true);\n break;\n }\n // removing cones when off screen\n if (cones.get(i).getX() < -100) {\n cones.remove(i);\n break;\n }\n\n if((cones.get(i).getX() < player.getX() -15) ){\n cones.remove(i);\n player.setPendingPoints(1000);\n break;\n }\n }\n }\n else if(player.getPlaying() == false && levelCompleted){\n long resetElapsed = (System.nanoTime()-levelReset)/1000000;\n if(resetElapsed > 4000) {\n Intent resultIntent = new Intent();\n resultIntent.putExtra(\"result\",true);\n ((Activity)context).setResult(Activity.RESULT_OK,resultIntent);\n ((Activity)context).finish();\n }\n }\n else if(player.getPlaying() == false && !levelCompleted){\n if(!reset){\n newGameCreated = false;\n startReset = System.nanoTime();\n reset = true;\n }\n\n long resetElapsed = (System.nanoTime()-startReset)/1000000;\n\n if(resetElapsed > 2500 && !newGameCreated){\n newGame();\n }\n else if(resetElapsed < 2500 && started){\n player.update();\n }\n }\n }", "public void run()\n {\n // Remember the starting time\n long tm = System.currentTimeMillis();\n while (Thread.currentThread() == animator)\n {\n // Display the next frame of animation.\n update();\n try\n {\n tm += delay;\n Thread.sleep(Math.max(0, tm - System.currentTimeMillis()));\n }\n catch (InterruptedException e)\n {\n break;\n }\n // Advance the frame\n frame++;\n }\n }", "public void speedUp(){\r\n\t\tmoveSpeed+=1;\r\n\t\tmoveTimer.setDelay(1000/moveSpeed);\r\n\t}", "public void setAnimation() {\r\n\r\n // start outside the screen and move down until the clock is out of sight\r\n ObjectAnimator moveDown = ObjectAnimator.ofFloat(this, \"y\", -100, screenY + 100);\r\n AnimatorSet animSet = new AnimatorSet();\r\n animSet.play(moveDown);\r\n\r\n // Set duration to 4000 milliseconds\r\n animSet.setDuration(4000);\r\n\r\n animSet.start();\r\n\r\n }", "@Override\n public void startGame() {\n timer.scheduleAtFixedRate(new TimerTask() {\n @Override\n public void run() {\n update();\n }\n }, 0, 2);\n }", "public void mo5969f() {\n this.f5416fa.setVisibility(0);\n this.f5416fa.setImageBitmap(C1413m.f5711i);\n ObjectAnimator duration = ObjectAnimator.ofFloat(this.f5416fa, \"translationY\", new float[]{0.0f, -((float) C1413m.f5711i.getHeight())}).setDuration(350);\n ObjectAnimator duration2 = ObjectAnimator.ofFloat(this.f5416fa, \"alpha\", new float[]{1.0f, 0.9f, 0.8f, 0.7f, 0.55f, 0.35f, 0.2f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}).setDuration(350);\n duration.start();\n duration2.start();\n long j = (long) 240;\n ObjectAnimator.ofFloat(this.f5386F, \"alpha\", new float[]{0.0f, 1.0f}).setDuration(j).start();\n ObjectAnimator.ofFloat(this.f5384D, \"alpha\", new float[]{0.0f, 1.0f}).setDuration(j).start();\n ObjectAnimator.ofFloat(this.f5385E, \"alpha\", new float[]{0.0f, 1.0f}).setDuration(j).start();\n this.f5384D.getTexView().setText(getResources().getString(R.string.pause));\n duration.addListener(new C1298Va(this));\n }", "private void updateTimer()\r\n {\n if (timeLeft > 0)\r\n {\r\n frameCounter++;\r\n \r\n // if a second has passed\r\n if (frameCounter >= frameRate)\r\n {\r\n // reset the frame counter\r\n frameCounter = 0;\r\n \r\n // update the secondsElapsed var\r\n totalSecondsElapsed++;\r\n \r\n // subtract a second from the timer\r\n timeLeft--;\r\n \r\n // change the time into mins & seconds\r\n int minsLeft = timeLeft / 60;\r\n int secondsLeft = timeLeft % 60;\r\n \r\n // update the time display (min:sec)\r\n String timerDisplay = minsLeft + \":\" + getLeadingZero(secondsLeft, 10) + secondsLeft;\r\n timerText.text = timerDisplay;\r\n timerText.updateText();\r\n }\r\n }\r\n else\r\n {\r\n endGame();\r\n }\r\n }", "void update(int seconds);", "@Override\n\tpublic void update() {\n\n\t\t//Get current time\n\t\tdouble currentTime = System.currentTimeMillis();\n\t\tdouble movement = ((currentTime - previousTime) * movementSpeed) / 1000.0;\n\t\t\n\t\t//Create a translation vector\n\t\tVector translation = new Vector(2);\n\n\t\tboolean moving = false;\n\t\t\n\t\t//Determine which keys are pressed\n\t\tif(Directory.inputManager.isKeyPressed('w')){\n\t\t\t//Set translation Vector to move up\n\t\t\ttranslation.setComponent(1, translation.getComponent(1)-movement);\n\t\t\tattachedTo.getSprite().playAnimation(3, true);\n\t\t\tmoving = true;\n\t\t}\n\t\tif(Directory.inputManager.isKeyPressed('s')){\n\t\t\t//Set translation vector to move down\n\t\t\ttranslation.setComponent(1, translation.getComponent(1) + movement);\n\t\t\tattachedTo.getSprite().playAnimation(2, true);\n\t\t\tmoving = true;\n\n\t\t}\n\t\tif(Directory.inputManager.isKeyPressed('a')){\n\t\t\t//Set translation Vector to move left\n\t\t\ttranslation.setComponent(0, translation.getComponent(0)-movement);\n\t\t\tattachedTo.getSprite().playAnimation(0, true);\n\t\t\tmoving = true;\n\n\t\t}\n\t\tif(Directory.inputManager.isKeyPressed('d')){\n\t\t\t//Set translation Vector to move right\n\t\t\ttranslation.setComponent(0, translation.getComponent(0)+movement);\n\t\t\tattachedTo.getSprite().playAnimation(1, true);\n\t\t\tmoving = true;\n\n\t\t}\n\t\t\n\t\tif(!moving) attachedTo.getSprite().setRepeating(false);\n\t\t\n\t\t//Move this gameObject\n\t\tgetAttachedMObj().move(translation);\n\t\t\n\t\t//Update previous time\n\t\tpreviousTime = currentTime;\n\t\t\t\n\t}", "public void starteSpiel(ActionEvent actionEvent) {\n System.out.println(\"Started\");\n //https://www.programcreek.com/java-api-examples/?api=javafx.animation.AnimationTimer\n //60 fps\n new AnimationTimer() {\n public void handle(long currentNanoTime) {\n // calculate time since last update.\n moveBall();\n }\n }.start(); // Was diese?\n\n\n }", "@Override\r\n\t//Event handler for the Timer action\r\n\tpublic void actionPerformed(ActionEvent e) {\n\t\tmoveSnake();\r\n\t}", "public void onUpdateTimerTick() {\r\n\t\tx = x+dx;\r\n\t\ty = y+dy;\r\n\t\tgame.updateWorld();\r\n\r\n\t}", "void setTime(){\n gTime += ((float)millis()/1000 - millisOld)*(gSpeed/4);\n if(gTime >= 4) gTime = 0;\n millisOld = (float)millis()/1000;\n }", "public void progressBarTimer() {\r\n progressBar.setProgress(0);\r\n TimerTask task = new TimerTask() {\r\n @Override\r\n public void run() {\r\n if(!pause) progressBar.incrementProgressBy(1);\r\n\r\n //Game over\r\n if (progressBar.getProgress() >= 100) gameOver();\r\n }\r\n };\r\n\r\n //schedule starts after 0.01 seconds and repeats every second.\r\n timer.schedule(task, 10, 1000);\r\n }", "public void timer() \r\n\t{\r\n\t\tSeconds.tick();\r\n\t \r\n\t if (Seconds.getValue() == 0) \r\n\t {\r\n\t \tMinutes.tick();\r\n\t \r\n\t \tif (Minutes.getValue() == 0)\r\n\t \t{\r\n\t \t\tHours.tick();\r\n\t \t\t\r\n\t \t\tif(Hours.getValue() == 0)\r\n\t \t\t{\r\n\t \t\t\tHours.tick();\r\n\t \t\t}\r\n\t \t}\r\n\t }\t\t\r\n\t \r\n\t updateTime();\r\n\t }", "public void update()\n {\n long elapsed = (System.nanoTime()-startTime)/1000000;\n if(elapsed>100)\n {\n hard += 20; // increase difficulty\n score = Dynamics.getPosition();\n startTime = System.nanoTime();\n }\n dx = (int)Dynamics.getVelocityX();\n\n animation.update();\n x += dx;\n if(x < 0){\n x = 0;\n } else if (x+width > GamePanel.WIDTH){\n x = GamePanel.WIDTH-width;\n }\n\n }", "private void updateTime() {\n timer.update();\n frametime = timer.getTimePerFrame();\n }", "public void moveForward() {\t\t\t\t\t\t\t\t\t\t\t\t\t\t \t // 2\n\t\tseconds += tic;\n\t\tif (seconds >= 60.0) {\n\t\t\tseconds -= 60.0;\n\t\t\tminutes++;\n\t\t\tif (minutes == 60) {\n\t\t\t\tminutes = 0;\n\t\t\t\thours++;\n\t\t\t}\n\t\t}\n\t}", "@Override\r\n\tpublic void update(int delta)\r\n\t{\r\n\t\tcounter += delta;\r\n\t\twhile(counter >= interval)\r\n\t\t{\r\n\t\t\tcounter -= interval;\r\n\t\t\ttarget.act();\r\n\t\t}\r\n\t}", "public void tick(){\r\n if(timer != 0)\r\n timer++;\r\n }", "public void update(float delta) {\n\t\tposition.add(1*60*delta, 1*60*delta);\r\n\t\tposition.x += 10;\r\n\t\tif(position.x >= 400) {\r\n\t\t\talive = false;\r\n\t\t}\r\n\t}", "@Override\n public State update() {\n if(mRuntime.seconds()<=time) {\n arm.setPosition(pos);\n return this;\n }\n //(1000);\n\n return NextState;\n\n\n\n\n\n }", "public static void initTimer(){\r\n\t\ttimer = new Timer();\r\n\t timer.scheduleAtFixedRate(new TimerTask() {\r\n\t public void run() {\r\n\t \t//se o player coletar todas os lixos, o tempo para\r\n\t \tif(ScorePanel.getScore() == 100){\r\n\t \t\ttimer.cancel();\r\n\t \t}\r\n\t \t//se o Tempo se esgotar, é game over!!!\r\n\t \telse if (tempo == 0){\r\n\t \t timer.cancel();\r\n \t\tAvatar.noMotion();\r\n \t\t//System.exit(0);\r\n\t }\r\n\t \t//Senão, vai contando\r\n\t \telse{\r\n\t \tlbltimer.setText(\"Tempo: \"+ --tempo);\r\n\t }\r\n\t }\r\n\t\t}, 1000, 1000);\r\n\t}", "private void updateTime(){\n currentTime = System.currentTimeMillis();\n float tp = previousTime;\n previousTime = (float)(currentTime - startingTime);\n dt = previousTime - tp;\n fps = 1000f/dt;\n }", "private void ufoMotion() {\n leftToRightAnimation(ufo, 500);\n new Handler().postDelayed(new Runnable() {\n @Override\n public void run() {\n if (!clickable)\n ufoMotion();\n }\n }, 1000);\n }", "private void moveTimer(long period) {\n\t\tmoveTimer.schedule(new TimerTask() {\n\t\t\tpublic void run() {\n\t\t\t\tif (Math.abs(relativeX + MOVE_DISTANCE * (getMoveRight() ? 1 : -1)) > onLog.getImageWidth() / 2) {\n\t\t\t\t\tsetMoveRight(!getMoveRight());\n\t\t\t\t\trelativeX += MOVE_DISTANCE * (getMoveRight() ? 1 : -1);\n\t\t\t\t} else {\n\t\t\t\t\trelativeX += MOVE_DISTANCE * (getMoveRight() ? 1 : -1);\n\t\t\t\t}\n\t\t\t}\n\t\t}, period, period);\n\t}", "public void update(){\n\t\t\tif (x<200){\n\t\t\t\txmoving=1; \n\t\t\t}\n\t\t\tif (x>900){ \n\t\t\t\txmoving=-.1; \n\t\t\t} \n\n\t\t\tx+=xmoving;\n\n\t}", "@Override\n public void update(){\n getNextPosition();\n checkTileMapCollision();\n setPosition(xtemp, ytemp);\n animation.update();\n }", "void startUpdateTimer();", "private void movementPhase() {\n ClickObserver.getInstance().setCreatureFlag(\"\");\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getDoneButton().setDisable(false);\n TheCupGUI.update();\n Board.removeCovers();\n }\n });\n for (Player p : playerList) {\n \tplayer = p;\n player.flipAllUp();\n\t ClickObserver.getInstance().setActivePlayer(player);\n\t ClickObserver.getInstance().setCreatureFlag(\"Movement: SelectMovers\");\n\t InfoPanel.uncover(player.getName());\n\t if (p.getHexesWithPiece().size() > 0) {\n\t \tClickObserver.getInstance().setClickedTerrain(p.getHexesWithPiece().get(0));\n\t }\n\t pause();\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n \tClickObserver.getInstance().whenTerrainClicked();\n \t GUI.getHelpText().setText(\"Movement Phase: \" + player.getName()\n + \", Move your armies\");\n \t Game.getRackGui().setOwner(player);\n }\n });\n\t \n\t while (isPaused) {\n \ttry { Thread.sleep(100); } catch( Exception e ){ return; } \n\t }\n\t InfoPanel.cover(player.getName());\n player.flipAllDown();\n }\n Platform.runLater(new Runnable() {\n @Override\n public void run() {\n GUI.getDoneButton().setDisable(true);\n }\n });\n ClickObserver.getInstance().setCreatureFlag(\"\");\n }", "public void mo5964b() {\n this.f5416fa.setVisibility(0);\n this.f5416fa.setImageBitmap(C1413m.f5711i);\n ObjectAnimator duration = ObjectAnimator.ofFloat(this.f5416fa, \"translationY\", new float[]{0.0f, -((float) C1413m.f5711i.getHeight())}).setDuration(350);\n ObjectAnimator duration2 = ObjectAnimator.ofFloat(this.f5416fa, \"alpha\", new float[]{1.0f, 0.9f, 0.8f, 0.7f, 0.55f, 0.35f, 0.2f, 0.1f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f}).setDuration(350);\n duration.start();\n duration2.start();\n long j = (long) 240;\n ObjectAnimator.ofFloat(this.f5436pa, \"alpha\", new float[]{0.0f, 0.3f, 0.5f, 0.7f, 0.9f, 1.0f}).setDuration(j).start();\n this.f5438qa.getMeasuredHeight();\n this.f5384D.getmImageViewHeight();\n C1413m.m6828a(27, this.f5389I);\n ObjectAnimator.ofFloat(this.f5386F, \"alpha\", new float[]{0.0f, 1.0f}).setDuration(j).start();\n ObjectAnimator.ofFloat(this.f5384D, \"alpha\", new float[]{0.0f, 1.0f}).setDuration(j).start();\n ObjectAnimator.ofFloat(this.f5385E, \"alpha\", new float[]{0.0f, 1.0f}).setDuration(j).start();\n this.f5384D.getTexView().setText(getResources().getString(R.string.pause));\n this.f5384D.getmImageView().setImageResource(R.drawable.iqoo_buttonanimation);\n this.f5393M = (AnimationDrawable) this.f5384D.getmImageView().getDrawable();\n this.f5393M.start();\n duration.addListener(new C1300Wa(this));\n }", "@Override\r\n public void update(long fps,\r\n Transform t,\r\n Transform playerTransform) {\n }", "private void startAnimation()\n\t{\n\t\tActionListener timerListener = new TimerListener();\n\t\tTimer timer = new Timer(DELAY, timerListener);\n\t\ttimer.start();\n\t}", "public void animateMovementUp()\n {\n if(animationCount%frameRate == 0)\n {\n imageNumber = (imageNumber + 1)% (upMvt.length);\n setImage(upMvt[imageNumber]);\n } \n }", "public abstract void advance(double deltaTime);", "private void runTimer() {\n\n // Handler\n final Handler handler = new Handler();\n\n handler.post(new Runnable() {\n @Override\n public void run() {\n\n if (playingTimeRunning) {\n playingSecs++;\n }\n\n handler.postDelayed(this, 1000);\n }\n });\n\n }", "private void startAnimation(){\n\t TimerActionListener taskPerformer = new TimerActionListener();\n\t new Timer(DELAY, taskPerformer).start();\n \t}", "public void run()\n\t{\n\t\tfloat oneFrame = 1000000000.0f / gameFPS;\n\t\t//same but for animation frames\n\t\tfloat oneAnimFrame = 1000000000.0f / animFPS;\n\t\t//current time in nanoseconds\n\t\tlong now = 0;\n\t\t//holds time of last iteration of game loop\n\t\tlong last = System.nanoTime();\n\t\t//how many frames have passed (can be a fraction)\n\t\tfloat delta = 0;\n\t\t//same but for anim frames\n\t\tfloat animDelta = 0;\n\t\t\n\t\t//for counting and displaying only \n\t\tint countFrames = 0;\n\t\tlong lastMilli = System.currentTimeMillis();\n\t\t\n\t\trequestFocus();\n\t\t//game loop\n\t\twhile (playing)\n\t\t{\n\t\t\t\n\t\t\tnow = System.nanoTime();\n\t\t\t//(now - last) time elapsed, divided by oneFrame gives\n\t\t\t//what fraction of a frame has passed\n\t\t\tdelta += (now - last) / oneFrame;\n\t\t\tanimDelta += (now - last) / oneAnimFrame;\n\t\t\tlast = now;\n\t\t\t//keep calling tick for as many frames have passed\n\t\t\t//if it's at least 1\n\t\t\tif (delta >= 1.0f)\n\t\t\t{\n\t\t\t\tcountFrames++;\n\t\t\t\twhile (delta >= 1.0f)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\ttick();\n\t\t\t\t\tdelta--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (animDelta >= 1.0f)\n\t\t\t{\n\t\t\t\twhile (animDelta >= 1.0f)\n\t\t\t\t{\n\t\t\t\t\t\n\t\t\t\t\tanimTick();\n\t\t\t\t\tanimDelta--;\n\t\t\t\t}\n\t\t\t}\n\t\t\trender();\n\t\t\tcountFrames++;\n\t\t\tif (Math.abs(System.currentTimeMillis() - lastMilli) >= 1000)\n\t\t\t{\n\t\t\t\tFPS = countFrames;\n\t\t\t\tcountFrames = 0;\n\t\t\t\tlastMilli = System.currentTimeMillis();\n\t\t\t}\n\t\t}\n\t}", "public void animateMovementDown()\n {\n if(animationCount%frameRate == 0)\n {\n imageNumber = (imageNumber + 1)% (downMvt.length);\n setImage(downMvt[imageNumber]);\n } \n }", "@SuppressWarnings(\"static-access\")\n\t@Override\n\tpublic void run() \n\t{\n\t\tint currentdx = 0;\n\t\tint currentdy = 0;\n\t\twhile(currentdy < Math.abs(dy) || currentdx < Math.abs(dx))\n\t\t{\n\t\t\tif(time == 0)\n\t\t\t{\n\t\t\t\tif(dx < 0 || dy < 0){\n\t\t\t\tdy = -dy;\n\t\t\t\tdx = -dx;\n\t\t\t\tcurrentdy = dy;\n\t\t\t\tcurrentdx = dx;\n\t\t\t\tMainController.getInstance().moveImage(name, -dx, -dy);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tcurrentdy = dy;\n\t\t\t\t\tcurrentdx = dx;\n\t\t\t\t\tMainController.getInstance().moveImage(name, dx, dy);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(currentdy < Math.abs(dy) && currentdx < Math.abs(dx)){\n\t\t\t\tcurrentdy++;\n\t\t\t\tcurrentdx++;\t\t\t\t\n\t\t\t\tMainController.getInstance().moveImage(name, dx/Math.abs(dx), dy/Math.abs(dy));\n\t\t\t}\n\t\t\telse{\n\t\t\t\tif(currentdy < Math.abs(dy)){\n\t\t\t\t\tcurrentdy++;\t\n\t\t\t\t\tMainController.getInstance().moveImage(name, 0, dy/Math.abs(dy));\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tif(currentdx < Math.abs(dx)){\n\t\t\t\t\tcurrentdx++;\t\t\t\t\n\t\t\t\t\tMainController.getInstance().moveImage(name, dx/Math.abs(dx), 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\ttry {\n\t\t\t\tthis.sleep(time * 1000 / (( Math.max(Math.abs(dx), Math.abs(dy) ))+1));\n\t\t\t\tMainController.getInstance().repaint();\n\t\t\t} catch (InterruptedException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\t\n\t\t\tif((currentdx % 100 == 0 && currentdx != dx )|| (currentdy % 100 == 0&& currentdy!=dy))\n\t\t\t\tSystem.out.println(currentdx + \" \" + currentdy);\n\t\t}\n\t}", "public void move() {\n\t\tdouble xv = 0;\r\n\t\tdouble yv = 0;\r\n\t\t//this method allows the entity to hold both up and down (or left and right) and not move. gives for smooth direction change and movement\r\n\t\tif (moveRight) {\r\n\t\t\txv+=getSpeed();\r\n\t\t\torientation = Orientation.EAST;\r\n\t\t}\r\n\t\tif (moveLeft) {\r\n\t\t\txv-=getSpeed();\r\n\t\t\torientation = Orientation.WEST;\r\n\t\t}\r\n\t\tif (moveUp)\r\n\t\t\tyv-=getSpeed();\r\n\t\tif (moveDown)\r\n\t\t\tyv+=getSpeed();\r\n\t\tif (!doubleEquals(xv,0) || !doubleEquals(yv,0)) {\r\n\t\t\t((Player)this).useMana(0.1);\r\n\t\t\tImageIcon img = new ImageIcon(\"lib/assets/images/fireball.png\");\r\n\t\t\tBufferedImage image = new BufferedImage(32,32,BufferedImage.TYPE_INT_ARGB);\r\n\t\t\tGraphics g = image.getGraphics();\r\n\t\t\tg.drawImage(img.getImage(), 0, 0, image.getWidth(), image.getHeight(), null);\r\n\t\t\tColor n = loop[ind%loop.length];\r\n\t\t\tind++;\r\n\t\t\timage = ImageProcessor.scaleToColor(image, n);\r\n\t\t\t//PopMessage.addPopMessage(new PopMessage(image,getX(),getY()));\r\n\t\t}\r\n\t\telse\r\n\t\t\t((Player)this).useMana(-0.1);\r\n\t\tmove(xv,yv);\r\n\t}", "public static void move()\n\t{\n\t\tswitch(step)\n\t\t{\n\t\t\tcase 0:\n\t\t\t\ttimer.start();\n\t\t\t\tstep = 1;\n\t\t\tbreak;\n\t\t\t// 1. Right wheels forward\n\t\t\tcase 1:\n\t\t\t\tif(timer.get() < time)\n\t\t\t\t{\n\t\t\t\t\tsetSpeed(0, .5);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttimer.reset();\n\t\t\t\t\tstep = 2;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\ttimer.start();\n\t\t\t\tstep = 3;\n\t\t\tbreak;\n\t\t\t// 2. Right wheels back\n\t\t\tcase 3:\n\t\t\t\tif(timer.get() < time)\n\t\t\t\t{\n\t\t\t\t\tsetSpeed(0, -.5);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttimer.reset();\n\t\t\t\t\tstep = 4;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\ttimer.start();\n\t\t\t\tstep = 5;\n\t\t\tbreak;\n\t\t\t// 3. Left wheels forward\n\t\t\tcase 5:\n\t\t\t\tif(timer.get() < time)\n\t\t\t\t{\n\t\t\t\t\tsetSpeed(.5, 0);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttimer.reset();\n\t\t\t\t\tstep = 6;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 6:\n\t\t\t\ttimer.start();\n\t\t\t\tstep = 7;\n\t\t\tbreak;\n\t\t\t// 4. Left wheels back\n\t\t\tcase 7:\n\t\t\t\tif(timer.get() < time)\n\t\t\t\t{\n\t\t\t\t\tsetSpeed(-.5, 0);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttimer.reset();\n\t\t\t\t\tstep = 8;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 8:\n\t\t\t\ttimer.start();\n\t\t\t\tstep = 9;\n\t\t\tbreak;\n\t\t\t// 5. Intake pick up\n\t\t\tcase 9:\n\t\t\t\tif(timer.get() < time)\n\t\t\t\t{\n\t\t\t\t\tsetSpeed(0, 0);\n\t\t\t\t\tshoot(.5);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttimer.reset();\n\t\t\t\t\tstep = 10;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\tcase 10:\n\t\t\t\ttimer.start();\n\t\t\t\tstep = 11;\n\t\t\tbreak;\n\t\t\t// 6. Intake shoot\n\t\t\tcase 11:\n\t\t\t\tif(timer.get() < time)\n\t\t\t\t{\n\t\t\t\t\tsetSpeed(0, 0);\n\t\t\t\t\tpickUp(.5);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\ttimer.reset();\n\t\t\t\t\tstep = 12;\n\t\t\t\t}\n\t\t\tbreak;\n\t\t\t// Stop and reset everything\n\t\t\tcase 12:\n\t\t\t\tsetSpeed(0, 0);\n\t\t\t\tpickUp(0);\n\t\t\t\tshoot(0);\n\t\t\t\ttimer.reset();\n\t\t\tbreak;\n\t\t}\n\t}", "public static void increaseDifficaulty() {\r\n\t\tif (Enemy._timerTicker > 5)\r\n\t\t\tEnemy._timerTicker -= 2;\r\n\t\tif (Player._timerTicker < 100)\r\n\t\t\tPlayer._timerTicker += 2;\r\n\t}", "public void run() {\n\t \tif(ScorePanel.getScore() == 100){\r\n\t \t\ttimer.cancel();\r\n\t \t}\r\n\t \t//se o Tempo se esgotar, é game over!!!\r\n\t \telse if (tempo == 0){\r\n\t \t timer.cancel();\r\n \t\tAvatar.noMotion();\r\n \t\t//System.exit(0);\r\n\t }\r\n\t \t//Senão, vai contando\r\n\t \telse{\r\n\t \tlbltimer.setText(\"Tempo: \"+ --tempo);\r\n\t }\r\n\t }", "public void trackTime()\n {\n frames += 1;\n\n // Every second (roughly) reduce the time left\n if (frames % 60 == 0)\n {\n time += 1;\n showTime();\n }\n }", "protected abstract void animate(int anim);", "private void animate() {\r\n\t\tif (spriteCounter > 50) {\r\n\t\t\tanimationFrame = 0;\r\n\t\t} else {\r\n\t\t\tanimationFrame = -16;\r\n\t\t}\r\n\t\t\r\n\t\tif (spriteCounter > 100) {\r\n\t\t\tspriteCounter = 0;\r\n\t\t}\r\n\t\t\r\n\t\r\n\t\tspriteCounter++;\r\n\t\tsetImage((Graphics2D) super.img.getGraphics());\r\n\t}", "public abstract void advanceBoard(float deltaTime);", "public void MovePlayer(int dir, double dt){\n //move the player on the y axis only \n float moveAmount = 1f;\n switch(dir){\n case 0: \n if( py < ( 0.98f - sy ) )\n py += (moveAmount * dt);\n break;\n case 1: //move down\n if( py > ( -0.98f + sy) )\n py -= (moveAmount * dt);\n break;\n default:\n break;\n }\n }", "public void startAnimation() {\n timer.start();\n }", "@Override\r\n public void tick() {\n playerNextTo();\r\n if (playerContact() && isCollisioned()) {\r\n if (!((GameState) game.getGameState()).getWorld().getTile((int) (x + xMove), (int) (y + yMove)).isSolid()\r\n && isValidMove(xMove, yMove)) {\r\n x += xMove;\r\n y += yMove;\r\n }\r\n }\r\n }", "@Override\n protected void update(Engine engine) {\n\t\trs = (GL4RenderSystem) engine.getRenderSystem();\n\t\t\n\t\telapsTime += engine.getElapsedTimeMillis();\n\t\telapsTimeSec = Math.round(elapsTime/1000.0f);\n\t\telapsTimeStr = Integer.toString(elapsTimeSec);\n\t\t\n\t\t//player.update(elapsTimeSec);\n\t\tSceneNode dragon = engine.getSceneManager().getSceneNode(\"dragonNPCNode\");\n\t\t\n\t\tdIter++;\n\t\t//if(dIter == 200)\n\t\t//{\n\t\t\t//dir = dir*-1;\n\t\t\t//dIter = 0;\n\t\t//}\n\t\tif(dIter <= 200)\n\t\tdragon.moveBackward(dir);\n\t\t\n\t\tif(dIter > 200 && dIter <= 400 )\n\t\t\tdragon.moveLeft(dir);\n\t\t\n\t\tif(dIter > 400 && dIter <= 600 )\n\t\t\tdragon.moveForward(dir);\n\t\t\n\t\tif(dIter > 600 && dIter <= 800 )\n\t\t\tdragon.moveRight(dir);\n\t\t\n\t\tif(dIter == 800 )\n\t\t\tdIter = 0;\n\t\t//SkeletalEntity dragonSE =\n\t\t\t\t//(SkeletalEntity) engine.getSceneManager().getEntity(\"dragonSkeleton\");\n\t\t//dragonSE.update();\n\t\t\n\t\tfloat time = engine.getElapsedTimeMillis();\n\t\t\n\t\tfloat playerFloat[] = player.getNode().getLocalTransform().toFloatArray();\n\t\t//playerFloat[7] = player.getNode().getLocalPosition().y();\n\t\tdouble playerMat[] = toDoubleArray(playerFloat);\n\t\tMatrix4 mat3;\n\t\tmat3 = Matrix4f.createFrom(toFloatArray(player.getNode().getPhysicsObject().getTransform()));\n\t\t//player.getNode().setLocalPosition(playerFloat[3],mat3.value(1,3), playerFloat[11]);\n\t\t//double playerMat[] = toDoubleArray(player.getNode().getLocalTransform().toFloatArray());\n\t\tplayerFloat = player.getNode().getLocalTransform().toFloatArray();\n\t\t//playerFloat[7] = player.getNode().getLocalPosition().y();\n\t\tplayerFloat[7] = mat3.value(1,3);//set y coordinate to physics world\n\t\tplayerMat = toDoubleArray(playerFloat);\n\t\tSystem.out.println(\"player.getNode().getLocalTransform(): \" + player.getNode().getLocalTransform());\n\t player.getNode().getPhysicsObject().setTransform(playerMat);\n\t \n\t player.update(elapsTimeSec);\n\t SkeletalEntity manSE =\n \t\t(SkeletalEntity) engine.getSceneManager().getEntity(\"knightSkeleton\");\n \t\tmanSE.update();\n\n\t \n\t\tif (running)\n\t\t{ \n\t\t\tMatrix4 mat;\n\t\t\tphysicsEng.update(time);\n\t\t\tfor (SceneNode s : engine.getSceneManager().getSceneNodes())\n\t\t\t{ \n\t\t\t\t//if (s.getPhysicsObject() != null && s.getName() != player.getNode().getName())\n\t\t\t\t//if (s.getPhysicsObject() != null /*&& s.getName() != player.getNode().getName()*/)\n\t\t\t\t{ \n\t\t\t\t\tmat = Matrix4f.createFrom(toFloatArray(s.getPhysicsObject().getTransform()));\n\t\t\t\t\ts.setLocalPosition(mat.value(0,3),mat.value(1,3), mat.value(2,3));\n\t\t\t\t} \n\t\t\t} \n\t\t}\n\n\t\tdispStr=\"Time = \" + elapsTimeStr + \" Score: \"+player.getScore();\n\t\trs.setHUD(dispStr, 15, 15);\n\t\tif(player.isBoostActive()) dispStr+=\" Boost Active!\";\n\t\tim.update(elapsTime);\n\t\tprocessNetworking(elapsTime);\n\t\t\n\t\tcheckForCollisions();\n\t\t//player.update(elapsTimeSec);\n\t\tSystem.out.println(\"ball transform: \" + ball2Node.getLocalTransform() );\n\t\tSystem.out.println(\"ball physycs object transform: \" + ball2Node.getPhysicsObject().getTransform()[0] + ',' \n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[1] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[2] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[3] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[4] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[5] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[6] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[7] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[8] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[9] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[10] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[11] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[12] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[13] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[14] + ','\n\t\t\t\t+ ball2Node.getPhysicsObject().getTransform()[15] + ',');\n\t\tSystem.out.println(\"ball linear velocity: \" + ball2Node.getPhysicsObject().getLinearVelocity());\n\t\tif(distanceTo(player.getNode().getLocalPosition(),ball2Node.getLocalPosition()) <= 4)\n\t\t{\n\t\t\tball2Node.setLocalPosition(0,10,0);\n\t\t\tfloat velocityArray[] = { 0, 5, 0};\n\t\t\tball2Node.getPhysicsObject().setLinearVelocity(velocityArray);\n\t\t\tfloat floTemp[] = ball2Node.getLocalTransform().toFloatArray();\n\t\t\tdouble dubTemp[] = {(double)floTemp[0], (double)floTemp[1], (double)floTemp[2], (double)floTemp[3], (double)floTemp[4],\n\t\t\t\t\t(double)floTemp[5],(double)floTemp[6],(double)floTemp[7], (double)floTemp[8], (double)floTemp[9], (double)floTemp[10], (double)floTemp[11]\n\t\t\t\t\t\t\t, (double)floTemp[12], (double)floTemp[13], (double)floTemp[14], (double)floTemp[15] };\n\t\t\t\n\t\t\tdouble dubTemp2[] = toDoubleArray(floTemp);\n\n\n\t\t\t Matrix4 mat2;\n\t\t\tball2Node.getPhysicsObject().setTransform(dubTemp2);\n\t\t\t\n\t\t\t//mat2 = Matrix4f.createFrom(toDoubleArray( ball2Node.getLocalTransform().toFloatArray()))\n\t\t\t//ball2Node.getPhysicsObject().setTransform(dubTemp2);\n\t\t\t//ball2Node.setPhysicsObject(ball2PhysObj);\n\t\t\t//ball2Node.getPhysicsObject().getTransform().\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\t//player.playWalkAnimation();\n\t\t\n\t\t\n\t\t\n\t\t/*ball2Node.getPhysicsObject().setTransform(ball2Node.getLocalTransform());\n\t\t//ball2PhysObj.set\n\t\tphysicsEng.\n\t\ttemptf = toDoubleArray(ball1Node.getLocalTransform().toFloatArray());\n \tball1PhysObj = physicsEng.addSphereObject(physicsEng.nextUID(),\n \tmass, temptf, 2.0f);\n \tball1PhysObj.setBounciness(1.0f);\n \tball1Node.setPhysicsObject(ball1PhysObj);*/\n\t\t\n\t\t/* check if player jumped*/\n\t\t\n\t}", "private void m23259e() {\n boolean z;\n if (this.f19138f != null) {\n ValueAnimator valueAnimator = this.f19137e;\n if (valueAnimator != null) {\n z = valueAnimator.isStarted();\n this.f19137e.cancel();\n this.f19137e.removeAllUpdateListeners();\n } else {\n z = false;\n }\n this.f19137e = ValueAnimator.ofFloat(0.0f, ((float) (this.f19138f.f19131u / this.f19138f.f19130t)) + 1.0f);\n this.f19137e.setRepeatMode(this.f19138f.f19129s);\n this.f19137e.setRepeatCount(this.f19138f.f19128r);\n this.f19137e.setDuration(this.f19138f.f19130t + this.f19138f.f19131u);\n this.f19137e.addUpdateListener(this.f19133a);\n if (z) {\n this.f19137e.start();\n }\n }\n }", "public void movePlayer(String nomeArq, int px, int py) {\r\n if(Main.player1.Vez()) {\r\n if(nomeArq.equals(Main.PLAYER_LEFT)){\r\n \tMain.player1.MudaLado(true,false);\r\n }\r\n else {\r\n \tMain.player1.MudaLado(false,true);\r\n } \r\n pos = Main.player1.Position();\r\n int x = pos[0]+px;\r\n int y = pos[1];\r\n double t = 0.1;\r\n int OrigemY = y;\r\n double g=10;\r\n if(andar.BatidaFrente(x,y,Main.player1.Size()[0]+1,Main.player1.Size()[1]+1)==false) {\r\n \tMain.player1.NovaPosition(x,y); \r\n }\r\n Main.Fase.repinta(); \r\n while(andar.temChao(x,y,Main.player1.Size()[0]+1,Main.player1.Size()[1]+1)==false && andar.Paredao((int)x,(int)y,Main.player1.Size()[0],Main.player1.Size()[1])==false)\r\n {\r\n \tMain.player1.NovaPosition(x,y);\r\n \tMain.Fase.repinta(); \r\n y = (int)(OrigemY - (0-(g * (t*t))/2.0));\r\n t = t + 0.1; \r\n }\r\n Main.Fase.repinta(); \r\n }\r\n else {\r\n if(nomeArq.equals(Main.PLAYER_LEFT)) {\r\n \tMain.player2.MudaLado(true,false);\r\n }\r\n else {\r\n \tMain.player2.MudaLado(false,true);\r\n } \r\n pos = Main.player2.Position();\r\n int x = pos[0]+px;\r\n int y = pos[1];\r\n double t = 0;\r\n int OrigemY = y;\r\n double g=10;\r\n if(andar.BatidaFrente(x,y,Main.player2.Size()[0]+1,Main.player2.Size()[1]+1)==false) {\r\n \tMain.player2.NovaPosition(x,y); \r\n }\r\n Main.Fase.repinta(); \r\n while(andar.temChao(x,y,Main.player2.Size()[0]+1,Main.player2.Size()[1]+1)==false && andar.Paredao((int)x,(int)y,Main.player2.Size()[0]+1,Main.player2.Size()[1]+1)==false)\r\n {\r\n \tMain.player2.NovaPosition(x,y);\r\n \tMain.Fase.repinta(); \r\n y = (int)(OrigemY - (0-(g * (t*t))/2.0));\r\n t = t + 0.1; \r\n }\r\n }\r\n }", "public void moveDelay ( )\r\n\t{\r\n\t\ttry {\r\n\t\t\tThread.sleep( 1000 );\r\n\t\t} catch (InterruptedException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private void animationSpeedLeft() \n {\n if(animationCounter % 4 == 0){\n animateLeft();\n }\n }", "public void updateGameTime() {\n\t\tGameTime = Timer.getMatchTime();\n\t}", "@Override\n public void tick() {\n setPosition(getPosition().add(getSpeed())); \n }", "public void tick() {\n\t\tif (timer!=Game.timeCount)\n\t\t\thandler.addObject(new EnemyPlane(Game.WIDTH-38,r.nextInt(Game.HEIGHT-50), ID.Enemy, handler));\n\t\t\ttimer = Game.timeCount;\n\t}", "public void update()\n\t{\n\t\tif(currentState == moving)\n\t\t{\n\t\t\tx += xSpeed;\n\t\t\ty += ySpeed;\n\t\t\t\n\t\t\tif(x < 0 || x > world.getSIMULATION_WIDTH() - individualSize)\n\t\t\t\trandomizeDirection();\n\t\t\tif(y < 0 || y > world.getSIMULATION_HEIGHT() - individualSize)\n\t\t\t\trandomizeDirection();\n\t\t\t\n\t\t\tif(x < 0)\n\t\t\t\tx = 0;\n\t\t\tif(x > world.getSIMULATION_WIDTH() - individualSize)\n\t\t\t\tx = world.getSIMULATION_WIDTH() - individualSize;\n\t\t\t\n\t\t\tif(y < 0)\n\t\t\t\ty = 0;\n\t\t\tif(y > world.getSIMULATION_HEIGHT() - individualSize)\n\t\t\t\ty = world.getSIMULATION_HEIGHT() - individualSize;\n\t\t}\n\t\tfor(PlayPauseTimer timer: timerList)\n\t\t\ttimer.update();\n\t\tworld.locationUpdate(this);\n\t}", "public void tick(){\n\t\ttimer += System.currentTimeMillis() - lastTime;\n\t\tif(timer > speed){\n\t\t\tcurrent = image.next();\n\t\t\ttimer = 0;\n\t\t}\n\t\tlastTime = System.currentTimeMillis();\n\t}", "public void SpeedControl(long iDasherX, long iDasherY, double dFrameRate) {}", "private void animationActionPerformed(java.awt.event.ActionEvent evt) {\n timer = new Timer(10, new ActionListener() {\n @Override\n public void actionPerformed(ActionEvent e) {\n \n if(yOptionsText<-10){\n yOptionsText+=5;\n OptionsText.setBounds(xOptionsText, yOptionsText, wOptionsText, hOptionsText);\n }\n else {\n ((Timer) (e.getSource())).stop();\n }\n }\n });\n \n timer.setInitialDelay(0);\n timer.start();\n \n }", "private void weakenPlayerAnimation(int player) {\n\t\t//red stat decrease arrow\n\t\tImage decreaseArrowImage = new Image(\"res/images/Red Down Arrow.png\");\n\t\tImageView decreaseArrow = new ImageView(decreaseArrowImage);\n\t\t\n\t\tdecreaseArrow.setTranslateX(100);\n\t\tdecreaseArrow.setTranslateY(100);\n\t\t\n\t\tdecreaseArrow.setFitWidth(40);\n\t\tdecreaseArrow.setPreserveRatio(true);\n\t\tdecreaseArrow.setSmooth(true);\n\t\t\n\t\tScaleTransition arrowScaleTrans = new ScaleTransition(Duration.millis(500),decreaseArrow);\n\t\tarrowScaleTrans.setToX(1.5f);\n\t\tarrowScaleTrans.setToY(1.5f);\n\t\tarrowScaleTrans.setCycleCount(1);\n\t\t\n\t\tFadeTransition arrowFadeTrans = new FadeTransition(Duration.millis(1000),decreaseArrow);\n\t\tarrowFadeTrans.setFromValue(1.0f);\n\t\tarrowFadeTrans.setToValue(0.0f);\n\t\tarrowFadeTrans.setCycleCount(1);\n\t\t\n\t\t//Left dust cloud\n\t\tImage dust1Image = new Image(\"res/images/Dust #1.png\");\n\t\tImageView dust1 = new ImageView(dust1Image);\n\t\t\n\t\tdust1.setTranslateX(50);\n\t\tdust1.setTranslateY(250);\n\t\t\n\t\tdust1.setFitWidth(20);\n\t\tdust1.setPreserveRatio(true);\n\t\tdust1.setSmooth(true);\n\t\t\n\t\tFadeTransition dust1transIn = new FadeTransition(Duration.millis(200),dust1);\n\t\tdust1transIn.setFromValue(0.0f);\n\t\tdust1transIn.setToValue(1.0f);\n\t\tdust1transIn.setCycleCount(1);\n\t\t\n\t\tFadeTransition dust1transOut = new FadeTransition(Duration.millis(500),dust1);\n\t\tdust1transOut.setFromValue(1.0f);\n\t\tdust1transOut.setToValue(0.0f);\n\t\tdust1transOut.setCycleCount(1);\n\t\t\n\t\tImage dust2Image = new Image(\"res/images/Dust #2.png\");\n\t\tImageView dust2 = new ImageView(dust2Image);\n\t\t\n\t\tdust2.setTranslateX(150);\n\t\tdust2.setTranslateY(250);\n\t\t\n\t\tdust2.setFitWidth(20);\n\t\tdust2.setPreserveRatio(true);\n\t\tdust2.setSmooth(true);\n\t\t\n\t\tFadeTransition dust2transIn = new FadeTransition(Duration.millis(200),dust2);\n\t\tdust2transIn.setFromValue(0.0f);\n\t\tdust2transIn.setToValue(1.0f);\n\t\tdust2transIn.setCycleCount(1);\n\t\t\n\t\tFadeTransition dust2transOut = new FadeTransition(Duration.millis(500),dust2);\n\t\tdust2transOut.setFromValue(1.0f);\n\t\tdust2transOut.setToValue(0.0f);\n\t\tdust2transOut.setCycleCount(1);\n\t\t\n\t\tif (player == LOCAL) {\n\t\t\tlocPane.getChildren().addAll(decreaseArrow,dust1,dust2);\n\t\t} else if (player == OPPONENT) {\n\t\t\toppPane.getChildren().addAll(decreaseArrow,dust1,dust2);\n\t\t}\n\t\t\n\t\tSequentialTransition sequencer = new SequentialTransition();\n\t\tsequencer.getChildren().addAll(arrowScaleTrans,\n\t\t\t\t\t\t\t\t\t dust1transIn,\n\t\t\t\t\t\t\t\t\t dust2transIn,\n\t\t\t\t\t\t\t\t\t dust1transOut,\n\t\t\t\t\t\t\t\t\t dust2transOut,\n\t\t\t\t\t\t\t\t\t arrowFadeTrans);\n\t\tsequencer.setCycleCount(1);\n\t\tsequencer.play();\n\t\t\n\t\t\n\t}", "public void startAnimation()\n {\n if ( animationTimer == null )\n {\n currentImage = 0; // display first image\n \n // Create timer\n animationTimer = new Timer ( ANIMATION_DELAY, new TimerHandler() );\n \n animationTimer.start(); // start Timer\n } // end if statement\n else // animationTimer already exists, restart animation\n {\n if ( ! animationTimer.isRunning() )\n animationTimer.restart();\n } // end else statement\n }", "@Override\n synchronized public void run() {\n if (gameBoard.wasCollisionDetected()) {\n Point collisionPoint = gameBoard.getLastCollision();\n if (collisionPoint.x >= 0) {\n dummyText.setText(\"Last Collision XY (\" + Integer.toString(collisionPoint.x) + \",\" + Integer.toString(collisionPoint.y) + \")\");\n score++;\n }\n //turn off the animation until reset gets pressed\n //return;\n }\n frame.removeCallbacks(frameUpdate);\n\n Point playerNewPosition = new Point(gameBoard.getPlayerX(), gameBoard.getPlayerY());\n Point targetNewPosition = new Point(gameBoard.getTargetX(), gameBoard.getTargetY());\n Point obstacle1NewPosition = new Point(gameBoard.getObstacle1X(), gameBoard.getObstacle1Y());\n Point obstacle2NewPosition = new Point(gameBoard.getObstacle2X(), gameBoard.getObstacle2Y());\n\n updatePlayerVelocity();\n playerNewPosition.y = playerNewPosition.y + playerVelocity.y;\n if (playerNewPosition.y > playerMaxY) {\n // return doge to original position if it overshoots\n playerNewPosition.y = playerMaxY;\n performJump = false;\n button.setEnabled(true);\n }\n\n targetNewPosition.x = targetNewPosition.x + targetVelocity.x;\n if (targetNewPosition.x > memeMaxX || targetNewPosition.x < 5) {\n targetVelocity.x *= -1;\n }\n targetNewPosition.y = targetNewPosition.y + targetVelocity.y;\n if (targetNewPosition.y > memeMaxY || targetNewPosition.y < 5) {\n targetVelocity.y *= -1;\n }\n\n obstacle1NewPosition.x = obstacle1NewPosition.x + obstacle1Velocity.x;\n if (obstacle1NewPosition.x > memeMaxX || obstacle1NewPosition.x < 5) {\n obstacle1Velocity.x *= -1;\n }\n obstacle1NewPosition.y = obstacle1NewPosition.y + obstacle1Velocity.y;\n if (obstacle1NewPosition.y > memeMaxY || obstacle1NewPosition.y < 5) {\n obstacle1Velocity.y *= -1;\n }\n\n obstacle2NewPosition.x = obstacle2NewPosition.x + obstacle2Velocity.x;\n if (obstacle2NewPosition.x > memeMaxX || obstacle2NewPosition.x < 5) {\n obstacle2Velocity.x *= -1;\n }\n obstacle2NewPosition.y = obstacle2NewPosition.y + obstacle2Velocity.y;\n if (obstacle2NewPosition.y > memeMaxY || obstacle2NewPosition.y < 5) {\n obstacle2Velocity.y *= -1;\n }\n\n gameBoard.setPlayerPosition(playerNewPosition.x, playerNewPosition.y);\n gameBoard.setTargetPosition(targetNewPosition.x, targetNewPosition.y);\n gameBoard.setObstacle1Position(obstacle1NewPosition.x, obstacle1NewPosition.y);\n gameBoard.setObstacle2Position(obstacle2NewPosition.x, obstacle2NewPosition.y);\n gameBoard.invalidate();\n frame.postDelayed(frameUpdate, getFrameRate());\n }", "public void notifyMoveAnimationFinished();", "public void move()\n {\n if (!alive) {\n return;\n }\n\n if (speedTimer > 0) {\n speedTimer --;\n } else if (speedTimer == 0 && speed != DEFAULT_SPEED) {\n speed = DEFAULT_SPEED;\n }\n\n Location last = playerLocations.get(playerLocations.size()-1);\n Location next = null;\n\n // For the speed, iterate x blocks between last and next\n\n if (direction == UPKEY)\n {\n next = getLocation(last.getX(), (int)(last.getY() - speed * getPixelSize()));\n } else if (direction == DOWNKEY)\n {\n next = getLocation(last.getX(), (int)(last.getY() + speed * getPixelSize()));\n } else if (direction == LEFTKEY)\n {\n next = getLocation((int)(last.getX() - speed * getPixelSize()), last.getY());\n } else if (direction == RIGHTKEY)\n {\n next = getLocation((int)(last.getX() + speed * getPixelSize()), last.getY());\n }\n\n ArrayList<Location> line = getLine(last, next);\n\n if (line.size() == 0) {\n gameOver();\n return;\n }\n\n for (Location loc : line) {\n if (checkCrash (loc)) {\n gameOver();\n return;\n } else {\n // Former bug: For some reason when a player eats a powerup a hole appears in the line where the powerup was.\n Location l2 = getLocation(loc.getX(), loc.getY());\n l2.setType(LocationType.PLAYER);\n l2.setColor(this.col);\n\n playerLocations.add(l2);\n getGridCache().add(l2);\n }\n }\n }", "public void move(int delta);", "public void update(float f) {\n Timer.this.clipGroup.setClipArea( -(Timer.this.TimeBar.getWidth() * f),0, Timer.this.TimeBar.getWidth(), Timer.this.TimeBar.getHeight());\n ef.setPosition(clipGroup.getX()+(TimeBar.getWidth()*0.99f)-TimeBar.getWidth()*f,frmTime.getY()+frmTime.getHeight()*0.5f);\n resDura = duration-(int)(duration*f);\n checkStar(ef.getX());\n// System.out.println(\"resTime: \"+((int)(duration*f)));\n if (f == 1.0f) {\n Timer.this.onComplete.run();\n ef.free();\n }\n }" ]
[ "0.70769167", "0.69772726", "0.67308336", "0.67155975", "0.670579", "0.655079", "0.6539143", "0.64824015", "0.6470951", "0.6413121", "0.64108616", "0.6370942", "0.63547635", "0.63267577", "0.6306176", "0.6301276", "0.6299094", "0.6297573", "0.62863076", "0.6254648", "0.62542784", "0.62514806", "0.6240224", "0.6234973", "0.62147146", "0.6211477", "0.62007785", "0.61939585", "0.6187392", "0.6186402", "0.61800975", "0.6161166", "0.61523753", "0.6136881", "0.6131912", "0.6110272", "0.61063474", "0.6099454", "0.60993314", "0.607843", "0.60558814", "0.60372704", "0.60327405", "0.60325503", "0.60279036", "0.6013488", "0.6010652", "0.59884226", "0.5965684", "0.5959669", "0.5959614", "0.5949615", "0.59464085", "0.59463674", "0.5944164", "0.5943534", "0.5943419", "0.5940285", "0.59283775", "0.59251493", "0.5923967", "0.59199", "0.5917335", "0.5902256", "0.5901058", "0.5897016", "0.58845437", "0.587399", "0.5867866", "0.58622193", "0.5850098", "0.5843844", "0.58418465", "0.5837455", "0.58369184", "0.5828636", "0.5824278", "0.58224696", "0.5818892", "0.58185035", "0.58125067", "0.5807288", "0.5803268", "0.5799498", "0.5796278", "0.5795429", "0.579357", "0.5790632", "0.5788011", "0.5787273", "0.578234", "0.57770765", "0.5747911", "0.57476383", "0.5742663", "0.5742294", "0.57404697", "0.5736513", "0.5735745", "0.5729487" ]
0.70199156
1
Sets up a new SesameMGraph.
public SesameMGraph setUp(String testName) throws RepositoryException, IOException { final File dataDir= File.createTempFile("SesameGraph", "Test"); dataDir.delete(); dataDir.mkdirs(); cleanDirectory(dataDir); graph= new SesameMGraph(); graph.initialize(dataDir); //graph.activate(cCtx); return graph; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Graph() {\r\n\t\tnodePos = new HashMap<Integer, Vec2D>();\r\n\t\tconnectionLists = new HashMap<Integer, List<Connection>>();\r\n\t\t//screenWidth = Config.SCREEN_WIDTH;\r\n\t}", "public Graph() {\r\n\t\tinit();\r\n\t}", "public Graphs() {\n graph = new HashMap<>();\n }", "public samJGraph()\n {\n super(new GraphPane( new GraphModel(), new samGraphController() ) );\n }", "public Graph() {\r\n\t\tthis.matrix = new Matrix();\r\n\t\tthis.listVertex = new ArrayList<Vertex>();\r\n\t}", "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 Graph()\n\t{\n\t\tthis.map = new HashMap<Object, SinglyLinkedList>();\n\t}", "private Graph<Node, DefaultEdge> initialiseSpaceGraph() {\n Graph<Node, DefaultEdge> g = new SimpleGraph<>(DefaultEdge.class);\n g = addNodes(g);\n g = addEdges(g);\n return g;\n }", "public Graph(){//constructor\n //edgemap\n srcs=new LinkedList<>();\n maps=new LinkedList<>();\n chkIntegrity(\"edgemap\");\n \n nodes=new LinkedList<>();\n //m=new EdgeMap();\n }", "public MapGraph()\n {\n this.nodes = new HashMap<Integer, MapNode>();\n this.edges = new HashMap<Integer, Set<MapEdge>>();\n this.nodesByName = new HashMap<String, Set<Integer>>();\n }", "Graph(){\n\t\tadjlist = new HashMap<String, Vertex>();\n\t\tvertices = 0;\n\t\tedges = 0;\n\t\tkeys = new ArrayList<String>();\n\t}", "public Graph() {\n\t\tthis(new PApplet());\n\t}", "private void setupGraph() {\n // we use subcomponent, this is a parent dependance\n mSpotifyStreamerComponent = DaggerSpotifyStreamerComponent\n .builder()\n .spotifyStreamerModule(new SpotifyStreamerModule(this))\n .build();\n }", "public Graph() {\n }", "public Graph(){\n\t\tthis.sizeE = 0;\n\t\tthis.sizeV = 0;\n\t}", "public void createGraph() {\n System.out.println(\"The overlay graph will be created from scratch\");\n graph = new MatrixOverlayGraph();\n parse(dumpPath);\n saveGraph();\n graph.createSupporters(kdTreeSupporterActived);\n saveSupporters();\n }", "public WGraph_DS()\n {\n modeCount=0;\n edges=0;\n HashMap<Integer,node_info>nodesHash=new HashMap<>();\n HashMap<Integer,Neighbors>edgesHash=new HashMap<>();\n }", "@Override\n\tpublic void init() {\n\t\tGraph<Number,Number> ig = Graphs.<Number,Number>synchronizedDirectedGraph(new DirectedSparseMultigraph<Number,Number>());\n\t\tObservableGraph<Number,Number> og = new ObservableGraph<Number,Number>(ig);\n\t\tog.addGraphEventListener(new GraphEventListener<Number,Number>() {\n\n\t\t\tpublic void handleGraphEvent(GraphEvent<Number, Number> evt) {\n\t\t\t\tSystem.err.println(\"got \"+evt);\n\n\t\t\t}});\n\t\tthis.g = og;\n\n\t\tthis.timer = new Timer();\n\t\tthis.layout = new FRLayout2<Number,Number>(g);\n\t\t// ((FRLayout)layout).setMaxIterations(200);\n\t\t// create a simple pickable layout\n\t\tthis.vv = new VisualizationViewer<Number,Number>(layout, new Dimension(600,600));\n\n\n\n\t}", "public Graph() {\n\t\tdictionary=new HashMap<>();\n\t}", "public UGraph()\r\n {\r\n uNodes = new HashMap<Integer , UNode>();\r\n uEdges = new HashMap<Integer, UEdge>();\r\n }", "public Graph(PApplet p) {\n\t\tvertices = new HashMap<Integer, Vertex>();\n\t\tedges = new HashSet<Edge>();\n\t\tparent = p;\n\t}", "public Graph() {\n\t\ttowns = new HashSet<Town>();\n\t\troads = new HashSet<Road>();\n\t\tprevVertex = new HashMap<String, Town>();\n\t}", "public static Graph<Vertex,Edge> createGraphObject()\n\t{\n\t\tGraph<Vertex,Edge> g = new DirectedSparseMultigraph<Vertex, Edge>();\n\t\treturn g;\n\t}", "public DSAGraph()\n\t{\n\t\tvertices = new DSALinkedList();\n\t\tedgeCount = 0;\n\t}", "public Graph()\n\t{\n\t\tthis.total_verts = null;\n\t\tthis.total_edges = null;\n\t\tnodes = new HashMap<String, Node>();\n\t}", "public void setGraphModel(GraphModel m)\n {\n getGraphPane().setGraphModel(m);\n }", "public void init() {\n\t\t// Read the data text file and load up the local database\n\t\tinitData();\n\n\t\t// Create the labels and the textbox\n\t\taddNameLabel();\n\t\taddNameBox();\n\t\taddGraphButton();\n\t\taddClearButton();\n\n\t\t// Set up the graph object\n\t\tgraph = new NameSurferGraph();\n\t\tadd(graph);\n\n\t}", "public void constructGraph(){\r\n\t\tmyGraph = new Graph();\r\n\r\n\t\tfor(int i =0;i<=35;i++) {\r\n\t\t\tmyGraph.addVertex(allSpots[i]);\r\n\t\t}\r\n\r\n\t\tfor(int i =0;i<=35;i++) {\r\n\t\t\tint th = i;\r\n\t\t\twhile(th%6!=0) {\r\n\t\t\t\tth--;\r\n\t\t\t}\r\n\t\t\tfor(int h=th;h<=th+5;h++) {\r\n\t\t\t\tif(h!=i) {\r\n\t\t\t\t\tif(allSpots[i].equals(allSpots[h])) {\t\t\r\n\t\t\t\t\t\tmyGraph.addEdge(allSpots[i], allSpots[h]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tint tv=i;\r\n\t\t\twhile(tv-6>0) {\r\n\t\t\t\ttv=tv-6;\r\n\t\t\t}\r\n\t\t\tfor(int v=tv;v<36; v=v+6) {\r\n\t\t\t\tif(v!=i) {\r\n\t\t\t\t\tif(allSpots[i].equals(allSpots[v])) {\t\t\r\n\t\t\t\t\t\tmyGraph.addEdge(allSpots[i], allSpots[v]);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t//Add verticies that store the Spot objects\r\n\t\t//Add edges to connect spots that share a property along an orthogonal direction\r\n\r\n\t\t//This is the ONLY time it is ok to iterate the array.\r\n\t\t\r\n\t\t//myGraph.addVert(...);\r\n\t\t//myGraph.addEdge(...);\r\n\t}", "public Main() {\n grafo = new MultiGraph(\"Mapa\", false, true);\n initComponents();\n\n }", "public MyModel() {\n mazeGeneratingServer = new Server(5400, 1000, new ServerStrategyGenerateMaze());\n solveSearchProblemServer = new Server(5401, 1000, new ServerStrategySolveSearchProblem());\n //Raise the servers\n }", "public Graph(){\r\n this.listEdges = new ArrayList<>();\r\n this.listNodes = new ArrayList<>();\r\n this.shown = true;\r\n }", "private static ManagementGraph constructTestManagementGraph() {\n\n\t\t/**\n\t\t * This is the structure of the constructed test graph. The graph\n\t\t * contains two stages and all three channel types.\n\t\t * 4\n\t\t * | In-memory\n\t\t * 3\n\t\t * --/ \\-- Network (was FILE)\n\t\t * 2 2\n\t\t * \\ / Network\n\t\t * 1\n\t\t */\n\n\t\t// Graph\n\t\tfinal ManagementGraph graph = new ManagementGraph(new JobID());\n\n\t\t// Stages\n\t\tfinal ManagementStage lowerStage = new ManagementStage(graph, 0);\n\t\tfinal ManagementStage upperStage = new ManagementStage(graph, 1);\n\n\t\t// Group vertices\n\t\tfinal ManagementGroupVertex groupVertex1 = new ManagementGroupVertex(lowerStage, \"Group Vertex 1\");\n\t\tfinal ManagementGroupVertex groupVertex2 = new ManagementGroupVertex(lowerStage, \"Group Vertex 2\");\n\t\tfinal ManagementGroupVertex groupVertex3 = new ManagementGroupVertex(upperStage, \"Group Vertex 3\");\n\t\tfinal ManagementGroupVertex groupVertex4 = new ManagementGroupVertex(upperStage, \"Group Vertex 4\");\n\n\t\t// Vertices\n\t\tfinal ManagementVertex vertex1_1 = new ManagementVertex(groupVertex1, new ManagementVertexID(), \"Host 1\",\n\t\t\t\"small\", 0);\n\t\tfinal ManagementVertex vertex2_1 = new ManagementVertex(groupVertex2, new ManagementVertexID(), \"Host 2\",\n\t\t\t\"medium\", 0);\n\t\tfinal ManagementVertex vertex2_2 = new ManagementVertex(groupVertex2, new ManagementVertexID(), \"Host 2\",\n\t\t\t\"medium\", 1);\n\t\tfinal ManagementVertex vertex3_1 = new ManagementVertex(groupVertex3, new ManagementVertexID(), \"Host 2\",\n\t\t\t\"medium\", 0);\n\t\tfinal ManagementVertex vertex4_1 = new ManagementVertex(groupVertex4, new ManagementVertexID(), \"Host 2\",\n\t\t\t\"medium\", 0);\n\n\t\t// Input/output gates\n\t\tfinal ManagementGate outputGate1_1 = new ManagementGate(vertex1_1, new ManagementGateID(), 0, false);\n\n\t\tfinal ManagementGate inputGate2_1 = new ManagementGate(vertex2_1, new ManagementGateID(), 0, true);\n\t\tfinal ManagementGate outputGate2_1 = new ManagementGate(vertex2_1, new ManagementGateID(), 0, false);\n\n\t\tfinal ManagementGate inputGate2_2 = new ManagementGate(vertex2_2, new ManagementGateID(), 0, true);\n\t\tfinal ManagementGate outputGate2_2 = new ManagementGate(vertex2_2, new ManagementGateID(), 0, false);\n\n\t\tfinal ManagementGate inputGate3_1 = new ManagementGate(vertex3_1, new ManagementGateID(), 0, true);\n\t\tfinal ManagementGate outputGate3_1 = new ManagementGate(vertex3_1, new ManagementGateID(), 0, false);\n\n\t\tfinal ManagementGate inputGate4_1 = new ManagementGate(vertex4_1, new ManagementGateID(), 0, true);\n\n\t\t// Group Edges\n\t\tnew ManagementGroupEdge(groupVertex1, 0, groupVertex2, 0, ChannelType.NETWORK);\n\t\tnew ManagementGroupEdge(groupVertex2, 0, groupVertex3, 0, ChannelType.NETWORK);\n\t\tnew ManagementGroupEdge(groupVertex3, 0, groupVertex4, 0, ChannelType.IN_MEMORY);\n\n\t\t// Edges\n\t\tnew ManagementEdge(new ManagementEdgeID(), new ManagementEdgeID(), outputGate1_1, 0, inputGate2_1, 0,\n\t\t\tChannelType.NETWORK);\n\t\tnew ManagementEdge(new ManagementEdgeID(), new ManagementEdgeID(), outputGate1_1, 1, inputGate2_2, 0,\n\t\t\tChannelType.NETWORK);\n\t\tnew ManagementEdge(new ManagementEdgeID(), new ManagementEdgeID(), outputGate2_1, 0, inputGate3_1, 0,\n\t\t\tChannelType.NETWORK);\n\t\tnew ManagementEdge(new ManagementEdgeID(), new ManagementEdgeID(), outputGate2_2, 0, inputGate3_1, 1,\n\t\t\tChannelType.NETWORK);\n\t\tnew ManagementEdge(new ManagementEdgeID(), new ManagementEdgeID(), outputGate3_1, 0, inputGate4_1, 0,\n\t\t\tChannelType.IN_MEMORY);\n\n\t\treturn graph;\n\t}", "public EDMGraphScene() {\n setKeyEventProcessingType(EventProcessingType.FOCUSED_WIDGET_AND_ITS_PARENTS);\n\n addChild(backgroundLayer);\n addChild(mainLayer);\n addChild(connectionLayer);\n addChild(upperLayer);\n\n router = RouterFactory.createOrthogonalSearchRouter(mainLayer, connectionLayer);\n\n getActions().addAction(ActionFactory.createZoomAction());\n getActions().addAction(ActionFactory.createPanAction());\n getActions().addAction(ActionFactory.createSelectAction(new SceneSelectProvider()));\n\n graphLayout.addGraphLayoutListener(new GridGraphListener());\n sceneLayout = LayoutFactory.createSceneGraphLayout(this, graphLayout);\n }", "@SuppressWarnings(\"rawtypes\")\r\n\tpublic Graph() {\r\n \tthis.vertex = new HashMap<T, Vertex>();\r\n \tthis.edge = new HashMap<Integer, Edge>();\r\n }", "public void setup() {\n space = null;\n rabbitList = new ArrayList<>();\n schedule = new Schedule(1);\n\n //recreate main window\n if (displaySurf != null) {\n displaySurf.dispose();\n }\n displaySurf = null;\n displaySurf = new DisplaySurface(this, \"Rabbits Grass Simulation 1\");\n registerDisplaySurface(\"Rabbits Grass Simulation 1\", displaySurf);\n\n //recreate population plot\n if (populationPlot != null) {\n populationPlot.dispose();\n }\n populationPlot = null;\n populationPlot = new OpenSequenceGraph(\"Population Plot\", this);\n populationPlot.setYAutoExpand(false);\n populationPlot.setYRange(0, 200);\n this.registerMediaProducer(\"Plot\", populationPlot);\n }", "private void buildGraph()\n\t{\n\t\taddVerticesToGraph();\n\t\taddLinkesToGraph();\n\t}", "protected void setUpGraph() {\n mAppComponent = DaggerAppComponent\n .builder()\n .appModule(new AppModule(this))\n .build();\n }", "public HashGraph()\n {\n graph = new HashMap <>();\n }", "private final void constructGraph() {\n losScanner = new LineOfSightScannerDouble(graph);\n queue = new int[11];\n\n queueSize = 0;\n\n // STEP 1: Construct SVG (Strict Visibility Graph)\n \n // Initialise SVG Vertices\n xPositions = new int[11];\n yPositions = new int[11];\n nNodes = 0;\n addNodes();\n \n // Now xPositions and yPositions should be correctly initialised.\n // We then initialise the rest of the node data.\n originalSize = nNodes;\n maxSize = nNodes + 2;\n xPositions = Arrays.copyOf(xPositions, maxSize);\n yPositions = Arrays.copyOf(yPositions, maxSize);\n hasEdgeToGoal = new boolean[maxSize];\n nOutgoingEdgess = new int[maxSize];\n outgoingEdgess = new int[maxSize][];\n outgoingEdgeIndexess = new int[maxSize][];\n outgoingEdgeOppositeIndexess = new int[maxSize][];\n outgoingEdgeIsMarkeds = new boolean[maxSize][];\n for (int i=0;i<maxSize;++i) {\n nOutgoingEdgess[i] = 0;\n outgoingEdgess[i] = new int[11];\n outgoingEdgeIndexess[i] = new int[11];\n outgoingEdgeOppositeIndexess[i] = new int[11];\n outgoingEdgeIsMarkeds[i] = new boolean[11];\n }\n\n // Initialise SVG Edges + edgeWeights\n edgeWeights = new float[11];\n nEdges = 0;\n addAllEdges();\n\n \n // Now all the edges, indexes and weights should be correctly initialise.\n // Now we initialise the rest of the edge data.\n originalNEdges = nEdges;\n int maxPossibleNEdges = nEdges + nNodes*2;\n edgeWeights = Arrays.copyOf(edgeWeights, maxPossibleNEdges);\n edgeLevels = new int[maxPossibleNEdges];\n Arrays.fill(edgeLevels, LEVEL_W);\n isMarked = new boolean[maxPossibleNEdges];\n //Arrays.fill(isMarked, false); // default initialises to false anyway.\n \n \n // Reserve space in level w edge and marked edge arrays.\n nLevelWNeighbourss = new int[maxSize];\n levelWEdgeOutgoingIndexess = new int[maxSize][];\n nMarkedEdgess = new int[maxSize];\n outgoingMarkedEdgeIndexess = new int[maxSize][];\n for (int i=0;i<nNodes;++i) {\n levelWEdgeOutgoingIndexess[i] = new int[nOutgoingEdgess[i]];\n outgoingMarkedEdgeIndexess[i] = new int[nOutgoingEdgess[i]];\n }\n for (int i=nNodes;i<maxSize;++i) {\n levelWEdgeOutgoingIndexess[i] = new int[11];\n outgoingMarkedEdgeIndexess[i] = new int[11];\n }\n\n \n // STEP 2: Label edge levels in SVG.\n computeAllEdgeLevelsFast();\n addLevelWEdgesToLevelWEdgesArray();\n\n nSkipEdgess = new int[maxSize];\n outgoingSkipEdgess = new int[maxSize][];\n outgoingSkipEdgeNextNodess = new int[maxSize][];\n outgoingSkipEdgeNextNodeEdgeIndexess = new int[maxSize][];\n outgoingSkipEdgeWeightss = new float[maxSize][]; \n\n // STEP 3: Initialise the skip-edges & Group together Level-W edges using isMarkedIndex.\n setupSkipEdges();\n \n pruneParallelSkipEdges();\n }", "public SGraphValidator() {\r\n\t\tsuper();\r\n\t}", "private void setupGraph() {\n graph = new DualGraph(SchemaFactoryUtilities.getSchemaFactory(VisualSchemaFactory.VISUAL_SCHEMA_ID).createSchema());\n try {\n\n WritableGraph wg = graph.getWritableGraph(\"\", true);\n\n // Create LayerMask attributes\n layerMaskV = LayersConcept.VertexAttribute.LAYER_MASK.ensure(wg);\n layerMaskT = LayersConcept.TransactionAttribute.LAYER_MASK.ensure(wg);\n\n // Create LayerVisilibity Attributes\n layerVisibilityV = LayersConcept.VertexAttribute.LAYER_VISIBILITY.ensure(wg);\n layerVisibilityT = LayersConcept.TransactionAttribute.LAYER_VISIBILITY.ensure(wg);\n\n // Create Selected Attributes\n selectedV = VisualConcept.VertexAttribute.SELECTED.ensure(wg);\n selectedT = VisualConcept.TransactionAttribute.SELECTED.ensure(wg);\n\n // Adding 2 Vertices - not selected, layer 1, visible\n vxId1 = wg.addVertex();\n wg.setIntValue(layerMaskV, vxId1, 1);\n wg.setFloatValue(layerVisibilityV, vxId1, 1.0f);\n wg.setBooleanValue(selectedV, vxId1, false);\n\n vxId2 = wg.addVertex();\n wg.setIntValue(layerMaskV, vxId2, 1);\n wg.setFloatValue(layerVisibilityV, vxId2, 1.0f);\n wg.setBooleanValue(selectedV, vxId2, false);\n\n // Adding 2 Transactions - not selected, layer 1, visible\n txId1 = wg.addTransaction(vxId1, vxId2, true);\n wg.setIntValue(layerMaskT, txId1, 1);\n wg.setFloatValue(layerVisibilityT, txId1, 1.0f);\n wg.setBooleanValue(selectedT, txId1, false);\n\n txId2 = wg.addTransaction(vxId1, vxId2, false);\n wg.setIntValue(layerMaskT, txId2, 1);\n wg.setFloatValue(layerVisibilityT, vxId2, 1.0f);\n wg.setBooleanValue(selectedT, vxId2, false);\n\n wg.commit();\n\n } catch (final InterruptedException ex) {\n Exceptions.printStackTrace(ex);\n Thread.currentThread().interrupt();\n }\n }", "public SimAbstractGraph(GraphConfig graphConfig, SimpleDirectedGraph innerGraph) {\n super(innerGraph);\n referenceGraph = new JungAdapterGraph<Agent, TestbedEdge>((SimpleDirectedGraph) innerGraph.clone());\n this.graphConfig = graphConfig;\n }", "public SmartMove() {\r\n\t\t_graph = new Graph(GameStats._height, GameStats._width);\r\n\r\n\t}", "public GameConfigure()\n {\n trackItems = new Stack<String>();\n random = new Random();\n visits = new Stack<Room>();\n items = new ArrayList<Item>(); \n rooms = new ArrayList<Room>(); \n characters = new ArrayList<Person>();\n\n // Creates all the items, people, rooms and the player.\n resetGame();\n }", "public void init() {\n jgxAdapter = new JGraphXAdapter<DatabaseProcess, DefaultEdge>(this.graph);\n\n getContentPane().add(new mxGraphComponent(jgxAdapter));\n resize(DEFAULT_SIZE);\n\n // positioning via jgraphx layouts\n mxCircleLayout layout = new mxCircleLayout(jgxAdapter);\n layout.execute(jgxAdapter.getDefaultParent());\n }", "private void createGraph() {\r\n graph = new Graph(SHELL, SWT.NONE);\r\n\r\n final GridData gridData = new GridData();\r\n gridData.horizontalAlignment = GridData.FILL;\r\n gridData.verticalAlignment = GridData.FILL;\r\n gridData.grabExcessHorizontalSpace = true;\r\n gridData.grabExcessVerticalSpace = true;\r\n gridData.heightHint = DEFAULT_GRAPH_SIZE;\r\n gridData.widthHint = DEFAULT_GRAPH_SIZE;\r\n graph.setLayoutData(gridData);\r\n }", "Graph() {\r\n\t\tvertices = new LinkedList<Vertex>();\r\n\t\tedges = 0;\r\n\r\n\t\tfor (int i = 0; i < 26; i++) {\r\n\t\t\t// ASCII value of 'A' is 65\r\n\t\t\tVertex vertex = new Vertex((char) (i + 65));\r\n\t\t\tvertices.add(vertex);\r\n\t\t}\r\n\t\tcurrentVertex = vertices.get(0);\r\n\t\tseen = new boolean[26];\r\n\t}", "public void setGraph(){\r\n setDisplay(currentGraph);\r\n }", "public static void initialize() {\r\n\t\tgraph = null;\r\n\t\tmseeObjectNames = new HashMap<String, String>();\r\n\t\tmseeEventTypes = new HashMap<String, String>();\r\n\t\tmodifiedIdentifiers = new HashMap<String, String>();\r\n\t}", "public void setGraph(Graph<V,E> graph);", "public GraphPanel()\n\t{\n\t\t// instantiates graphArray to hold list of names to graph \n\t\tgraphArray = new ArrayList<NameRecord>();\n\t\t\n\t\t// sets the size of the panel\n\t\tsetPreferredSize(new Dimension(600,600));\n\t}", "public Automata() {\n initComponents();\n getContentPane().setSize(600, 400);\n getContentPane().setMinimumSize(new Dimension(600, 400));\n \n graph.setPreferredSize(new Dimension(600, 400));\n graph.setMinimumSize(new Dimension(600, 400));\n getContentPane().add(graph, java.awt.BorderLayout.CENTER);\n pack();\n }", "public ExportGraph()\n {\n }", "public BFSMaze(MazeConstructor maze) {\n this.maze = maze;\n this.r = maze.getR();\n queue = new LinkedList<>();\n parents = new LinkedList<>();\n }", "public SAP(Digraph G) {\n\n if (G == null) throw new IllegalArgumentException(\"Null graph\");\n\n dg = new Digraph(G);\n\n }", "@Setup(Level.Trial)\n public void setupGraph() {\n initializeMethod();\n prepareRequest();\n emitFrontEnd();\n }", "@Setup(Level.Trial)\n public void setupGraph() {\n initializeMethod();\n prepareRequest();\n emitFrontEnd();\n }", "@Setup(Level.Trial)\n public void setupGraph() {\n initializeMethod();\n prepareRequest();\n emitFrontEnd();\n }", "private static void setGraph()\n\t\t{\n\t\t\tmap = new HashMap();\n\t\t\t\n\t\t\twordNum = 0;\n\t\t\twordList = new String[txtStr.length()];\n\t\t\tfor(int i = 0; i<strList.length; i++)\n\t\t\t{\n\t\t\t\tif(!map.containsKey(strList[i]))\n\t\t\t\t{\n\t\t\t\t\tmap.put(strList[i], wordNum);\n\t\t\t\t\twordList[wordNum] = strList[i];\n\t\t\t\t\twordNum++;\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tg = new MyGraph(wordNum);\n\t\t\tfor(int i=0; i<strList.length - 1; i++)\n\t\t\t{\n\t\t\t\tint v0 = (int)(map.get(strList[i]));\n\t\t\t\tint v1 = (int)(map.get(strList[i+1]));\n\t\t\t\tint cost = g.getEdge(v0, v1);\n\t\t\t\t\n\t\t\t\tg.setEdge(v0, v1, cost+1);\n\t\t\t}\n\t\t//\treturn g;\n\t\t\t\t\t\n\t\t}", "public NavigatorAStar(){\n makeGraph();\n //randomStart();\n }", "private void initializeGraph() {\r\n map = new HashMap<>();\r\n graph = new List[n];\r\n for (int i = 0; i < n; i++) graph[i] = new ArrayList<>();\r\n\r\n\r\n }", "Graph(){\n\t\taddNode();\n\t\tcurrNode=myNodes.get(0);\n\t}", "public Graph()\r\n {\r\n this( \"x\", \"y\" );\r\n }", "public GraphInfo(){}", "private void initialize()\n\t{\n\t\tfor(int i = 0 ; i < SOM.length; i++)\n\t\t{\n\t\t\tfor(int j=0; j < SOM[0].length; j++)\n\t\t\t{ \n\t\t\t\tSOM[i][j] = new Node(INPUT_DIMENSION,i,j);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSOM_HORIZONTAL_LENGTH = SOM[0].length;\n\t\tSOM_VERTICAL_LENGTH = SOM.length;\n\t}", "public RoutingResourceGraph() {\n ex = new RunGraph(3,2);\n squares = new JLabel[ex.getGraphSize()][ex.getGraphSize()];\n squares_sinks = new JLabel[ex.getGraphSize()][ex.getGraphSize()];\n squares_wires = new JLabel[2 * ex.getGraphSize() * ex.getGraphSize()][ex.getWireSize()];\n switches = new JToggleButton[ex.getGraphSize()][ex.getGraphSize()];\n ex.initialize();\n initComponents();\n initialize();\n add_edge();\n ex.find_shortest_path();\n showCong();\n showGraph();\n }", "private void initialize(SemSimModel semsimmodel){\n\t\tthis.semsimmodel = semsimmodel;\n\t\t\n\t\t// Don't set model prefix for cellml models. They use relative IDs and ad-hoc namespaces.\n\t\tif( ! modeltype.equals(ModelType.CELLML_MODEL)){\n\t\t\trdf.setNsPrefix(\"model\", semsimmodel.getNamespace());\n\t\t\txmlbase = semsimmodel.getNamespace();\n\t\t}\n\t\telse xmlbase = \"#\";\n\t\t\t\t\n\t\tcreateSubmodelURIandNameMap();\n\t\t\n\t\tlocalids.addAll(semsimmodel.getMetadataIDcomponentMap().keySet());\n\n\t\trdf.setNsPrefix(\"semsim\", RDFNamespace.SEMSIM.getNamespaceAsString());\n\t\trdf.setNsPrefix(\"bqbiol\", RDFNamespace.BQB.getNamespaceAsString());\n\t\trdf.setNsPrefix(\"bqmodel\", RDFNamespace.BQM.getNamespaceAsString());\n\t\trdf.setNsPrefix(\"opb\", RDFNamespace.OPB.getNamespaceAsString());\n\t\trdf.setNsPrefix(\"ro\", RDFNamespace.RO.getNamespaceAsString());\n\t\trdf.setNsPrefix(\"dcterms\", RDFNamespace.DCTERMS.getNamespaceAsString());\n\t}", "public CSGraph(String fileName) {\n hashTable = new CSHashing();\n words = readWords(fileName);\n\n// createGraph(); // Minimal lösning\n\n createHashTable(); // Frivillig bra lösning\n createGraphWithHashTable(); // Frivillig bra lösning\n\n// shortestPaths(); // Metod som endast används till textfilen utan par.\n\n readPairs(\"files/5757Pairs\");\n }", "@Override\r\n public void init(weighted_graph g) {\r\n this.Graph = g;\r\n }", "public WebSession(){\n\tstartmodel = new StartModel();\n\tgraphmodel = new GraphModel();\n\treportmodel = new ReportModel();\n\tsetupmodel = new SetupModel();\n }", "public DiGraphReader() {\n // Configure the graph reader here\n g = null;\n e = null;\n }", "public void setNewGraph() {\n\tresetHints();\r\n Random random = new Random();\r\n if (graphMode == 1) {\r\n if (selectedSize == 1) {\r\n currentGraph = chromaticManager.calculate(random.nextInt(myInformation.smallGraph) + 1, -1);\r\n }\r\n if (selectedSize == 2) {\r\n currentGraph = chromaticManager.calculate(random.nextInt(myInformation.middleGraph - myInformation.smallGraph) + myInformation.smallGraph + 1, -1);\r\n }\r\n if (selectedSize == 3) {\r\n currentGraph = chromaticManager.calculate(random.nextInt(myInformation.bigGraph - myInformation.middleGraph) + myInformation.middleGraph + 1, -1);\r\n }\r\n }\r\n if (graphMode == 2) {\r\n currentGraph = chromaticManager.calculate(myGraph);\r\n }\r\n if (graphMode == 3) {\r\n try {\r\n stackPane.getChildren().removeAll(textFieldHBox, backPane);\r\n myVertices = Integer.parseInt(textFieldVertices.getText());\r\n myEdges = Integer.parseInt(textFieldEdges.getText());\r\n currentGraph = chromaticManager.calculate(myVertices, myEdges);\r\n setDisplay(currentGraph);\r\n } catch (NumberFormatException e) {\r\n\r\n }\r\n }\r\n threadPoolExecutor.execute(() -> {\r\n NewForce newForce = new NewForce();\r\n currentGraph.setCNumer(newForce.doNewForce(currentGraph,currentGraph.getUpperBound(),currentGraph.getLowerBound()));\r\n });\r\n }", "private GraphParser(){ \n\t}", "public Network() {\n\t\t\n\t\t//Initialize new hashmap for nodes and neighbors\n\t\tnodes = new HashSet<Node>();\n\t\t\n\t\t//Initialize new arraylist for messages in network\n\t\tmessages = new ArrayList<Message>();\n\t\t\n\t\t//Set the network to open for accepting messages \n\t\tthis.open = true;\n\t\t\n\t}", "public MDS() {\n\t\ttreeMap = new TreeMap<>();\n\t\thashMap = new HashMap<>();\n\t}", "private void createGraph() {\n \t\t\n \t\t// Check capacity\n \t\tCytoscape.ensureCapacity(nodes.size(), edges.size());\n \n \t\t// Extract nodes\n \t\tnodeIDMap = new OpenIntIntHashMap(nodes.size());\n \t\tginy_nodes = new IntArrayList(nodes.size());\n \t\t// OpenIntIntHashMap gml_id2order = new OpenIntIntHashMap(nodes.size());\n \n \t\tfinal HashMap gml_id2order = new HashMap(nodes.size());\n \n \t\tSet nodeNameSet = new HashSet(nodes.size());\n \n \t\tnodeMap = new HashMap(nodes.size());\n \n \t\t// Add All Nodes to Network\n \t\tfor (int idx = 0; idx < nodes.size(); idx++) {\n \t\t\t\n \t\t\tif (taskMonitor != null) {\n \t\t\t\ttaskMonitor.setPercentCompleted(percentUtil.getGlobalPercent(1,\n \t\t\t\t\t\tidx, nodes.size()));\n \t\t\t}\n \n \t\t\t// Get a node object (NOT a giny node. XGMML node!)\n \t\t\tfinal cytoscape.generated2.Node curNode = (cytoscape.generated2.Node) nodes\n \t\t\t\t\t.get(idx);\n \t\t\tfinal String nodeType = curNode.getName();\n \t\t\tfinal String label = (String) curNode.getLabel();\n \n \t\t\treadAttributes(label, curNode.getAtt(), NODE);\n \n \t\t\tnodeMap.put(curNode.getId(), label);\n \n \t\t\tif (nodeType != null) {\n \t\t\t\tif (nodeType.equals(\"metaNode\")) {\n \t\t\t\t\tfinal Iterator it = curNode.getAtt().iterator();\n \t\t\t\t\twhile (it.hasNext()) {\n \t\t\t\t\t\tfinal Att curAttr = (Att) it.next();\n \t\t\t\t\t\tif (curAttr.getName().equals(\"metanodeChildren\")) {\n \t\t\t\t\t\t\tmetanodeMap.put(label, ((Graph) curAttr.getContent()\n \t\t\t\t\t\t\t\t\t.get(0)).getNodeOrEdge());\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\tif (nodeNameSet.add(curNode.getId())) {\n \t\t\t\tfinal Node node = (Node) Cytoscape.getCyNode(label, true);\n \n \t\t\t\tginy_nodes.add(node.getRootGraphIndex());\n \t\t\t\tnodeIDMap.put(idx, node.getRootGraphIndex());\n \n \t\t\t\t// gml_id2order.put(Integer.parseInt(curNode.getId()), idx);\n \n \t\t\t\tgml_id2order.put(curNode.getId(), Integer.toString(idx));\n \n \t\t\t\t// ((KeyValue) node_root_index_pairs.get(idx)).value = (new\n \t\t\t\t// Integer(\n \t\t\t\t// node.getRootGraphIndex()));\n \t\t\t} else {\n \t\t\t\tthrow new XGMMLException(\"XGMML id \" + nodes.get(idx)\n \t\t\t\t\t\t+ \" has a duplicated label: \" + label);\n \t\t\t\t// ((KeyValue)node_root_index_pairs.get(idx)).value = null;\n \t\t\t}\n \t\t}\n \t\tnodeNameSet = null;\n \n \t\t// Extract edges\n \t\tginy_edges = new IntArrayList(edges.size());\n \t\tSet edgeNameSet = new HashSet(edges.size());\n \n \t\tfinal CyAttributes edgeAttributes = Cytoscape.getEdgeAttributes();\n \n \t\t// Add All Edges to Network\n \t\tfor (int idx = 0; idx < edges.size(); idx++) {\n \n \t\t\tif (taskMonitor != null) {\n \t\t\t\ttaskMonitor.setPercentCompleted(percentUtil.getGlobalPercent(2,\n \t\t\t\t\t\tidx, edges.size()));\n \t\t\t}\n \t\t\tfinal cytoscape.generated2.Edge curEdge = (cytoscape.generated2.Edge) edges\n \t\t\t\t\t.get(idx);\n \n \t\t\tif (gml_id2order.containsKey(curEdge.getSource())\n \t\t\t\t\t&& gml_id2order.containsKey(curEdge.getTarget())) {\n \n \t\t\t\tString edgeName = curEdge.getLabel();\n \n \t\t\t\tif (edgeName == null) {\n \t\t\t\t\tedgeName = \"N/A\";\n \t\t\t\t}\n \n \t\t\t\tint duplicate_count = 1;\n \t\t\t\twhile (!edgeNameSet.add(edgeName)) {\n \t\t\t\t\tedgeName = edgeName + \"_\" + duplicate_count;\n \t\t\t\t\tduplicate_count += 1;\n \t\t\t\t}\n \n \t\t\t\tEdge edge = Cytoscape.getRootGraph().getEdge(edgeName);\n \n \t\t\t\tif (edge == null) {\n \n \t\t\t\t\tfinal String sourceName = (String) nodeMap.get(curEdge\n \t\t\t\t\t\t\t.getSource());\n \t\t\t\t\tfinal String targetName = (String) nodeMap.get(curEdge\n \t\t\t\t\t\t\t.getTarget());\n \n \t\t\t\t\tfinal Node node_1 = Cytoscape.getRootGraph().getNode(\n \t\t\t\t\t\t\tsourceName);\n \t\t\t\t\tfinal Node node_2 = Cytoscape.getRootGraph().getNode(\n \t\t\t\t\t\t\ttargetName);\n \n \t\t\t\t\tfinal Iterator it = curEdge.getAtt().iterator();\n \t\t\t\t\tAtt interaction = null;\n \t\t\t\t\tString itrValue = \"unknown\";\n \t\t\t\t\twhile (it.hasNext()) {\n \t\t\t\t\t\tinteraction = (Att) it.next();\n \t\t\t\t\t\tif (interaction.getName().equals(\"interaction\")) {\n \t\t\t\t\t\t\titrValue = interaction.getValue();\n \t\t\t\t\t\t\tif (itrValue == null) {\n \t\t\t\t\t\t\t\titrValue = \"unknown\";\n \t\t\t\t\t\t\t}\n \t\t\t\t\t\t\tbreak;\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \n \t\t\t\t\tedge = Cytoscape.getCyEdge(node_1, node_2,\n \t\t\t\t\t\t\tSemantics.INTERACTION, itrValue, true);\n \n \t\t\t\t\t// Add interaction to CyAttributes\n \t\t\t\t\tedgeAttributes.setAttribute(edge.getIdentifier(),\n \t\t\t\t\t\t\tSemantics.INTERACTION, itrValue);\n \t\t\t\t}\n \n \t\t\t\t// Set correct ID, canonical name and interaction name\n \t\t\t\tedge.setIdentifier(edgeName);\n \n \t\t\t\treadAttributes(edgeName, curEdge.getAtt(), EDGE);\n \n \t\t\t\tginy_edges.add(edge.getRootGraphIndex());\n \t\t\t\t// ((KeyValue) edge_root_index_pairs.get(idx)).value = (new\n \t\t\t\t// Integer(\n \t\t\t\t// edge.getRootGraphIndex()));\n \t\t\t} else {\n \t\t\t\tthrow new XGMMLException(\n \t\t\t\t\t\t\"Non-existant source/target node for edge with gml (source,target): \"\n \t\t\t\t\t\t\t\t+ nodeMap.get(curEdge.getSource()) + \",\"\n \t\t\t\t\t\t\t\t+ nodeMap.get(curEdge.getTarget()));\n \t\t\t}\n \t\t}\n \t\tedgeNameSet = null;\n \n \t\tif (metanodeMap.size() != 0) {\n \t\t\tfinal Iterator it = metanodeMap.keySet().iterator();\n \t\t\twhile (it.hasNext()) {\n \t\t\t\tfinal String key = (String) it.next();\n \t\t\t\tcreateMetaNode(key, (List) metanodeMap.get(key));\n \t\t\t}\n \t\t}\n \t}", "public MapGraphExtra()\n\t{\n\t\t// TODO: Implement in this constructor in WEEK 3\n\t\tmap = new HashMap<GeographicPoint, MapNode> ();\n\t}", "protected void initGSM() {\n gsm = new GameStateManager();}", "public MhsmNetworkRuleSet() {\n }", "public StreetSearcher() {\n vertices = new HashMap<>();\n graph = new SparseGraph<>();\n //double smDistance = 0;\n //previous = new HashMap<>();\n }", "private void createGraphs() {\n initialGraphCreation.accept(caller, listener);\n graphCustomization.accept(caller, listener);\n caller.generateAndAdd(params.getNumCallerEvents(), callerAddToGraphTest);\n listener.generateAndAdd(params.getNumListenerEvents(), listenerAddToGraphTest);\n generationDefinitions.accept(caller, listener);\n }", "public SAP(Digraph G) throws java.lang.NullPointerException, java.lang.IndexOutOfBoundsException \n\t {\n\t\t if(null==G) throw new java.lang.NullPointerException(\"Digraph argument to SAP is null\");\n\t\t mGraph = G;\n\t\t \n\t }", "private GraphFileManager() {\n\t}", "public SAP(Digraph G) {\n if (G == null) throw new IllegalArgumentException();\n wordGraph = new Digraph(G);\n }", "public SpaceSim() {\n TimeZone.setDefault(TimeZone.getTimeZone(\"GMT\"));\n initComponents();\n \n bodies = new CopyOnWriteArrayList<>();\n addBody(\"Sun\", massOfSun, .001, 0, 0, 0, 0, 0, 0);\n sun = bodies.get(0);\n \n for (String c : colors.keySet()) {\n colorComboBoxEdit.addItem(c);\n colorComboBoxAdd.addItem(c);\n }\n colorComboBoxAdd.setSelectedItem(\"Black\");\n \n setEditor(bodies.get(0));\n simDate = new Date(0);\n setupKeyMaps();\n }", "public void buildGraph() {\n //System.err.println(\"Build Graph \"+this);\n if (node instanceof eu.mihosoft.ext.j3d.com.sun.j3d.scenegraph.io.SceneGraphIO)\n ((eu.mihosoft.ext.j3d.com.sun.j3d.scenegraph.io.SceneGraphIO)node).restoreSceneGraphObjectReferences( control.getSymbolTable() );\n }", "@Before\n\tpublic void setUp() throws Exception {\n\t\t\n\t\ttestGraph = \"Test\";\n\t\tmapGraph.setMapGraph(testGraph);\n\t}", "@BeforeClass\n\tpublic static void setUpBeforeClass() throws Exception {\n\t\tmapGraph = new MapGraph();\n\t}", "public NameSurferGraph() {\r\n\t\taddComponentListener(this);\r\n\t\tentryGraph = new ArrayList<NameSurferEntry>();\r\n\t}", "public void createGraphPanel(List<String> states){\n\t\tgraph = new GraphPanel(states);\n\t\tgraph.update(updatePopulations(), 0);\n\t}", "public void setUpEcosystem() {\n Pool skookumchuk = setUpSkookumchuk();\n Pool rutherford = setUpRutherford();\n Pool gamelin = setUpGamelin();\n\n ecosystem.addPool(skookumchuk);\n ecosystem.addPool(rutherford);\n ecosystem.addPool(gamelin);\n\n ecosystem.addStream(new Stream(skookumchuk, rutherford));\n ecosystem.addStream(new Stream(rutherford, gamelin));\n }", "public GraphView() {\r\n graphModel = new GraphModel();\r\n graphModel.setNoOfChannels(0);\r\n graphModel.setXLength(1);\r\n initializeGraph();\r\n add(chartPanel);\r\n setVisible(true);\r\n }", "@RequiresApi(api = Build.VERSION_CODES.KITKAT)\n public void initializeGraph() {\n checkpointPrefix = Tensors.create((getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath() + \"final_model.ckpt\").toString());\n checkpointDir = getApplicationContext().getExternalFilesDir(Environment.DIRECTORY_DOCUMENTS).getAbsolutePath();\n graph = new Graph();\n sess = new Session(graph);\n InputStream inputStream;\n try {\n inputStream = getAssets().open(\"final_graph_hdd.pb\");\n byte[] buffer = new byte[inputStream.available()];\n int bytesRead;\n ByteArrayOutputStream output = new ByteArrayOutputStream();\n while ((bytesRead = inputStream.read(buffer)) != -1) {\n output.write(buffer, 0, bytesRead);\n }\n graphDef = output.toByteArray();\n } catch (IOException e) {\n e.printStackTrace();\n }\n graph.importGraphDef(graphDef);\n try {\n sess.runner().feed(\"save/Const\", checkpointPrefix).addTarget(\"save/restore_all\").run();\n Toast.makeText(this, \"Checkpoint Found and Loaded!\", Toast.LENGTH_SHORT).show();\n }\n catch (Exception e) {\n sess.runner().addTarget(\"init\").run();\n Log.i(\"Checkpoint: \", \"Graph Initialized\");\n }\n }", "public DynamicGraph(int pintVCount, int pintEdgeCount) {\n this.hmpGraphsAtTimeframes = new HashMap<>();\n mapAllVertices = new DynamicArray<>(pintVCount);\n mapAllEdges = new DynamicArray<>(pintEdgeCount);\n darrGlobalAdjList = new DynamicArray<>(pintVCount);\n \n icommunityColors = new CommunityColors();\n }", "void makeSampleGraph() {\n\t\tg.addVertex(\"a\");\n\t\tg.addVertex(\"b\");\n\t\tg.addVertex(\"c\");\n\t\tg.addVertex(\"d\");\n\t\tg.addVertex(\"e\");\n\t\tg.addVertex(\"f\");\n\t\tg.addVertex(\"g\");\n\t\tg.addEdge(\"a\", \"b\");\n\t\tg.addEdge(\"b\", \"c\");\n\t\tg.addEdge(\"b\", \"f\");\n\t\tg.addEdge(\"c\", \"d\");\n\t\tg.addEdge(\"d\", \"e\");\n\t\tg.addEdge(\"e\", \"f\");\n\t\tg.addEdge(\"e\", \"g\");\n\t}", "void createGraphForMassiveLoad();", "protected GraphNode() {\n }", "protected GraphNode() {\n }", "private void setUpGraph() {\n \tString title;\n\t\ttry {\n\t\t\ttitle = util.readTextFile(new File(UI.UITEXT_DIRECTORY)).get(GRAPHTITLE_DEX);\n\t\t\taCS = new AreaChartSample(cellStateNames,title);\n\t\t} catch (FileNotFoundException e) {\n\t\t\taCS = new AreaChartSample(cellStateNames, \"ERROR ON TITLE\");\n\t\t}\n\t\troot.getChildren().add(aCS.getAreaChart());\n \tplot();\n }", "@Before\n public void setUp() {\n a = new Graph(5);\n \n }" ]
[ "0.6336331", "0.6312268", "0.6293049", "0.6212147", "0.6153441", "0.5996722", "0.59593886", "0.5915313", "0.5839407", "0.57786673", "0.576391", "0.5744886", "0.57432395", "0.572677", "0.5714772", "0.5706195", "0.5698144", "0.56787324", "0.56677437", "0.56599534", "0.5626892", "0.5618767", "0.5614374", "0.56107724", "0.5596165", "0.5594756", "0.55713505", "0.556416", "0.5554973", "0.55543077", "0.55368054", "0.5522845", "0.5519539", "0.5486356", "0.5467737", "0.5448332", "0.5444822", "0.542537", "0.5416706", "0.54153264", "0.5411227", "0.5410288", "0.5398532", "0.53691506", "0.53623825", "0.5343886", "0.53406864", "0.5329265", "0.5325056", "0.53190106", "0.5315737", "0.53001344", "0.5289149", "0.52857155", "0.5284833", "0.5281877", "0.5281877", "0.5281877", "0.52793187", "0.5268438", "0.52549523", "0.5253134", "0.52493113", "0.52325505", "0.5213846", "0.5212849", "0.52109784", "0.5195197", "0.519133", "0.51882136", "0.51811403", "0.51754874", "0.5172675", "0.51689297", "0.5167524", "0.51666224", "0.5158753", "0.5154394", "0.5152072", "0.51511055", "0.5150911", "0.51303667", "0.51284254", "0.51264304", "0.5124691", "0.5097029", "0.5081008", "0.507922", "0.5072213", "0.5065195", "0.50557476", "0.50354075", "0.5032053", "0.5027016", "0.50221", "0.50166136", "0.50133544", "0.50133544", "0.5013246", "0.5010155" ]
0.6828744
0
Tears down the SesameMGraph.
public void tearDown() throws RepositoryException { graph.shutdown(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void shutdownMassiveGraph();", "public void ShutDown()\n {\n bRunning = false;\n \n LaunchLog.Log(COMMS, LOG_NAME, \"Shut down instruction received...\");\n\n for(LaunchServerSession session : Sessions.values())\n {\n LaunchLog.Log(COMMS, LOG_NAME, \"Closing session...\");\n session.Close();\n }\n \n LaunchLog.Log(COMMS, LOG_NAME, \"...All sessions are closed.\");\n }", "void exitSession()\n\t{\n\t\t// clear out our watchpoint list and displays\n\t\t// keep breakpoints around so that we can try to reapply them if we reconnect\n\t\tm_displays.clear();\n\t\tm_watchpoints.clear();\n\n\t\tif (m_fileInfo != null)\n\t\t\tm_fileInfo.unbind();\n\n\t\tif (m_session != null)\n\t\t\tm_session.terminate();\n\n\t\tm_session = null;\n\t\tm_fileInfo = null;\n\t}", "public void shutdown() {\n mGameHandler.shutdown();\n mTerminalNetwork.terminate();\n }", "public synchronized void shutDown() {\n\t state.shutDown();\n\t}", "public void shutdown()\r\n\t{\r\n\t\tgraphDb.shutdown();\r\n\t\tSystem.out.println(\"Shutdown-Done!\");\r\n\t}", "public void shutDown() {\n StunStack.shutDown();\n stunStack = null;\n stunProvider = null;\n requestSender = null;\n\n this.started = false;\n\n }", "public void endSession() {\n if (sqlMngr != null) {\n sqlMngr.disconnect();\n }\n if (sc != null) {\n sc.close();\n }\n sqlMngr = null;\n sc = null;\n }", "public void shutDown() {\n isStarted = false;\n logger.info(\"[GAME] shut down\");\n }", "public void shutdown(){\n\t\tAndroidSensorDataManagerSingleton.cleanup();\n\t}", "private void shutDown() {\r\n\t\t\r\n\t\t// send shutdown to children\r\n\t\tlogger.debug(\"BagCheck \"+ this.lineNumber+\" has sent an EndOfDay message to it's Security.\");\r\n\t\tthis.securityActor.tell(new EndOfDay(1));\r\n\r\n\t\t// clear all references\r\n\t\tthis.securityActor = null;\r\n\t}", "private void shutDown() {\n this.setState(State.SHUTTING);\n // clean all msg queues\n if (isRoot()) {\n System.out.println(String.format(\"%s: shutdown\", Thread.currentThread().getName()));\n Neighbor pseudoParent = null;\n ArrayList<Neighbor> children = node.getChildren();\n if (children.isEmpty()) {\n // shutDown fast\n } else {\n System.out.println(String.format(\"%s: looking for next root\", Thread.currentThread().getName()));\n for (Neighbor child : node.getChildren()) {\n try {\n child.sendMessage(\n new RootMessage(),\n child::detach\n ).get();\n pseudoParent = child;\n break;\n } catch (InterruptedException | CancellationException | ExecutionException e) {\n e.printStackTrace();\n System.err.println(Thread.currentThread().getName() + \": child not available\");\n }\n }\n\n if (pseudoParent != null) {\n System.out.println(String.format(\"%s: found next root\", Thread.currentThread().getName()));\n broadcastRejoin(pseudoParent);\n } else {\n // shutdown fast\n System.out.println(String.format(\"%s: didn't find next root\", Thread.currentThread().getName()));\n }\n }\n } else {\n try {\n Neighbor parent = node.parent;\n broadcastRejoin(parent);\n parent.sendMessage(new LeaveMessage(), this::detachParent).get();\n } catch (InterruptedException | ExecutionException e) {\n e.printStackTrace();\n }\n }\n setState(State.TERMINATED);\n }", "public void shutDown()\n {\n stunStack.removeSocket(serverAddress);\n messageSequence.removeAllElements();\n localSocket.close();\n }", "public synchronized void cleanup() {\n\t\t// by freeing the mother group we clean up all the nodes we've created\n\t\t// on the SC server\n\t\tsendMessage(\"/g_freeAll\", new Object[] { _motherGroupID });\n\t\tfreeNode(_motherGroupID);\n\t\tfreeAllBuffers();\n\t\t\n\t\t//reset the lists of sound nodes, nodeIds, busses, etc\n\t\tSoundNode sn;\n\t\tEnumeration<SoundNode> e = _soundNodes.elements();\n\t\twhile (e.hasMoreElements()) {\n\t\t\tsn = e.nextElement();\n\t\t\tsn.setAlive(false);\n\t\t}\n\t\t_soundNodes.clear();\n\t\t_nodeIdList.clear();\n\t\t_busList.clear();\n\t\t_bufferMap.clear();\n\t}", "public void disconnect(){ \r\n if (matlabEng!=null){ \r\n matlabEng.engEvalString (id,\"bdclose ('all')\");\r\n matlabEng.engClose(id);\r\n matlabEng=null;\r\n id=-1; \r\n }\r\n }", "public void shutdown() {\n\t\tInput.cleanUp();\n\t\tVAO.cleanUp();\n\t\tTexture2D.cleanUp();\n\t\tResourceLoader.cleanUp();\n\t}", "protected void takeDown() {\n\t\t// Deregister from the yellow pages\n\t\ttry {\n\t\t\tDFService.deregister(this);\n\t\t}\n\t\tcatch (FIPAException fe) {\n\t\t\tfe.printStackTrace();\n\t\t}\n\t\t// Close the GUI\n\t\tmyGui.dispose();\n\t\t// Printout a dismissal message\n\t\tSystem.out.println(\"agent \"+getAID().getName()+\" terminating.\");\n\t}", "public void shutdown(boolean endGame) {\n\t\tif (!endGame) trayicon.shutdown();\n\t\t\n\t\tsaveTabs();\n\t\t\n\t\tstatus.shutdown();\n\t\t\n\t\t//do this last:\n\t\tif (!endGame) {\n\t\t\tdispose();\n\t\t}\n\t}", "public void teardown() {\n LOGGER.info(\"Shutting down driver\");\n driver.quit();\n }", "public void disconnect() {\n DatabaseGlobalAccess.getInstance().getEm().close();\n DatabaseGlobalAccess.getInstance().getEmf().close();\n }", "@Override\n protected void onDestroy() {\n mObjectGraph = null;\n super.onDestroy();\n }", "public static void shutdown()\n\t{\n\t\tinstance = null;\n\t}", "public void shutdown() {\n shutdown(false);\n }", "private void shutdown() {\n\t\ttry {\n\t\t\tsock.close();\n\t\t\tgame.handleExit(this);\n\t\t\tstopped = true;\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} \n\t}", "private void endGame() {\r\n\t\t// Change state (if not already done)\r\n\t\tstate = GameState.STOPPED;\r\n\t\t\r\n\t\t// End simulator\r\n\t\tsimulator.endGame();\r\n\t}", "public static void unjoinAndClose(){\n Session s = (Session)_sessionRef.get();\n if(s != null){\n s.close();\n }\n }", "public void stop() {\n\t\tserver.saveObjectToFile(offlineMessagesFileName, _offlineMessages);\n\t\tserver.saveObjectToFile(onlineClientsFileName, _onlineClients);\n\t\tserver.saveObjectToFile(clientFriendsFileName, _clientFriends);\n\t\t_offlineMessages.clear();\n\t\t_onlineClients.clear();\n\t\t_clientFriends.clear();\n\t\tserver.stop();\n\t}", "public void shutdownNetwork() {\r\n networkPlayer.stop();\r\n }", "public void unload() {\n plugin.getEngine().getWorldProvider().getHeartbeat().unsubscribe(WIND);\n plugin.getRootConfig().unsubscribe(TEMPERATURES);\n }", "public final void cleanUp() {\n\t\tmgdmfunctions = null;\n\t\tmgdmlabels = null;\n\t\theap.finalize();\n\t\theap = null;\n\t\tSystem.gc();\n\t}", "public void endGame() {\n\r\n\t\tplaying = false;\r\n\t\tstopShip();\r\n\t\tstopUfo();\r\n\t\tstopMissle();\r\n\t}", "protected void takeDown() {\n\t\ttry {\r\n\t\t\tDFService.deregister(this);\r\n\t\t}\r\n\t\tcatch (FIPAException fe) {\r\n\t\t\tfe.printStackTrace();\r\n\t\t}\r\n\r\n // connec.desconectar();\r\n\t\t// Printout a dismissal message\r\n\t\tSystem.out.println(\"Supplier-agent \"+getAID().getName()+\" terminating.\");\r\n\t}", "@AfterClass\n public static void tearDown() {\n em.clear();\n em.close();\n emf.close();\n }", "public void closeDown() {\n\t\tdispose();\n\n\t}", "private void closeSuperMarketSimulation()\r\n\t{\n\t\t\r\n\t\tSystem.out.println(\"CLOSED THE MARKET\");\r\n\t\tSystem.out.println(\" \");\r\n\t\tdataManager.reporter(\"---------------------------THE SUPER MARKET CLOSED---------------------------\");\r\n\t\tdataManager.printResults(this.queueManager.getLongestQueueSize(),this.queueManager.getLongestCustomer(),this.queueManager.getLongestQueueSizeTime());\r\n\t\tdataManager.printReport();\r\n\t\tqueueManager.dequeueEveryone();\r\n\t}", "public static void end() {\n\t\tif(firstTime)\r\n\t\t\tfirstTime=false;\r\n\t\tif (over) {\r\n\t\t\treset();\r\n\t\t\tover = false;\r\n\t\t}\r\n\t\tGUI.panel.changeGame();\r\n\t}", "public void endGame() {\r\n\t\tthis.gameStarted = false;\r\n\t\tthis.sendMessages = false;\r\n\t\tthis.centralServer.removeServer(this);\r\n\t}", "@Override\r\n public void onClosed() {\n if (emdkManager != null) {\r\n emdkManager.release();\r\n emdkManager = null;\r\n }\r\n updateStatus(\"EMDK closed unexpectedly! Please close and restart the application.\");\r\n }", "public void close() {\n socket.close();\n game.close();\n this.running = false;\n }", "public static void shutDownPlayer()\n {\n MusicPlayerControl.shutdown();\n JSoundsMainWindowViewController.listSongs=null;\n JSoundsMainWindowViewController.listSongs=new JMusicPlayerList();\n JSoundsMainWindowViewController.alreadyPlaying=false;\n JSoundsMainWindowViewController.dontInitPlayer=false;\n JSoundsMainWindowViewController.shutDown=true;\n }", "@Override\n protected void onDestroy() {\n mActivityGraph = null;\n super.onDestroy();\n }", "public void shutDown(){\n sequence128db.shutDown();\n }", "private void cleanUp() {\n\t\tVisualizerView mVisualizerView = MusicApplication.getInstance()\n\t\t\t\t.getVisualizerView();\n\t\tif (mVisualizerView != null) {\n\t\t\tmVisualizerView.updateVisualizer(new byte[] {});\n\t\t}\n\t\t//\t\tif (mCurrentMediaPlayer != null) {\n\t\t//\t\t\tmCurrentMediaPlayer.reset();\n\t\t//\t\t\t//\t\t\tmCurrentMediaPlayer = null;\n\t\t//\t\t\tsetState(IDLE);\n\t\t//\t\t\tcom.dj.util.Log.i(this.getClass().getSimpleName(),\n\t\t//\t\t\t\t\t\" 歌曲停止,释放资源。mCurrentMediaPlayer: \" + mCurrentMediaPlayer);\n\t\t//\t\t\t//\t\t\tcleanEQ();\n\t\t//\t\t}\n\t}", "public void shutdown() {\n locationManager.removeUpdates(this);\n Log.i(TAG, \"GPS provider closed.\");\n }", "protected void takeDown() {\n // Deregister from the yellow pages\n try {\n DFService.deregister(this);\n } catch (FIPAException fe) {\n fe.printStackTrace();\n }\n\n // Printout a dismissal message\n System.out.println(\"Dataset-agent \" + getAID().getName() + \" terminating.\");\n }", "@Override\n\tpublic void onExit() {\n\t\tlabelHelp = null;\n\t\tlayer_force = null;\n\t\tmSoundBtn = null;\n\t\tboxMessage = null;\n\n\t\tSystem.gc();\n\t\tsuper.onExit();\n\t}", "public static void shutdown() {\n\t\tgetSessionFactory().close();\n\t}", "private void shutdown(){\n\t\ttry{\n\t\t\tMainController gainCtr=loader.getController();\n\t\t\tgainCtr.isOnline=false;\n\t\t\tif(!gainCtr.sc.equals(null)) {\n\t\t\t\tgainCtr.sc.close();\n\t\t\t}\n\t\t\t}catch (Exception e) {\n\t\t\t\t\t\n\t\t\t\t}\n\t}", "public void disconnect() {\n try {\n theCoorInt.unregisterForCallback(this);\n theCoorInt = null;\n }\n catch (Exception e) {\n simManagerLogger.logp(Level.SEVERE, \"SimulationManagerModel\", \n \"closeSimManager\", \"Exception in unregistering Simulation\" +\n \"Manager from the CAD Simulator.\", e);\n }\n }", "public void shutdown()\r\n {\r\n debug(\"shutdown() the application module\");\r\n\r\n // Shutdown all the Timers\r\n shutdownWatchListTimers();\r\n // Save Our WatchLists\r\n saveAllVectorData();\r\n // Our Container vectors need to be emptied and clear. \r\n modelVector.removeAllElements();\r\n modelVector = null;\r\n\r\n tableVector.removeAllElements();\r\n tableVector = null;\r\n\r\n // Delete any additional Historic Data that is Serialized to disk\r\n expungeAllHistoricFiles();\r\n\r\n // Shutdown the task that monitors the update tasks\r\n if ( this.monitorTask != null )\r\n {\r\n this.monitorTask.cancel();\r\n this.monitorTask = null;\r\n }\r\n // Null out any reference to this data that may be present\r\n stockData = null;\r\n debug(\"shutdown() the application module - complete\");\r\n\r\n }", "public void stop()\n {\n mover.stop();\n }", "public void destroy() {\r\n Display.destroy();\r\n System.exit(0);\r\n }", "public void close() {\n\t\tif (this.luaState != 0) {\n\t\t\tLuaStateManager.removeState(stateId);\n\t\t\t_close(luaState);\n\t\t\tthis.luaState = 0;\n\t\t}\n\t}", "public final void clean() {\n distributed_graph.unpersist(true);\n }", "public void shutdown() {\r\n System.exit(0);\r\n }", "public void shutDown();", "@After\n\tpublic void teardown() {\n\t\tdrv.quit();\n\t}", "public void shutdown() {\n for (Entry<String,Session> entry : _sessions.entrySet())\n entry.getValue().disconnect();\n \n writeLine(\"\\nDebugServer shutting down.\");\n close();\n }", "void shutDown();", "public static void teardown() {\n\t\tdriver.quit();\n\t}", "public void stop() {\r\n\t\t// Tell the Gui Agent to shutdown the system\r\n\t\tGui.shutdown = true;\r\n\t}", "public void stop() {\n\tanimator = null;\n\toffImage = null;\n\toffGraphics = null;\n }", "public void stop()\n {\n _panel.cleanup();\n _appContext.cleanup();\n }", "public void shutDown() {\n collector.removePool(this);\n factory.poolClosing(this);\n\n // close all objects\n synchronized (objects) {\n for (Iterator it = objects.values().iterator(); it.hasNext();) {\n ObjectRecord rec = (ObjectRecord) it.next();\n if (null != rec) {\n if (rec.isInUse())\n factory.returnObject(rec.getClientObject());\n factory.deleteObject(rec.getObject());\n rec.close();\n }\n }\n objects.clear();\n deadObjects.clear();\n }//end of synch\n\n factory = null;\n poolName = null;\n initialized = false;\n }", "private void close() {\n\t\ttry {\n\t\t\tsendCommand(\"end\\n\");\n\t\t\tout.close();\n\t\t\tin.close();\n\t\t\tsocket.close();\n\t\t} catch (MossException e) {\n\t\t} catch (IOException e2) {\n\t\t} finally {\n\t\t\tcurrentStage = Stage.DISCONNECTED;\n\t\t}\n\n\t}", "void destroy() {\n \t\ttry {\r\n \t\t\tupKeep.stopRunning();\r\n \t\t} catch (InterruptedException e) {\r\n \t\t}\r\n \r\n \t\t// Kill all running processes.\r\n \t\tfor (MaximaProcess mp : pool) {\r\n \t\t\tmp.kill();\r\n \t\t}\r\n \t\tpool.clear();\r\n \r\n \t\t// Kill all used processes.\r\n \t\tfor (MaximaProcess mp : usedPool) {\r\n \t\t\tmp.kill();\r\n \t\t}\r\n \t\tusedPool.clear();\r\n \t}", "public void onDestroy() {\n cancelPausedTimer();\n k.a().b();\n stopSocket();\n clearAllMapData();\n if (this.pushManager != null) {\n this.pushManager.i();\n this.pushManager = null;\n }\n if (this.liveAnimationView != null) {\n this.liveAnimationView.onDestroy();\n }\n if (this.mLivePusherInfoView != null) {\n this.mLivePusherInfoView.onDestroy();\n }\n if (this.countDownAnimSet != null) {\n this.countDownAnimSet.cancel();\n }\n if (this.mainHandler != null) {\n this.mainHandler.removeCallbacksAndMessages(null);\n this.mainHandler = null;\n }\n if (this.workHandler != null) {\n this.workHandler.removeCallbacksAndMessages(null);\n this.workHandler = null;\n }\n if (this.mGiftBoxView != null) {\n this.mGiftBoxView.release();\n }\n if (this.mInputTextMsgDialog != null) {\n this.mInputTextMsgDialog.onDestroy();\n this.mInputTextMsgDialog = null;\n }\n super.onDestroy();\n }", "@Override\r\n\tpublic void shutDown() {\r\n\t\tdown.set(true);\r\n\t\tif (shutDownImmediatelly) {\r\n\t\t\ttry {\r\n\t\t\t\tsuper.shutDown();\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tThread thread = new Thread(new Runnable() {\r\n\t\t\t\t@Override\r\n\t\t\t\tpublic void run() {\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tSessionForUI.super.shutDown();\r\n\t\t\t\t\t} catch (Exception e) {\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\tthread.setDaemon(true);\r\n\t\t\tthread.start();\r\n\t\t}\r\n\t}", "void shutdown() {\n if (metricRegistry != null) {\n for (String metricName : gaugeMetricNames) {\n try {\n metricRegistry.remove(metricName);\n } catch (RuntimeException e) {\n // ignore\n }\n }\n }\n }", "public void cleanUp() {\r\n\t\temfactory.close();\r\n\t}", "public void close() {\n\t\ttry {\n\t\t\texecutorService.shutdownNow();\n\t\t\toutput.close();\n\t\t\tinput.close();\n\t\t\tconnection.close();\n\t\t} catch (IOException ioe) {\n\t\t\tMain.LOGGER.log(Level.SEVERE, \"Error closing GameHandler\", ioe);\n\t\t} \n\t}", "final synchronized void close(VMWareCore graphics) {\n this.currentConfig = null;\n }", "public void cleanup() {\n endtracking();\n\n //sends data to UI\n MainActivity.trackingservicerunning = false;\n MainActivity.servicestopped();\n\n //stops\n stopSelf();\n }", "public void close() {\n this.sipStack = null;\n }", "public void shutdown() {\n logger.info(\"Shutting down modules.\");\n for (Module module : modules) {\n module.stop();\n }\n logger.info(\"Shutting down reporters.\");\n for (Reporter reporter : reporters.values()) {\n reporter.stop();\n }\n }", "public final void destroy()\n {\n processDestroy();\n super.destroy();\n }", "protected void takeDown() {\n\t\t// Deregister from the yellow pages\n\t\ttry {\n\t\t\tDFService.deregister(this);\n\t\t}\n\t\tcatch (FIPAException fe) {\n\t\t\tfe.printStackTrace();\n\t\t}\n\n\t\t// Close the GUI\n\t\tmyGui.dispose();\n\n\t\t// Printout a dismissal message\n\t\tSystem.out.println(\"Bidder \"+getAID().getName()+\" terminating.\");\n\t}", "void stopGame() {\n leader.disconnect();\n opponent.disconnect();\n }", "private void end() {\r\n isRunning = false;\r\n if( mineField.exploder.isRunning() ) mineField.exploder.stop();\r\n if( settingsOpen ) settingsFrame.dispose();\r\n }", "@AfterClass\n public static void tearDownClass() {\n ApplicationSessionManager.getInstance().stopSession();\n }", "public static void cleanUp() {\n\t\tHashDecay.stopAll();\n\t\tSystem.gc();\n\t}", "@AfterClass\n\tpublic void tearDown() {\n\n\t\tsettings.clickLogout();\n\t\ttest.log(Status.INFO, \"Signed off\");\n\t\tapp.quit();\n\t\ttest.log(Status.INFO, \"Closed firefox\");\n\n\t}", "public void swigDirectorDisconnect() {\n this.swigCMemOwn = false;\n delete();\n }", "private void cleanUp(){\n\t\tSSHUtil sSHUtil=(SSHUtil) SpringUtil.getBean(\"sSHUtil\");\n\t\ttry {\n\t\t\tsSHUtil.disconnect();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void onDestroy() {\n super.onDestroy();\n Object object = this.mLock;\n synchronized (object) {\n Iterator<MediaSession2> iterator = this.getSessions().iterator();\n do {\n if (!iterator.hasNext()) {\n this.mSessions.clear();\n this.mNotifications.clear();\n // MONITOREXIT [2, 3, 4] lbl9 : MonitorExitStatement: MONITOREXIT : var1_1\n this.mStub.close();\n return;\n }\n this.removeSession(iterator.next());\n } while (true);\n }\n }", "public void quit()\r\n {\r\n brokerage.logout(this);\r\n myWindow = null;\r\n }", "public void destroy()\n\t{\n\t\ttry\n\t\t{\n\t\t\tmessageCanvas.getGraphics().destroy();\n\t\t\tmessageCanvas.destroy();\n\t\t}\n\t\tcatch (SlickException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void shutDown () {\n sparkService.stop();\n }", "public static void exit() {\n\t\t\n\t\t//\tlog out\n\t\tlogout();\n\t\t\n\t\t//\tclean up\n\t\taccountNames.clear();\n\t\taccountsByName.clear();\n\t\tdataProvider = null;\n\t\trememberedUserNames = null;\n\t}", "public synchronized void shutdown() {\n try {\n stop();\n } catch (Exception ex) {\n }\n \n try {\n cleanup();\n } catch (Exception ex) {\n }\n }", "public void destroy() {\n try {\n service.shutdown();\n } catch (Exception e) {Log.v(\"HierarchyDumpManager\", \"Could not destroy: \" + e.getMessage());}\n }", "public void destroy() {\n\t\tsuper.destroy();\n\t\tlockManager.releaseLock();\n\t\tlockManager.releaseTimer();\n\t\tif (timerForAutomaticSaving != null) {\n\t\t\t/* cancel the timer, if map is closed. */\n\t\t\ttimerForAutomaticSaving.cancel();\n\t\t}\n\t}", "public void shutdown() {\n if (configurations.isRegisterMXBeans()) {\n JmxConfigurator.get().removeMXBean(this);\n }\n configurations.shutdown();\n }", "public static void shut () {\r\n if(factory != null) { \t \r\n factory.finalixe(); \r\n }\r\n factory = null ;\r\n }", "public void end()\n\t{\n\t\tStateManager.setState(StateManager.GameState.MAINMENU);\n\t\tStateManager.setGame(null);\n\t}", "public void disconnect()\n\t{\n\t\tif (isConnected)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tvimPort.logout(serviceContent.getSessionManager());\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tlogger.trace(\"Failed to logout esx: \" + host, e);\n\t\t\t}\n\t\t}\n\t\tisConnected = false;\n\t}", "public void closeConnection(){\r\n\t\t_instance.getServerConnection().logout();\r\n\t}", "@Override\n\tpublic void close() {\n\t\tframe = null;\n\t\tclassic = null;\n\t\trace = null;\n\t\tbuild = null;\n\t\tbt_classic = null;\n\t\tbt_race = null;\n\t\tbt_build = null;\n\t\tGameView.VIEW.removeDialog();\n\t}", "public void terminate() {\n screen.closeScreen();\n }", "public void close() {\n this.consoleListenerAndSender.shutdownNow();\n this.serverListenerAndConsoleWriter.shutdownNow();\n try {\n this.getter.close();\n this.sender.close();\n this.socket.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void destroy() {\n this.bfc.cleanUp();\n }" ]
[ "0.6746431", "0.6457153", "0.641792", "0.64047414", "0.6375863", "0.6343797", "0.6192592", "0.61754775", "0.61228096", "0.6120931", "0.60957736", "0.6021747", "0.6011301", "0.6004563", "0.59984463", "0.5976256", "0.5957791", "0.5950299", "0.59499055", "0.5940274", "0.5914492", "0.5888229", "0.5885625", "0.5879073", "0.58615106", "0.5854662", "0.58450735", "0.5833252", "0.58247775", "0.5806601", "0.57867414", "0.5785374", "0.57832175", "0.5769774", "0.5766879", "0.5761268", "0.57573223", "0.57569975", "0.5753708", "0.57326853", "0.57322603", "0.573164", "0.57296914", "0.5727653", "0.57247406", "0.57222205", "0.57176125", "0.5705538", "0.5705113", "0.5695204", "0.5695064", "0.5694857", "0.5692696", "0.5688399", "0.5688388", "0.5685587", "0.56849116", "0.5682803", "0.5682302", "0.5673235", "0.5667684", "0.566625", "0.5660058", "0.56506217", "0.5644818", "0.5638577", "0.5632427", "0.5627805", "0.5627584", "0.5627446", "0.5626668", "0.5622317", "0.56203836", "0.5619787", "0.5610561", "0.5608454", "0.56054866", "0.5604558", "0.5604379", "0.55950963", "0.5594744", "0.55900264", "0.55824417", "0.5579815", "0.55783176", "0.55758613", "0.55752593", "0.5570969", "0.5559341", "0.555592", "0.55522335", "0.5551962", "0.55505645", "0.55497134", "0.55479914", "0.5546767", "0.5539954", "0.5538943", "0.5536981", "0.553499", "0.5527847" ]
0.0
-1
Cleans the content of the specified directory recursively.
private void cleanDirectory(File dir) { File[] files= dir.listFiles(); if (files!=null && files.length>0) { for (File file: files) { delete(file); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void cleanDirectory(File dir) {\n if (dir.isDirectory()) {\n for (File f : dir.listFiles()) {\n cleanDirectory( f );\n }\n }\n dir.delete();\n }", "private void emptyDirectory(File dir){\n\n for (File file : Objects.requireNonNull(dir.listFiles())){\n if (file.isDirectory())\n {\n emptyDirectory(file);\n }\n file.delete();\n }\n }", "protected boolean cleanUpDir(File dir) {\n if (dir.isDirectory()) {\n LOG.info(\"Cleaning up \" + dir.getName());\n String[] children = dir.list();\n for (String string : children) {\n boolean success = cleanUpDir(new File(dir, string));\n if (!success)\n return false;\n }\n }\n // The directory is now empty so delete it\n return dir.delete();\n }", "private void clearClipsDirectory(){\n /* Citation : http://helpdesk.objects.com.au/java/how-to-delete-all-files-in-a-directory#:~:text=Use%20the%20listFiles()%20method,used%20to%20delete%20each%20file. */\n File directory = new File(Main.CREATED_CLIPS_DIRECTORY_PATH);\n File[] files = directory.listFiles();\n if(files != null){\n for(File file : files){\n if(!file.delete()) System.out.println(\"Failed to remove file \" + file.getName() + \" from \" + Main.CREATED_CLIPS_DIRECTORY_PATH);\n }\n }\n }", "public void clearDirectory(File directory) {\n if (directory.exists()) {\n for (File file : directory.listFiles()) {\n file.delete();\n }\n }\n }", "private void clean(Path path) throws IOException {\n if (Files.exists(path)) {\n Files.walkFileTree(path, new SimpleFileVisitor<>() {\n public FileVisitResult visitFile(Path path, BasicFileAttributes attributes) throws IOException {\n Files.delete(path);\n return FileVisitResult.CONTINUE;\n }\n\n public FileVisitResult postVisitDirectory(Path path, IOException exception) throws IOException {\n Files.delete(path);\n return FileVisitResult.CONTINUE;\n }\n });\n }\n }", "public static final void cleanDirectory(File directory) throws IOException {\n if (!directory.exists()) {\n throw new IllegalArgumentException(directory + \" does not exist\");\n }\n\n if (!directory.isDirectory()) {\n throw new IllegalArgumentException(directory + \" is not a directory\");\n }\n\n File[] files = directory.listFiles();\n if (files == null) { // null if security restricted\n throw new IOException(\"Failed to list contents of \" + directory);\n }\n\n IOException exception = null;\n for (File file : files) {\n try {\n forceDelete(file);\n } catch (IOException ioe) {\n exception = ioe;\n }\n }\n\n if (exception != null) {\n throw exception;\n }\n }", "@Override\n public void removeDirectory(File directory, boolean recursive) throws FileNotFoundException, IOException {\n }", "public static void cleanDirectory( File directory ) throws IOException\n {\n if ( !directory.exists() )\n {\n throw new IllegalArgumentException( I18n.err( I18n.ERR_17006_DOES_NOT_EXIST, directory ) );\n }\n\n if ( !directory.isDirectory() )\n {\n throw new IllegalArgumentException( I18n.err( I18n.ERR_17007_IS_NOT_DIRECTORY, directory ) );\n }\n\n File[] files = directory.listFiles();\n\n if ( files == null )\n {\n // null if security restricted\n throw new IOException( I18n.err( I18n.ERR_17008_FAIL_LIST_DIR, directory ) );\n }\n\n IOException exception = null;\n\n for ( File file : files )\n {\n try\n {\n forceDelete( file );\n }\n catch ( IOException ioe )\n {\n exception = ioe;\n }\n }\n\n if ( null != exception )\n {\n throw exception;\n }\n }", "public synchronized void cleanup() {\n\t\tString[] children = mStorageDirectory.list();\n\t\tif (children != null) { // children will be null if the directory does\n\t\t\t\t\t\t\t\t// not exist.\n\t\t\tfor (int i = 0; i < children.length; i++) { // remove too small file\n\t\t\t\tFile child = new File(mStorageDirectory, children[i]);\n\t\t\t\tif (!child.equals(new File(mStorageDirectory, NOMEDIA))\n\t\t\t\t\t\t&& child.length() <= MIN_FILE_SIZE_IN_BYTES) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\tchild.delete();\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void cleanDirs() {\n\t\tfor (File f : files) {\n\t\t\tFileUtils.deleteDir(f.toString());\n\t\t}\n\t}", "@Override\n public void clean(Path path) {\n }", "void deleteDirectory(String path, boolean recursive) throws IOException;", "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\tpublic void remDir(String path) {\n\t\t\r\n\t}", "void deleteTagDirectory() {\n\n try {\n\n Log.i(\"Deleting Tag Directory\", tag_directory.toString());\n FileUtils.deleteDirectory(tag_directory);\n } catch (IOException e) {\n\n }\n\n }", "public static void cleanFolder(File outputFolder)\n {\n File[] files = outputFolder.listFiles();\n for (File file : files)\n {\n if (file.isDirectory())\n {\n cleanFolder(file);\n }\n else\n {\n if (file.delete())\n {\n Main.out(\"Deleted: \" + file);\n }\n else\n {\n Main.warn(\"Failed to delete file: \" + file);\n }\n }\n }\n }", "private void emptyTestDirectory() {\n // Delete the files in the /tmp/QVCSTestFiles directory.\n File tempDirectory = new File(TestHelper.buildTestDirectoryName(TEST_SUBDIRECTORY));\n File[] files = tempDirectory.listFiles();\n if (files != null) {\n for (File file : files) {\n if (file.isDirectory()) {\n File[] subFiles = file.listFiles();\n for (File subFile : subFiles) {\n if (subFile.isDirectory()) {\n File[] subSubFiles = subFile.listFiles();\n for (File subSubFile : subSubFiles) {\n subSubFile.delete();\n }\n }\n subFile.delete();\n }\n }\n file.delete();\n }\n }\n }", "private void deleteDirectory(Path path) throws IOException {\n if (Files.isDirectory(path, LinkOption.NOFOLLOW_LINKS)) {\n try (DirectoryStream<Path> entries = Files.newDirectoryStream(path)) {\n for (Path entry : entries) {\n deleteDirectory(entry);\n }\n }\n }\n Files.delete(path);\n }", "public boolean folderCleaner(String folderPath, Boolean ifDeleteSubdirs, Boolean ifDeleteFiles, Boolean ifDeleteRoot, Boolean ifPrompt) throws IOException { \n folderPath = folderPath.replace(\"\\\\\", \"/\");\n if(folderPath.endsWith(\"/\")) { folderPath = folderPath.substring(0, folderPath.length() - 1); }\n File dir = new File(folderPath);\n String how = \"\", action = null;\n Boolean success = false;\n Boolean current = false;\n if (dir.exists() && dir.isDirectory()) { \n try{ \n success = true;\n String[] children = dir.list();\n if(children.length > 0) {\n action = \"CLEANED\";\n for (int i = 0; i < children.length; i++) {\n File child = new File(dir, children[i]);\n if(child.isDirectory()){ if(ifDeleteSubdirs) { FileUtils.forceDelete(child); } if(ifPrompt && ifDeleteSubdirs) {System.out.print(\"DIRECTORY \");} }\n else { if(ifDeleteFiles) { FileUtils.forceDelete(child); } if(ifPrompt && ifDeleteFiles) {System.out.print(\" FILE \");} }\n \n current = !child.exists();\n success = success && current;\n if(current) { how = \" DELETED: \\\"\"; } else { how = \"NOT DELETED: \\\"\"; }\n if(ifPrompt && current) System.out.print(how + child.getAbsolutePath() + \"\\n\");\n }\n }\n // THE DIRECTORY IS EMPTY - DELETE IT IF REQUIRED\n if (ifDeleteRoot) { FileUtils.forceDelete(dir); success = success && !dir.exists(); action = \"DELETED\"; }\n if(ifPrompt && (!action.equals(null))) {\n if (success) { \n System.out.println(\"\\n\" + \"FULLY \" + action + \" DIRECTORY: \\\"\" + folderPath.substring(folderPath.lastIndexOf(\"/\") + 1, folderPath.length()) + \"\\\"\\n\");\n } else {\n System.out.println(\"\\n\" + \"NOT FULLY \" + action + \" DIRECTORY: \\\"\" + folderPath.substring(folderPath.lastIndexOf(\"/\") + 1, folderPath.length()) + \"\\\"\\n\");\n }\n }\n } catch (Exception e) {} \n }\n return success;\n }", "private void cleanup() {\n File tmpdir = new File(System.getProperty(\"java.io.tmpdir\"));\n File[] backupDirs = tmpdir.listFiles(file -> file.getName().contains(BACKUP_TEMP_DIR_PREFIX));\n if (backupDirs != null) {\n for (File file : backupDirs) {\n try {\n FileUtils.deleteDirectory(file);\n log.info(\"removed temporary backup directory {}\", file.getAbsolutePath());\n } catch (IOException e) {\n log.error(\"failed to delete the temporary backup directory {}\", file.getAbsolutePath());\n }\n }\n }\n }", "private void cleanTempFolder() {\n File tmpFolder = new File(getTmpPath());\n if (tmpFolder.isDirectory()) {\n String[] children = tmpFolder.list();\n for (int i = 0; i < children.length; i++) {\n if (children[i].startsWith(TMP_IMAGE_PREFIX)) {\n new File(tmpFolder, children[i]).delete();\n }\n }\n }\n }", "private static void deleteDirectory(File directory) {\r\n File[] files = directory.listFiles();\r\n for (int i = 0; i < files.length; i++) {\r\n if (files[i].isDirectory()) {\r\n deleteDirectory(files[i]);\r\n } else {\r\n files[i].delete();\r\n }\r\n }\r\n // Now that the directory is empty. Delete it.\r\n directory.delete();\r\n }", "void deleteStoryDirectory() {\n\n try {\n\n Log.i(\"Deleting StoryDirectory\", story_directory.toString());\n FileUtils.deleteDirectory(story_directory);\n } catch (IOException e) {\n\n }\n\n }", "private void cleanFolder(File[] files) {\n \t\t\n \t\tif (files != null) {\n \t\t\t// Iterate the files\n \t\t\tfor (int i = 0; i < files.length; i++) {\n \t\t\t\tFile f = files[i];\n \t\t\t\t// If the file is a directory, remove its contents recursively\n \t\t\t\tif (f.isDirectory()) {\n \t\t\t\t\tcleanFolder(f.listFiles());\n \t\t\t\t}\n \t\t\t\t// Remove the file if it is a class file\n \t\t\t\tif (f.getName().endsWith(\".class\"))\n \t\t\t\t\tf.delete();\n \t\t\t}\n \t\t}\n \t}", "@Override\n\tpublic synchronized void clear() {\n\t\tFile[] files = mRootDirectory.listFiles();\n\t\tif (files != null) {\n\t\t\tfor (File file : files) {\n\t\t\t\tfile.delete();\n\t\t\t}\n\t\t}\n\t\tmEntries.clear();\n\t\tmTotalSize = 0;\n\t\tVolleyLog.d(\"Cache cleared.\");\n\t}", "@Override\n public FileVisitResult postVisitDirectory(Path dir, IOException e) throws IOException{\n if (e == null) {\n Files.deleteIfExists(dir);\n }\n return FileVisitResult.CONTINUE;\n }", "private static void deleteDir(File file) {\n\t\tFile[] contents = file.listFiles();\n\t\tif (contents != null) {\n\t\t\tfor (File f : contents) {\n\t\t\t\tdeleteDir(f);\n\t\t\t}\n\t\t}\n\t\tfile.delete();\n\t}", "public void reset(File folder) {\n File[] listOfFiles = folder.listFiles();\n for(int x=0;x<listOfFiles.length;x++) {\n if(listOfFiles[x].isDirectory()) {\n this.reset(listOfFiles[x]);\n listOfFiles[x].delete();\n }\n }\n folder.delete();\n }", "@Override public void cleanupTempCheckpointDirectory() throws IgniteCheckedException {\n try {\n try (DirectoryStream<Path> files = Files.newDirectoryStream(cpDir.toPath(), TMP_FILE_MATCHER::matches)) {\n for (Path path : files)\n Files.delete(path);\n }\n }\n catch (IOException e) {\n throw new IgniteCheckedException(\"Failed to cleanup checkpoint directory from temporary files: \" + cpDir, e);\n }\n }", "public void clean()\r\n {\r\n // DO NOT TOUCH\r\n // System.out.println(unzipedFilePath);\r\n\r\n // only clean if there was a successful unzipping\r\n if (success)\r\n {\r\n // only clean if the file path to remove matches the zipped file.\r\n if (unzippedFilePath.equals(zippedFilePath.substring(0,\r\n zippedFilePath.length() - 4)))\r\n {\r\n // System.out.println(\"to be implmented\");\r\n for (File c : outputDir.listFiles())\r\n {\r\n // System.out.println(c.toString());\r\n if (!c.delete())\r\n {\r\n System.out.println(\"failed to delete\" + c.toString());\r\n }\r\n }\r\n outputDir.delete();\r\n outputDir = null;\r\n }\r\n }\r\n }", "public void cleanImportDirectory(String iPath) {\r\n\t\ttry {\r\n\t\t\tFile theFile = new File(iPath);\r\n\t\t\tFile allFiles[] = theFile.listFiles();\r\n\r\n\t\t\tfor (File allFile : allFiles) {\r\n\t\t\t\tif (allFile.isDirectory()) {\r\n\t\t\t\t\tcleanImportDirectory(allFile.toString());\r\n\t\t\t\t\tallFile.delete();\r\n\t\t\t\t} else {\r\n\t\t\t\t\tallFile.delete();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (NullPointerException npe) {\r\n\t\t\tmLogger.severe(iPath + \" did not exist and was not cleaned!!\");\r\n\t\t}\r\n\t}", "@Override\n public FileVisitResult postVisitDirectory(Path dir,\n IOException exc)\n throws IOException {\n Files.delete(dir);\n System.out.printf(\"Directory is deleted : %s%n\", dir);\n return FileVisitResult.CONTINUE;\n }", "public static void deleteDir(File dir) {\n\t if (dir.isDirectory()) {\n\t String[] children = dir.list();\n\t for (int i=0; i<children.length; i++) {\n\t File file = new File(dir, children[i]);\n\t log.info(\"Deleting file:\" + file.toString());\n\t file.delete();\n\t }\n\t }\n\t }", "public static void ClearAssetFolder(File directory) throws InterruptedException\r\n {\n try\r\n {\r\n \t\r\n \tFileUtils.deleteDirectory(directory);\r\n }\r\n catch (Exception ex) { }\r\n Thread.sleep(100);\r\n\r\n // Create a new assets folder\r\n try \r\n {\r\n \tdirectory.mkdir();\r\n }\r\n catch (Exception ex)\r\n {\r\n Logger.Log(\"Failed saving assets: \", Logger.LogLevel.Error, ex);\r\n return;\r\n }\r\n Thread.sleep(100);\r\n }", "public synchronized void cleanupSimple() {\n\t\tfinal int maxNumFiles = 1000;\n\t\tfinal int numFilesToDelete = 50;\n\n\t\tString[] children = mStorageDirectory.list();\n\t\tif (children != null) {\n\t\t\tif (children.length > maxNumFiles) {\n\t\t\t\tfor (int i = children.length - 1, m = i - numFilesToDelete; i > m; i--) {\n\t\t\t\t\tFile child = new File(mStorageDirectory, children[i]);\n\t\t\t\t\ttry {\n\t\t\t\t\t\tchild.delete();\n\t\t\t\t\t} catch (Exception 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}\n\t}", "private static void deletePublicationDir(File pubDir) {\n System.out.println(\" Deleting contents of directory: \" + pubDir);\n for (File pubFile : pubDir.listFiles()) {\n if (pubFile.isFile()) {\n System.out.println(\" Deleting file: \" + pubFile);\n pubFile.delete();\n }\n }\n System.out.println(\" Now deleting directory: \" + pubDir);\n pubDir.delete();\n }", "private static void doDeleteEmptyDir(String dir) {\n\n boolean success = (new File(dir)).delete();\n\n if (success) {\n System.out.println(\"Successfully deleted empty directory: \" + dir);\n } else {\n System.out.println(\"Failed to delete empty directory: \" + dir);\n }\n\n }", "private static void clearCache(File cacheDir)\n {\n // Get the list of the files in the cache folder\n final File[] files = cacheDir.listFiles();\n\n // Perform a for loop to delete/remove all files\n for (File file : files)\n {\n file.delete();\n }\n // end of for (int i=0; i<files.length; i++)\n }", "@AfterClass\n public static void teardown() {\n logger.info(\"teardown: remove the temporary directory\");\n\n // the assumption is that we only have one level of temporary files\n for (File file : directory.listFiles()) {\n file.delete();\n }\n directory.delete();\n }", "public static void cleanDirectory(final ContextualLogger logger, Path start) throws IOException {\n if (!start.toFile().exists()) {\n boolean didMake = start.toFile().mkdir();\n Assert.assertTrue(didMake);\n }\n // We need the directory to be a directory (as we don't want to follow symlinks anywhere in this delete operation).\n Assert.assertTrue(start.toFile().isDirectory());\n // We don't want to delete the starting directory, but we do want to delete everything in it.\n Files.walkFileTree(start, new FileVisitor<Path>() {\n @Override\n public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {\n // Do nothing.\n return FileVisitResult.CONTINUE;\n }\n\n @Override\n public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {\n // This clearly can't be the start.\n Assert.assertFalse(start.equals(file));\n // Delete the file.\n Files.delete(file);\n logger.output(\"Deleted file \" + file);\n return FileVisitResult.CONTINUE;\n }\n\n @Override\n public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException {\n logger.error(\"visitFileFailed: \\\"\" + file + \"\\\"\");\n throw exc;\n }\n\n @Override\n public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException {\n if (null == exc) {\n // Make sure that this isn't the starting directory.\n if (!start.equals(dir)) {\n Files.delete(dir);\n logger.output(\"Deleted directory \" + dir);\n }\n } else {\n throw exc;\n }\n return FileVisitResult.CONTINUE;\n }\n }\n );\n }", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tFile dir = new File(\"src/reports\");\n\t\t\t\tfor (File file : dir.listFiles())\n\t\t\t\tif (!file.isDirectory())\n\t\t\t\tfile.delete();\n\t\t\t\t}", "protected void deleteDirectory(String oneDir) {\n \n File[] listOfFiles;\n File cleanDir;\n\t\n cleanDir = new File(oneDir);\n if (!cleanDir.exists()) {// Nothing to do. Return; \n\t return;\n\t}\n listOfFiles = cleanDir.listFiles();\n if(listOfFiles != null) { \n for(int countFiles = 0; countFiles < listOfFiles.length; countFiles++) { \n if (listOfFiles[countFiles].isFile()) {\n listOfFiles[countFiles].delete();\n } else { // It is a directory\n String nextCleanDir = cleanDir + separator + listOfFiles[countFiles].getName();\n\t\t File newCleanDir = new File(nextCleanDir);\n deleteDirectory(newCleanDir.getAbsolutePath());\n } \n }// End for loop\n } // End if statement \n cleanDir.delete();\n }", "public static void deleteEverythingInPath(String path) {\n try {\n Path rootPath = Paths.get(path);\n Files.walk(rootPath, FileVisitOption.FOLLOW_LINKS)\n .sorted(Comparator.reverseOrder())\n .map(Path::toFile)\n .peek(System.out::println)\n .forEach(File::delete);\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "protected void deleteTmpDirectory(File file) {\n\t\tif (file.exists() && file.canWrite()) {\n\t\t\tif (file.isDirectory()) {\n\t\t\t\tFile[] files = file.listFiles();\n\t\t\t\tfor (File child : files) {\n\t\t\t\t\tif (child.isDirectory()) {\n\t\t\t\t\t\tdeleteTmpDirectory(child);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tchild.delete();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tfile.delete();\n\t\t}\n\t}", "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 cleanFile(IFile file) {\n \t\tlog(\" Cleaning build directory for \" + file.getName());\n \t\t\n \t\tString buildDir = getBuildDirectory(file);\n \t\t// Check the build directory and try to create it\n \t\tFile buildDirFile = new File(buildDir);\n \t\tif (buildDirFile.exists()) {\n \t\t\tFile[] files = buildDirFile.listFiles();\n \t\t\tfor (File f : files) {\n \t\t\t\ttry {\n \t\t\t\t\tf.delete();\n \t\t\t\t\tlog(\" - \" + f.getName());\n \t\t\t\t} catch (Exception _) {\n \t\t\t\t\tlog(\" > Failed: \" + f.getName());\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t}", "public static void cleanUpCustomTempDirectories(){\n\n\t\tif(tempDirectoryList != null){\n\t\t\tlog.info(\"Removing custom temp directories\");\n\t\t\ttry {\n\t\t\t\tfor(File tempFile : tempDirectoryList)\n\t\t\t\t\tif(tempFile.exists()){\n\t\t\t\t\t\tlog.info(\"Deleting : \" + tempFile.getCanonicalPath());\n\t\t\t\t\t\tdeleteDirectory(tempFile);\n\t\t\t\t\t}\n\t\t\t\t// also remove all file references from ArrayList\n\t\t\t\ttempDirectoryList.clear();\n\t\t\t} catch (IOException e) {e.printStackTrace();}\n\t\t}\n\t\telse\n\t\t\tlog.info(\"No custom temp directory created.\");\n\t\tlog.info(\"Finished removing custom temp directories\");\n\t}", "public void deleteFiles(File directory) {\n File[] contents = directory.listFiles();\n if (contents != null) {\n for (File file : contents) {\n deleteFiles(file);\n }\n }\n directory.delete();\n }", "@AfterClass\n public static void cleanup() throws Exception {\n fs.delete(new Path(baseDir), true);\n }", "public static void delTree(File file) {\r\n File[] files = file.listFiles();\r\n if (files != null) { \r\n for (int i = 0; i < files.length; i++) {\r\n if (files[i].isDirectory()) {\r\n delTree(files[i]);\r\n }\r\n }\r\n }\r\n files = file.listFiles();\r\n if (files != null) {\r\n for (int i = 0; i < files.length; i++) {\r\n files[i].delete();\r\n }\r\n }\r\n }", "public void deleteTmpDirectory() {\n\t\tdeleteTmpDirectory(tmpDir);\n\t}", "public final void clear(boolean cleanup) {\n for (val chapter : children) {\n chapter.parent = null;\n if (cleanup) {\n chapter.cleanup();\n }\n }\n children.clear();\n }", "public static void deleteDirectory(String directory){\n\t\tlog.info(\"Removing \" + directory + \" directory\");\n\t\tFile tempDir = new File(directory);\n\t\tdeleteDirectory(tempDir);\n\t\tlog.info(\"Finished removing directory\");\n\t}", "public static void deleteDirectory(File dir) {\n\t\tif (dir.isDirectory()) {\n\t\t\t//directory is empty, then delete it\n\t\t\tif (dir.list().length == 0) {\n\t\t\t\tdir.delete();\n\t\t\t} else {\n\t\t\t\t//list all the directory contents\n\t\t\t\tString[] subFiles = dir.list();\n\t\t\t\tfor (int i = 0; i < subFiles.length; i++) {\n\t\t\t\t\t//construct the file structure\n\t\t\t\t\tFile fileDelete = new File(dir, subFiles[i]);\n\t\t\t\t\t//recursive delete\n\t\t\t\t\tdeleteDirectory(fileDelete);\n\t\t\t\t}\n\t\t\t\t//check the directory again, if empty then delete it\n\t\t\t\tif (dir.list().length == 0) {\n\t\t\t\t\tdir.delete();\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tdir.delete();\n\t\t}\n\t}", "@AfterClass\n public static void cleanup() throws IOException {\n File directory = new File(TMP_DIR_BASE);\n File dirname = directory.getParentFile();\n final String basename = directory.getName() + \"[0-9]+\";\n File[] files = dirname.listFiles(new FilenameFilter() {\n @Override\n public boolean accept(File dir, String name) {\n return name.matches(basename);\n }\n });\n for (File file : files) {\n if (file.delete() == false) {\n throw new IOException(\"Can't delete \" + file);\n }\n }\n }", "public static synchronized void emptyDerbyTestDirectory(final String derbyTestDirectory) {\n System.out.println(Thread.currentThread().getName() + \"********************************************************* TestHelper.emptyDerbyTestDirectory\");\n // Delete the files in the derbyTestDirectory directory.\n File tempDirectory = new File(derbyTestDirectory);\n File[] files = tempDirectory.listFiles();\n if (files != null) {\n for (File file : files) {\n if (file.isDirectory()) {\n File[] subFiles = file.listFiles();\n for (File subFile : subFiles) {\n if (subFile.isDirectory()) {\n File[] subSubFiles = subFile.listFiles();\n for (File subSubFile : subSubFiles) {\n subSubFile.delete();\n }\n }\n subFile.delete();\n }\n }\n file.delete();\n }\n }\n }", "public static void emptyFolder(File folder) {\n\tif (folder.exists()) {\n\t File[] files = folder.listFiles(new FilenameFilter(\"csv\"));\n\t if (null != files && files.length > 0) {\n\t\tfor (File file : files) {\n\t\t file.delete();\n\t\t}\n\t }\n\t}\n }", "private void deleteCacheFiles() {\n\n\t\t// get the directory file\n\t\tFile cache = new File(Constants.CACHE_DIR_PATH);\n\n\t\t// check if we got the correct instance of that directory file.\n\t\tif (!cache.exists() || !cache.isDirectory())\n\t\t\treturn;\n\n\t\t// gets the list of files in the directory\n\t\tFile[] files = cache.listFiles();\n\t\t// deleting\n\n\t\tdeleteFiles(cache);\n\t\tfiles = null;\n\t\tcache = null;\n\n\t}", "public static synchronized void deleteDirectory(File directory) {\n System.out.println(Thread.currentThread().getName() + \"********************************************************* TestHelper.deleteDirectory: [\" + directory.getPath() + \"]\");\n File[] firstDirectoryFiles = directory.listFiles();\n if (firstDirectoryFiles != null) {\n for (File file : firstDirectoryFiles) {\n file.delete();\n }\n }\n directory.delete();\n }", "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}", "void deleteDirectories() {\n\n if (story_directory != null && !newStoryReady) {\n deleteStoryDirectory();\n }\n\n if (tag_directory != null && !newStoryReady) {\n deleteTagDirectory();\n }\n\n if (cover_directory != null && !newStoryReady) {\n deleteCoverDirectory();\n }\n }", "private synchronized static void deleteParents(File file) {\n if (file == null) {\n return;\n }\n\n File tmp = file;\n\n for (int i = 0; i < directoryLevels; i++) {\n File directory = tmp.getParentFile();\n File[] files = directory.listFiles();\n\n // Only delete empty directories\n if (files.length != 0) {\n break;\n }\n\n directory.delete();\n tmp = directory;\n }\n }", "public boolean clean() {\n\t\tboolean result = false;\n\n\t\ttry{\n\t\t\tif (this.exists()) {\n\t\t\t\tif (this.listFiles() != null) {\n\t\t\t\t\tfor (java.io.File file : this.listFiles()) {\n\t\t\t\t\t\t((File) file).delete();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\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 clearFiles() {\r\n File file = new File(\"test_files/upload\");\r\n File[] files = file.listFiles();\r\n for (File delFile : files) {\r\n delFile.delete();\r\n }\r\n file = new File(\"test_files/stress.jar\");\r\n file.delete();\r\n }", "private void cleanOutputFolder(String output) {\n \t\tFile[] files = new File[1];\n \t\tfiles[0] = new File(output);\n \t\tcleanFolder(files);\n \t}", "private void delete(File file) {\n if (file.isDirectory()) {\n cleanDirectory(file);\n }\n file.delete();\n }", "static void clean(TreeDeleter treeDeleter, Path outputBase) {\n Path stashDir = getStashBase(outputBase);\n if (!stashDir.isDirectory()) {\n return;\n }\n Path stashTrashDir = stashDir.getChild(\"__trash\");\n try {\n stashDir.renameTo(stashTrashDir);\n } catch (IOException e) {\n // If we couldn't move the stashdir away for deletion, we need to delete it synchronously\n // in place, so we can't use the treeDeleter.\n treeDeleter = null;\n stashTrashDir = stashDir;\n }\n try {\n if (treeDeleter != null) {\n treeDeleter.deleteTree(stashTrashDir);\n } else {\n stashTrashDir.deleteTree();\n }\n } catch (IOException e) {\n logger.atWarning().withCause(e).log(\"Failed to clean sandbox stash %s\", stashDir);\n }\n }", "private void deleteRecursive(File fileOrDirectory) {\n if (fileOrDirectory.isDirectory()) {\n for (File child : fileOrDirectory.listFiles()) {\n deleteRecursive(child);\n }\n }\n fileOrDirectory.delete();\n }", "static String cleanBundleDir( String bundleDir )\n {\n if ( bundleDir == null )\n {\n return bundleDir;\n }\n\n // Using slashes\n bundleDir = bundleDir.replace( '\\\\', '/' );\n\n // Remove '/' prefix if any so that directory is a relative path\n if ( bundleDir.startsWith( \"/\" ) )\n {\n bundleDir = bundleDir.substring( 1, bundleDir.length() );\n }\n\n if ( bundleDir.length() > 0 && !bundleDir.endsWith( \"/\" ) )\n {\n // Adding '/' suffix to specify a directory structure if it is not empty\n bundleDir = bundleDir + \"/\";\n }\n\n return bundleDir;\n }", "public boolean clearDataDir(String path) {\n logger.info(\"clearDataDir is called, and processing.\");\n logger.info(\"Status report before remove data directory.\");\n IndexManager.statusReport();\n ArrayList<File> dataDirs = getDataDirectories();\n if (path.equals(\"*\")) {\n int size = dataDirs.size();\n for (int i = size - 1; i >= 0; i--) {\n Path removed_path = this.dataDirectories.remove(i).toPath();\n unWatchDir(removed_path);\n }\n if (dataDirs.size() == 0) {\n IndexManager indexManager = new IndexManager();\n indexManager.deleteIndex();\n return true;\n } else {\n logger.warning(\"Remove all data directory error. Cannot clear all directory.\");\n return false;\n }\n } else {\n Iterator<File> fileIterator = dataDirs.iterator();\n Path dir_path;\n Path file_path = Paths.get(path);\n //Iterate through a list of paths, If matched, remove.\n while (fileIterator.hasNext()) {\n dir_path = Paths.get(fileIterator.next().getAbsolutePath());\n if (dir_path.equals(file_path)) { //If it is matched.\n fileIterator.remove(); //remove the path that is matched.\n //Report to a terminal.\n logger.fine(\"Following path has been removed: \" + dir_path);\n IndexManager.statusReport(); //Log\n unWatchDir(file_path);\n return true;\n }\n }\n logger.info(\"No directory match.\");\n IndexManager.statusReport();\n return false;\n }\n }", "private void handleRmd(String dir) {\n String filename = currDirectory;\n\n // only alphanumeric folder names are allowed\n if (dir != null && dir.matches(\"^[a-zA-Z0-9]+$\")) {\n filename = filename + fileSeparator + dir;\n\n // check if file exists, is directory\n File d = new File(filename);\n\n if (d.exists() && d.isDirectory()) {\n d.delete();\n\n sendMsgToClient(\"250 Directory was successfully removed\");\n } else {\n sendMsgToClient(\"550 Requested action not taken. File unavailable.\");\n }\n } else {\n sendMsgToClient(\"550 Invalid file name.\");\n }\n\n }", "protected static void cleanUpWorkingDir() {\n final Path testControllerPath =\n Paths.get(SystemPersistence.manager.getConfigurationPath().toString(), TEST_CONTROLLER_FILE);\n try {\n Files.deleteIfExists(testControllerPath);\n } catch (final Exception e) {\n logger.info(\"Problem cleaning {}\", testControllerPath, e);\n }\n\n final Path testControllerBakPath =\n Paths.get(SystemPersistence.manager.getConfigurationPath().toString(), TEST_CONTROLLER_FILE_BAK);\n try {\n Files.deleteIfExists(testControllerBakPath);\n } catch (final Exception e) {\n logger.info(\"Problem cleaning {}\", testControllerBakPath, e);\n }\n }", "@SuppressWarnings(\"ResultOfMethodCallIgnored\")\n\tpublic static void cleanAgentCoverageDirectory() throws IOException {\n\t\tPath coverageDir = AgentUtils.getAgentDirectory().resolve(\"coverage\");\n\t\tif (Files.exists(coverageDir)) {\n\t\t\tFiles.list(coverageDir).forEach(path -> path.toFile().delete());\n\t\t\tFiles.delete(coverageDir);\n\t\t}\n\t}", "public static void clearAll(Context ctx){\n \t\t// delete files\n \t\tfor( File f : getCachedFiles(ctx) ){\n \t\t\tf.delete();\n \t\t}\n \t}", "public static void deleteDirectory(String inputDirectory) {\n File directory = new File(inputDirectory);\n //check if it is a directory\n if (directory.isDirectory()) {\n //check if the directory has children\n if (directory.listFiles().length == 0) {\n directory.delete();\n System.out.println(\"Directory is deleted: \"\n + directory.getAbsolutePath());\n } else {\n //ask user whether he wants to delete the directory\n System.out.println(\"The chosen directory contains few files.\");\n viewDirectory(inputDirectory);\n System.out.println(\"Do you really want to delete the whole directory: \\n 1.Yes\\n 2.No\");\n Scanner userInput = new Scanner(System.in);\n String userRes = userInput.nextLine();\n if (userRes.equalsIgnoreCase(\"yes\") || userRes.equalsIgnoreCase(\"1\")) {\n //delete files inside the directory one by one\n deleteFilesInsideDirectory(directory);\n //delete parent directory\n directory.delete();\n if (!directory.exists()) {\n System.out.println(\"Directory has been deleted.\");\n } else {\n System.out.println(\"Deletion failed\");\n }\n } else if (userRes.equalsIgnoreCase(\"no\") || userRes.equalsIgnoreCase(\"2\")) {\n System.out.println(\"Delete directory request cancelled by user.\");\n } else {\n deleteDirectory(inputDirectory);\n }\n }\n } else {\n System.out.println(\"Invalid path or directory.\");\n }\n }", "public void deleteDir() throws Exception\n{\n if(_repo!=null) _repo.close(); _repo = null;\n _gdir.delete();\n _gdir.setProp(GitDir.class.getName(), null);\n}", "@Test\n\tpublic void cleanupTargetDirectory() throws IOException {\n\t\tfinal Path targetDir = _temp.toPath().resolve(\"target\");\n\t\tfinal Path installerTar = new File(getClass().getResource(TEST_INSTALLER_TAR_GZ).getFile()).toPath();\n\t\tFileUtil.mkDirs(targetDir);\n\t\tArchiveUtil.decompressTarGz(installerTar, targetDir);\n\n\t\t// test\n\t\tassertTrue(targetDir.toFile().list().length > 0, \"target dir should exist with children\");\n\t\tServerInstaller.cleanupTargetDirectory(targetDir);\n\n\t\t// verify\n\t\tassertFalse(targetDir.toFile().exists(), \"target dir should not exist\");\n\t}", "public static native void deleteTreesBelow(String dir) throws IOException;", "private static void cleanupLogcatCache(File cacheDir) {\n FLog.d(TAG, \"Cleaning up log files from cache dir\");\n if (cacheDir == null) {\n FLog.w(TAG, \"External storage not available. Can't cleanup cache\");\n return;\n }\n\n final File[] logFiles = cacheDir.listFiles(new FilenameFilter() {\n @Override\n public boolean accept(File dir, String filename) {\n return filename.toLowerCase().endsWith(\".log\");\n }\n });\n\n if (logFiles == null) {\n FLog.d(TAG, \"No log files to prune from cache\");\n return;\n }\n\n int count = 0;\n for (File logFile : logFiles) {\n count += logFile.delete() ? 1 : 0;\n }\n\n FLog.d(TAG, \"Pruned \" + count + \" log file(s) from cache\");\n }", "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 void cleanup() {\n if (cleaned) {\n return;\n }\n for (val cleanup : cleanups) {\n cleanup.accept(this);\n }\n clear(true);\n cleanups.clear();\n attributes.clear();\n if (parent != null) {\n parent.remove(this);\n }\n cleaned = true;\n }", "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 }", "private void deleteDir(File fileDir)\n {\n try\n {\n FileHelper.deleteDir(fileDir);\n }\n catch (Exception e)\n {\n // ignore\n }\n }", "protected void cleanup() {\n // if the java runtime is holding onto any files in the build dir, we\n // won't be able to delete them, so we need to force a gc here\n System.gc();\n\n if (deleteFilesOnNextBuild) {\n // delete the entire directory and all contents\n // when we know something changed and all objects\n // need to be recompiled, or if the board does not\n // use setting build.dependency\n //Base.removeDir(tempBuildFolder);\n \n // note that we can't remove the builddir itself, otherwise\n // the next time we start up, internal runs using Runner won't\n // work because the build dir won't exist at startup, so the classloader\n // will ignore the fact that that dir is in the CLASSPATH in run.sh\n Base.removeDescendants(tempBuildFolder);\n \n deleteFilesOnNextBuild = false;\n } else {\n // delete only stale source files, from the previously\n // compiled sketch. This allows multiple windows to be\n // used. Keep everything else, which might be reusable\n if (tempBuildFolder.exists()) {\n String files[] = tempBuildFolder.list();\n for (String file : files) {\n if (file.endsWith(\".c\") || file.endsWith(\".cpp\") || file.endsWith(\".s\")) {\n File deleteMe = new File(tempBuildFolder, file);\n if (!deleteMe.delete()) {\n System.err.println(\"Could not delete \" + deleteMe);\n }\n }\n }\n }\n }\n \n // Create a fresh applet folder (needed before preproc is run below)\n //tempBuildFolder.mkdirs();\n }", "public static void deleteDirectory(File directory) {\n // LOG.debug(\"ics.core.io.FileUtils.deleteDirectory(): Deleting directory \"\n // + directory.toString());\n File[] files = directory.listFiles();\n for (int n = 0; n < files.length; n++) {\n File nextFile = files[n];\n\n // if it's a directory, delete sub-directories and files before\n // removing the empty directory\n if (nextFile.isDirectory() == true) {\n deleteDirectory(nextFile);\n } else {\n nextFile.delete(); // otherwise just delete the file\n // LOG.debug(\"ics.core.io.FileUtils.deleteDirectory(): Deleting file \"\n // + nextFile.toString());\n }\n }\n\n // finally, delete the specified directory\n if (directory.delete() == false) {\n LOG.warn(\"ics.core.io.FileUtils.deleteDirectory(): Unable to delete \"\n + directory.toString());\n }\n }", "@Test\n\tpublic void removeUnneededDirectory() throws IOException {\n\t\tfinal Path targetDir = _temp.toPath().resolve(\"target\");\n\t\tfinal Path fsTargetDir = targetDir.resolve(DIR_FIRSTSPIRIT_5);\n\t\tfinal Path installerTar = new File(getClass().getResource(TEST_INSTALLER_TAR_GZ).getFile()).toPath();\n\t\tServerInstaller.decompressInstaller(targetDir, installerTar);\n\t\tassertTrue(fsTargetDir.toFile().exists(), DIR_FIRSTSPIRIT_5 + \" dir should exist\");\n\n\t\t// test\n\t\tServerInstaller.removeUnneededDirectory(targetDir);\n\n\t\t// verify\n\t\tassertFalse(fsTargetDir.toFile().exists(), DIR_FIRSTSPIRIT_5 + \" dir should have been deleted\");\n\t}", "@AfterClass\n\tpublic static void cleanup() {\n\t\ttestDir.delete();\n\t\tfile.delete();\n\t}", "public static void cleanOldTemp(String rootOutput){\r\n\t\tif(new File(rootOutput).exists()){\r\n\t\t\tLog.log(\"cleanOldTemp \"+rootOutput);\r\n\t\t\tPath pathToBeDeleted = Paths.get(rootOutput);\r\n\t\t\ttry {\r\n\t\t\t\tFiles.walk(pathToBeDeleted)\r\n\t\t\t\t .sorted(Comparator.reverseOrder())\r\n\t\t\t\t .map(Path::toFile)\r\n\t\t\t\t .forEach(File::delete);\r\n\t\t\t} catch (IOException e) {\r\n\t\t\t\tLog.error(e);\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void processDirectory(File directory) {\n FlatFileProcessor processor = new FlatFileProcessor(directory);\n processor.processDirectory();\n }", "private static boolean deleteDir(File dir) {\n\n if (dir.isDirectory()) {\n String[] children = dir.list();\n for (int i=0; i<children.length; i++) {\n boolean success = deleteDir(new File(dir, children[i]));\n if (!success) {\n return false;\n }\n }\n }\n\n // The directory is now empty so now it can be smoked\n return dir.delete();\n }", "@Test\n public void testInitialCleanup() throws Exception{\n File f = new File(path);\n assertTrue(f.exists());\n assertTrue(f.isDirectory());\n File[] files = f.listFiles();\n // Expect all files were deleted\n assertTrue(files.length == 0);\n }", "public static void deleteBundleParentDirectory(Bundle bundle) throws IOException {\n if (bundle != null) {\n Path bundleSource = bundle.getSource();\n File parent = bundleSource.getParent().toFile();\n if (parent.exists() && parent.isDirectory()) {\n File[] files = parent.listFiles();\n // We expect the directory to be empty or contain just one file (the ZIP bundle,\n // since the bundle files are stored temporarily in another temporary directory).\n if (files != null && files.length <= 1) {\n org.apache.commons.io.FileUtils.forceDelete(parent);\n }\n }\n }\n }", "public static void deleteDirectory(String path) throws KubernetesPluginException {\n Path pathToBeDeleted = Paths.get(path);\n if (!Files.exists(pathToBeDeleted)) {\n return;\n }\n try {\n Files.walk(pathToBeDeleted)\n .sorted(Comparator.reverseOrder())\n .map(Path::toFile)\n .forEach(File::delete);\n } catch (IOException e) {\n throw new KubernetesPluginException(\"Unable to delete directory: \" + path, e);\n }\n\n }", "public static final void deleteDirectory(File directory) throws IOException {\n if (!directory.exists()) {\n return;\n }\n\n cleanDirectory(directory);\n\n if (!directory.delete()) {\n throw new IOException(\"Unable to delete directory \" + directory + \".\");\n }\n }", "public static void wipe(String directory, String keyword)\t{\n\t\tArrayList<String> filePaths = OncAnnotator.getPaths(directory);\n\t\tfor(String path:filePaths) {\n\t\t\tFile f = new File(path);\n\t\t\tif (!f.getAbsolutePath().contains(keyword)) { //Deletes a file without the keyword\n\t\t\t\tf.delete();\n\t\t\t}\n\t\t}\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}", "@Override\n\t\t\tpublic FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException {\n\t\t\t\tPath resolve = target.resolve(source.relativize(dir));\n\t\t\t\tFile resolve_file = resolve.toFile();\n\n\t\t\t\tif (resolve_file.exists() == false) {\n\t\t\t\t\tFiles.createDirectory(resolve);\n\t\t\t\t} else {\n\t\t\t\t\t// delete old data in sub-directories\n\t\t\t\t\t// without deleting the directory\n\t\t\t\t\tArrays.asList(resolve_file.listFiles()).forEach(File::delete);\n\t\t\t\t}\n\t\t\t\treturn FileVisitResult.CONTINUE;\n\t\t\t}", "private static void cleanUpGlobalStateAndFileStore() {\n FileUtils.deleteDirectory(Paths.get(GLOBAL_STATE_DIR));\n }", "final private static boolean removeTemporaryDirectory(File directory) {\n //System.out.println(\"removeDirectory \" + directory);\n\n if (directory == null)\n return false;\n final File sdirectory = directory;\n\n Boolean b = (Boolean)AccessController.doPrivileged(\n new java.security.PrivilegedAction() {\n public Object run() {\n if (!sdirectory.exists())\n return new Boolean(true);\n if (!sdirectory.isDirectory())\n return new Boolean(false);\n String[] list = sdirectory.list();\n // Some JVMs return null for File.list() when the\n // directory is empty.\n if (list != null) {\n for (int i = 0; i < list.length; i++) {\n File entry = new File(sdirectory, list[i]);\n if (entry.isDirectory())\n {\n if (!removeTemporaryDirectory(entry))\n return new Boolean(false);\n }\n else\n {\n if (!entry.delete())\n return new Boolean(false);\n }\n }\n }\n return new Boolean(sdirectory.delete());\n }\n });\n if (b.booleanValue())\n {\n return true;\n }\n else return false;\n }" ]
[ "0.69367397", "0.6860781", "0.657672", "0.6529941", "0.65037066", "0.64709204", "0.6460337", "0.64513606", "0.64343315", "0.64187837", "0.63739043", "0.6221994", "0.6147974", "0.6133527", "0.6120153", "0.6111219", "0.61055243", "0.6068884", "0.60301924", "0.59941936", "0.5985676", "0.5978875", "0.59731126", "0.5959856", "0.5937088", "0.5875154", "0.58714336", "0.58659375", "0.5847419", "0.5841431", "0.5819404", "0.58042645", "0.5765708", "0.5763674", "0.5762124", "0.57203174", "0.5720107", "0.5671553", "0.5643967", "0.56411076", "0.55915576", "0.55883664", "0.55832", "0.5573357", "0.5569382", "0.5562597", "0.5558957", "0.55485576", "0.5525414", "0.55195403", "0.5508234", "0.5507597", "0.5507162", "0.54786867", "0.54696053", "0.5468839", "0.546851", "0.5462657", "0.5454252", "0.54427224", "0.54330385", "0.5432054", "0.5424166", "0.5420426", "0.54189885", "0.53920585", "0.5391951", "0.53712726", "0.53685975", "0.5362343", "0.5353961", "0.5348765", "0.53470975", "0.5333166", "0.5324432", "0.5310071", "0.53005934", "0.5300405", "0.52968585", "0.5291101", "0.52855587", "0.52613825", "0.52588725", "0.5253619", "0.52504486", "0.5250236", "0.5246009", "0.5241997", "0.52384025", "0.52350664", "0.5222936", "0.52040416", "0.5203852", "0.5193259", "0.518816", "0.5186435", "0.51663697", "0.5165626", "0.51543504", "0.5154342" ]
0.69271535
1
Deletes the specified file or directory.
private void delete(File file) { if (file.isDirectory()) { cleanDirectory(file); } file.delete(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void deleteFile(FsPath path);", "public void deleteFile(File f);", "private void deleteFile() {\n\t\tFile dir = getFilesDir();\n\t\tFile file = new File(dir, FILENAME);\n\t\tfile.delete();\n\t}", "public void delete_File(){\n context.deleteFile(Constant.FILE_NAME);\n }", "public boolean delete(String filename);", "boolean deleteFile(File f);", "void deleteFile(FileReference fileReferece);", "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 public void delete(File file) {\n }", "public static void delete(File f) {\n delete_(f, false);\n }", "public File delete(File f) throws FileDAOException;", "public int deleteFile(String datastore, String filename) throws HyperVException;", "public void delete() throws IOException {\n\t\tclose();\n\t\tdeleteContents(directory);\n\t}", "void fileDeleted(String path);", "public static void delete(String filename) \n throws IOException {\n if ((filename != null) && (!filename.isEmpty())) {\n delete(new File(filename));\n }\n }", "@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}", "public void deleteFile(IAttachment file)\n throws OculusException;", "private void deleteFile() {\r\n actionDelete(dataModelArrayList.get(position));\r\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}", "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 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 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 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 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}", "@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 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 deleteFile(@Nonnull File file) throws IOException {\n Files.delete(file.toPath());\n }", "public static void deleteFile(String inputFile){\n File file = new File(inputFile);\n //validate the file\n if(file.isFile()){\n try{\n if(file.delete())\n System.out.println(\"File \"+inputFile+\" has been deleted.\");\n else\n System.out.println(\"Error in deleting the file.\");\n }catch(Exception e){\n e.printStackTrace();\n }\n }else{\n System.out.println(\"Invalid file path.\");\n }\n }", "public void delete() throws Exception {\n\n getConnection().do_Delete(new URL(getConnection().getFilemanagerfolderendpoint() + \"/\" + getId()),\n getConnection().getApikey());\n }", "public static void deleteFile(String filePath) {\n File file = getFile(filePath);\n if (file.exists()) {\n file.delete();\n }\n }", "@PreAuthorize(\"hasPermission(#file, 'delete')\")\n public void delete(File file) {\n fileRepository.delete(file);\n }", "@Override\n\tpublic void delete(File file) {\n\t\tthis.getSession().delete(file);\n\t}", "@Override\n public void delete(String id) {\n log.debug(\"Request to delete File : {}\", id);\n fileRepository.delete(id);\n }", "public static final void delete(final File file)\n\t{\n\t\tif (file.isDirectory())\n\t\t{\n\t\t\tfor (final String temp : file.list())\n\t\t\t{\n\t\t\t\tdelete(new File(file, temp));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfile.delete();\n\t\t}\n\t}", "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 static void fileDelete(String filePath) {\n\t\tFile f = new File(filePath);\n\n\t\t// noinspection ResultOfMethodCallIgnored\n\t\tf.delete();\n\t}", "public boolean remove(File fileToDelete, File repositoryDirectory)\n throws RepositoryMgtException;", "public void delete() {\n if (tempFile != null) {\n tempFile.delete();\n }\n }", "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 }", "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 void deleteData(String filename, SaveType type);", "alluxio.proto.journal.File.DeleteFileEntry getDeleteFile();", "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 void deleteFile(FileItem file) {\n\t\tPerformDeleteFileAsyncTask task = new PerformDeleteFileAsyncTask(this, credential);\n\t\ttask.execute(file);\n\t}", "public boolean delete()\n\t{\n\t\treturn deleteRecursive( file ) ;\n\t}", "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}", "@Override\r\n\tpublic int fileDelete(int no) {\n\t\treturn sqlSession.delete(namespace + \"fileDelete\", no);\r\n\t}", "public boolean deleteFile(String inKey) throws NuxeoException;", "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 }", "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}", "public boolean deleteFile(File file) {\n\t\treturn file.delete();\n\t}", "public boolean delete(String path, boolean recurse) throws SystemException;", "alluxio.proto.journal.File.DeleteFileEntryOrBuilder getDeleteFileOrBuilder();", "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}", "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 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 }", "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 }", "private static void removeFile(File fileDir) throws Exception {\n String fileName = getFileNameInput();\n File fileToRemove = new File(fileDir.toString() + \"\\\\\" + fileName);\n boolean fileRemoved = fileToRemove.delete();\n if (fileRemoved) {\n System.out.println(\"File removed successfully.\");\n } else {\n throw new FileNotFoundException(\"No such file under current directory.\");\n }\n }", "abstract public void remove( String path )\r\n throws Exception;", "public static final void deleteDirectory(File directory) throws IOException {\n if (!directory.exists()) {\n return;\n }\n\n cleanDirectory(directory);\n\n if (!directory.delete()) {\n throw new IOException(\"Unable to delete directory \" + directory + \".\");\n }\n }", "void deleteDirectory(String path, boolean recursive) throws IOException;", "void delete(InformationResourceFile file);", "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}", "private void delete(String name) {\n File f = new File(name);\n if (f.exists()) {\n f.delete();\n }\n }", "public void delete(String so_cd);", "public final void deleteTemporaryFile()\n\t\tthrows IOException {\n\t\t\t\n // DEBUG\n \n if ( isQueued()) {\n Debug.println(\"@@ Delete queued file segment, \" + this);\n Thread.dumpStack();\n }\n \n\t\t//\tDelete the temporary file used by the file segment\n\n\t\tFile tempFile = new File(getTemporaryFile());\n\t\t\t\t\n\t\tif ( tempFile.exists() && tempFile.delete() == false) {\n\n\t\t //\tDEBUG\n\t\t \n\t\t Debug.println(\"** Failed to delete \" + toString() + \" **\");\n\t\t \n\t\t //\tThrow an exception, delete failed\n\t\t \n\t\t\tthrow new IOException(\"Failed to delete file \" + getTemporaryFile());\n\t\t}\n\t}", "@Override\n\tpublic void deleteFile(AuthenticationToken authenticationToken, String filePath) throws PermissionDeniedException, \n\t\t\tFileDeleteFailedException {\n\t\tboolean permissionResult = filePermissionService.hasWritePermission(authenticationToken, filePath);\n\t\tif(!permissionResult)\n\t\t\tthrow new PermissionDeniedException();\n\t\telse {\n\t\t\tboolean inUseResult = this.isInUse(authenticationToken, filePath);\n\t\t\tif(!inUseResult) {\n\t\t\t\tFile file = new File(filePath);\n\t\t\t\tboolean resultDelete = deleteRecursively(authenticationToken, file);\n\t\t\t\tif(!resultDelete)\n\t\t\t\t\tthrow new FileDeleteFailedException();\n\t\t\t} else {\n\t\t\t\tthrow new FileDeleteFailedException(\"Can't delete file, it \"+this.createMessageFileInUse(authenticationToken, filePath)+ \". Delete the tasks using Task Manager, then try again.\");\n\t\t\t}\n\t\t}\n\t}", "private void deleteDir(File fileDir)\n {\n try\n {\n FileHelper.deleteDir(fileDir);\n }\n catch (Exception e)\n {\n // ignore\n }\n }", "private void deleteRecursive(File fileOrDirectory) {\n if (fileOrDirectory.isDirectory()) {\n for (File child : fileOrDirectory.listFiles()) {\n deleteRecursive(child);\n }\n }\n fileOrDirectory.delete();\n }", "public static boolean deleteFile(SourceFile sourceFile) throws IOException {\n return deleteFile(sourceFile.getPath(), sourceFile.getSourceType());\n }", "private void deleteSelectedFile() {\r\n\t\tString sel = this.displayFileNames.getSelectedValue();\r\n\t\tif(sel != null) {\r\n\t\t\tFileModel model = FileData.getFileModel(sel);\r\n\t\t\tFileType type = model.getFileType();\r\n\t\t\tFileData.deleteFileModel(type);\r\n\t\t\tthis.setButtonEnabled(type);\r\n\t\t\tthis.loadFileNames();\r\n\t\t\tthis.updateColumnSelections(type);\r\n\t\t\tColumnData.clearMatchedCells(type);\r\n\t\t}\r\n\t}", "void delete(String identifier) throws IOException;", "public static void remove(File file) throws IOException {\n\t\tif (!file.exists())\n\t\t\treturn;\n\t\tif (file.isDirectory()) {\n\t\t\tFile[] files = file.listFiles();\n\t\t\tfor (File f : files)\n\t\t\t\tremove(f);\n\t\t}\n\t\tif (!file.delete())\n\t\t\tthrow new IOException(\"Can't delete the file \\\"\"\n\t\t\t\t\t+ file.getAbsolutePath() + \"\\\"\");\n\t}", "private void deleteFile(String runtimePropertiesFilename) {\n File f = new File(runtimePropertiesFilename);\r\n\r\n // Make sure the file or directory exists and isn't write protected\r\n if (!f.exists())\r\n return; // already gone!\r\n\r\n if (!f.canWrite())\r\n throw new IllegalArgumentException(\"Delete: write protected: \"\r\n + runtimePropertiesFilename);\r\n\r\n // If it is a directory, make sure it is empty\r\n if (f.isDirectory()) {\r\n String[] files = f.list();\r\n if (files.length > 0)\r\n throw new IllegalArgumentException(\r\n \"Delete: directory not empty: \" + runtimePropertiesFilename);\r\n }\r\n\r\n // Attempt to delete it\r\n if (!f.delete())\r\n throw new IllegalArgumentException(\"Delete: deletion failed\");\r\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 }", "public static native boolean remove(String path) throws IOException;", "public static void deleteFiles(final String _file) throws IOException {\n final File file = new File(_file);\n FileUtils.forceDelete(file);\n }", "public static void deleteDirectory( File directory ) throws IOException\n {\n if ( !directory.exists() )\n {\n return;\n }\n\n if ( !isSymlink( directory ) )\n {\n cleanDirectory( directory );\n }\n\n if ( !directory.delete() )\n {\n throw new IOException( I18n.err( I18n.ERR_17004_UNABLE_DELETE_DIR, directory ) );\n }\n }", "public static void deleteQuietly(File f) {\n if (!delete_(f, true)) {\n // As a last resort\n f.deleteOnExit();\n }\n }", "public DocumentMutation delete(String path);", "@Override\n\tpublic void fileDelete(int file_num) {\n\t\tworkMapper.fileDelete(file_num);\n\t}", "private static void deleteDir(File file) {\n\t\tFile[] contents = file.listFiles();\n\t\tif (contents != null) {\n\t\t\tfor (File f : contents) {\n\t\t\t\tdeleteDir(f);\n\t\t\t}\n\t\t}\n\t\tfile.delete();\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 qnaFileDelete(int qnaFileIdx) {\n\t\t\r\n\t}", "public void delete( String name) throws PhileNotFoundException {\n\t\tif (!fileList.containsKey(name)) {\n\t\t\tthrow new PhileNotFoundException(\"File doesn't exist\");\n\t\t}\n\t\telse {\n\t\t\tPhile phile = fileList.get(name);\n\t\t\tfileList.remove(name);\n\t\t\ttotalNumberOfFiles--;\n\t\t\tif (openFiles.contains(phile)) {\n\t\t\t\topenFiles.remove(phile);\n\t\t\t\tnumberOfOpenFiles--;\n\t\t\t}\n\t\t}\n }", "@DeleteMapping(\"/deleteFile\")\n public String deleteFile(@RequestPart(value = \"url\") String fileUrl) {\n return this.amazonClient.deleteFileFromS3Bucket(fileUrl);\n }", "public void delete(String path) throws GRIDAClientException {\n\n List<String> paths = new ArrayList<String>();\n paths.add(path);\n\n delete(paths);\n }", "int deleteByPrimaryKey(Integer fileId);", "public static int delete(String fileName) {\n return Kernel.interrupt(Kernel.INTERRUPT_SOFTWARE, Kernel.DELETE, 0, fileName);\n }", "void delete(LogicalDatastoreType store, P path);", "public void deleteById(String id);", "public static void deleteFile(String strFilePath) {\n File file = new File(strFilePath);\n file.delete();\n }", "public static void deleteDir(File dir) {\n\t if (dir.isDirectory()) {\n\t String[] children = dir.list();\n\t for (int i=0; i<children.length; i++) {\n\t File file = new File(dir, children[i]);\n\t log.info(\"Deleting file:\" + file.toString());\n\t file.delete();\n\t }\n\t }\n\t }", "@RequestMapping(value=\"/remove/{filename}&{subdir}\", method = RequestMethod.GET)\r\n public String processRemoveFile(@PathVariable String filename, @PathVariable String subdir, Locale locale, Model model, HttpServletRequest request) {\r\n\t\t\r\n\t\tlogger.info(\"Delete file: \" + filename + \" in \" + QRDA_URIResolver.REPOSITORY_TESTFILES + \"/\" + subdir);\r\n\t\tfileService.deleteFile(filename, QRDA_URIResolver.REPOSITORY_TESTFILES, subdir);\r\n\t\treturn \"redirect:/testFiles\";\r\n\t}", "private void del_file() {\n\t\tFormatter f;\n\t\ttry{\n\t\t\tf = new Formatter(url2); //deleting file content\n\t\t\tf.format(\"%s\", \"\");\n\t\t\tf.close();\t\t\t\n\t\t}catch(Exception e){}\n\t}", "public static void deletePath(Path path) throws IOException {\n if (!Files.isDirectory(path) || Files.list(path).count() == 0) { Files.deleteIfExists(path); }\n else {\n try (Stream<Path> files = Files.list(path)) {\n files.forEach(p -> {\n try { deletePath(p); }\n catch (IOException e) { e.printStackTrace(); }\n });\n Files.delete(path);\n }\n }\n }", "public static void deleteFileOrDirectory(KVFile file) {\n if (file.isDirectory()) {\n String[] children = file.list();\n for (String aChildren : children) {\n if (new KVFile(file, aChildren).isDirectory() && !aChildren.equals(\"PreinstalledMaps\") && !aChildren.equals(\"Maps\")) {\n deleteFileOrDirectory(new KVFile(file, aChildren));\n } else {\n new KVFile(file, aChildren).delete();\n }\n }\n }\n }", "public static void deleteDirectory(String inputDirectory) {\n File directory = new File(inputDirectory);\n //check if it is a directory\n if (directory.isDirectory()) {\n //check if the directory has children\n if (directory.listFiles().length == 0) {\n directory.delete();\n System.out.println(\"Directory is deleted: \"\n + directory.getAbsolutePath());\n } else {\n //ask user whether he wants to delete the directory\n System.out.println(\"The chosen directory contains few files.\");\n viewDirectory(inputDirectory);\n System.out.println(\"Do you really want to delete the whole directory: \\n 1.Yes\\n 2.No\");\n Scanner userInput = new Scanner(System.in);\n String userRes = userInput.nextLine();\n if (userRes.equalsIgnoreCase(\"yes\") || userRes.equalsIgnoreCase(\"1\")) {\n //delete files inside the directory one by one\n deleteFilesInsideDirectory(directory);\n //delete parent directory\n directory.delete();\n if (!directory.exists()) {\n System.out.println(\"Directory has been deleted.\");\n } else {\n System.out.println(\"Deletion failed\");\n }\n } else if (userRes.equalsIgnoreCase(\"no\") || userRes.equalsIgnoreCase(\"2\")) {\n System.out.println(\"Delete directory request cancelled by user.\");\n } else {\n deleteDirectory(inputDirectory);\n }\n }\n } else {\n System.out.println(\"Invalid path or directory.\");\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}" ]
[ "0.76978916", "0.7491678", "0.73087513", "0.7122125", "0.7119734", "0.71066266", "0.70178485", "0.7011207", "0.6983791", "0.69394517", "0.69109946", "0.6851014", "0.68416226", "0.6775642", "0.6750147", "0.6738102", "0.6706748", "0.66922814", "0.6659294", "0.66490597", "0.6629276", "0.6607259", "0.6570935", "0.65421116", "0.654189", "0.65404093", "0.65345573", "0.6520576", "0.64996713", "0.6492499", "0.6492423", "0.64401126", "0.6397908", "0.6373016", "0.63589835", "0.63407034", "0.63388234", "0.6328465", "0.632257", "0.6303251", "0.6301459", "0.62618434", "0.62570846", "0.6247354", "0.6221173", "0.6178235", "0.6175151", "0.61662024", "0.61492234", "0.6143903", "0.61340064", "0.6132536", "0.611983", "0.61170864", "0.6112321", "0.6088876", "0.60864985", "0.60796446", "0.6077868", "0.6055488", "0.60525995", "0.6034723", "0.59927183", "0.59873325", "0.59801793", "0.5974645", "0.59656227", "0.5943854", "0.59360427", "0.5923508", "0.59204113", "0.59065974", "0.59009695", "0.5898802", "0.5889327", "0.58722776", "0.58578587", "0.58570576", "0.58271354", "0.58203256", "0.5796368", "0.579415", "0.5790528", "0.5773011", "0.57724303", "0.57656974", "0.576499", "0.57596076", "0.5755816", "0.5754185", "0.5748128", "0.57479537", "0.57086825", "0.5707696", "0.57029253", "0.570187", "0.5695759", "0.56927794", "0.5691779", "0.56905246" ]
0.64789295
31
Converts the specified triple Iterator into a collection.
public static Collection<Triple> toCollection(Iterator<Triple> i) { LinkedList<Triple> list= new LinkedList<Triple>(); while (i.hasNext()) { list.add(i.next()); } return list; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public IndexedImmutableGraph(Iterator<Triple> tripleIter) {\n this.tripleCollection = new IndexedGraph(tripleIter);\n }", "public Iterator iterator() {\n maintain();\n return new MyIterator(collection.iterator());\n }", "public static <T> List<T> toList(Iterator<T> iterator)\n {\n List<T> newList = new ArrayList();\n addToCollection(newList, iterator);\n return newList;\n }", "@SuppressWarnings(\"unchecked\")\n\tpublic static <T> Iterator<T> covariantIterator(Iterator<? extends T> it) {\n\t\t// Iterators only support read and remove, not insert. Safe to cast.\n\t\treturn (Iterator<T>) it;\n\t}", "@Override\n public IntVec3SubspaceIterator iterator() {\n return new IntVec3SubspaceIterator(this);\n }", "public ArrayList convertDataStructure(Iterator iterator) {\r\n ArrayList list = new ArrayList();\r\n int i = 0;\r\n while (iterator.hasNext()) {\r\n AgrupamentoBean bean = (AgrupamentoBean) iterator.next();\r\n bean.setRegistro(new Long(i));\r\n list.add(bean);\r\n i++;\r\n }\r\n return list;\r\n }", "@Override\r\n\tpublic Iterator<GIS_layer> iterator() {\n\t\treturn set.iterator();\r\n\t}", "public Iterator<DystoreTuple> iterator()\t{ return tuple_data.iterator(); }", "public static <T> Set<T> set(Iterator<T> iterator) {\n return set(iterator, v -> v);\n }", "protected static void writeIterator(Output out, Iterator<Object> it) {\n log.trace(\"writeIterator\");\n // Create LinkedList of collection we iterate thru and write it out later\n LinkedList<Object> list = new LinkedList<Object>();\n while (it.hasNext()) {\n list.addLast(it.next());\n }\n // Write out collection\n out.writeArray(list);\n }", "public Iterator<K> iterator()\n {\n\treturn (new HashSet<K>(verts)).iterator();\n }", "@Override\n\tpublic Iterator<E> iterator() {\n\t\treturn vertices.iterator();\n\t}", "Iterable<CtElement> asIterable();", "public Iterator<K> iterator()\n {\n return (new HashSet<K>(verts)).iterator();\n }", "@Override\n public Iterator<Object> iterator() {\n return new Iterator<Object>() {\n\n private int i = 0;\n\n @Override\n public boolean hasNext() {\n return i < data.length;\n }\n\n @Override\n public Object next() {\n Object result = data[i];\n i = i + 1;\n return result;\n }\n\n @Override\n public void remove() {\n throw new UnsupportedOperationException(\"Tuples are immutable\");\n }\n };\n }", "public static <T> ConstList<T> make(Iterable<T> collection) {\n if (collection == null)\n return make();\n if (collection instanceof ConstList)\n return (ConstList<T>) collection;\n if (collection instanceof Collection) {\n Collection<T> col = (Collection<T>) collection;\n if (col.isEmpty())\n return make();\n else\n return new ConstList<T>(new ArrayList<T>(col));\n }\n ArrayList<T> ans = null;\n for (T x : collection) {\n if (ans == null)\n ans = new ArrayList<T>();\n ans.add(x);\n }\n if (ans == null)\n return make();\n else\n return new ConstList<T>(ans);\n }", "public Iterator iterator() {\n\t return new EntryIterator(set.iterator());\n\t}", "public Iterator2Iterador(Iterator<E> iterator) {\r\n\t\tthis.iterator = iterator;\r\n\t}", "@Override\n\t\t\tpublic Iterator<T> iterator() {\n\t\t\t\treturn convertData(data.iterator(), targetClass);\n\t\t\t}", "public static Iterator<Triple> createIteratorNTriples(InputStream input) {\n return createIteratorNTriples(input, RiotLib.dftProfile());\n }", "private Iterator getEntries(){\r\n\t\tSet entries = items.entrySet();\r\n\t\treturn entries.iterator();\r\n\t}", "@Override\n public Iterator<Integer> convert(Iterator<Iterator<Integer>> it) throws IteratorException {\n return new Iterator<Integer>() {\n\n private Iterator<Integer> currentIterator;\n\n {\n if (it != null && it.hasNext()) {\n this.currentIterator = it.next();\n } else {\n throw new IteratorException(\"Iterator<Iterator<Integer>> must be not null!\");\n }\n }\n\n /**\n * This method returned true if the iterator has more elements.\n *\n * @return true if the iterator has more elements.\n */\n @Override\n public boolean hasNext() {\n boolean result = false;\n if (checkCurrentIterator(this.currentIterator) && this.currentIterator.hasNext()) {\n return true;\n } else if (it.hasNext()) {\n this.currentIterator = getIterator(it);\n return this.hasNext();\n }\n return result;\n\n }\n\n /**\n * This method returns the next even element in the iteration.\n *\n * @return the next even element in the iteration.\n */\n @Override\n public Integer next() {\n Integer result = null;\n if (checkCurrentIterator(this.currentIterator) && this.currentIterator.hasNext()) {\n while (this.currentIterator.hasNext()) {\n return this.currentIterator.next();\n }\n } else if (it.hasNext()) {\n this.currentIterator = getIterator(it);\n return this.next();\n }\n return result;\n }\n\n /**\n * This method return the next Iterator.\n *\n * @return the next Iterator.\n */\n private Iterator<Integer> getIterator(Iterator<Iterator<Integer>> iter) {\n Iterator<Integer> iterator = null;\n while (iter.hasNext()) {\n iterator = iter.next();\n break;\n }\n return iterator;\n }\n\n /**\n * This method checked Iterator<Integer> iter.\n *\n * @param iter Iterator<Integer> iter.\n * @return true if Iterator<Integer> iter not null.\n */\n private boolean checkCurrentIterator(Iterator<Integer> iter) {\n return iter != null;\n }\n };\n }", "@Override\n public Iterator iterator() {\n return new PairIterator();\n }", "public static <T> Iterable<T> newIterable(Iterator<T> items) {\n final Iterator<T> finalItems = items;\n\n return new Iterable<T>() {\n @Override\n public Iterator<T> iterator() {\n return finalItems;\n }\n };\n }", "@Override\n public Iterator<E> reverseIterator() {\n return collection.iterator();\n }", "@Nullable\n @SuppressWarnings(\"unchecked\")\n protected Collection createCollection(MappingContext context, Object value) {\n if (value instanceof Iterable<?>) {\n TypeInformation entryType = context.getGenericTypeInfoOrFail(0);\n Collection result = createCollectionMatchingType(context);\n\n int index = 0;\n for (Object entry : (Iterable) value) {\n Object convertedEntry = convertValueForType(context.createChild(\"[\" + index + \"]\", entryType), entry);\n if (convertedEntry == null) {\n context.registerError(\"Cannot convert value at index \" + index);\n } else {\n result.add(convertedEntry);\n }\n }\n return result;\n }\n return null;\n }", "public static <T> List<T> createList(Iterator<T> iter) {\n\t\tList<T> list = new ArrayList<T>();\n\t\twhile (iter.hasNext()) {\n\t\t\tlist.add(iter.next());\n\t\t}\n\t\treturn list;\n\t}", "public Iiterator getIterator() { \n\t\treturn new GameCollectionIterator();\n\t}", "public void setIterator(Iterator iterator) {\n/* 96 */ this.iterator = iterator;\n/* */ }", "@Override\n public Iterator<E> iterator() {\n return new SimpleArrayListIterator<E>();\n }", "public static List toList(Iterator iter)\r\n {\r\n if (iter == null)\r\n {\r\n return null;\r\n }\r\n List list = new ArrayList();\r\n while (iter.hasNext())\r\n {\r\n list.add(iter.next());\r\n }\r\n return list;\r\n }", "public static Collection<JSONObject> createTriplePatternItemsArray(final TriplePattern triplePattern) throws JSONException {\n\t\tfinal Collection<JSONObject> tripleItems = new LinkedList<JSONObject>();\n\t\tfor (final Item item : triplePattern.getItems()) {\n\t\t\tfinal JSONObject itemJson = Helper.createItemAsJSONObject(item);\n\t\t\ttripleItems.add(itemJson);\n\t\t}\n\t\treturn tripleItems;\n\t}", "@Override\n\tpublic Iterator iterator() {\n\t\treturn new TrieIterator(this.root,\"\");\n\t}", "protected abstract Collection createCollection();", "public SimpleDuplicateableIterator(Iterator<E> iterator)\r\n\t{\r\n\t\tthis.currentIndex = 0;\r\n\t\tthis.oldElements = new ArrayList<E>();\r\n\t\tthis.iterator = iterator;\r\n\t}", "@Test\n public void test3() throws Throwable {\n\t\tfr.inria.diversify.sosie.logger.LogWriter.writeTestStart(547,\"org.apache.commons.collections4.iterators.IteratorIterableEvoSuiteTest.test3\");\n HashMap<Integer, Object> hashMap0 = new HashMap<Integer, Object>();\n EntrySetMapIterator<Integer, Object> entrySetMapIterator0 = new EntrySetMapIterator<Integer, Object>((Map<Integer, Object>) hashMap0);\n IteratorIterable<Object> iteratorIterable0 = new IteratorIterable<Object>((Iterator<?>) entrySetMapIterator0);\n Iterator<Object> iterator0 = iteratorIterable0.iterator();\n assertEquals(false, iterator0.hasNext());\n }", "public IndexedImmutableGraph(Graph tripleCollection) {\n this.tripleCollection = new IndexedGraph(tripleCollection);\n }", "public Iterator<Item> iterator() { return new ListIterator(); }", "public abstract Iterator getCascadableChildrenIterator(EventSource session, CollectionType collectionType, Object collection);", "public Iterator<IDatasetItem> iterateOverDatasetItems();", "public static Iterator<Triple> createIteratorNTriples(InputStream input, ParserProfile profile) {\n // LangNTriples supports iterator use.\n Tokenizer tokenizer = TokenizerText.create().source(input).errorHandler(profile.getErrorHandler()).build();\n return createParserNTriples(tokenizer, null, profile);\n }", "@Override\n public Iterator<Item> iterator(){return new ListIterator();}", "public LoopingIterator(final Collection<? extends E> collection) {\n this.collection = Objects.requireNonNull(collection, \"collection\");\n reset();\n }", "public ImmutableIterator(final Iterator<T> iterator) {\n\t\t_decorated = iterator;\n\t}", "@SuppressWarnings(\"unchecked\")\r\n public Iterator<Tuple<T>> iterator() {\n Iterator<Tuple<T>> fi = (Iterator<Tuple<T>>) new FilteredIterator<T>(resultTable.iterator(), filterOn);\r\n return fi;\r\n }", "@Override\n public Iterator<Item> iterator() {\n return new ListIterator();\n }", "Collect getColl();", "private static Iterator getAllElementsIterator(EventSource session, CollectionType collectionType, Object collection) {\n\t\treturn collectionType.getElementsIterator(collection, session);\n\t}", "private DataSet toDataSet(final Collection<TrainingEntry<Login>> trainingDataSet) {\n final int numTimestampsDifferences = getNumberOfInputFeatures(trainingDataSet);\n final IterableRecordReader recordReader = new IterableRecordReader(trainingDataSet);\n return new RecordReaderDataSetIterator(recordReader, trainingDataSet.size(), numTimestampsDifferences, NUM_CATEGORIES).next();\n }", "@Override\n public Iterator<Map.Entry<K, V>> iterator() {\n return new SetIterator();\n }", "public static <TT> CollectionTree.IterationState<TT> getIterationState( Iterable<TT> iterable ) {\r\n return new CollectionTree.IterationState<TT>( iterable.iterator() );\r\n }", "public TW<E> iterator() {\n ImmutableMultiset immutableMultiset = (ImmutableMultiset) this;\n return new N5(immutableMultiset, immutableMultiset.entrySet().iterator());\n }", "@Override\n public Iterator<T> iterator() {\n return items.iterator();\n }", "public Iterator iterator () {\n return new MyIterator (first);\n }", "public JsonIterator(Iterator<T> iterator) {\n if (iterator == null)\n throw new IllegalArgumentException(\"Iterator must not be null\");\n this.iterator = iterator;\n }", "IStreamList<T> transform(IStreamList<T> dataset);", "private static <T> T identity(Collection<T> collection) {\n return identity(collection.iterator());\n }", "@Override\n public Iterator<Pair<K, V>> iterator() {\n return new Iterator<Pair<K, V>>() {\n private int i = 0, j = -1;\n private boolean _hasNext = true;\n\n @Override\n public boolean hasNext() {\n return _hasNext;\n }\n\n @Override\n public Pair<K, V> next() {\n Pair<K, V> r = null;\n if (j >= 0) {\n List<Pair<K, V>> inl = l.get(i);\n r = inl.get(j++);\n if (j > inl.size())\n j = -1;\n }\n else {\n for (; i < l.size(); ++i) {\n List<Pair<K, V>> inl = l.get(i);\n if (inl == null)\n continue;\n r = inl.get(0);\n j = 1;\n }\n }\n if (r == null)\n _hasNext = false;\n return r;\n }\n };\n }", "public Iterator iterator()\n {\n return new HashSetIterator();\n }", "@Test\n public void whenAddThreeDifferentElementsThenSetHasThreeTheSameElements() {\n SimpleSet<Integer> set = new SimpleSet<>();\n set.add(1);\n set.add(2);\n set.add(3);\n\n Iterator<Integer> iterator = set.iterator();\n\n assertThat(iterator.next(), is(1));\n assertThat(iterator.next(), is(2));\n assertThat(iterator.next(), is(3));\n assertThat(iterator.hasNext(), is(false));\n }", "public /*@ non_null @*/ JMLIterator<E> iterator() {\n return new JMLEnumerationToIterator<E>(elements());\n }", "@Override\r\n\tpublic Iterator<V> iterator() {\r\n\t\treturn store.iterator();\r\n\t}", "Iterator<T> iterator();", "public Iterator<ElementType> iterator(){\n return new InnerIterator();\n }", "public Iterator<Item> iterator() { \n return new ListIterator(); \n }", "public SimplifiedPathIterator(PathIterator i) {\n this.i = i;\n }", "public QuadTreeIterator() {\n\t\t\telements = new TreeSet();\n\t\t\tanalyze(((RootNode)root).children[0]);\n\t\t\tanalyze(((RootNode)root).children[1]);\n\t\t\tanalyze(((RootNode)root).children[2]);\n\t\t\tanalyze(((RootNode)root).children[3]);\n\t\t}", "public static <T> List<T> toList(Iterator<T> elements) {\n List<T> list = new LinkedList<T>();\n\n while (elements.hasNext()) {\n list.add(elements.next());\n }\n\n return list;\n }", "@Override\n public Iterator<T> iterator() {\n return new Itr();\n }", "@Override\n public Iterator<T> iterator() {\n return new Itr();\n }", "@Override\n\tpublic Iterator<Item> iterator() {\n\t\treturn new ListIterator();\n\t}", "public native IterableIterator<Tuple<K, V>> entries();", "public Iterator<T> iterator() {\n return new SetIterator<T>(this.head);\n }", "public Iterator<T> getIterator();", "public abstract Iterator<E> createIterator();", "abstract Collection<Object> mapResultClass(Collection<Object> resultSet);", "Iterator<Vertex<V, E, M>> getVertices() {\n return this.vertices.values().iterator();\n }", "Iterator<TrieEntry<T, U>> trieIterator();", "@Override\n public Iterator<Item> iterator() {\n return new DequeIterator<Item>(first);\n }", "public Iterator <item_t> iterator () {\n return new itor ();\n }", "public FlightIterator createIterator() {\r\n\t\treturn new FlightIterator(flights);\r\n\t}", "@Override\n public Iterator<Long> iterator() {\n Collection<Long> c = new ArrayList<>();\n synchronized (data) {\n for (int i=0; i<data.length; i++)\n c.add(get(i));\n }\n return c.iterator();\n }", "@Override\n public Iterator<E> iterator() {\n return new AVLTreeIterator();\n }", "@Override\n Iterator<T> iterator();", "public Iterator<Item> iterator(){\n return new Iterator<Item>(); //Iterator interface implementation instance(has all Iterator methods)\n }", "@Override\n\tpublic Iterator<T> iterator() {\n\t\t\n\t\treturn lista.iterator();\n\t}", "@Override\n public Builder iterate(@NonNull SequenceIterator<VocabWord> iterator) {\n super.iterate(iterator);\n return this;\n }", "protected static QueryIterator chainTriples(List<Triple> triples,\n\t\t\tQueryIterator iter, ExecutionContext ctx) {\n\t\treturn QueryIterBlockTriples.create(iter, BasicPattern.wrap(triples),\n\t\t\t\tctx);\n\t}", "@Override\n public Iterator<Set<E>> iterator() {\n return new DisjointSetIterator(theSet);\n }", "@Override\r\n\tpublic Iterator createIterator() {\n\t\treturn bestSongs.values().iterator();\r\n\t}", "public Iterator<ResultItem> iterateItems() {\r\n\t\treturn items.iterator();\r\n\t}", "@Override\n public Iterator<T> iterator() {\n return new MyArrayList.MyIterator();\n }", "private static Stream<?> all(Iterator<Object> i) {\n requireNonNull(i);\n final Iterable<Object> it = () -> i;\n return StreamSupport.stream(it.spliterator(), false);\n }", "public Iterator<Object> iterator()\r\n {\r\n return new MyTreeSetIterator(root);\r\n }", "Set<Set<V>> routine3(Graph<V, E> g)\n {\n Set<Set<V>> NuvList = new HashSet<>();\n for (V u : g.vertexSet()) {\n for (V v : g.vertexSet()) {\n if (u == v || !g.containsEdge(u, v))\n continue;\n NuvList.add(N(g, u, v));\n }\n }\n\n Set<Set<V>> tripleList = new HashSet<>();\n for (V a : g.vertexSet()) {\n for (V b : g.vertexSet()) {\n if (a == b || g.containsEdge(a, b))\n continue;\n Set<V> Nab = N(g, a, b);\n for (V c : g.vertexSet()) {\n if (isTripleRelevant(g, a, b, c)) {\n tripleList.add(X(g, Nab, c));\n }\n }\n }\n }\n Set<Set<V>> res = new HashSet<>();\n for (Set<V> Nuv : NuvList) {\n for (Set<V> triple : tripleList) {\n Set<V> temp = new HashSet<>();\n temp.addAll(Nuv);\n temp.addAll(triple);\n res.add(temp);\n }\n }\n return res;\n }", "Iterable<Long> vertices() {\n //YOUR CODE HERE, this currently returns only an empty list.\n ArrayList<Long> verticesIter = new ArrayList<>();\n verticesIter.addAll(adj.keySet());\n return verticesIter;\n }", "@Override\n public Iterator<E> iterator() {\n return new InsideIterator(first);\n }", "public SortedList(Iterator<? extends T> iterator) {\n super(iterator);\n }", "@Override\n\tpublic final Iterator<T> iterator() {\n\t\treturn new IteratorImpl<>(value.get());\n\t}", "public Iterator<Shape> iterator(){\n\t\treturn shapes.iterator();\n\t}" ]
[ "0.5460443", "0.53297037", "0.5235926", "0.51830864", "0.51015496", "0.5089332", "0.5030728", "0.4937148", "0.4892064", "0.4873604", "0.48731536", "0.48701546", "0.4867987", "0.48514307", "0.47871172", "0.47766992", "0.47408876", "0.4739478", "0.4708794", "0.47011307", "0.46897244", "0.46616426", "0.4656499", "0.46188515", "0.46120152", "0.45961145", "0.4587362", "0.45834228", "0.45728844", "0.45647728", "0.45491597", "0.45483655", "0.45442545", "0.452567", "0.45221746", "0.4514027", "0.4501365", "0.44849166", "0.44718623", "0.44648427", "0.44637012", "0.4460095", "0.44598702", "0.44556773", "0.44452003", "0.44377533", "0.4432508", "0.4428534", "0.44257432", "0.44216454", "0.4417514", "0.44170418", "0.44123122", "0.4411327", "0.44059536", "0.43951282", "0.4395034", "0.43920642", "0.43734708", "0.43723056", "0.43671906", "0.43668896", "0.43514436", "0.43510887", "0.4348586", "0.43440792", "0.43411165", "0.43384328", "0.43380532", "0.43380532", "0.4331495", "0.4329968", "0.43286693", "0.43209496", "0.43174052", "0.4312275", "0.43068853", "0.4304512", "0.42989257", "0.429819", "0.42975625", "0.4295895", "0.42935243", "0.42913842", "0.4291227", "0.4290053", "0.4287549", "0.4285699", "0.42823216", "0.42802018", "0.42800343", "0.42796743", "0.42746434", "0.42732158", "0.42725894", "0.42657942", "0.42609838", "0.4255205", "0.42537925", "0.4251397" ]
0.8032804
0
Content id for which you want the related content.
public Builder forContent(String contentId) { this.contentId = contentId; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "java.lang.String getContentId();", "int getContentId();", "public Integer getContentId() {\n return contentId;\n }", "@Override\n\tpublic long getContent_id() {\n\t\treturn _contentupdate.getContent_id();\n\t}", "@java.lang.Override\n public int getContentId() {\n return contentId_;\n }", "@java.lang.Override\n public int getContentId() {\n return instance.getContentId();\n }", "public String getContentId() {\n\t\treturn _contentId;\n\t}", "public void setContentId(Integer contentId) {\n this.contentId = contentId;\n }", "public void setContentId(String id) {\n\t\tthis._contentId = id;\n\t}", "UserContent findContentById(@Param(\"contentUid\") long contentUid);", "String getContentGeneratorId();", "@Override\n\tpublic long getId() {\n\t\treturn _contentupdate.getId();\n\t}", "@Override\n\tpublic long getContent_id() {\n\t\treturn _buySellProducts.getContent_id();\n\t}", "boolean hasContentId();", "public String getContentId() {\n\n String as[] = getMimeHeader(\"Content-Id\");\n\n if (as != null && as.length > 0) {\n return as[0];\n } else {\n return null;\n }\n }", "public int getContentViewId() {\n return R.id.tv_content;\n }", "public Content findContentById(Long contentId) {\n return contentDAO.findById(contentId);\n }", "private void setContentId(int value) {\n bitField0_ |= 0x00000001;\n contentId_ = value;\n }", "com.google.protobuf.ByteString\n getContentIdBytes();", "String getChildId();", "public String getdictContentID() {\r\n return (String)getNamedWhereClauseParam(\"dictContentID\");\r\n }", "public Builder setContentId(int value) {\n copyOnWrite();\n instance.setContentId(value);\n return this;\n }", "ContentIdentifier getParent(ContentIdentifier cid);", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "java.lang.String getId();", "void setContentGeneratorId( String contentGeneratorId );", "@java.lang.Override\n public boolean hasContentId() {\n return instance.hasContentId();\n }", "protected String get_object_id()\r\n\t{\r\n\t\treturn id;\r\n\t}", "protected String get_object_id()\r\n\t{\r\n\t\treturn id;\r\n\t}", "protected String get_object_id()\r\n\t{\r\n\t\treturn id;\r\n\t}", "public Content getContentMeta(Integer contentId) {\n String sql = \"SELECT * FROM contents WHERE content_id = ?\";\n return jdbc.queryForObject(sql, new ContentMetaRowMapper(), contentId);\n }", "public Content get(Integer contentId) {\n String sql = \"SELECT * FROM contents WHERE content_id = ?\";\n return jdbc.queryForObject(sql, new ContentRowMapper(), contentId);\n }", "public String getReferenceId();", "public Optional<Content> findContentById(Integer contentID){\n\n Optional<Content> content = contentRepository.findById(contentID);\n\n if(content.isPresent()){\n return content;\n }\n throw new HubNotFoundException(\"Could not find content for contentID: \" + contentID);\n }", "public String getId();", "public String getId();", "public String getId();", "public String getId();", "public String getId();", "public String getId();", "public String getId();", "public String getId();", "public String getId();", "public String getId();", "public String getId();", "public int getId();", "public int getId();", "public int getId();", "public int getId();", "public int getId();", "public int getId();", "public int getId();", "Object getId();", "int getPostId();", "public long getPostId();", "java.lang.String getCommentId();", "public int getStoryId();", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "public int getId() { return id; }", "@Override\n\tpublic long getPrimaryKey() {\n\t\treturn _news_Blogs.getPrimaryKey();\n\t}", "public java.lang.Integer getMetaId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();" ]
[ "0.7866705", "0.7567799", "0.7374597", "0.72496206", "0.7234269", "0.72219104", "0.70387805", "0.66962886", "0.65256697", "0.64901793", "0.6447005", "0.6409668", "0.63900065", "0.6360793", "0.6354046", "0.6330157", "0.6309281", "0.6298827", "0.6271014", "0.61972696", "0.6108634", "0.6091779", "0.6070384", "0.60271", "0.60271", "0.60271", "0.60271", "0.60271", "0.60271", "0.60271", "0.60271", "0.60271", "0.60271", "0.60271", "0.60271", "0.60271", "0.60271", "0.60271", "0.60271", "0.60271", "0.60271", "0.60271", "0.599244", "0.58916736", "0.5878177", "0.5878177", "0.5878177", "0.5856214", "0.58448774", "0.5830794", "0.58281744", "0.5815842", "0.5815842", "0.5815842", "0.5815842", "0.5815842", "0.5815842", "0.5815842", "0.5815842", "0.5815842", "0.5815842", "0.5815842", "0.581406", "0.581406", "0.581406", "0.581406", "0.581406", "0.581406", "0.581406", "0.5801803", "0.5801775", "0.57946086", "0.57552284", "0.57362735", "0.5725711", "0.5725711", "0.5725711", "0.5725711", "0.5725711", "0.5725711", "0.5725524", "0.5724112", "0.5717707", "0.5717707", "0.5717707", "0.5717707", "0.5717707", "0.5717707", "0.5717707", "0.5717707", "0.5717707", "0.5717707", "0.5717707", "0.5717707", "0.5717707", "0.5717707", "0.5717707", "0.5717707", "0.5717707", "0.5717707", "0.5717707" ]
0.0
-1
User id for whom you want the related content.
public Builder byUser(String uid) { this.uid = uid; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public long getUserId() {\n return _partido.getUserId();\n }", "@Override\n public long getUserId() {\n return _usersCatastropheOrgs.getUserId();\n }", "public int getOwnUserId()\n {\n return this.ownUserId;\n }", "@Override\n\tpublic long getUserId() {\n\t\treturn _paper.getUserId();\n\t}", "public int getIdUser() {\n return idUser;\n }", "public int getIdUser() {\n return idUser;\n }", "@Override\n\tpublic long getUserId() {\n\t\treturn model.getUserId();\n\t}", "@Override\n\tpublic long getUserId() {\n\t\treturn model.getUserId();\n\t}", "@Override\n\tpublic long getUserId() {\n\t\treturn model.getUserId();\n\t}", "public long getUserId();", "public long getUserId();", "public long getUserId();", "public long getUserId();", "@Override\n public String getUserID() {\n return user_id;\n }", "java.lang.String getUserId();", "java.lang.String getUserId();", "java.lang.String getUserId();", "@Override\n\tpublic long getUserId();", "@Override\n\tpublic long getUserId();", "public int getIduser() {\n return iduser;\n }", "java.lang.String getUserIdOne();", "private long getOwnID(){\n return authenticationController.getMember() == null ? -1 :authenticationController.getMember().getID();\n }", "@Override\n\tpublic Long getUserId() {\n\t\treturn user.getKey().getId();\n\t}", "@Override\n\tpublic String getUserId() {\n\t\treturn super.getUserId();\n\t}", "public int getDoc_User_ID() {\n return getCreatedBy();\n }", "@Override\n\tpublic long getUserId() {\n\t\treturn _scienceApp.getUserId();\n\t}", "Long getUserId();", "String getUserId();", "String getUserId();", "long getUserId();", "long getUserId();", "@Override\n\tpublic long getUserId() {\n\t\treturn _second.getUserId();\n\t}", "public int getUserID() {\n return userID;\n }", "public int getUserID() {\n return userID;\n }", "public int getUserID() {\n return userID;\n }", "Integer getUserId();", "public int getUserId() {\n return instance.getUserId();\n }", "public Integer getIdUser() {\r\n\t\treturn idUser;\r\n\t}", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "@Override\n\tpublic long getUserId() {\n\t\treturn _userTracker.getUserId();\n\t}", "@Override\n\tpublic long getUserId() {\n\t\treturn _esfTournament.getUserId();\n\t}", "public int getUserID()\n {\n return userID;\n }", "public int getUserId() {\n return userId_;\n }", "public int getId()\r\n\t{\r\n\t\treturn this.userId;\r\n\t}", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public int getUserID() {\n return userID_;\n }", "public String getUserID();", "public Long getUserId() {\n return this.user.getId();\n }", "public int getUserID()\n {\n return this.userID;\n }", "protected long getUserID() {\n return userID;\n }", "public String getUser_id() {\n return this.user_id;\n }", "int getOwnerID();", "public String getIdUser() {\n\t\treturn idUser;\n\t }", "public Integer getUser_id() {\n\t\treturn user_id;\n\t}", "@Override\n\tpublic long getUserId() {\n\t\treturn _userSync.getUserId();\n\t}", "public String getIdUser() {\n\t\treturn idUser;\n\t}", "public java.lang.String getUserId() {\n return instance.getUserId();\n }", "@java.lang.Override\n public long getUserId() {\n return instance.getUserId();\n }", "public Integer getUserid() {\n return userid;\n }", "public Integer getUserid() {\n return userid;\n }", "public Integer getUserid() {\n return userid;\n }", "public Integer getUserid() {\n return userid;\n }", "public Integer getUserid() {\n return userid;\n }", "public Integer getUserid() {\n return userid;\n }", "public Integer getUserid() {\n return userid;\n }", "public Integer getUserid() {\n return userid;\n }", "public Integer getUserid() {\n return userid;\n }", "public Integer getUserid() {\n return userid;\n }", "public Integer getUserid() {\n return userid;\n }", "public Integer getUserid() {\n return userid;\n }" ]
[ "0.6693674", "0.66255623", "0.66015136", "0.65714854", "0.6499418", "0.6499418", "0.6470841", "0.6470841", "0.6470841", "0.6394552", "0.6394552", "0.6394552", "0.6394552", "0.6393937", "0.6376345", "0.6376345", "0.6376345", "0.63652384", "0.63652384", "0.6363737", "0.63444346", "0.63427263", "0.6340182", "0.6336125", "0.6329753", "0.6316271", "0.630636", "0.62990046", "0.62990046", "0.62954533", "0.62954533", "0.62662965", "0.6251248", "0.6251248", "0.6251248", "0.62497914", "0.6249779", "0.62438375", "0.62399584", "0.62399584", "0.62399584", "0.62399584", "0.62399584", "0.62399584", "0.62399584", "0.62399584", "0.62399584", "0.62399584", "0.62399584", "0.62399584", "0.62399584", "0.62399584", "0.62399584", "0.6239404", "0.6239404", "0.6210277", "0.6195844", "0.6180246", "0.6158725", "0.61383426", "0.6134885", "0.6134885", "0.6133326", "0.6133326", "0.6133326", "0.6133326", "0.6133326", "0.6133326", "0.6133326", "0.6133326", "0.6133326", "0.6133326", "0.6133326", "0.6133326", "0.6133326", "0.6133326", "0.6133326", "0.6123158", "0.6121087", "0.6118256", "0.6105516", "0.6087292", "0.6082052", "0.60795534", "0.60743904", "0.60726416", "0.6050437", "0.60379905", "0.6027642", "0.6016595", "0.6016595", "0.6016595", "0.6016595", "0.6016595", "0.6016595", "0.6016595", "0.6016595", "0.6016595", "0.6016595", "0.6016595", "0.6016595" ]
0.0
-1
Language id of the related content. ex: Hindi hi, Kannada kn & etc
public Builder byLanguage(String language) { this.language = language; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getLangId();", "public Integer getLanguageId() {\r\n return languageId;\r\n }", "public String getLanguageKey();", "public String getLanguageId() {\r\n\t\treturn this.languageId;\r\n\t}", "Language findById(String id);", "io.dstore.values.IntegerValue getValueLanguageId();", "public Language(Integer languageId) {\r\n this.languageId = languageId;\r\n }", "public void setLanguageId(int v) throws TorqueException\n {\n \n if (this.languageId != v)\n {\n this.languageId = v;\n setModified(true);\n }\n \n \n if (aLanguageRelatedByLanguageId != null && !(aLanguageRelatedByLanguageId.getLanguageId() == v))\n {\n aLanguageRelatedByLanguageId = null;\n }\n \n }", "public Language getLanguageRelatedByLanguageId() throws TorqueException\n {\n if (aLanguageRelatedByLanguageId == null && (this.languageId != 0))\n {\n aLanguageRelatedByLanguageId = LanguagePeer.retrieveByPK(SimpleKey.keyFor(this.languageId));\n \n /* The following can be used instead of the line above to\n guarantee the related object contains a reference\n to this object, but this level of coupling\n may be undesirable in many circumstances.\n As it can lead to a db query with many results that may\n never be used.\n Language obj = LanguagePeer.retrieveByPK(this.languageId);\n obj.addNewslettersRelatedByLanguageId(this);\n */\n }\n return aLanguageRelatedByLanguageId;\n }", "@Override\n public String getContentLang() {\n return \"en\";\n }", "String getLanguage();", "String getLanguage();", "String getLanguage();", "CLanguage getClanguage();", "public void setLanguageId(Integer languageId) {\r\n this.languageId = languageId;\r\n }", "java.lang.String getLanguage();", "java.lang.String getLanguage();", "public String getLanguage();", "public Language getLanguageRelatedByCustLanguageId() throws TorqueException\n {\n if (aLanguageRelatedByCustLanguageId == null && (this.custLanguageId != 0))\n {\n aLanguageRelatedByCustLanguageId = LanguagePeer.retrieveByPK(SimpleKey.keyFor(this.custLanguageId));\n \n /* The following can be used instead of the line above to\n guarantee the related object contains a reference\n to this object, but this level of coupling\n may be undesirable in many circumstances.\n As it can lead to a db query with many results that may\n never be used.\n Language obj = LanguagePeer.retrieveByPK(this.custLanguageId);\n obj.addNewslettersRelatedByCustLanguageId(this);\n */\n }\n return aLanguageRelatedByCustLanguageId;\n }", "public Language(String languageId) {\r\n\t\tthis.languageId = languageId;\r\n\t}", "speech.multilang.Params.SemanticLangidParams getSemanticLangidParams();", "public Language getExistingLanguage(int id) {\n\t\treturn languageRepository.findOne(id);\r\n\t}", "String getLang();", "io.dstore.values.IntegerValueOrBuilder getValueLanguageIdOrBuilder();", "@DISPID(-2147413012)\n @PropGet\n java.lang.String language();", "public long getLichChiTietId();", "java.lang.String getLanguageCode();", "java.lang.String getLanguageCode();", "public String getPrimaryLanguage(){\n return sharedPreferences.getString(PRIMARY_LANGUAGE, \"LANG_NOT_FOUND\");\n }", "public String getTitile(String language) {\n if (language.startsWith(\"e\")) {\n return enTitle;\n } else {\n return localTitle;\n }\n }", "String getLanguageCode();", "java.lang.String getTargetLanguageCode();", "public Object language() {\n return this.language;\n }", "public void setLanguageId(String languageId) {\r\n\t\tthis.languageId = languageId;\r\n\t}", "public void setLanguageRelatedByLanguageId(Language v) throws TorqueException\n {\n if (v == null)\n {\n setLanguageId( 1000);\n }\n else\n {\n setLanguageId(v.getLanguageId());\n }\n aLanguageRelatedByLanguageId = v;\n }", "@DISPID(-2147413103)\n @PropGet\n java.lang.String lang();", "@Override\n\tpublic void delComLanguage(int id) {\n\t\t\n\t}", "countrylanguage selectByPrimaryKey(countrylanguageKey key);", "public Language getLanguage() {\n return this.language;\n }", "public void setLanguageRelatedByLanguageIdKey(ObjectKey key) throws TorqueException\n {\n \n setLanguageId(((NumberKey) key).intValue());\n }", "public String getLanguage()\n {\n return mLanguage;\n }", "public String getLanguageMenuText() {\r\n\t\treturn \"语言\";\r\n\t}", "public String getLanguage() {\n return _language;\n }", "public io.dstore.values.IntegerValue getValueLanguageId() {\n if (valueLanguageIdBuilder_ == null) {\n return valueLanguageId_ == null ? io.dstore.values.IntegerValue.getDefaultInstance() : valueLanguageId_;\n } else {\n return valueLanguageIdBuilder_.getMessage();\n }\n }", "public javax.sip.header.ContentLanguageHeader getContentLanguage() {\n return (ContentLanguageHeader)\n getHeader(ContentLanguageHeader.NAME);\n \n }", "Language findByName(String name);", "public String getLanguage() {\r\n return language;\r\n }", "@Override\n\tpublic java.lang.String getManualId(java.lang.String languageId) {\n\t\treturn _scienceApp.getManualId(languageId);\n\t}", "@Override\r\n public String toString() {\r\n return \"models.Language[ languageId=\" + languageId + \" ]\";\r\n }", "public LanguageCode getLanguage() {\n return language;\n }", "@objid (\"8b3ba8b8-4d09-4d8e-9064-983191cc6b26\")\n @Override\n public String getLanguage() {\n String language = Platform.getNL();\n if (language.contains(\"_\")) {\n return Platform.getNL().substring(0, language.lastIndexOf(\"_\"));\n }\n return Platform.getNL();\n }", "public String getContentLanguage() {\n return this.contentLanguage;\n }", "Language findByCode(LanguageCode code);", "public void setLanguage(String language);", "@Override\n public String getResumeLanguage() {\n return \"zh\";\n }", "private String getTranslation(String language, String id)\n {\n Iterator<Translation> translations = mTranslationState.iterator();\n \n while (translations.hasNext()) {\n Translation translation = translations.next();\n \n if (translation.getLang().equals(language)) {\n Iterator<TranslationText> texts = translation.texts.iterator();\n \n while (texts.hasNext()) {\n TranslationText text = texts.next();\n \n if (text.getId().equals(id)) {\n text.setUsed(true);\n return text.getValue();\n }\n }\n }\n }\n \n return \"[Translation Not Available]\";\n }", "public String getEnglish()\n {\n if (spanishWord.substring(0,3).equals(\"el \"))\n {\n spanishWord = spanishWord.substring(3, spanishWord.length());\n }\n else if (spanishWord.substring(0, 3).equals(\"la \"))\n {\n spanishWord = spanishWord.substring(3, spanishWord.length());\n }\n if (spanishWord.equals(\"estudiante\"))\n {\n return \"student\"; \n }\n else if (spanishWord.equals(\"aprender\"))\n {\n return \"to learn\";\n }\n else if (spanishWord.equals(\"entender\"))\n {\n return\"to understand\";\n }\n else if (spanishWord.equals(\"verde\"))\n {\n return \"green\";\n }\n else\n {\n return null;\n }\n }", "public String getLanguage() {\n return this.language;\n }", "public String getLanguage() {\n return language;\n }", "public String getLanguage() {\n return language;\n }", "public Language(Integer languageId, String languageName, String languageCode) {\r\n this.languageId = languageId;\r\n this.languageName = languageName;\r\n this.languageCode = languageCode;\r\n }", "Language getLanguage(LanguageID languageID, int version) throws LanguageNotFoundException;", "public int getLenguaje_id() {\n return lenguaje_id;\n }", "public String getLang() {\n return lang;\n }", "public void setCustLanguageId(int v) throws TorqueException\n {\n \n if (this.custLanguageId != v)\n {\n this.custLanguageId = v;\n setModified(true);\n }\n \n \n if (aLanguageRelatedByCustLanguageId != null && !(aLanguageRelatedByCustLanguageId.getLanguageId() == v))\n {\n aLanguageRelatedByCustLanguageId = null;\n }\n \n }", "public Language getLanguage() {\n return this.language;\n }", "public abstract String getLocalizationKey();", "public Language getLanguage() {\r\n\t\t\treturn lang;\r\n\t\t}", "int getLocalizedText();", "LanguageEnum(int id, String isoCode) {\n this.id = id;\n this.isoCode = isoCode;\n }", "@Override\r\n\tpublic String toString() {\r\n\t\treturn \"dudge.db.Language[languageId=\" + languageId + \"]\";\r\n\t}", "public String getLanguage()\n\t{\n\t\treturn language;\n\t}", "public java.lang.String getLanguageLocaleKey() {\n return languageLocaleKey;\n }", "public String getUserLangage() {\n return sessionData.getUserLanguage();\n }", "@AutoEscape\n\tpublic String getLanguage();", "public void setLanguageRelatedByCustLanguageId(Language v) throws TorqueException\n {\n if (v == null)\n {\n setCustLanguageId( 999);\n }\n else\n {\n setCustLanguageId(v.getLanguageId());\n }\n aLanguageRelatedByCustLanguageId = v;\n }", "public void cambiarIdioma(String lenguaje){\n\n Locale idioma=new Locale(lenguaje);\n Locale.setDefault(idioma);\n\n\n\n Configuration configuraciontelefono=getResources().getConfiguration();\n configuraciontelefono.locale=idioma;\n getBaseContext().getResources().updateConfiguration(configuraciontelefono,getBaseContext().getResources().getDisplayMetrics());\n }", "public String getLangCode() {\n\t\treturn langCode;\n\t}", "int getTranslationField();", "public void putPrimaryLanguage(String value){\n editor.putString(PRIMARY_LANGUAGE, value);\n editor.apply();\n }", "public int getCxlangue() {\r\r\r\r\r\r\r\n return cxlangue;\r\r\r\r\r\r\r\n }", "public EmployeeLanguage(Integer id) {\n super.id=id;\n }", "public io.dstore.values.IntegerValueOrBuilder getValueLanguageIdOrBuilder() {\n return getValueLanguageId();\n }", "@Override\n\tpublic int getId() {\n\t\treturn _keHoachKiemDemNuoc.getId();\n\t}", "Builder addInLanguage(Text value);", "boolean hasLanguage();", "public static String getLanguage() {\n return language;\n }", "public static Language getAD_Language() {\n\t\treturn null;\r\n\t}", "public String toLanguageTag() {\n if (this.languageTag != null) {\n return this.languageTag;\n }\n Object object = LanguageTag.parseLocale(this.baseLocale, this.localeExtensions);\n CharSequence charSequence = new StringBuilder();\n Object object22 = ((LanguageTag)object).getLanguage();\n if (((String)object22).length() > 0) {\n ((StringBuilder)charSequence).append(LanguageTag.canonicalizeLanguage((String)object22));\n }\n if (((String)(object22 = ((LanguageTag)object).getScript())).length() > 0) {\n ((StringBuilder)charSequence).append(\"-\");\n ((StringBuilder)charSequence).append(LanguageTag.canonicalizeScript((String)object22));\n }\n if (((String)(object22 = ((LanguageTag)object).getRegion())).length() > 0) {\n ((StringBuilder)charSequence).append(\"-\");\n ((StringBuilder)charSequence).append(LanguageTag.canonicalizeRegion((String)object22));\n }\n for (Object object22 : ((LanguageTag)object).getVariants()) {\n ((StringBuilder)charSequence).append(\"-\");\n ((StringBuilder)charSequence).append((String)object22);\n }\n for (Object object3 : ((LanguageTag)object).getExtensions()) {\n ((StringBuilder)charSequence).append(\"-\");\n ((StringBuilder)charSequence).append(LanguageTag.canonicalizeExtension((String)object3));\n }\n if (((String)(object = ((LanguageTag)object).getPrivateuse())).length() > 0) {\n if (((StringBuilder)charSequence).length() > 0) {\n ((StringBuilder)charSequence).append(\"-\");\n }\n ((StringBuilder)charSequence).append(\"x\");\n ((StringBuilder)charSequence).append(\"-\");\n ((StringBuilder)charSequence).append((String)object);\n }\n charSequence = ((StringBuilder)charSequence).toString();\n synchronized (this) {\n if (this.languageTag == null) {\n this.languageTag = charSequence;\n }\n return this.languageTag;\n }\n }", "void updateLang() {\n if (lang == null)\n lang = game.q;\n }", "public int getLanguageLevel() {\n return languageLevel;\n }", "public io.dstore.values.IntegerValue getValueLanguageId() {\n return valueLanguageId_ == null ? io.dstore.values.IntegerValue.getDefaultInstance() : valueLanguageId_;\n }", "java.lang.String getSourceLanguageCode();", "public String getLanguageCode() {\r\n return languageCode;\r\n }", "public int getLocaleId() {\r\n\t\treturn localeId;\r\n\t}", "boolean hasValueLanguageId();", "public String getLanguage() {\n\t\treturn this.language;\n\t}", "@Override\n\tpublic long getId() {\n\t\treturn _phieugiahan.getId();\n\t}", "public String getCurrentLanguage() {\n return getStringData(Key.APP_CURRENT_LANGUAGE + \"\", \"zh\");\n }", "@Override\n public void setLanguage(String lang) {\n }", "public String getLanguageName() {\r\n return languageName;\r\n }" ]
[ "0.7495984", "0.68665254", "0.6735882", "0.6710458", "0.66472226", "0.64309466", "0.6401251", "0.6395198", "0.63595", "0.6323766", "0.6307115", "0.6307115", "0.6307115", "0.63012505", "0.62844014", "0.6245705", "0.6245705", "0.6205839", "0.61184573", "0.60461766", "0.5992577", "0.5973294", "0.59657973", "0.5944176", "0.5941213", "0.593381", "0.5900982", "0.5900982", "0.5881269", "0.58672154", "0.58424324", "0.5829015", "0.58261526", "0.5825351", "0.5816348", "0.5789347", "0.5785981", "0.5766474", "0.5710665", "0.570252", "0.5691535", "0.56843", "0.5682733", "0.5674883", "0.5670808", "0.565313", "0.5650485", "0.5636808", "0.56357914", "0.5635782", "0.56355333", "0.5626192", "0.5616251", "0.561129", "0.5610595", "0.56073534", "0.5596699", "0.5596515", "0.5591008", "0.5591008", "0.5589371", "0.5562857", "0.55409384", "0.5534028", "0.55258185", "0.55233026", "0.55224943", "0.5521651", "0.55192167", "0.5517196", "0.5508778", "0.55067873", "0.54964095", "0.54905933", "0.5484447", "0.5477291", "0.5476614", "0.54753", "0.5469254", "0.5460097", "0.5450435", "0.5447663", "0.5433752", "0.5426169", "0.54193985", "0.5413474", "0.5410158", "0.53958523", "0.5382823", "0.5381472", "0.5379353", "0.5377191", "0.5370473", "0.5365801", "0.53648025", "0.53603977", "0.5351479", "0.53496313", "0.5347962", "0.5347341", "0.53396124" ]
0.0
-1
Related contents results limit.
public Builder limit(long limit) { this.limit = limit; return this; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setMaxResults(int limit);", "private void limitRows()\n {\n paginate(currentPage, getResultsPerPage());\n }", "public int getLimit() {\n return limit;\n }", "public int getLimit() {\r\n return limit;\r\n }", "public int getLimit() {\n return limit;\n }", "public int getLimit() {\n return limit;\n }", "public int getLimit() {\n return limit;\n }", "int getLimit();", "int getLimit();", "public void setLimit(int limit) {\n this.limit=limit;\n }", "public void setLimit(int limit) {\n this.limit = limit;\n }", "public int getLimit() {\n\t\treturn limit;\n\t}", "public int getLimit() {\n\t\treturn limit;\n\t}", "public Long getLimit() {\n return this.limit;\n }", "public int getLimit() {\n\treturn Limit;\n }", "public Long getLimit() {\n return this.Limit;\n }", "public Long getLimit() {\n return this.Limit;\n }", "public int getLimit(){\r\n return limit;\r\n\r\n }", "public void setLimit(Integer limit) {\n this.limit = limit;\n }", "WebPage limit(int limit);", "public void setLimit(int limit) {\n this.limit = limit;\n }", "public int getLimit() {\n\t\t\treturn limit;\n\t\t}", "public ListProxy limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "public ListInfrastructure limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "public void setLimit(int limit) {\n\tLimit = limit;\n }", "protected Limit getLimit() {\n return new Limit(skip, limit);\n }", "public Integer getLimit() {\n return limit;\n }", "public void setLimit(int limit) {\n\t\tthis.limit = limit;\n\t}", "public DeleteCollectionProxy limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "@SuppressWarnings(\"unchecked\")\n public Q limit(int limit) {\n this.limit = limit;\n return (Q) this;\n }", "public void setLimit(Long limit) {\n this.limit = limit;\n }", "public String getLimit() {\r\n\t\treturn this.limit;\r\n\t}", "Integer getMaxPageResults();", "public DeleteCollectionInfrastructure limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "private void loadMoreItems() {\n isLoading = true;\n\n currentPage += 1;\n\n Call findMyFeedVideosCall = vimeoService.findMyFeedVideos(currentPage, PAGE_SIZE);\n calls.add(findMyFeedVideosCall);\n findMyFeedVideosCall.enqueue(findMyFeedVideosNextFetchCallback);\n }", "public void setMaxResults(int wordLimit) {\r\n\t\tthis.wordLimit = wordLimit;\r\n\t}", "@Override\n public int getItemCount(){\n if(specialistList.size() > LIMIT) { return LIMIT; }\n else { return specialistList.size(); }\n }", "public boolean hasLimit() {\n return result.hasLimit();\n }", "public long limit();", "public double getLimit() {return limit;}", "public void setLimit(Long Limit) {\n this.Limit = Limit;\n }", "public void setLimit(Long Limit) {\n this.Limit = Limit;\n }", "public void setMaxResults(int max) {\n\r\n\t}", "public CommonFileQuery limit(Integer rows) {\n this.rows = rows;\n return this;\n }", "public ListImage limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "private int getCurrentLimit(){\n\t\treturn this.LIMIT;\n\t}", "String limitSubquery();", "@Override\n public Iterator<SimilarResult<T>> iterator() {\n lock();\n return Iterators.limit(getResults().iterator(), maxSize);\n }", "boolean getMoreResults();", "private void queryLimitedToNumberOfChildren(JSONArray data) {\n \tString strURL = String.format(\"https://%s.firebaseio.com\", appName); // = \"https://%@.firebaseio.com\" + appName;\n \tint nLimit = 0;\n\n if ( data.length() >= 2 )\n {\n \ttry {\n\t\t\t\tstrURL = data.getString(0);\n\t\t\t\tnLimit = data.getInt(1);\n\t\t\t} catch (JSONException e) {\n\t\t\t\tPluginResult pluginResult = new PluginResult(Status.ERROR, e.getMessage());\n\t\t\t\tmCallbackContext.sendPluginResult(pluginResult);\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn;\n\t\t\t}\n }\n else{\n \tPluginResult pluginResult = new PluginResult(Status.ERROR, \"queryLimitedToNumberOfChildren : Parameter Error\");\n \tmCallbackContext.sendPluginResult(pluginResult);\n \treturn;\n }\n\n Firebase urlRef = new Firebase(strURL);\n\n if(isUsed != true)\n isUsed = true;\n // Read data and react to changes\n urlRef.limit(nLimit).addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot snapshot) {\n JSONObject resultObj;\n\t\t\t\ttry {\n HashMap result = snapshot.getValue(HashMap.class);\n if (result == null)\n resultObj = new JSONObject();\n else\n resultObj = new JSONObject(result);\n\t PluginResult pluginResult = new PluginResult(Status.OK, resultObj);\n\t //pluginResult.setKeepCallback(true);\n\t mCallbackContext.sendPluginResult(pluginResult);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\tPluginResult pluginResult = new PluginResult(Status.ERROR, e.getMessage());\n\t\t\t\t\tmCallbackContext.sendPluginResult(pluginResult);\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n }\n\n @Override\n public void onCancelled(FirebaseError firebaseError) {\n System.out.println(\"limit(limit).addListenerForSingleValueEvent failed: \" + firebaseError.getMessage());\n PluginResult pluginResult = new PluginResult(Status.ERROR, \"queryLimitedToNumberOfChildren failded: \" + firebaseError.getMessage());\n mCallbackContext.sendPluginResult(pluginResult);\n }\n });\n }", "@Override\n public boolean getMoreResults(int current) throws SQLException {\n return false;\n }", "@Override\n public int getNumOfPageRows() {\n return 10;\n }", "@Override\n\tpublic void setMaxResultLength(int l) {\n\t\tlen = l;\n\t}", "public ListNetwork limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "public ListOAuth limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "public CommonFileQuery limit(Integer offset, Integer rows) {\n this.offset = offset;\n this.rows = rows;\n return this;\n }", "public boolean getMoreResults(int current) throws SQLException {\n return false;\r\n }", "public ListDNS limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "public Integer getResultLimit()\n {\n if (resultLimit == null)\n {\n return HPCCWsWorkUnitsClient.defaultResultLimit;\n }\n return resultLimit;\n }", "public ListBuild limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "public int getLimitEnd() {\n return limitEnd;\n }", "public int getLimitEnd() {\n return limitEnd;\n }", "public void setMaxResults(Integer maxResults) {\n this.maxResults = maxResults;\n }", "public void setMaxResults(Integer maxResults) {\n this.maxResults = maxResults;\n }", "public void setMaxResults(Integer maxResults) {\n this.maxResults = maxResults;\n }", "public void setMaxResults(Integer maxResults) {\n this.maxResults = maxResults;\n }", "@Override\n\tpublic List<T> getLimitedFilteredResult(Bson filter, int limit) {\n\t\tGson gson = new GsonBuilder().create();\n\t\tList<T> innerList = new ArrayList<>();\n\t\tcollection.find(filter).limit(limit).forEach((Block<Document>) document -> {\n\t\t\tinnerList.add(gson.fromJson(document.toJson(), entityClass));\n\t\t});\n\t\treturn innerList;\n\n\t}", "public DeleteCollectionBuild limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "public void setLimitEnd(int limitEnd) {\n this.limitEnd=limitEnd;\n }", "public void setLimitEnd(int limitEnd) {\n this.limitEnd=limitEnd;\n }", "@NotNull\n List<Result> executeQueryWithRaisingLimits(LimitedQuery limitedQuery, int offset, Integer limit);", "public void setLimitEnd(Integer limitEnd) {\r\n this.limitEnd=limitEnd;\r\n }", "public abstract void onLoadMore(int page, int totalItemsCount);", "public abstract void onLoadMore(int page, int totalItemsCount);", "public void setMaxResults(int val) throws HibException;", "public ListConsole limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "public void setLimitStart(Integer limitStart) {\r\n this.limitStart=limitStart;\r\n }", "private void fetchMorePosts() {\n long lastPostTimestamp = prismPostArrayList.get(prismPostArrayList.size() - 1).getTimestamp();\n //toast(\"Fetching more pics\");\n databaseReferenceAllPosts\n .orderByChild(Key.POST_TIMESTAMP)\n .startAt(lastPostTimestamp + 1)\n .limitToFirst(Default.IMAGE_LOAD_COUNT)\n .addListenerForSingleValueEvent(new ValueEventListener() {\n @Override\n public void onDataChange(DataSnapshot dataSnapshot) {\n if (dataSnapshot.exists()) {\n for (DataSnapshot postSnapshot : dataSnapshot.getChildren()) {\n PrismPost prismPost = Helper.constructPrismPostObject(postSnapshot);\n prismPostArrayList.add(prismPost);\n getActivity().runOnUiThread(new Runnable() {\n @Override\n public void run() {\n if (prismPostArrayList.size() > 0) {\n mainContentRecyclerViewAdapter\n .notifyItemInserted(prismPostArrayList.size());\n }\n }\n });\n\n }\n populateUserDetailsForAllPosts(false);\n } else {\n Log.i(Default.TAG_DB, Message.NO_DATA);\n }\n }\n\n @Override\n public void onCancelled(DatabaseError databaseError) {\n Log.e(Default.TAG_DB, databaseError.getMessage(), databaseError.toException());\n }\n });\n }", "public int getMaxResults() {\n return this.maxResults;\n }", "public DeleteCollectionConsole limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "@BeanTagAttribute(name = \"resultSetLimit\")\r\n public Integer getResultSetLimit() {\r\n return resultSetLimit;\r\n }", "public DeleteCollectionImage limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "protected int getMaxResults() {\n\t\treturn maxResults;\n\t}", "public ListNamespacedComponent limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "public void setLimitStart(int limitStart) {\n this.limitStart=limitStart;\n }", "public void setLimitStart(int limitStart) {\n this.limitStart=limitStart;\n }", "public void setLimitStart(int limitStart) {\n this.limitStart=limitStart;\n }", "public DeleteCollectionOperatorHub limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "String getLimit(boolean hasWhereClause, long limit);", "private void loadContent()\n {\n // locking the function to prevent the adapter\n // from calling multiples async requests with\n // the same definitions which produces duplicate\n // data.\n locker.lock();\n\n // this function contruct a GraphRequest to the next paging-cursor from previous GraphResponse.\n GraphRequest nextGraphRequest = lastGraphResponse.getRequestForPagedResults(GraphResponse.PagingDirection.NEXT);\n\n // if we reached the end of our pages, the above method 'getRequestForPagedResults'\n // return 'null' object\n if(nextGraphRequest != null)\n {\n // for clarificating and formatting purposes\n // I declared the callback besides the members\n // variables.\n nextGraphRequest.setCallback(callback);\n nextGraphRequest.executeAsync();\n }\n }", "public Query getTop(int limit){\n setLimit(limit);\n return this; //builder pattern allows users to chain methods\n }", "public int getSizeLimit() {\n\t\treturn sizeLimit;\n\t}", "public List<Pregunta> getPreguntasSinResponder(int limit);", "Limit createLimit();", "private RecordCollection toRecordCollectionWithLimitCheck(QueryResult result, int limit) {\n // Validation to ignore records insertion to the returned recordCollection when limit equals zero\n if (limit == 0) {\n return new RecordCollection().withTotalRecords(asRow(result.unwrap()).getInteger(COUNT));\n }\n else {\n return toRecordCollection(result);\n }\n }", "public DeleteCollectionOAuth limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }", "@Override\n\tpublic void onLoadMore() {\n\t\tpage++;\n\t\texecutorService.submit(new Runnable() {\n\n\t\t\t@Override\n\t\t\tpublic void run() {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\ttry {\n\t\t\t\t\tgetResultByKeyword(page);\n\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t}", "public int getLimitStart() {\n return limitStart;\n }", "public int getLimitStart() {\n return limitStart;\n }", "public int getLimitStart() {\n return limitStart;\n }", "public DeleteCollectionDNS limit(Number limit) {\n put(\"limit\", limit);\n return this;\n }" ]
[ "0.6780722", "0.6707805", "0.6213834", "0.6169908", "0.6165343", "0.6165343", "0.6165343", "0.6124767", "0.6124767", "0.6091629", "0.6074819", "0.60746735", "0.60746735", "0.6063436", "0.605837", "0.6058022", "0.6058022", "0.6055699", "0.60401094", "0.6032258", "0.60275286", "0.59985477", "0.5984363", "0.59692276", "0.596673", "0.59524846", "0.5934421", "0.59315413", "0.5895665", "0.58879703", "0.5875786", "0.58370435", "0.5830512", "0.5800393", "0.5786821", "0.57778895", "0.5766307", "0.57569546", "0.5750816", "0.573036", "0.5704754", "0.5704754", "0.5661025", "0.56435055", "0.5633901", "0.5627067", "0.5613687", "0.5590302", "0.55725425", "0.55723137", "0.5553189", "0.5530136", "0.5495999", "0.54656255", "0.5464684", "0.5462079", "0.5457529", "0.5455415", "0.5451016", "0.5450536", "0.5450088", "0.5450088", "0.54443747", "0.54443747", "0.54443747", "0.54443747", "0.5440503", "0.5438603", "0.5436818", "0.5436818", "0.543005", "0.5430007", "0.5426383", "0.5426383", "0.54095346", "0.54020435", "0.5397054", "0.5395998", "0.5391879", "0.53841937", "0.5373105", "0.53664243", "0.53663987", "0.535836", "0.5352766", "0.5352766", "0.5352766", "0.53504384", "0.5349186", "0.53424776", "0.5318084", "0.5313757", "0.530694", "0.53055924", "0.5281292", "0.52798563", "0.5274116", "0.5263758", "0.5263758", "0.5263758", "0.52625483" ]
0.0
-1
Creating service handler class instance
@Override protected Void doInBackground(Void... arg0) { ServiceHandler sh = new ServiceHandler(); // Making a request to url and getting response String playlist = sh.makeServiceCall(url, ServiceHandler.GET); if(playlist != null){ playlistID = playlist; Log.d("pla", playlistID); SharedPreferences sharedPref = getActivity().getPreferences(Context.MODE_PRIVATE); SharedPreferences.Editor editor = sharedPref.edit(); editor.putString("playlist-"+getArguments().getString("username")+"-youtube",playlist); editor.commit(); String posts = sh.makeServiceCall("http://thewotimes.com/Y/current.php?user="+getString(R.string.uniser)+"&type=youtube&get=true", ServiceHandler.GET); res = posts; Log.d("stuff", posts); if (posts != null) { try { String filename = getArguments().getString("username")+"-youtube.txt"; String string = posts; FileOutputStream outputStream; try { outputStream = MainActivity.getAppContext().openFileOutput(filename, Context.MODE_PRIVATE); outputStream.write(string.getBytes()); outputStream.close(); } catch (Exception e) { e.printStackTrace(); } JSONArray t = new JSONArray(posts); // Log.d("length", ""+t.length()); for (int i = 0 ; i < t.length(); i++) { JSONObject playlist_dict = t.getJSONObject(i); // NSString *p =[[[[playlist_dict objectForKey:@"items"] objectAtIndex:0] objectForKey:@"snippet"] valueForKey:@"playlistId"]; String p = playlist_dict.getJSONArray("items").getJSONObject(0).getJSONObject("snippet").getString("playlistId"); // Log.d("p", p); if(p.equals(playlist)){ json_dic = playlist_dict; } // do some work here on intValue } items = json_dic.getJSONArray("items"); String nextToken = json_dic.get("nextPageToken").toString(); nextPageToken = nextToken; } catch (JSONException e) { e.printStackTrace(); } } else { Log.e("ServiceHandler", "Couldn't get any data from the url"); } } else { Log.e("ServiceHandler", "Couldn't get any data from the url"); } return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "CreateHandler()\n {\n }", "public InternalNameServiceHandler() {\n }", "public GenericHandler() {\n\n }", "@Override\n public java.lang.AutoCloseable createInstance() {\n logger.info(\"Creating the Registry Handler Implementation Instance...\");\n\n DataBroker dataBrokerService = getDataBrokerDependency();\n RpcProviderRegistry rpcProviderRegistry = getRpcRegistryDependency();\n RegistryHandlerProvider provider = new RegistryHandlerProvider(dataBrokerService, rpcProviderRegistry);\n\n logger.info(\"Creating the Registry Handler Implementation created...\");\n\n return provider;\n }", "@Override\r\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\",\r\n 10);\r\n thread.start();\r\n\r\n // Get the HandlerThread's Looper and use it for our Handler\r\n serviceLooper = thread.getLooper();\r\n serviceHandler = new ServiceHandler(serviceLooper);\r\n }", "void createHandler(final String handlerClassName);", "@Override\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\");\n thread.start();\n\n // Get the HandlerThread's Looper and use it for our Handler\n mLooper = thread.getLooper();\n mServiceHandle = new ServiceHandle(mLooper);\n }", "Service newService();", "Handler getHandler(Service service, HandlerFactory handlerFactory) {\n String serializationName = \"PROTOBUF\";\n Driver.Serialization serialization;\n try {\n serialization = Driver.Serialization.valueOf(serializationName);\n } catch (Exception e) {\n LOG.error(\"Unknown message serialization type for \" + serializationName);\n throw e;\n }\n\n Handler handler = handlerFactory.getHandler(service, serialization);\n LOG.info(\"Instantiated \" + handler.getClass() + \" for Quark Server\");\n\n return handler;\n }", "private HandlerBuilder() {\n }", "private Service() {}", "@Override\r\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\",\r\n Process.THREAD_PRIORITY_BACKGROUND);\r\n thread.start();\r\n\r\n // Get the HandlerThread's Looper and use it for our Handler\r\n mServiceLooper = thread.getLooper();\r\n mServiceHandler = new ServiceHandler(mServiceLooper);\r\n }", "private ServiceGen() {\n }", "public Handler(Class<?> implementation) {\r\n this.implementation = implementation;\r\n }", "@Override\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\", Process.THREAD_PRIORITY_BACKGROUND);\n thread.start();\n\n //Get the HandlerThread's Looper and use it for ur Handler\n mServiceLooper = thread.getLooper();\n mServiceHandler = new ServiceHandler(mServiceLooper);\n }", "public SwitchYardServiceTaskHandler() {\n }", "@Override\n\tpublic void onCreate() {\n\t\t\n\t\tHandlerThread thread = new HandlerThread(\"ServiceStartArguments\",\n\t\t\t\tProcess.THREAD_PRIORITY_BACKGROUND);\n\t\tthread.start();\n\t\t// Get the HandlerThread's Looper and use it for our Handler\n\t\tmServiceLooper = thread.getLooper();\n\t\tmServiceHandler = new ServiceHandler(mServiceLooper);\n\t}", "static SecurityHandler create() {\n return DEFAULT_INSTANCE;\n }", "private ServiceFactory() {}", "private ServiceGenerator() {\n }", "private ServiceGenerator() {\n }", "private ServiceGenerator() {\n }", "public Hello(Handler handler){\n this.handler = handler;\n }", "PaymentHandler createPaymentHandler();", "public ServiceHandler createServiceHandler(\n Reactor reactor,\n SelectableChannel handle) {\n try {\n return new TestAcceptHandler(reactor, handle, this._pool);\n } catch (IOException ex) {\n MDMS.ERROR(ex.getMessage());\n return null;\n }\n }", "public Service(){\n\t\t\n\t}", "private PersonHandler() {\n }", "public RequestUrlHandler() {\n // requestService = SpringContextHolder.getBean(ScfRequestService.class);\n }", "private SparkeyServiceSingleton(){}", "public SwitchYardServiceTaskHandler() {\n super(SWITCHYARD_SERVICE);\n }", "private ServiceConstructorArguments(\n Class<? extends Service> implementation,\n Class<?> configClass,\n String configID,\n Object config,\n String serviceID,\n Class<? extends Service> serviceClass,\n Service serviceInstance\n ) {\n this.implementation = implementation;\n this.configClass = configClass;\n this.configID = configID;\n this.config = config;\n this.serviceID = serviceID;\n this.serviceClass = serviceClass;\n this.serviceInstance = serviceInstance;\n }", "public RESTWorkItemHandler() {\n\t}", "public ConfigParserHandler() {\n\t}", "public PolicyServiceDelegate()\n {\n log.debug(\"\") ;\n log.debug(\"----\\\"----\") ;\n log.debug(\"PolicyServiceDelegate()\") ;\n try\n {\n service = getService(CommunityConfig.getServiceUrl());\n }\n catch(Exception e) {\n e.printStackTrace();\n service = null;\n }\n log.debug(\"----\\\"----\") ;\n log.debug(\"\") ;\n }", "public ConsoleHandler createConsoleHandler () {\r\n\t\t\t\r\n\t\tConsoleHandler consoleHandler = null;\r\n\t\t\t\r\n\t\ttry {\r\n\t\t \t\r\n\t\t\tconsoleHandler = new ConsoleHandler();\r\n\t\t\t\t\r\n\t\t} catch (SecurityException e) {\r\n\t\t\t\t\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t \r\n\t\t return consoleHandler;\r\n\t}", "public RequestHandler getRequestHandlerInstance() {\n Object obj;\n try {\n obj = klass.newInstance();\n } catch (Exception e) {\n throw new RuntimeException(\"Problem during the Given class instanciation please check your contribution\", e);\n }\n if (obj instanceof RequestHandler) {\n RequestHandler rh = (RequestHandler) obj;\n rh.init(properties);\n return rh;\n }\n\n throw new RuntimeException(\"Given class is not a \" + RequestHandler.class + \" implementation\");\n }", "DispatchingProperties() {\r\n\t\tsuper();\r\n\t\t// if (handler != null) {\r\n\t\t// throw new\r\n\t\t// RuntimeException(\"ServicePropertiesHandler: class already instantiated!\");\r\n\t\t// }\r\n\t\t// handler = this;\r\n\t}", "public abstract ServiceDelegate createServiceDelegate(java.net.URL wsdlDocumentLocation,\n QName serviceName, Class<? extends Service> serviceClass);", "CdapService createCdapService();", "@Override\n public void onCreate() {\n HandlerThread thread = new HandlerThread(\"ServiceStartArguments\", THREAD_PRIORITY_BACKGROUND);\n thread.start();\n Log.d(\"LOG19\", \"DiscoveryService onCreate\");\n\n this.mLocalBroadCastManager = LocalBroadcastManager.getInstance(this);\n // Get the HandlerThread's Looper and use it for our Handler\n mServiceLooper = thread.getLooper();\n\n mServiceHandler = new ServiceHandler(mServiceLooper);\n }", "private ServiceLocator(){}", "Fog_Services createFog_Services();", "private static interface Service {}", "private void initializeHandler() {\n if (handler == null) {\n handler = AwsHelpers.initSpringBootHandler(Application.class);\n }\n }", "public InitService() {\n super(\"InitService\");\n }", "SourceBuilder createService();", "public ServiceGenerator(String function, ParsingResult parsingResult, String targetRootDir, String serviceName,\r\n\t\t\tConfig config, DatabaseConnectionHandler dbHandler) {\r\n\t\tthis.config = config;\r\n\t\tthis.dbHandler = dbHandler;\r\n\t\tthis.unalteredFunction = function;\r\n\t\tthis.parsingResult = parsingResult;\r\n\t\tthis.targetRootDir = targetRootDir;\r\n\t\tthis.serviceName = serviceName;\r\n\t}", "public static void bindServiceHandler(final Binder binder,\n\t\t\t\t\t\t\t\t\t\t final Class<? extends ServiceHandler> serviceHandlerType,final String name) {\n\t\tbinder.bind(ServiceHandler.class)\n\t\t\t .annotatedWith(Names.named(name))\n\t\t\t .to(serviceHandlerType)\n\t\t\t .in(Singleton.class);\n\t}", "IServiceContext createService(Class<?>... serviceModules);", "public VehmonService() {\n }", "Service_Resource createService_Resource();", "CdapServiceInstance createCdapServiceInstance();", "public Service(int id)\r\n {\r\n this.id = id;\r\n \r\n logger = new Logger(this);\r\n }", "public interface CommandHandlerFactory {\n public CommandHandler getHandler(Command command);\n}", "public void service_INIT(){\n }", "public static <S> S createService(Context context, Class<S> serviceClass) {\n return ApiClient.getClient(RemoteConfiguration.BASE_URL).create(serviceClass);\n }", "private TemplateService() {\n }", "public Class<?> getHandler();", "private void initService() {\r\n\t}", "public ContentItemServiceHandlerTest(String name) {\r\n\t}", "private ServiceDomains() {\n }", "public ServiceFactoryImpl() {\n\t\tsuper();\n\t}", "public static IProtocolHandler createHandler(String type) {\n if (type==null) {\n return new RestHandler(); //use REST by default\n } else if (type.equalsIgnoreCase(\"rest\")) {\n return new RestHandler();\n } else if (type.equalsIgnoreCase(\"soap\")) {\n //for future use\n return null;\n } else {\n throw new IllegalArgumentException(\"Unknown protocol type: \" + type);\n }\n }", "private RecipleazBackendService() {\n }", "protected Proxy(InvocationHandler h) { }", "public HelloIntentService() {\n super(\"HelloIntentService\");\n }", "go.micro.runtime.RuntimeOuterClass.Service getService();", "go.micro.runtime.RuntimeOuterClass.Service getService();", "go.micro.runtime.RuntimeOuterClass.Service getService();", "private MultibinderFactory() { }", "private synchronized Handler getCustomHandler( ) {\n if( (customHandler != null ) \n ||(customHandlerError) ) \n {\n return customHandler;\n }\n LogService logService = getLogService( );\n if( logService == null ) {\n return null;\n }\n String customHandlerClassName = null;\n try {\n customHandlerClassName = logService.getLogHandler( );\n\n customHandler = (Handler) getInstance( customHandlerClassName );\n // We will plug in our UniformLogFormatter to the custom handler\n // to provide consistent results\n if( customHandler != null ) {\n customHandler.setFormatter( new UniformLogFormatter(componentManager.getComponent(Agent.class)) );\n }\n } catch( Exception e ) {\n customHandlerError = true; \n new ErrorManager().error( \"Error In Initializing Custom Handler \" +\n customHandlerClassName, e, ErrorManager.GENERIC_FAILURE );\n }\n return customHandler;\n }", "@Override\n\tprotected ManageEventHandler createEventHandler() {\n\t\tif (m_handler == null)\n\t\t\tm_handler = new BankKeepEventHandler(this, createController());\n\t\treturn m_handler;\n\t}", "protected FedoraContentModelHandler() {\r\n }", "protected OpUserServiceImpl createServiceImpl() {\r\n return new OpUserServiceImpl();\r\n }", "public SapFactoryImpl() {\n super();\n }", "public static WPVService createInstance() {\n if ( CONFIG != null )\n return new WPVService( CONFIG );\n return null;\n }", "protected EventService getEventService() {\n return new EventService() {\n\n @Override\n public void removeHandler(final String eventType, final SHandler<SEvent> handler) throws HandlerUnregistrationException {\n }\n\n @Override\n public void removeAllHandlers(final SHandler<SEvent> handler) throws HandlerUnregistrationException {\n }\n\n @Override\n public Map<String, Set<SHandler<SEvent>>> getRegisteredHandlers() {\n return Collections.emptyMap();\n }\n\n @Override\n public Set<SHandler<SEvent>> getHandlers(final String eventType) {\n return null;\n }\n\n @Override\n public SEventBuilder getEventBuilder() {\n return getSEventBuilder();\n }\n\n private SEventBuilder getSEventBuilder() {\n return new SEventBuilder() {\n\n private SEvent event;\n\n @Override\n public SEventBuilder createNewInstance(final String type) {\n event = new SEvent() {\n\n @Override\n public String getType() {\n return type;\n }\n\n @Override\n public Object getObject() {\n return null;\n }\n\n @Override\n public void setObject(final Object ob) {\n }\n };\n return this;\n }\n\n @Override\n public SEvent done() {\n return event;\n }\n\n @Override\n public SEventBuilder setObject(final Object ob) {\n event.setObject(ob);\n return this;\n }\n\n @Override\n public SEventBuilder createInsertEvent(final String type) {\n return this;\n }\n\n @Override\n public SEventBuilder createDeleteEvent(final String type) {\n return this;\n }\n\n @Override\n public SEventBuilder createUpdateEvent(final String type) {\n return this;\n }\n };\n\n }\n\n @Override\n public void fireEvent(final SEvent event) throws FireEventException {\n }\n\n @Override\n public void addHandler(final String eventType, final SHandler<SEvent> handler) throws HandlerRegistrationException {\n }\n\n @Override\n public boolean hasHandlers(final String eventType, final EventActionType actionType) {\n return false;\n }\n };\n }", "public CallAppAbilityConnnectionHandler createHandler() {\n EventRunner create = EventRunner.create();\n if (create != null) {\n return new CallAppAbilityConnnectionHandler(create);\n }\n HiLog.error(LOG_LABEL, \"createHandler: no runner.\", new Object[0]);\n return null;\n }", "private void initService() {\n \tlog_d( \"initService()\" );\n\t\t// no action if debug\n if ( BT_DEBUG_SERVICE ) return;\n // Initialize the BluetoothChatService to perform bluetooth connections\n if ( mBluetoothService == null ) {\n log_d( \"new BluetoothService\" );\n \t\tmBluetoothService = new BluetoothService( mContext );\n\t }\n\t\tif ( mBluetoothService != null ) {\n log_d( \"set Handler\" );\n \t\tmBluetoothService.setHandler( sendHandler );\n\t }\t\t\n }", "private AnagramService() {\n\t}", "abstract public TelnetServerHandler createHandler(TelnetSocket s);", "ByteHandler getInstance();", "public RiftsawServiceLocator() {\n }", "public Handler getHandler();", "@SuppressWarnings(\"unchecked\")\n public static <T> T create(Class<?> klass, MethodInterceptor handler)\n throws InstantiationException {\n // Don't ask me how this work...\n final Enhancer enhancer = new Enhancer();\n enhancer.setSuperclass(klass);\n enhancer.setInterceptDuringConstruction(true);\n enhancer.setCallbackType(handler.getClass());\n final Class<?> proxyClass = enhancer.createClass();\n final Factory proxy =\n (Factory) ClassInstantiatorFactory.getInstantiator().newInstance(proxyClass);\n proxy.setCallbacks(new Callback[] { handler });\n return (T) proxy;\n }", "private void initHandler(Class<? extends Handler> handlerClass) throws InstantiationException, IllegalAccessException {\n\t\tsynchronized (waitingThreads) {\n\t\t\t/* start waiting handler threads */\n\t\t\twhile (waitingThreads.size() < handlers) {\n\t\t\t\tHandler h = addHandler(handlerClass.newInstance());\n\n\t\t\t\th.setHandlerPool(this);\n\t\t\t\th.start(); // start this handler thread\n\t\t\t}\n\t\t\t\n\t\t\tclosed = Boolean.FALSE;\n\t\t}\n\t}", "@Inject\n public SkillHandler(ISkillService skillService) {\n if (skillService == null) {\n throw new NullPointerException(\"skill service was null\");\n }\n\n this.fSkillSPI = skillService;\n }", "public SwitchYardServiceTaskHandler(String name) {\n super(name);\n }", "public abstract ServiceLocator create(String name);", "public static <T> T createService(Class<T> service) {\n return getInstanceRc().create(service);\n }", "@Override\n public void onCreate() {\n super.onCreate();\n handler = new Handler();\n BusProvider.register(this);\n }", "protected CommunicationsHandler(){}", "public TestService() {}", "ProgramActuatorService createProgramActuatorService();", "public RecordService() {\n super(\"RecordService\");\n }", "default Handler asHandler() {\n return new HandlerBuffer(this);\n }", "public interface IAPIServiceHandler<T> {\n void beforeStarting();\n\n void onSuccess(T result);\n\n void onFail();\n }", "public static <S> S createService(Class<S> serviceClass, String baseUrl) {\n return createService(serviceClass, baseUrl, null);\n }", "@Override\n\t\tpublic Service getService() {\n\t\t\treturn new Implementation1();\n\t\t}", "public DictionaryHandler() {\n\t}", "void init(HandlerContext context);" ]
[ "0.75162107", "0.7258091", "0.6739117", "0.66412854", "0.65841633", "0.6574419", "0.6513665", "0.64903134", "0.64754814", "0.63773835", "0.6354596", "0.6351367", "0.63301486", "0.6324524", "0.62904763", "0.6282285", "0.62756526", "0.6274459", "0.625382", "0.6220213", "0.62055045", "0.62055045", "0.61942816", "0.6177658", "0.6177256", "0.6148658", "0.61112726", "0.61007804", "0.60982376", "0.60931224", "0.6088941", "0.60299605", "0.60275644", "0.6010275", "0.5976568", "0.5971325", "0.5956283", "0.59515595", "0.59425277", "0.59402233", "0.5934476", "0.59301704", "0.59226406", "0.5921834", "0.59160954", "0.5882337", "0.58677083", "0.5856571", "0.5856427", "0.58558387", "0.5836449", "0.58342594", "0.5814027", "0.5802028", "0.579781", "0.5784363", "0.5775761", "0.5774778", "0.5755898", "0.57394946", "0.5736351", "0.5733769", "0.57097745", "0.57090056", "0.5699748", "0.5698823", "0.569645", "0.569645", "0.569645", "0.56960076", "0.56941223", "0.5692174", "0.5684188", "0.56722873", "0.56714046", "0.5669477", "0.566913", "0.5665857", "0.5665746", "0.56596744", "0.5657044", "0.56446135", "0.56336856", "0.5629809", "0.5624385", "0.5622843", "0.56221306", "0.5609222", "0.56083906", "0.5608055", "0.5607607", "0.5604079", "0.55890644", "0.5586525", "0.5585219", "0.55798686", "0.5579049", "0.55789876", "0.55743104", "0.5573362", "0.5571654" ]
0.0
-1
When clicked, show a toast with the TextView text or do whatever you need.
public void onItemClick(AdapterView<?> parent, View view, int position, long id) { try { JSONObject temp_items = items.getJSONObject(position); String ida = temp_items.getJSONObject("snippet").getJSONObject("resourceId").getString("videoId"); // MainActivity.setYoutubeVideo(ida); // getActivity().getActionBar().hide(); Intent intent = new Intent(MainActivity.getAppContext(), YoutubeActivity.class); Bundle extras = new Bundle(); extras.putString("vidid", ida); Log.d("A", position + ""); intent.putExtras(extras); startActivity(intent); } catch (JSONException e) { e.printStackTrace(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onClick(View v) {\n String toastText = \"Hello World\";\n\n // This is how long we want to show the toast\n int duration = Toast.LENGTH_SHORT;\n\n // Get the context\n Context context = getApplicationContext();\n\n // Create the toast\n Toast toast = Toast.makeText(context, toastText, duration);\n\n // Show the toast\n toast.show();\n }", "@Override\n public void onClick(View v) {\n\n String s = v.getTag().toString();\n int duration = Toast.LENGTH_SHORT;\n Toast toast = Toast.makeText(context, s, duration);\n toast.show();\n }", "public void showToast(View clickedButton) {\n String greetingText = getString(R.string.greeting_text);\n Toast tempMessage\n = Toast.makeText(this, greetingText,\n Toast.LENGTH_SHORT);\n tempMessage.show();\n }", "public void showToast(String text){\n Toast.makeText(this,text,Toast.LENGTH_SHORT).show();\n }", "private void displayToast(CharSequence text){\n Context context = getApplicationContext();\n int duration = Toast.LENGTH_SHORT;\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n }", "protected void showToast(CharSequence text) {\r\n\t Context context = getApplicationContext();\r\n\t int duration = Toast.LENGTH_SHORT;\r\n\t \r\n\t Toast toast = Toast.makeText(context, text, duration);\r\n\t toast.show();\r\n\t}", "@Override\n public void onClick(View v) {\n Context context = getApplicationContext();\n // When the Hello button on the app is pressed this line of code will show *Hello, how are you?!\"\n Toast toast = Toast.makeText(context,\n \"Contact details for the college are - \" +\n \"\\n\\t CSN College, Tramore Road, Co.Cork\" +\n \"\\n\\t Phone number: 021-4961020\" +\n \"\\n\\t Email: [email protected]\", Toast.LENGTH_LONG);\n // This is for the toast message to show.\n toast.show();\n\n }", "@Override\n public void onClick(View v) {\n\n Toast toast = Toast.makeText(getApplicationContext(), \"Coming soon.\", Toast.LENGTH_SHORT);\n toast.show();\n\n }", "public void onToast (View view)\r\n\t{\r\n\t\t// Respond to the button click\r\n\t\tdoToast ();\r\n\t}", "@Override\n public void onClick(View v) {\n Toast.makeText(mContext, \"You Clicked \" + position, Toast.LENGTH_LONG).show();\n }", "@Override\n public void onClick(View v) {\n Toast.makeText(getContext(),\"hey uuuu clicked me \",Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onClick(View v) {\n Toast.makeText(MainActivity.this, \"Hello World\", Toast.LENGTH_LONG).show();\n }", "@Override\n public void onClick(View v) {\n Toast.makeText(context, \"You Clicked \" + titles.get(position), Toast.LENGTH_SHORT).show();\n }", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position,\n\t\t\tlong id) {\n\t\tString text=listview.getItemAtPosition(position)+\"\";\n\t\tToast tipsToast=Toast.makeText(this, \"position+\"+position+\"text=\"+text, Toast.LENGTH_SHORT);\n\t\ttipsToast.show();\n\t}", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tToast.makeText(getApplication(), \"right\", 1).show();\r\n\t\t\t}", "@Override\n public void onClick(View v) {\n ((TextView) findViewById(R.id.text)).setText(\"Android is AWESOME!!\");\n }", "@Override\n\t\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\t\tint position, long id) {\n\t\t\t\t\tToast.makeText(MainActivity.this, \"我被点击了\", 0).show();\n\t\t\t\t}", "@Override\n public void onClick(View v) {\n \tSystem.out.println(\"ss1ss\");\n //Toast.makeText(ListViewActivity.this, title[mPosition], Toast.LENGTH_SHORT).show();\n }", "public void showToast(View view) {\n // Switch based on button ID\n switch (view.getId()) {\n case R.id.popular_movies:\n case R.id.stock_hawk:\n case R.id.build_it_bigger:\n case R.id.make_your_app_material:\n case R.id.go_ubiquitous:\n case R.id.capstone:\n displayToast(\"This button will launch \" +\n ((Button) view).getText().toString()\n + \" app!\");\n break;\n\n default:\n break;\n }\n }", "public void showMessage(String text)\n {\n Toast.makeText(this, text, Toast.LENGTH_SHORT).show();\n }", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\tToast.makeText(getApplicationContext(), \"Selected Text Is...\"+names[arg2]+\":\"+phones[arg2], 5000).show();\n\t\t\t}", "public void showToast(String text)\n {\n Text icon = GlyphsDude.createIcon(FontAwesomeIconName.CHECK_CIRCLE,\"1.5em\");\n icon.setFill(Color.WHITE);\n Label l = new Label(text) ;\n l.setTextFill(Color.WHITE);\n l.setGraphic(icon);\n snackbar = new JFXSnackbar(PrinciplePane);\n snackbar.enqueue( new JFXSnackbar.SnackbarEvent(l));\n }", "private static void showToastText(String infoStr, int TOAST_LENGTH) {\n Context context = null;\n\t\ttoast = getToast(context);\n\t\tTextView textView = (TextView) toast.getView().findViewById(R.id.tv_toast);\n\t\ttextView.setText(infoStr);\n textView.setTypeface(Typeface.SANS_SERIF);\n\t\ttoast.setDuration(TOAST_LENGTH);\n\t\ttoast.show();\n\t}", "@Override\n public void toastText(String s){\n Toast.makeText(getApplicationContext(), s, Toast.LENGTH_SHORT).show();\n }", "private void doToast() {\n\t\tEditText editText = (EditText) findViewById(R.id.edit_message);\r\n\t\tString message = editText.getText().toString();\r\n\t\t\r\n\t\t// Create and send toast\r\n\t\tContext context = getApplicationContext();\r\n\t\tint duration = Toast.LENGTH_SHORT;\r\n\t\tToast toast = Toast.makeText(context, message, duration);\r\n\t\ttoast.show();\r\n\t}", "public void onClick(View v) {\n lbl.setText(\"Hola jose\");\n }", "public void onClick(View v) {\n Toast.makeText( getActivity(),\"Voice Recognition\", Toast.LENGTH_SHORT).show();\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tToast.makeText(getApplicationContext(), \"Button 1\", Toast.LENGTH_SHORT).show();\n\t\t\t}", "public void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t\tToast.makeText(getApplicationContext(),\n\t\t\t\t\t\t((TextView) view).getText() + \" is an awesome prof!\",\n\t\t\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t\t}", "public void toastMsg(View v){\n String msg = \"Message Sent!\";\n Toast toast = Toast.makeText(this,msg,Toast.LENGTH_SHORT);\n toast.show();\n }", "public void showToast(View view) {\n // Initialize an object named 'toast' using the 'Toast' class\n Toast toast = Toast.makeText(this, R.string.toast_message, Toast.LENGTH_SHORT);\n\n // Use the method 'show()' under the 'Toast' class to show a message\n toast.show();\n }", "void showToast(String message);", "void showToast(String message);", "protected void toastshow1() {\n \n\t\tToast toast=Toast.makeText(this, \"image and text\", Toast.LENGTH_LONG);\n\t\t\n\t\tLinearLayout linearLayout=new LinearLayout(this);\n\t\tlinearLayout.setOrientation(LinearLayout.VERTICAL);\n\t\tImageView imageView=new ImageView(this);\n\t\timageView.setImageResource(R.drawable.icon);\n\t\tButton button=new Button(this);\n\t\tbutton.setText(\"progress over\");\n\t\tView toastView=toast.getView();\n\t\tlinearLayout.addView(imageView);\n\t\tlinearLayout.addView(button);\n\t\tlinearLayout.addView(toastView);\n\t\t\n\t\ttoast.setView(linearLayout);\n\t\ttoast.show();\n\t\t\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tmService.sendMessageToUI(\"Hey! You changed my TextView!\");\n\t\t\t}", "@Override\n\tpublic void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\t\tString text = listview.getItemAtPosition(position)+\"\";\n\t\t\n\t\tToast.makeText(context, \"position=\"+position+\" text=\"+text, Toast.LENGTH_SHORT).show();\n\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tToast.makeText(context, \"You Clicked \"+imageId[position], Toast.LENGTH_LONG).show();\n\t\t\t}", "public static void showToast(Context context, String text) {\n //Toast.makeText(context, text, Toast.LENGTH_SHORT).show();\n showToastAtCenter(context, text);\n }", "public void onClick(View view){\n\n String name = mNameField.getText().toString();\n Toast.makeText(this,\"Hello There\"+name, Toast.LENGTH_LONG).show();\n\n }", "public void displayMessage(View view) {\n // I got the following line of code from StackOverflow: http://stackoverflow.com/questions/5620772/get-text-from-pressed-button\n String s = (String) ((Button)view).getText();\n CharSequence msg = new StringBuilder().append(\"This button will launch my \").append(s.toString()).append(\" app\").toString();\n Toast.makeText(view.getContext(),msg, Toast.LENGTH_SHORT).show();\n }", "private void showToast(String text, int length) {\r\n if (toast != null)\r\n toast.cancel();\r\n\r\n toast = Toast.makeText(this, text, length);\r\n toast.show();\r\n }", "@Override\n public void onClick(View v) {\n Toast.makeText(context, \"You Clicked \" + result[position], Toast.LENGTH_SHORT).show();\n }", "public void onClick(View v) {\n \tsetTxtViews();\n }", "@Override\n public void onClick(View view) {\n\n switch (view.getId()) {\n case R.id.tvSomeText:\n listener.sendDataToActivity(\"MainActivity: TextView clicked\");\n break;\n\n case -1:\n listener.sendDataToActivity(\"MainActivity: ItemView clicked\");\n break;\n }\n }", "@Override\n public void onClick(View v) {\n Toast.makeText(MainActivity.this, \"Goodbye!\", Toast.LENGTH_SHORT).show();\n }", "private void toast(String string){\n Toast.makeText(this, string, Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onClick(View view) {\n Toast.makeText(MeetDetails.this,\n \"WIP: Ir a EditarCita\", Toast.LENGTH_LONG).show();\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\r\n\t\t\r\n\t\t\t\tToast.makeText(getApplicationContext(), \"등록완료\", Toast.LENGTH_SHORT).show();\r\n\t\t\t\r\n\t\t\t\t\t \r\n\t\t\t}", "public void onClick(View btn) {\n String paintingDescription = (String) btn.getContentDescription();\n\n // MAKE A METHOD CALL TO DISPLAY THE INFORMATION\n displayToast(paintingDescription);\n }", "private void displayToast(String message) {\n Toast.makeText(OptionActivity.this, message, Toast.LENGTH_SHORT).show();\n }", "private void toast(String aToast) {\n Toast.makeText(getApplicationContext(), aToast, Toast.LENGTH_LONG).show();\n }", "private static void showToast(String stringToDisplay, Context context) {\n Toast.makeText(context, stringToDisplay, Toast.LENGTH_SHORT).show();\n }", "protected void showToast(String string)\r\n\t{\n\t\tToast.makeText(MainActivity.this, string, Toast.LENGTH_SHORT).show();\r\n\t}", "@Override\n\tprotected void onListItemClick(ListView l, View v, int position, long id) {\n\t\tToast.makeText(this, String.format(\"Clicked on item #%d with text %s\",\n\t\t\tposition, mAdapter.getItem(position)), Toast.LENGTH_SHORT).show();\n\t}", "@Override\n public void onClick(View v) {\n CustomToast.show(getContext(),\"Service will be available Soon\");\n }", "public void onClick(View v) \n {\n Button b = (Button) v;\n Toast.makeText(this.mAnchorView.getContext(), b.getText(), Toast.LENGTH_SHORT).show();\n this.dismiss();\n }", "private void messageToUser(CharSequence text)\n {\n Context context = getApplicationContext();\n int duration = Toast.LENGTH_SHORT;\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tToast.makeText(mContext, \"购物\", Toast.LENGTH_SHORT).show();\n\t\t\t}", "public static void toastText(Context context, String s)\n\t{\n\t\tif(Utils.ConstantVars.canToastDebugText) \n\t\t\tToast.makeText(context, s, 2 * Toast.LENGTH_LONG).show();\n\t}", "@Override\n\tpublic void onClick(View v) {\n\n\t\tIntent intent = null;\n\t\tintent = new Intent(this, MusicUi.class);\n\t\tintent.putExtra(\"text\", \"look\");\n\t\tintent.putExtra(\"texttitle\", text.getText());\n\n\t\t// startActivity(intent);\n\n\t}", "@Override\n public void onClick(View view) {\n //Metodos Getters y Setters\n tvSaludo.setVisibility(View.VISIBLE);\n tvSaludo.setText(\"HOLA ANDROIDS JUNIORS\"); // hard coding\n }", "static void displayToast(Handler handler, final Context con, final String text, final int toast_length){\n\t\thandler.post(new Runnable(){\n\t\t\tpublic void run(){\n\t\t\t\tToast.makeText(con, text, toast_length).show();\n\t\t\t}\n\t\t});\n\t}", "private void showToast(String message){\n\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n }", "public void ToastPopper(String t){\n Context context = getApplicationContext();\n CharSequence text = t;\n int duration = Toast.LENGTH_LONG;\n\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n try {\n Thread.sleep(3000);\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n }", "protected void showToast(String message) {\n\tToast.makeText(this, message, Toast.LENGTH_SHORT).show();\n}", "@Override\n public void onClick(View v) {\n\n\n Toast.makeText(MainSOSActivity.this, \"Stay Safe and Confirm the Message! Your emergnecy conctacts will be notified!\", Toast.LENGTH_SHORT).show();\n\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tToast.makeText(CanvasActivity.this, \"HIHIHI\", Toast.LENGTH_SHORT).show();\n\t\t\t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tString str = \"FeedBack : \" + feedbackText + \"\\n Rating : \" + String.valueOf(ratebar.getRating());\n\t\t\t\tToast.makeText(getApplicationContext(), str, Toast.LENGTH_LONG).show();\n\t\t\t}", "void toast(CharSequence sequence);", "@Override\n public void onClick(View v) {\n if (tvHello.getText().equals(getText(R.string.helloWorld)))\n {\n tvHello.setText(R.string.agur);\n }\n\n else\n {\n tvHello.setText(R.string.helloWorld);\n }\n }", "@Override\n public void onClick(View v) {\n Toast.makeText(c, \"yes\" + article.getWeblink(), Toast.LENGTH_LONG).show();\n }", "private void toastMessage (String message){\n Toast.makeText(this, message, Toast.LENGTH_SHORT).show();\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tBeginNewText();\r\n\t\t\t}", "private void toastMessage(String message){\n Toast.makeText(this,message, Toast.LENGTH_SHORT).show();\n }", "private void toastMessage(String message){\n Toast.makeText(this,message, Toast.LENGTH_SHORT).show();\n }", "void showToast(String value);", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tmsg();\n\t\t\t}", "public void onClick(View v) {\n Toast toast = Toast.makeText(getApplicationContext(), \"This button will launch my Capstone app!\", Toast.LENGTH_SHORT);\n toast.show();\n }", "public void onClick(DialogInterface arg0, int arg1) {\n // the button was clicked\n Toast.makeText(getApplicationContext(), \"Professional backhand-Male Video\", Toast.LENGTH_LONG).show();\n }", "@Override\n public void run() {\n if (mToast == null) {\n mToast = Toast.makeText(getApplicationContext(), text,\n Toast.LENGTH_SHORT);\n } else {\n mToast.setText(text);\n }\n mToast.show();\n }", "@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\t\t\tpublic void onItemClick(AdapterView<?> parent, View view,\n\t\t\t\t\tint position, long id) {\n\t\t\t\tToast.makeText(getActivity(), listAdapter.getItem(position), Toast.LENGTH_LONG).show();\n\t\t\t}", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Toast.makeText(this, \"ITEM CLICKED\", Toast.LENGTH_SHORT).show();\n }", "private void displayToast(String message) {\n Toast.makeText(getLayoutInflater().getContext(), message, Toast.LENGTH_SHORT).show();\n }", "public void textbutton_clicked(View v) {\n \t\tIntent intent = new Intent(this, TextcraftActivity.class);\n \t\t\n \t\tBundle bundle =new Bundle();\n \t\tbundle.putStringArray(\"test bundle\", new String[]{\"Hello\", \"World\"});\n \t\t\n \t\tintent.putExtras(bundle);\n \t\t\n \t\t// We use startActivityForResult so that when the textcraft activity finishes, we can detect\n \t\t// WHAT finished and get back specialized results\n\t\tstartActivityForResult(intent, TEXTCRAFT_REQCODE);\n\t\toverridePendingTransition(R.anim.fade_in, R.anim.fade_out);\n \t}", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tif (v instanceof TextView) {\r\n\t\t\t\t\tString string = (String)v.getTag();\r\n\t\t\t\t\tif (string!=null) {\r\n\t\t\t\t\t\tint position = Integer.parseInt(string);\r\n\t\t\t\t\t\tIntent intent = new Intent(getActivity(), EssayDetailActivity.class);\r\n\r\n\t\t\t\t\t\tintent.putExtra(\"currentEssayPosition\", position);\r\n\t\t\t\t\t\tintent.putExtra(\"category\", requestCategory);\r\n\t\t\t\t\t\tstartActivity(intent);\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}", "private void displayToast(String message) {\n\n //get the LayoutInflater and inflate the custom_toast layout\n LayoutInflater view = getLayoutInflater();\n View layout = view.inflate(R.layout.toast, null);\n\n //get the TextView from the custom_toast layout\n TextView text = layout.findViewById(R.id.txtMessage);\n text.setText(message);\n\n //create the toast object, set display duration,\n //set the view as layout that's inflated above and then call show()\n Toast toast = new Toast(getApplicationContext());\n toast.setDuration(Toast.LENGTH_LONG);\n toast.setView(layout);\n toast.show();\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tstartThread();\n\t\t\t Toast.makeText(getContext(), \"Êղسɹ¦\", 1).show();\n\t\t\t}", "public void onClick(View v) {\n Toast toast = Toast.makeText(getApplicationContext(), \"This button will launch my Scores app!\", Toast.LENGTH_SHORT);\n toast.show();\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tTextView tv1 = (TextView) findViewById(R.id.textView1);\n\t\t\t\tTextView tv2 = (TextView) findViewById(R.id.textView2);\n\t\t\t\tTextView tv3 = (TextView) findViewById(R.id.textView3);\n\t\t\t\t\n\t\t\t\tint a = Integer.parseInt(tv1.getText().toString());\n\t\t\t\tint b = Integer.parseInt(tv2.getText().toString());\n\t\t\t\tHelloCal cal = new HelloCal();\n\t\t\t\tint c = cal.helloAdd(a,b);\n\t\t\t\tString str = cal.helloSay(); \n\t\t\t\ttv3.setText(str + Integer.toString(c));\n\t\t\t}", "void toast(int resId);", "public void showToast(String msg){\n Toast.makeText(this, msg, Toast.LENGTH_SHORT).show();\n }", "@Override\n\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\tlong arg3) {\n\t\t\t\t\n\t\t\tToast.makeText(getBaseContext(), list.get(arg2),\n\t\t\t\tToast.LENGTH_SHORT).show();\n\t\t}", "static void makeToast(Context ctx, String s){\n Toast.makeText(ctx, s, Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n TextView channelTitle = (TextView) view.findViewById(R.id.channel_name);\n Toast.makeText(getActivity(), getString(R.string.click_on_channel_message)\n + \" \" + channelTitle.getText() + \"! :-)\", Toast.LENGTH_LONG).show();\n }", "public void onClick(View v) {\n \t\t// get the current context to display a Toast (below)\n \t\tContext context = getApplicationContext();\n\n \t\tCharSequence text;\n\n \t\t// figure out which button was clicked by comparing\n \t\t// the View's ID with known IDs.\n \t\tswitch(v.getId()) {\n\t \t\tcase R.id.one: text = \"one pushed!\"; break;\n\t \t\tcase R.id.two: text = \"two pushed!\"; break;\n\t \t\tcase R.id.three: text = \"three pushed!\"; break;\n\t \t\tcase R.id.four: text = \"four pushed!\"; break;\n\t \t\tcase R.id.five: text = \"five pushed!\"; break;\n\t \t\tcase R.id.six: text = \"six pushed!\"; break;\n\t \t\tdefault: text=\"Who knows what was pushed!\";\n \t\t}\n\n \t\t// show a Toast for a short amount of time, displaying\n \t\t// which button was pushed.\n \t\tint duration = Toast.LENGTH_SHORT;\n \t\tToast toast = Toast.makeText(context, text, duration);\n \t\ttoast.show();\n \t}", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tToast.makeText(context.getBaseContext(), \"a:\"+v.getId(), Toast.LENGTH_SHORT).show();\n\t\t\t}", "@Override\n public void onClick(View v) {\n Toast tst = Toast.makeText(MainActivity.this, \"test\", Toast.LENGTH_SHORT);\n tst.show();\n Test();\n }", "@Override\n\t\t \t public void onItemClick(AdapterView<?> arg0, View arg1,int position, long arg3) {\n\t\t \t \n\t\t \t Toast.makeText(getApplicationContext(), \"Clicked at Position\"+position, Toast.LENGTH_SHORT).show();\n\t\t \t }", "@Override\n public void onClick(View v) {\n onClickTwitt();\n }", "public void onClick(DialogInterface dialog, int id) {\n\r\n Context context = getApplicationContext();\r\n CharSequence text = \"Welcome \" + name + \"! Signing up...\";\r\n int duration = Toast.LENGTH_SHORT;\r\n\r\n Toast toast = Toast.makeText(context, text, duration);\r\n toast.show();\r\n }" ]
[ "0.7825363", "0.77406174", "0.7539003", "0.7409347", "0.7378426", "0.73124695", "0.7293316", "0.7275178", "0.7244123", "0.7208238", "0.71937823", "0.7175023", "0.71101505", "0.7085779", "0.7068756", "0.7068285", "0.7065549", "0.7035961", "0.7033898", "0.7022557", "0.7002013", "0.69999415", "0.69986993", "0.697956", "0.697554", "0.69716746", "0.6954733", "0.6944566", "0.6932807", "0.6930537", "0.69161856", "0.6915077", "0.6915077", "0.68684703", "0.6858206", "0.6847221", "0.6836595", "0.68266386", "0.68108046", "0.67987275", "0.6776908", "0.67760485", "0.6775941", "0.6771779", "0.6769874", "0.6764332", "0.6755845", "0.67506063", "0.6742478", "0.6728404", "0.67069834", "0.6700573", "0.66912776", "0.6691224", "0.6689296", "0.66849357", "0.6679308", "0.667479", "0.6660497", "0.6656821", "0.66502905", "0.664742", "0.66459775", "0.66351706", "0.66159314", "0.6615926", "0.66151094", "0.6608395", "0.6599899", "0.6597525", "0.65861326", "0.6585803", "0.6582078", "0.65760225", "0.65760225", "0.657228", "0.6556669", "0.65424883", "0.65340066", "0.65335613", "0.6533376", "0.65314126", "0.65255344", "0.6524249", "0.6521447", "0.6513516", "0.6511329", "0.650933", "0.6508902", "0.65073097", "0.6505685", "0.6501833", "0.65001535", "0.64994574", "0.6491234", "0.6490247", "0.6481336", "0.648105", "0.6477374", "0.64742935", "0.64736044" ]
0.0
-1
Get the data item for this position
@Override public View getView(int position, View convertView, ViewGroup parent) { YoutubeCell cell = getItem(position); // Check if an existing view is being reused, otherwise inflate the view if (convertView == null) { convertView = LayoutInflater.from(getContext()).inflate(R.layout.youtuber_layout, parent, false); } // Lookup view for data population ImageView yimg = (ImageView)convertView.findViewById(R.id.youtube_image); TextView t = (TextView) convertView.findViewById(R.id.youtube_title); Picasso.with(getContext()).load(cell.theImage).into(yimg); t.setText(cell.theTitle); // Populate the data into the template view using the data object // Return the completed view to render on screen return convertView; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Item getData()\r\n\t{\r\n\t\treturn theItem;\r\n\t}", "public E getData(int pos) {\n\t\tif (pos >= 0 && pos < dataSize()) {\n\t\t\treturn data.get(pos);\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\n\t}", "@Override\n\t\tpublic Object getItem(int position) {\n\t\t\treturn mDatas.get(position);\n\t\t}", "@Override\n public DataItemPosition getItem(int position) {\n return mDatas.get(position);\n }", "public Object getDataItem() {\n return this.dataItem;\n }", "public Object getItem(int position) {\n\t\treturn data.get(position);\r\n\t}", "public Object getItem(int position) {\n return _data.get(position);\n }", "@Override\n public Object getItem(int position) {\n return data.get(position);\n }", "@Override\n\tpublic Object getItem(int position) {\n\t\treturn data.get(position);\n\t}", "@Override\n\tpublic Object getItem(int position) {\n\t\treturn data.get(position);\n\t}", "@Override\n\tpublic Object getItem(int position) {\n\t\treturn data.get(position);\n\t}", "@Override\r\n public Object getItem(int position) {\n return data.get(position);\r\n }", "@Override\r\n\tpublic Object getItem(int position) {\n\t\treturn mData.get(position);\r\n\t}", "public DataItem getData() {\n return data;\n }", "@Override\n public Object getItem(int position) {\n return data.get(position);\n }", "@Override\n public Object getItem(int position) {\n return data.get(position);\n }", "@Override\r\n\tpublic Object getItem(int position) {\n\t\treturn datas.get(position);\r\n\t}", "@Override\r\n\tpublic Object getItem(int position) {\n\t\treturn datas.get(position);\r\n\t}", "@Override\n\tpublic Object getItem(int position) {\n\t\treturn datas.get(position);\n\t}", "@Override\n public Object getItem(int position) {\n return data;\n }", "public Object getItem(int position) {\n return datalist.get(position);\n }", "public Object getItem(int position) {\n return dataList.get(position);\n }", "public GenericItemType getData() {\n return this.data;\n }", "@Override\r\n\t\tpublic Object getItem(int position) {\n\t\t\treturn listData.get(position);\r\n\t\t}", "@Override\n public Item getItem(int position) {\n return data.get(position);\n }", "@Override\n\tpublic Object getItem(int arg0) {\n\t\treturn mData.get(arg0);\n\t}", "@Override\n\t\tpublic Object getItem(int position) {\n\t\t\treturn mlistData.get(position);\n\t\t}", "@Override\r\n\tpublic Object getItem(int arg0) {\n\t\treturn mData.get(arg0);\r\n\t}", "@Override\n\tpublic Object getItem(int position) {\n\t\treturn mDataList.get(position);\n\t}", "public String get(int position) {\r\n lastDataPosition = position;\r\n return data.get(lastDataPosition);\r\n }", "@Override\n public Object getItem(int position) {\n if(datas != null && position < datas.size() && position >= 0){\n return datas.get(position);\n }\n return null;\n }", "@Override\r\n\tpublic Object getItem(int arg0) {\n\t\treturn data.get(arg0);\r\n\t}", "@Override\n public Object getItem(int arg0) {\n return mData.get(arg0);\n }", "@Override\n public Object getItem(int position) {\n return listData.get(position);\n }", "@Override\n\tpublic SquareLiveModel getItem(int position) {\n\t\treturn listData.get(position);\n\t}", "@Override\n\tpublic Object getItem(int position) {\n\t\treturn datalist.get(position);\n\t}", "public Object getItem(int arg0) {\n\t\t\treturn data.get(arg0);\n\t\t}", "@Override\n\tpublic Object getItem(int position) {\n\t\treturn mlvData.get(position);\n\t}", "@Override\n\tpublic Object getItem(int position) {\n\t\treturn dataList.get(position);\n\t}", "@Override\n\tpublic Object getItem(int position) {\n\t\treturn dataList.get(position);\n\t}", "@Nullable\n public T getItem(@IntRange(from = 0) int position) {\n if (position < mData.size())\n return mData.get(position);\n else\n return null;\n }", "private String getItem(int position) {\n return data[position - 1];\n }", "@Override\n public Object getItem(int position) {\n return dataList.get(position);\n }", "@Override\n\tpublic String getItem(int position) {\n\t\treturn data.get(position);\n\t}", "public Object getItem(int position) { \n return mDataObjects.get(position); \n }", "public ListData getItem(int position)\n {\n return values.get(position);\n }", "public Object getData(){\n\t\treturn this.data;\n\t}", "@Override\n public Object getItem(int item) {\n return dataList.get(item);\n }", "@Override\n\tpublic IdValue getItem(int position) {\n\t\treturn idValues.get(position);\n\t}", "@Override\r\n public Object getChild(int groupPosition, int childPosition) {\n return mDataList.get(\"\" + groupPosition).get(childPosition);\r\n }", "public BoxItem.Info getItem() {\n return this.item;\n }", "E getData(int index);", "public Object getItem(int arg0) {\n\t\t\treturn dataList.get(arg0);\r\n\t\t}", "public E get(int pos) {\n \t\n \tif (pos < 0 || pos > numItems) {\n throw new IndexOutOfBoundsException();\n }\n \t\n \t/*\n \tif (pos == numItems-1) {\n \t\treturn lastNode.getData();\n }\n \t*/\n \t\n \tDblListnode<E> n = items.getNext();\n for (int k = 0; k < pos; k++) {\n n = n.getNext();\n }\n return n.getData();\n }", "public TDAPrioridad getDato(int pos) {\r\n return datos[pos];\r\n }", "public int getData(int index) {\n return data_.get(index);\n }", "public String get(int position)\n\t{\n\t\treturn data[position];\n\t}", "public Object getData() {\n\t\t\treturn null;// this.element;\n\t\t}", "public Object data() {\n return this.data;\n }", "public T getItem() {\n return item;\n }", "public Object getData() {\n\t\treturn data;\n\t}", "public DatasetItem getDatasetItem() {\n return (attributes.containsKey(KEY_DATASET_ITEM) ? (DatasetItem) attributes\n .get(KEY_DATASET_ITEM) : null);\n }", "public Object getData()\r\n\t\t{\r\n\t\t\treturn data;\r\n\t\t}", "public Object getData() {\r\n\t\t\treturn data;\r\n\t\t}", "public T getItem() {\n\t\treturn item;\n\t}", "public T getItem() {\n\t\treturn item;\n\t}", "@Override\n\t\tpublic Object getItem(int position) {\n\t\t\treturn BaseData.list.get(position);\n\t\t}", "@Override\n\t\tpublic Object getItem(int position) {\n\t\t\treturn message.array.get(position);\n\t\t}", "public int getTag(int position) {\r\n return dataTag.get(position);\r\n }", "@Override\r\n\tpublic E getData() {\n\t\treturn data;\r\n\t}", "public Object getItem(int position) {\n\t\t\treturn gnombre[position];\n\t\t}", "public E getData(){\n\t\t\treturn data;\n\t\t}", "@Override\n\tpublic Object getItem(int position) {\n\t\treturn dataSource.get(position);\n\t}", "public E getData() {\r\n\t\treturn data;\r\n\t}", "public Object getItem(int position) {\n\t\treturn events.get(position);\n\t}", "public int getData(int index) {\n return data_.get(index);\n }", "public BubbleData getBubbleData() { return (BubbleData)this.mData; }", "public T getX() {\n return data;\n }", "public Item getItem ()\n\t{\n\t\treturn item;\n\t}", "public T getItem() {\r\n return item;\r\n }", "public Object getData() {\n if (this.mInvitation != null) return this.mInvitation;\n else if (this.mChatMessageFragment != null) return this.mChatMessageFragment;\n else return null;\n }", "public int getData() {\n return this.data;\n }", "public T getData()\n\t{\n\t\treturn this.data;\n\t}", "public Item getItem() {\n\t\treturn this.item;\n\t}", "public Item getItem() {\n\t\treturn this.item;\n\t}", "@Override\r\n\t\tpublic Meta_data getData() {\n\t\t\treturn this.data;\r\n\t\t}", "public E getData() {\n return data;\n }", "public T getData() {\n return this.data;\n }", "public PData getData() {\n\t\treturn data;\n\t}", "public TitleDTO getItem(int position) {\n\t\t\treturn arrTitle.get(position);\n\t\t}", "public TitleDTO getItem(int position) {\n\t\t\treturn arrTitle.get(position);\n\t\t}", "public E getData() { return data; }", "public T getData(int index){\n if(index < 0 || index >= data.size())\n return null;\n\n //give back the data\n return data.get(index);\n }", "public ArrayOfItem getItem() {\r\n return localItem;\r\n }", "public Item getItem() {\r\n\t\treturn this.item;\r\n\t}", "public SpItem getItem() {\n return _spItem;\n }", "@Override\n\tpublic Object getItem(int position) {\n\t\treturn array.get(position);\n\t}", "Object getDataValue(final int row, final int column);", "public Object getItem(int position) {\n\t\treturn OReportOne.get(position);\n\t}", "public Data getData() {\n return data;\n }", "public Data getData() {\n return data;\n }" ]
[ "0.7668654", "0.731151", "0.72089416", "0.71677965", "0.7130208", "0.7076344", "0.70645505", "0.70532256", "0.7042189", "0.7042189", "0.7042189", "0.70360523", "0.7032629", "0.6959", "0.6956786", "0.6956786", "0.69467556", "0.69467556", "0.69104123", "0.6871041", "0.6827699", "0.6812586", "0.6802695", "0.6801953", "0.67860985", "0.6752288", "0.6732555", "0.67268413", "0.67054063", "0.67026263", "0.6679791", "0.6672056", "0.66684264", "0.66492325", "0.66461563", "0.6645873", "0.6625707", "0.6589671", "0.6572217", "0.6572217", "0.6571286", "0.6549029", "0.65464556", "0.65058756", "0.64889824", "0.6462878", "0.64314336", "0.6383995", "0.6353117", "0.6351189", "0.6335703", "0.63236636", "0.6320233", "0.63196313", "0.63037884", "0.62979305", "0.62950414", "0.62738", "0.6272995", "0.6271909", "0.6266127", "0.6262787", "0.6258756", "0.6254655", "0.6253725", "0.6253725", "0.62515825", "0.6249249", "0.6247676", "0.62365335", "0.6233035", "0.622878", "0.62259644", "0.6220017", "0.62199694", "0.6209388", "0.62046456", "0.6197702", "0.6195945", "0.619199", "0.61916137", "0.61839", "0.61789274", "0.61788934", "0.61788934", "0.6175576", "0.6173883", "0.6173774", "0.61694", "0.616044", "0.616044", "0.6158161", "0.61328167", "0.6124875", "0.6123582", "0.612205", "0.6121791", "0.6121193", "0.6120425", "0.61148196", "0.61148196" ]
0.0
-1
Handle action bar item clicks here. The action bar will automatically handle clicks on the Home/Up button, so long as you specify a parent activity in AndroidManifest.xml.
@Override public boolean onOptionsItemSelected(MenuItem item) { int id = item.getItemId(); //noinspection SimplifiableIfStatement if (id == R.id.action_settings) { finish(); return true; } return super.onOptionsItemSelected(item); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onOptionsItemSelected(MenuItem item) { 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\n //\n // HANDLE BACK BUTTON\n //\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // Back button clicked\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // app icon in action bar clicked; goto parent activity.\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n switch (id) {\r\n case android.R.id.home:\r\n // app icon in action bar clicked; go home\r\n this.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 if (id == android.R.id.home) {\n // app icon in action bar clicked; go home\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n Log.e(\"clik\", \"action bar clicked\");\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\t public boolean onOptionsItemSelected(MenuItem item) {\n\t int id = item.getItemId();\n\t \n\t\t\tif (id == android.R.id.home) {\n\t\t\t\t// Respond to the action bar's Up/Home button\n\t\t\t\t// NavUtils.navigateUpFromSameTask(this);\n\t\t\t\tonBackPressed();\n\t\t\t\treturn true;\n\t\t\t}\n\t \n\t \n\t return super.onOptionsItemSelected(item);\n\t }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n // Respond to the action bar's Up/Home button\r\n case android.R.id.home:\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n\n switch (item.getItemId()) {\n case android.R.id.home:\n\n // app icon in action bar clicked; goto parent activity.\n this.finish();\n return true;\n default:\n\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle presses on the action bar items\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n case R.id.action_clear:\n return true;\n case R.id.action_done:\n\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onActionHomePressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId())\n {\n case android.R.id.home :\n super.onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId ()) {\n case android.R.id.home:\n onBackPressed ();\n return true;\n\n default:\n break;\n }\n return super.onOptionsItemSelected ( item );\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t switch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\t// app icon in action bar clicked; go home \n\t\t\tIntent intent = new Intent(this, Kelutral.class); \n\t\t\tintent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); \n\t\t\tstartActivity(intent); \n\t\t\treturn true;\t\t\n\t case R.id.Search:\n\t \treturn onSearchRequested();\n\t\tcase R.id.AppInfo:\n\t\t\t// Place holder menu item\n\t\t\tIntent newIntent = new Intent(Intent.ACTION_VIEW,\n\t\t\t\t\tUri.parse(\"http://forum.learnnavi.org/mobile-apps/\"));\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\n\t\tcase R.id.Preferences:\n\t\t\tnewIntent = new Intent(getBaseContext(), Preferences.class);\n\t\t\tstartActivity(newIntent);\n\t\t\treturn true;\t\n\t }\n\t return false;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n onBackPressed();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // Intent homeIntent = new Intent(this, MainActivity.class);\n // homeIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);\n // startActivity(homeIntent);\n finish();\n return true;\n default:\n return (super.onOptionsItemSelected(item));\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // setResult and close the activity when Action Bar Up Button clicked.\n if (item.getItemId() == android.R.id.home) {\n setResult(RESULT_CANCELED);\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n // This ID represents the Home or Up button. In the case of this\n // activity, the Up button is shown. Use NavUtils to allow users\n // to navigate up one level in the application structure. For\n // more details, see the Navigation pattern on Android Design:\n //\n // http://developer.android.com/design/patterns/navigation.html#up-vs-back\n //\n \tgetActionBar().setDisplayHomeAsUpEnabled(false);\n \tgetFragmentManager().popBackStack();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if(id == android.R.id.home){\n onBackPressed();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@RequiresApi(api = Build.VERSION_CODES.M)\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif(item.getItemId()==android.R.id.home)\r\n\t\t{\r\n\t\t\tgetActivity().onBackPressed();\r\n\t\t}\r\n\t\treturn super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if(item.getItemId()==android.R.id.home){\n super.onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n onBackPressed();\n return false;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n //Back arrow\n case android.R.id.home:\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // android.R.id.home是Android内置home按钮的id\n finish();\n break;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n super.onBackPressed();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n this.onBackPressed();\n return false;\n }\n return false;\n }", "@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\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n return true;\n default:\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n switch (item.getItemId()) {\r\n\r\n case android.R.id.home:\r\n /*Intent i= new Intent(getApplication(), MainActivity.class);\r\n i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);\r\n startActivity(i);*/\r\n onBackPressed();\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 switch (id){\n case android.R.id.home:\n this.finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Pass the event to ActionBarDrawerToggle, if it returns\n // true, then it has handled the app icon touch event\n if (mDrawerToggle.onOptionsItemSelected(item)) {\n return true;\n }\n\n // Handle your other action bar items...\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n // Respond to the action bar's Up/Home button\n case android.R.id.home:\n NavUtils.navigateUpFromSameTask(getActivity());\n return true;\n case R.id.action_settings:\n Intent i = new Intent(getActivity(), SettingsActivity.class);\n startActivity(i);\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n //Fixes the Up Button\n if(id == android.R.id.home) {\n BuildRoute.this.finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()){\n case android.R.id.home:\n onBackPressed();\n break;\n }\n return true;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if (id == android.R.id.home) {\n NavUtils.navigateUpFromSameTask(this);\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n break;\r\n }\r\n return true;\r\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tif (item.getItemId() == android.R.id.home) {\n\t\t\tfinish();\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n onBackPressed();\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if ( id == android.R.id.home ) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.home) {\r\n NavUtils.navigateUpFromSameTask(this);\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_about) {\r\n AboutDialog();\r\n return true;\r\n }\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == R.id.action_exit) {\r\n finish();\r\n return true;\r\n }\r\n\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n\n this.finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n//noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n// finish the activity\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item)\n {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if( id == android.R.id.home ) // Back button of the actionbar\n {\n finish();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\t\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\t\tswitch (item.getItemId()) {\r\n\t\t\tcase android.R.id.home:\r\n\t\t\t\tfinish();\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\treturn super.onOptionsItemSelected(item);\r\n\t\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n return true;\n }\n return false;\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n\n if(id == android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\r\n\t\tcase android.R.id.home:\r\n\t\t\tsetResult(RESULT_OK, getIntent());\r\n\t\t\tfinish();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n\n if (item.getItemId() == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n // If we got here, the user's action was not recognized.\n // Invoke the superclass to handle it.\n return super.onOptionsItemSelected(item);\n\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n\n case android.R.id.home:\n this.finish();\n return true;\n }\n return true;\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tint id = item.getItemId();\n\t\tif (id == android.R.id.home) {\n\t\t\tfinish();\n\t\t\treturn true;\n\t\t}\n\t\treturn super.onOptionsItemSelected(item);\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n if (id == android.R.id.home) {\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n onBackPressed();\n //NavUtils.navigateUpFromSameTask(this);\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n // todo: goto back activity from here\n finish();\n return true;\n\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\r\n // Handle item selection\r\n switch (item.getItemId()) {\r\n case android.R.id.home:\r\n onBackPressed();\r\n return true;\r\n\r\n case me.cchiang.lookforthings.R.id.action_sample:\r\n// Snackbar.make(parent_view, item.getTitle() + \" Clicked \", Snackbar.LENGTH_SHORT).show();\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 if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n\n\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tonBackPressed();\n\t\t\treturn true;\n\t\tcase R.id.scan_menu:\n\t\t\tonScan();\n\t\t\tbreak;\n\t\tcase R.id.opt_about:\n\t\t\t//onAbout();\n\t\t\tbreak;\n\t\tcase R.id.opt_exit:\n\t\t\tfinish();\n\t\t\tbreak;\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t\treturn true;\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n if (id == android.R.id.home) {\n super.onBackPressed();\n return true;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id) {\n case android.R.id.home:\n this.finish();\n return true;\n default:\n return super.onOptionsItemSelected(item);\n }\n }", "@Override\n public boolean onOptionsItemSelected(@NonNull MenuItem item) {\n if (item.getItemId() == android.R.id.home) {\n onBackPressed();\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n switch (id) {\n case android.R.id.home:\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n\n case android.R.id.home:\n finish();\n return true;\n\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if(id==android.R.id.home){\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\r\n\t switch (item.getItemId()) {\r\n\t \t// back to previous page\r\n\t case android.R.id.home:\r\n\t finish();\r\n\t return true;\r\n\t }\r\n\t return super.onOptionsItemSelected(item);\r\n\t}", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n if (id == android.R.id.home) {\n finish();\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\r\n\r\n //noinspection SimplifiableIfStatement\r\n if (id == android.R.id.home) {\r\n // finish the activity\r\n onBackPressed();\r\n return true;\r\n }\r\n\r\n return super.onOptionsItemSelected(item);\r\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId())\n {\n case android.R.id.home:\n this.finish();\n return (true);\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n if (id == android.R.id.home) {\n finish();\n return true;\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n switch (id){\n case R.id.home:{\n NavUtils.navigateUpFromSameTask(this);\n return true;\n }\n }\n return super.onOptionsItemSelected(item);\n }", "@Override\n public boolean onOptionsItemSelected(MenuItem item) {\n int id = item.getItemId();\n\n //noinspection SimplifiableIfStatement\n switch(item.getItemId())\n {\n case android.R.id.home:\n super.onBackPressed();\n break;\n }\n\n return super.onOptionsItemSelected(item);\n }", "@Override\n\tpublic boolean onOptionsItemSelected(MenuItem item) {\n\t\tswitch (item.getItemId()) {\n\t\tcase android.R.id.home:\n\t\t\tfinish();\n\t\t\treturn true;\n\n\t\tdefault:\n\t\t\treturn super.onOptionsItemSelected(item);\n\t\t}\n\t}", "@Override\r\n public boolean onOptionsItemSelected(MenuItem item) {\n\r\n int id = item.getItemId();\r\n if(id==android.R.id.home){\r\n finish();\r\n return true;\r\n }\r\n return super.onOptionsItemSelected(item);\r\n }" ]
[ "0.79039484", "0.78061193", "0.7765948", "0.772676", "0.76312095", "0.76217103", "0.75842994", "0.7530533", "0.748778", "0.7458179", "0.7458179", "0.7438179", "0.74213266", "0.7402824", "0.7391232", "0.73864055", "0.7378979", "0.73700106", "0.7362941", "0.73555434", "0.73453045", "0.7341418", "0.7330557", "0.7327555", "0.7326009", "0.7318337", "0.73160654", "0.73132724", "0.73037714", "0.73037714", "0.73011225", "0.7297909", "0.7293188", "0.72863173", "0.7282876", "0.72807044", "0.72783154", "0.72595924", "0.72595924", "0.72595924", "0.7259591", "0.72591716", "0.7249715", "0.72243243", "0.7219297", "0.7216771", "0.72042644", "0.72012293", "0.7199543", "0.7193037", "0.7184855", "0.7177254", "0.7168334", "0.7167477", "0.71536905", "0.7153523", "0.7135821", "0.7134834", "0.7134834", "0.7128953", "0.7128911", "0.71241933", "0.7123363", "0.71228945", "0.71219414", "0.7117495", "0.71173275", "0.71169853", "0.7116851", "0.7116851", "0.7116851", "0.7116851", "0.71148705", "0.7112308", "0.7109725", "0.71084905", "0.71055764", "0.70995593", "0.7098301", "0.7096311", "0.70935965", "0.70935965", "0.7086441", "0.7082852", "0.70806813", "0.70801675", "0.7073609", "0.70681775", "0.7061872", "0.7060011", "0.7059868", "0.70513153", "0.7037599", "0.7037599", "0.7036033", "0.70353055", "0.70353055", "0.70322436", "0.70304227", "0.70294935", "0.70187974" ]
0.0
-1
onPostExecute muestra el resultado de AsyncTask.
@Override protected void onPostExecute(String result) { imprime(result); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\t protected void onPostExecute(String result) {\n\t }", "protected void onPostExecute(String result) {\n }", "protected void onPostExecute(String result) {\r\n\r\n\t\t}", "@Override\n protected void onPostExecute(String result) {\n }", "@Override\n protected void onPostExecute(String result) {\n }", "@Override\n protected void onPostExecute(String result) {\n }", "@Override\n protected void onPostExecute(String result) {\n }", "@Override\n protected void onPostExecute(String result) {\n\n }", "@Override\n protected void onPostExecute(String result) {\n\n }", "protected void onPostExecute(Long result) {\n\t }", "protected void onPostExecute(Void result) {\n }", "public void onPostExecute(Result result) {\n }", "public void onPostExecute(Result result) {\n }", "public void onPostExecute(Result result) {\n }", "protected void onPostExecute(String result) {\n onTaskCompleted(result,jsoncode);\n }", "protected void onPostExecute(String result){\n }", "protected void onPostExecute(Long result) {\n }", "protected void onPostExecute(Long result) {\n }", "protected void onPostExecute(Long result) {\n\t\t}", "protected void onPostExecute(Void v) {\n\n }", "protected void onPostExecute(Void v) {\n\n }", "protected void onPostExecute() {\n }", "protected void onPostExecute() {\n }", "protected void onPostExecute(String resultado) {\n\t\t\ttextView.setText(\"\");\n\t\t\ttextView.setTextColor(Color.BLACK);\n\t\t\ttextView.setText(getString(R.string.main_1) +\"\\n\"+ getString(R.string.visit_final)+\"\\n\"+ getString(R.string.code)+ \" \"+ getString(R.string.participant)+ \": \"+partCaso.getParticipante().getParticipante().getCodigo());\n\t\t\tmVisitaFinalCasoAdapter = new VisitaFinalCasoAdapter(getApplication().getApplicationContext(), R.layout.complex_list_item, mVisitaFinalCaso);\n\t\t\tsetListAdapter(mVisitaFinalCasoAdapter);\n\t\t\tdismissProgressDialog();\n\t\t}", "protected void onPostExecute() {\n }", "protected void onPostExecute() {\r\n\t}", "protected void onPostExecute(Void v) {\n }", "@Override\n\tprotected void onPostExecute(String result) {\n\t\tLog.d(TAG, result);\n\t}", "@Override\n protected void onPostExecute(String result) {\n Log.i(\"this is the result\", \"HULA\");\n //Do anything with response..\n }", "protected void onPostExecute(String resultado) {\n dismissProgressDialog();\n showResult(resultado);\n }", "protected void onPostExecute(String resultado) {\n dismissProgressDialog();\n showResult(resultado);\n }", "protected void onPostExecute(Void v) {\n Log.v(\"Result\",response);\n }", "@Override\n protected void onPostExecute(String result) {\n mListener.onTaskCompleted(result);\n }", "@Override\n protected void onPostExecute(Void result) {\n\n }", "@Override\n protected void onPostExecute(String result) {\n Gson gson = new Gson(); //iz Jsona napravi objekte unutar jave\n ArhivaRoot arhivaRoot = gson.fromJson(result, ArhivaRoot.class);\n\n textView.setText(joinRows(arhivaRoot.getRows()));\n mProgressDialog.dismiss();\n }", "@Override\r\n protected void onPostExecute(String result) {\n\r\n }", "@Override\n protected void onPostExecute(Void aVoid) {\n }", "@Override\n\tprotected void onPostExecute(String result) {\n\t\tsuper.onPostExecute(result);\n\t\t\n\t}", "@Override\r\n\t\tprotected void onPostExecute(Void result)\r\n\t\t{\n\t\t}", "@Override\r\n\tprotected void onPostExecute(String result) {\n\t\tsuper.onPostExecute(result);\r\n\t}", "@Override\r\n protected void onPostExecute(String result) {\n\r\n }", "@Override\r\n\t\tprotected void onPostExecute(Void result) \r\n\t\t{\n\t\t}", "@Override\n protected void onPostExecute(final Void unused) {\n super.onPostExecute(unused);\n Log.i(\"Dict\", \"Done processing\");\n delegate.processFinish(result);\n }", "protected void onPostExecute(Void v) {\n\n\n }", "protected void onPostExecute(String result) {\n Gson gson = new Gson();\n Book book = gson.fromJson(result, Book.class);\n\n onDownloadAsyncTask.onComplete(book);\n }", "@Override\n protected void onPostExecute(String result) {\n super.onPostExecute(result);\n value=result;\n\n }", "@Override\n protected void onPostExecute (ArrayList<Event> result) {\n }", "protected void onPostExecute(Integer resultado) {\n\t\t\tpd.dismiss();\n\t\t\tif (respuesta != null){\n\t\t\t\tToast.makeText(getBaseContext(), respuesta.getMensaje(), Toast.LENGTH_SHORT).show();\n\t\t\t\tif (respuesta.isResultado()){\n\t\t\t\t\tregresar();\n\t\t\t\t}\n\t\t\t}\n\t\t}", "@Override\n protected void onPostExecute(Void result) {\n super.onPostExecute(result);//Run the generic code that should be ran when the task is complete\n onCompleteListener.onAsyncTaskComplete(result);//Run the code that should occur when the task is complete\n }", "@Override\n protected void onPostExecute(String result) {\n Log.i(TAG, \"STATUS IS: \" + result);\n }", "public void onPostExecute(ResultData resultdata) {\n this.f16350b.mo24178a(resultdata);\n }", "@Override\n protected void onPostExecute(Boolean result) {\n }", "@Override\n protected void onPostExecute(Boolean result) {\n }", "@Override\r\n\tprotected void onPostExecute(String result) {\r\n\t\tprogressDialog.setMessage(\"Finalizado!\");\r\n\t\t// fecha o dialog\r\n\t\tprogressDialog.dismiss();\r\n\t\tsuper.onPostExecute(result);\r\n\t}", "@Override\n protected void onPostExecute(Void result) {\n // This is where we would process the results if needed.\n this.progressDialog.dismiss();\n }", "@Override\n protected void onPostExecute(String result) {\n tvContenidoTarea.setText(result); // txt.setText(result);\n // might want to change \"executed\" for the returned string passed\n // into onPostExecute() but that is upto you\n }", "protected void onPostExecute(String serverData){\n }", "@Override protected void onPostExecute(String returnVal) {\r\n //Print the response code as toast popup \r\n //android.widget.Toast.makeText(\r\n // mContext, \"[myAsyncTask.onPostExecute] Response: \" + returnVal,\r\n // android.widget.Toast.LENGTH_LONG\r\n //).show();\r\n if (gHandlers != null) gHandlers.onPostExecute(returnVal);\r\n }", "@Override\r\n\t protected void onPostExecute(String result) {\r\n\t super.onPostExecute(result);\r\n\t \r\n\t ParserTask parserTask = new ParserTask();\r\n\t \r\n\t // Invokes the thread for parsing the JSON data\r\n\t parserTask.execute(result);\r\n\t }", "@Override\n protected void onPostExecute(String result) {\n super.onPostExecute(result);\n\n ParserTask parserTask = new ParserTask();\n\n // Invokes the thread for parsing the JSON data\n parserTask.execute(result);\n mProgressDialog.dismiss();\n }", "@Override\n protected void onPostExecute(String result) {\n super.onPostExecute(result);\n\n ParserTask parserTask = new ParserTask();\n\n // Invokes the thread for parsing the JSON data\n parserTask.execute(result);\n\n }", "@Override\n protected void onPostExecute(String result) {\n mProgressDialog.dismiss();\n //Success to retrieve data from the service\n mColor = result;\n // result = ColorList.parseColorJSON(mColor, mList);\n // color = mList.get(mColorId);\n // myGenerator = new Generator();\n ColorList.parseColorJSON(mColor, myGenerator);\n\n Log.d(TAG, \"is it working\");\n Toast.makeText(ColorActivity.this, \"HELLO\", Toast.LENGTH_LONG).show();\n setNextColor();\n }", "@Override\n\t\tprotected void onPostExecute(Void result) {\n\t\t\tsuper.onPostExecute(result);\n\t\t}", "@Override\n\t\tprotected void onPostExecute(Void result) {\n\t\t\tsuper.onPostExecute(result);\n\t\t}", "@Override\n protected void onPostExecute(String result) {\n super.onPostExecute(result);\n\n ParserTask parserTask = new ParserTask();\n\n // Invokes the thread for parsing the JSON data\n parserTask.execute(result);\n }", "@Override\n protected void onPostExecute(String result) {\n super.onPostExecute(result);\n\n ParserTask parserTask = new ParserTask();\n\n // Invokes the thread for parsing the JSON data\n parserTask.execute(result);\n }", "@Override\n protected void onPostExecute(String result) {\n super.onPostExecute(result);\n\n ParserTask parserTask = new ParserTask();\n\n // Invokes the thread for parsing the JSON data\n parserTask.execute(result);\n }", "@Override\n protected void onPostExecute(String result) {\n super.onPostExecute(result);\n\n ParserTask parserTask = new ParserTask();\n\n // Invokes the thread for parsing the JSON data\n parserTask.execute(result);\n }", "protected void onPostExecute(Integer result){\n\t Utils.logThreadSignature(this.tag);\n\t r.reportBack(tag, \"onPostExecute result:\" + result);\n\t pd.cancel();\n\t r.allDone(0);\n }", "@Override\n\t\t\tprotected void onPostExecute(Void result) {\n\t\t\t\tsuper.onPostExecute(result);\n\t\t\t}", "@Override\n\t\t\tprotected void onPostExecute(Void result) {\n\t\t\t\tsuper.onPostExecute(result);\n\t\t\t}", "@Override\r\n protected void onPostExecute(String result) {\r\n super.onPostExecute(result);\r\n\r\n ParserTask parserTask = new ParserTask();\r\n\r\n // Invokes the thread for parsing the JSON data\r\n parserTask.execute(result);\r\n }", "@Override\n protected void onPostExecute(String result) {\n traer_notificaciones_partido();\n }", "@Override\n protected void onPostExecute(String result){\n ParserTask parserTask = new ParserTask(viewHolder);\n\n // Start parsing the Google places in JSON format\n // Invokes the \"doInBackground()\" method of ParserTask\n parserTask.execute(result);\n }", "protected void onPostExecute(String result) {\n\t\tsuper.onPostExecute(result);\n\t\t\n\t\treceiver.onLoad(result);\n\t}", "@Override\n\t\tprotected void onPostExecute(String result) {\n\t\t\tsuper.onPostExecute(result);\n\n\t\t\tParserTask parserTask = new ParserTask();\n\n\t\t\t// Invokes the thread for parsing the JSON data\n\t\t\tparserTask.execute(result);\n\n\t\t}", "@Override\r\n\tprotected void onPostExecute(Integer result) {\n\t\tsuper.onPostExecute(result);\r\n\t}", "@Override\n protected void onPostExecute(String result) {\n // convert JSON string to a POJO\n JsonValidate jv = convertFromJson(result);\n if (jv != null) {\n Log.v(Constants.LOG_TAG, \"Conversion Succeed: \" + result);\n } else {\n Log.v(Constants.LOG_TAG, \"Conversion Failed\");\n }\n }", "@Override\n protected void onPostExecute(List<Parkingspot> result){\n\n if(result != null) {\n for (Parkingspot parkingspot : result) {\n Log.i(TAG, \"Address: \" + parkingspot.getAddress() + \" Location: \"\n + parkingspot.getLocation());\n\n }\n }\n }", "@Override\n protected void onPostExecute(Integer result) {\n super.onPostExecute(result);\n }", "@Override\r\n protected void onPostExecute(Void result) {\n\r\n }", "@Override\n\t\tprotected void onPostExecute(String result)\n\t\t{\n\t\t\tsuper.onPostExecute(result);\n\n\t\t\tParserTask parserTask = new ParserTask();\n\n\t\t\t// Invokes the thread for parsing the JSON data\n\t\t\tparserTask.execute(result);\n\n\t\t}", "@Override\n protected void onPostExecute(String result)\n {\n //Toast.makeText(OTPActivity.this, result.toString(), Toast.LENGTH_LONG).show();\n }", "@Override\n\t\t protected void onPostExecute(Void result) {\n\t\t \t\n\t\t super.onPostExecute(result); \n\t\t }", "@Override\n\t\t protected void onPostExecute(Boolean result) {\n\t\t\t\tsuper.onPostExecute(result);\n\t\t\t\t\n\t\t }", "@Override\n protected void onPostExecute(String result){\n finish();\n }", "@Override\n protected void onPostExecute(String result) {\n\n try {\n // To display message after response from server\n if (!result.contains(\"ERROR\")) {\n if (responseJSON.equalsIgnoreCase(\"success\")) {\n db.open();\n db.Update_OutletExpenseIsSync();\n db.close();\n }\n if (common.isConnected()) {\n AsyncOutletSaleWSCall task = new AsyncOutletSaleWSCall();\n task.execute();\n }\n } else {\n if (result.contains(\"null\"))\n result = \"Server not responding.\";\n common.showAlert(StockAdjustmentList.this, result, false);\n common.showToast(\"Error: \" + result);\n }\n } catch (Exception e) {\n common.showAlert(StockAdjustmentList.this,\n \"Unable to fetch response from server.\", false);\n }\n\n Dialog.dismiss();\n }", "@Override\n protected void onPostExecute(String result) {\n super.onPostExecute(result);\n\n ParseTask parserTask = new ParseTask();\n\n // Invokes the thread for parsing the JSON data\n parserTask.execute(result);\n }", "protected void onPostExecute(String res) {\n\t\t super.onPostExecute(res);\r\n\t\t \r\n\r\n\t\t try {\r\n\t\t\t JSONObject responseObject = json.getJSONObject(\"responseData\");\r\n\t\t\t JSONArray resultArray = responseObject.getJSONArray(\"results\");\r\n\r\n\t\t\t // listImages = getImageList(resultArray);\r\n\t//\t\t SetListViewAdapter(listImages);\r\n\t\t } catch (JSONException 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 onPostExecute(String result) {\n showOpinionCreatedMessage(Integer.parseInt(result));\n }", "@Override\n protected void onPostExecute(String result) {\n Toast.makeText(getBaseContext(), \"Received!\", Toast.LENGTH_LONG).show();\n Toast.makeText(getBaseContext(), \"title : \" + result, Toast.LENGTH_LONG).show();\n\n Log.i(\"Message\", \"Result*****\" + result);\n }", "@Override\n protected void onPostExecute(String result) {\n// Toast.makeText(getBaseContext(), \"Data Sent!\", Toast.LENGTH_LONG).show();\n }", "@Override\n\t\tprotected void onPostExecute(String result) {\n\t\t\tsuper.onPostExecute(result);\n\t\t\tmResult = result;\n\t\t\tmIsFinish = true;\n\t\t\tif (mFinishListener != null) {\n\t\t\t\tmFinishListener.OnFinish(result);\n\t\t\t}\n\t\t\tGlobalConstants.PrintLog_D(\"[GetSource->onPostExecute]\" + result);\n\t\t}", "@Override\n\t\tprotected void onPostExecute(NetworkTaskResult result) {\n\t\t\tsuper.onPostExecute(result);\n\t\t\tthis.handleResponse(result);\n\t\t}", "@Override\n protected void onPostExecute(String result) {\n ParserTask parserTask = new ParserTask();\n\n // Start parsing the Google places in JSON format\n // Invokes the \"doInBackground()\" method of the class ParseTask\n parserTask.execute(result);\n }", "@Override\n protected void onPostExecute(String result) {\n if(result == null) {\n result = ERRORE;\n }\n\n switch(result) {\n case RICERCA_COMPLETATA: {\n ElencoParcheggi.getInstance().setCoordAttuali(mCoordinateCercate);\n mMainActivity.setTitle(mQueryTitolo);\n\n AsyncDownloadParcheggi adp\n = new AsyncDownloadParcheggi(mMainActivity, mCoordinateCercate);\n adp.execute();\n break;\n }\n\n case NO_INTERNET: {\n Toast.makeText(mMainActivity, R.string.no_connection, Toast.LENGTH_SHORT).show();\n mMainActivity.hideProgressBar();\n break;\n }\n\n default: {\n Toast.makeText(mMainActivity, R.string.indirizzo_non_riconosciuto, Toast.LENGTH_SHORT).show();\n mMainActivity.hideProgressBar();\n break;\n }\n }\n }", "@Override\n\t protected void onPostExecute(String result) \n\t {\n\t \tmHandler.post(updateList);\n\t \t\n\t //mProgress.setVisibility(View.GONE);\n\n\t }", "@Override\n\t\tprotected void onPostExecute(Object result) {\n\t\t\tsuper.onPostExecute(result);\t\t\n\t\t\tprogressDialog.dismiss();\n\t\t\tsetAllValues();\n\t\t}", "@Override\n\t protected void onPostExecute(ContentValues result) {\n\t super.onPostExecute(result);\n\t }", "protected void onPostExecute(Double result){\n }" ]
[ "0.7849769", "0.7842368", "0.78373325", "0.7783752", "0.7778886", "0.7778886", "0.7778886", "0.77631074", "0.77631074", "0.77219886", "0.7664888", "0.76597893", "0.76597893", "0.76597893", "0.7655948", "0.7648587", "0.76460505", "0.76460505", "0.7637873", "0.7612863", "0.7612863", "0.7601161", "0.7601161", "0.75985086", "0.758695", "0.7551866", "0.754715", "0.75333375", "0.75198996", "0.7429322", "0.7429322", "0.7391251", "0.7386411", "0.73857784", "0.73632675", "0.7347523", "0.7342437", "0.7342262", "0.7338779", "0.7331129", "0.73204464", "0.73127574", "0.7302772", "0.73005027", "0.72968096", "0.7234196", "0.71910703", "0.7188484", "0.7188126", "0.71873784", "0.7178394", "0.71660817", "0.71660817", "0.71592104", "0.71276903", "0.71232474", "0.7096579", "0.70962363", "0.7090257", "0.70847976", "0.7074958", "0.7067459", "0.7066289", "0.7066289", "0.70487016", "0.70487016", "0.70487016", "0.70487016", "0.70402384", "0.70393753", "0.70393753", "0.70354563", "0.70312774", "0.7029483", "0.7020782", "0.70118034", "0.70099765", "0.7009532", "0.69948894", "0.6973456", "0.69676083", "0.69633394", "0.6955696", "0.69532615", "0.6945678", "0.6933867", "0.69336706", "0.6929162", "0.69251937", "0.6919835", "0.69132125", "0.6912131", "0.69109106", "0.6910461", "0.6906124", "0.69026107", "0.688004", "0.6876083", "0.68670225", "0.6865907" ]
0.6864514
100
wrong url changes to "" removes trailing slash
public Link(String url) { try { uri = new URL(fix(url)).toURI(); } catch (Exception e) { uri = URI.create(""); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static String handleUrl(String s) {\n if (s.endsWith(\"/..\")) {\n int idx = s.lastIndexOf('/');\n s = s.substring(0, idx - 1);\n idx = s.lastIndexOf('/');\n String gs = s.substring(0, idx);\n if (!gs.equals(\"smb:/\")) {\n s = gs;\n }\n }\n if (!s.endsWith(\"/\")) {\n s += \"/\";\n }\n System.out.println(\"now its \" + s);\n return s;\n }", "private static String normalizeUrlPath(String baseUrl) {\n if (!baseUrl.matches(\".*/$\")) {\n return baseUrl + \"/\";\n }\n return baseUrl;\n }", "protected static URL addEndSlash(URL url) {\r\n String fileName = url.getPath();\r\n if (MoreString.fileExtension(fileName).equals(\"\"))\r\n try {\r\n return new URL(url.toString() + \"/\");\r\n }\r\n catch (MalformedURLException e) {\r\n System.err.println(\"HTMLPage: \" + e);\r\n }\r\n return url;\r\n }", "@Test\n public void testNormalizeToStringWithSpaceURL() throws Exception {\n AbstractURLHandler handler = new TestURLHandler();\n String normalizedUrl = handler.normalizeToString(new URL(\n \"http://ant.apache.org/ivy/url with space/ivy-1.0.xml\"));\n assertEquals(\"http://ant.apache.org/ivy/url%20with%20space/ivy-1.0.xml\", normalizedUrl);\n }", "public static String appendSlash(String url) {\r\n\t\tif (url.endsWith(\"/\"))\r\n\t\t\treturn url;\r\n\t\telse\r\n\t\t\treturn url + \"/\";\r\n\t}", "public URL standardizeURL(URL startingURL);", "public static String removeTrailingSlash(String url) {\n if (url.endsWith(\"/\")) {\n return url.substring(0, url.length() - 1);\n } else {\n return url;\n }\n }", "@Test\n public void testMakeRelativeURL3() throws Exception {\n URL base = new URL(\"http://ahost.invalid/a/b/c\");\n assertEquals(new URL(\"http://host.invalid/e\"),ConversionUtils.makeRelativeURL(base ,\"http://host.invalid/e\"));\n assertEquals(new URL(\"https://host.invalid/e\"),ConversionUtils.makeRelativeURL(base ,\"https://host.invalid/e\"));\n assertEquals(new URL(\"http://host.invalid:8081/e\"),ConversionUtils.makeRelativeURL(base ,\"http://host.invalid:8081/e\"));\n assertEquals(new URL(\"https://host.invalid:8081/e\"),ConversionUtils.makeRelativeURL(base ,\"https://host.invalid:8081/e\"));\n }", "private URI findBaseUrl0(String stringUrl) throws URISyntaxException {\n stringUrl = stringUrl.replace(\"\\\\\", \"/\");\n int qindex = stringUrl.indexOf(\"?\");\n if (qindex != -1) {\n // stuff after the ? tends to make the Java URL parser burp.\n stringUrl = stringUrl.substring(0, qindex);\n }\n URI url = new URI(stringUrl);\n URI baseUrl = new URI(url.getScheme(), url.getAuthority(), url.getPath(), null, null);\n\n String path = baseUrl.getPath().substring(1); // toss the leading /\n String[] pieces = path.split(\"/\");\n List<String> urlSlashes = new ArrayList<String>();\n // reverse\n for (String piece : pieces) {\n urlSlashes.add(piece);\n }\n List<String> cleanedSegments = new ArrayList<String>();\n String possibleType = \"\";\n boolean del;\n\n for (int i = 0; i < urlSlashes.size(); i++) {\n String segment = urlSlashes.get(i);\n\n // Split off and save anything that looks like a file type.\n if (segment.indexOf(\".\") != -1) {\n possibleType = segment.split(\"\\\\.\")[1];\n\n /*\n * If the type isn't alpha-only, it's probably not actually a file extension.\n */\n if (!possibleType.matches(\"[^a-zA-Z]\")) {\n segment = segment.split(\"\\\\.\")[0];\n }\n }\n\n /**\n * EW-CMS specific segment replacement. Ugly. Example:\n * http://www.ew.com/ew/article/0,,20313460_20369436,00.html\n **/\n if (segment.indexOf(\",00\") != -1) {\n segment = segment.replaceFirst(\",00\", \"\");\n }\n\n // If our first or second segment has anything looking like a page\n // number, remove it.\n /* Javascript code has some /i's here, we might need to fiddle */\n Matcher pnMatcher = Patterns.PAGE_NUMBER_LIKE.matcher(segment);\n if (pnMatcher.matches() && ((i == 1) || (i == 0))) {\n segment = pnMatcher.replaceAll(\"\");\n }\n\n del = false;\n\n /*\n * If this is purely a number, and it's the first or second segment, it's probably a page number.\n * Remove it.\n */\n if (i < 2 && segment.matches(\"^\\\\d{1,2}$\")) {\n del = true;\n }\n\n /* If this is the first segment and it's just \"index\", remove it. */\n if (i == 0 && segment.toLowerCase() == \"index\")\n del = true;\n\n /*\n * If our first or second segment is smaller than 3 characters, and the first segment was purely\n * alphas, remove it.\n */\n /* /i again */\n if (i < 2 && segment.length() < 3 && !urlSlashes.get(0).matches(\"[a-z]\"))\n del = true;\n\n /* If it's not marked for deletion, push it to cleanedSegments. */\n if (!del) {\n cleanedSegments.add(segment);\n }\n }\n\n String cleanedPath = \"\";\n for (String s : cleanedSegments) {\n cleanedPath = cleanedPath + s;\n cleanedPath = cleanedPath + \"/\";\n }\n URI cleaned = new URI(url.getScheme(), url.getAuthority(), \"/\"\n + cleanedPath.substring(0, cleanedPath\n .length() - 1), null, null);\n return cleaned;\n }", "public static String removeProtocolAndTrailingSlash(String url , boolean toLowerCase) {\n return removeTrailingSlash(removeProtocal(toLowerCase ? url.toLowerCase() : url));\n }", "@Test\n public void testNormalizeToStringWithPlusCharacter() throws Exception {\n AbstractURLHandler handler = new TestURLHandler();\n String normalizedUrl = handler.normalizeToString(new URL(\n \"http://ant.apache.org/ivy/ivy-1.+.xml\"));\n assertEquals(\"http://ant.apache.org/ivy/ivy-1.%2B.xml\", normalizedUrl);\n }", "private String sanitizePath(String path)\r\n\t{\r\n\t\tif (path == null)\r\n\t\t\treturn \"\";\r\n\t\telse if (path.startsWith(\"/\"))\r\n\t\t\tpath = path.substring(1);\r\n\r\n\t\treturn path.endsWith(\"/\") ? path : path + \"/\";\r\n\t}", "public static String removePrecedingSlash(String url) {\n if (url.startsWith(\"/\")) {\n return url.substring(1);\n } else {\n return url;\n }\n }", "public static String removeLeadingDoubleSlash(String url, String scheme) {\n if (url != null && url.startsWith(\"//\")) {\n url = url.substring(2);\n if (scheme != null) {\n if (scheme.endsWith(\"://\")) {\n url = scheme + url;\n } else {\n Log.e(TAG, \"Invalid scheme used: \" + scheme);\n }\n }\n }\n return url;\n }", "String checkAndTrimUrl(String url);", "private String cleanPath(String path) {\n if(path == null)\n return path;\n if(path.equals(\"\") || path.equals(\"/\"))\n return path;\n\n if(!path.startsWith(\"/\"))\n path = \"/\" + path;\n path = path.replaceAll(\"/+\", \"/\");\n if(path.endsWith(\"/\"))\n path = path.substring(0,path.length()-1);\n return path;\n }", "@PostConstruct\n private void checkUrl() {\n if (weatherServiceUrl.endsWith(\"/\")) {\n weatherServiceUrl = weatherServiceUrl.substring(0, weatherServiceUrl.length() - 1);\n }\n }", "public static String removeProtocolAndTrailingSlash(String url) {\n return removeProtocolAndTrailingSlash(url, true);\n }", "@Override\n protected void parseURL(URL url, String spec, int start, int end) {\n if (end < start) {\n return;\n }\n String parseString = \"\";\n if (start < end) {\n parseString = spec.substring(start, end).replace('\\\\', '/');\n }\n super.parseURL(url, parseString, 0, parseString.length());\n }", "private static String trim (String urlString) {\n int ix = urlString.lastIndexOf('/');\n boolean trimTrailingSlash = ix == urlString.length() - 1;\n if (trimTrailingSlash) {\n ix = urlString.lastIndexOf('/', ix - 1);\n }\n String result;\n if (ix > 0) {\n result = urlString.substring(ix + 1);\n } else {\n result = urlString;\n }\n if (trimTrailingSlash && result.length() > 1) {\n result = result.substring(0, result.length() - 1);\n }\n return result;\n }", "private String getHttpPath(String httpPath) {\n if(httpPath == null || httpPath.equals(\"\")) {\n httpPath = \"/*\";\n }\n else {\n if(!httpPath.startsWith(\"/\")) {\n httpPath = \"/\" + httpPath;\n }\n if(httpPath.endsWith(\"/\")) {\n httpPath = httpPath + \"*\";\n }\n if(!httpPath.endsWith(\"/*\")) {\n httpPath = httpPath + \"/*\";\n }\n }\n return httpPath;\n }", "String rewriteUrl(String originalUrl);", "@Override\n\tpublic String buildURL(String string) {\n\t\treturn null;\n\t}", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "private URI makeUri(String source) throws URISyntaxException {\n if (source == null)\n source = \"\";\n\n if ((source.length()>0)&&((source.substring(source.length() - 1)).equals(\"/\") ))\n source=source.substring(0, source.length() - 1);\n\n return new URI( source.toLowerCase() );\n }", "private static String cleanup(String uri) {\n String[] dirty = tokenize(uri, \"/\\\\\", false);\n int length = dirty.length;\n String[] clean = new String[length];\n boolean path;\n boolean finished;\n\n while (true) {\n path = false;\n finished = true;\n for (int i = 0, j = 0; (i < length) && (dirty[i] != null); i++) {\n if (\".\".equals(dirty[i])) {\n // ignore\n } else if (\"..\".equals(dirty[i])) {\n clean[j++] = dirty[i];\n if (path) {\n finished = false;\n }\n } else {\n if ((i + 1 < length) && (\"..\".equals(dirty[i + 1]))) {\n i++;\n } else {\n clean[j++] = dirty[i];\n path = true;\n }\n }\n }\n if (finished) {\n break;\n } else {\n dirty = clean;\n clean = new String[length];\n }\n }\n StringBuffer b = new StringBuffer(uri.length());\n\n for (int i = 0; (i < length) && (clean[i] != null); i++) {\n b.append(clean[i]);\n if ((i + 1 < length) && (clean[i + 1] != null)) {\n b.append(\"/\");\n }\n }\n return b.toString();\n }", "public boolean useTrailingSlashMatch()\n/* */ {\n/* 574 */ return this.trailingSlashMatch;\n/* */ }", "@Test\n\tpublic void testGetBaseUrlDir() {\n\t\tString result = helper.getBaseUrl(\"http://www.bobbylough.com/test/\");\n\t\tassertEquals(\"http://www.bobbylough.com/test\", result);\n\t}", "public static String replaceLastURLPart(String original, String lastPart) {\n StringBuffer sb = new StringBuffer();\n sb.append(original.substring(0, original.lastIndexOf(\"/\") + 1));\n sb.append(lastPart);\n return sb.toString();\n }", "private String extractRealUrl(String url) {\n return acceptsURL(url) ? url.replace(\"p6spy:\", \"\") : url;\n }", "protected String cleanSurt(String surt) {\n if (!isSurt(surt)) {\n surt = ArchiveUtils.addImpliedHttpIfNecessary(surt);\n surt = SURT.fromURI(surt);\n }\n \n if (surt.endsWith(\",)\") && surt.indexOf(')') == surt.length()-1) {\n surt = surt + \"/\";\n }\n \n return surt;\n }", "public String getCorrectURL() {\n\t\treturn defineCorrectURL(); \t\r\n\t}", "protected abstract String getUrl();", "private String getURL() {\n String url = profileLocation.getText().toString();\n if (url == null || url.length() == 0) {\n return url;\n }\n // if it's not the last (which should be \"Raw\") choice, we'll use the prefix\n if (!url.contains(\"://\")) { // if there is no (http|jr):// prefix, we'll assume it's a http://bit.ly/ URL\n url = \"http://bit.ly/\" + url;\n }\n return url;\n }", "String url();", "@Override\n protected boolean shouldEncodeUrls() {\n return isShouldEncodeUrls();\n }", "public static String verifierUri(String uri) {\n\t\treturn uri.charAt(uri.length() - 1) == '/' ? uri : uri + \"/\";\n\t}", "private String getUrlHost(String url) {\n // httpx://host/.....\n\n int hostStart = url.indexOf(\"//\");\n if (hostStart == -1) {\n return \"\";\n }\n int hostEnd = url.indexOf(\"/\", hostStart + 2);\n if (hostEnd == -1) {\n return url.substring(hostStart + 2);\n } else {\n return url.substring(hostStart + 2, hostEnd);\n }\n\n }", "private static String buildServletURL(final String applicationURL) {\n\n final String result;\n if (applicationURL.endsWith(\"/\")) {\n result =\n new StringBuffer(applicationURL.substring(0, applicationURL.length() - 1)).append(\n \"/seam/resource/rest/importer\").toString();\n } else {\n result = new StringBuffer(applicationURL).append(\"/seam/resource/rest/importer\").toString();\n }\n return result;\n }", "@Override\n public String getUrlContextPath() {\n return \"\";\n }", "private String getDemande(HttpServletRequest request) {\n String demande = \"\";\n demande = request.getRequestURI();\n demande = demande.substring(demande.lastIndexOf(\"/\") + 1);\n return demande;\n }", "public static String determineBaseUrl(String url) {\r\n\t\t// Determine the index of the first slash after the first period.\r\n\t\tint firstSub = url.indexOf(\"/\", url.indexOf(\".\"));\r\n\t\t\r\n\t\tif (firstSub == -1)\r\n\t\t\t// There were no sub directories included in the URL.\r\n\t\t\treturn url;\r\n\t\telse\r\n\t\t\treturn url.substring(0, firstSub);\r\n\t}", "protected String getTildered(String wrappedUri) {\r\n\t\treturn wrappedUri.replaceAll(\"~\", \"~0\").replaceAll(\"/\", \"~1\");\r\n\t}", "public static String fixUrlFromPathInfo(final String pathInfo) {\n\t\treturn pathInfo.replaceAll(\":/([^/])\", \"://$1\");\n\t}", "public String fixForScheme(String url) {\n\t\tStringBuffer returnUrl = new StringBuffer(url);\n\t\tif(StringUtils.contains(url, \"returnurl=\"))\n\t\t{\n\t\t\treturnUrl = new StringBuffer(StringUtils.substring(url,0, \n\t\t\t\t\tStringUtils.indexOf(url, \"returnurl=\")));\n\t\t\t\n\t\t\treturnUrl.append(\"returnurl=\");\n\t\t\tString returnurl = StringUtils.substring(url, \n\t\t\t\t\tStringUtils.indexOf(url, \"returnurl=\")+10);\n\t\t\t\n\t\t\ttry {\n\t\t\t\treturnUrl.append(URLEncoder.encode(new String(Base64.encodeBase64(returnurl.getBytes())),\"UTF-8\"));\n\t\t\t} catch (UnsupportedEncodingException e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\treturn returnUrl.toString();\n\t}", "FullUriTemplateString baseUri();", "public static String getValidUrl(String url){\n String result = null;\n if(url.startsWith(\"http://\")){\n result = url;\n }\n else if(url.startsWith(\"/\")){\n result = \"http://www.chenshiyu.com\" + url;\n }\n return result;\n }", "String getUrl();", "String getUrl();", "String getUrl();", "String getUrl();", "String getUrl();", "public static String formatUrl(String url) {\n if (!url.startsWith(\"http://\") && !url.startsWith(\"https://\")) {\n url = \"http://\" + url;\n }\n return url;\n }", "String getBaseUri();", "private String getURL() {\n\t\t// TODO : Generate URL\n\t\treturn null;\n\t}", "public static String toRelativeURL(URL base, URL target) {\n\t\t// Precondition: If URL is a path to folder, then it must end with '/'\n\t\t// character.\n\t\tif ((base.getProtocol().equals(target.getProtocol()))\n\t\t\t\t|| (base.getHost().equals(target.getHost()))) { // changed this logic symbol\n\n\t\t\tString baseString = base.getFile();\n\t\t\tString targetString = target.getFile();\n\t\t\tString result = \"\";\n\n\t\t\t// remove filename from URL\n\t\t\tbaseString = baseString.substring(0,\n\t\t\t\t\tbaseString.lastIndexOf(\"/\") + 1);\n\n\t\t\t// remove filename from URL\n\t\t\ttargetString = targetString.substring(0,\n\t\t\t\t\ttargetString.lastIndexOf(\"/\") + 1);\n\n\t\t\tStringTokenizer baseTokens = new StringTokenizer(baseString, \"/\");// Maybe\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// this\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// causes\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// problems\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// under\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// windows\n\t\t\tStringTokenizer targetTokens = new StringTokenizer(targetString,\n\t\t\t\t\t\"/\");// Maybe this causes problems under windows\n\n\t\t\tString nextBaseToken = \"\", nextTargetToken = \"\";\n\n\t\t\t// Algorithm\n\n\t\t\twhile (baseTokens.hasMoreTokens() && targetTokens.hasMoreTokens()) {\n\t\t\t\tnextBaseToken = baseTokens.nextToken();\n\t\t\t\tnextTargetToken = targetTokens.nextToken();\n\t\t\t\tif (!(nextBaseToken.equals(nextTargetToken))) {\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tresult = result.concat(\"../\");\n\t\t\t\t\t\tif (!baseTokens.hasMoreTokens()) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnextBaseToken = baseTokens.nextToken();\n\t\t\t\t\t}\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tresult = result.concat(nextTargetToken + \"/\");\n\t\t\t\t\t\tif (!targetTokens.hasMoreTokens()) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tnextTargetToken = targetTokens.nextToken();\n\t\t\t\t\t}\n\t\t\t\t\tString temp = target.getFile(); // to string\n\t\t\t\t\tresult = result.concat(temp.substring(\n\t\t\t\t\t\t\ttemp.lastIndexOf(\"/\") + 1, temp.length()));\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\twhile (baseTokens.hasMoreTokens()) {\n\t\t\t\tresult = result.concat(\"../\");\n\t\t\t\tbaseTokens.nextToken();\n\t\t\t}\n\n\t\t\twhile (targetTokens.hasMoreTokens()) {\n\t\t\t\tnextTargetToken = targetTokens.nextToken();\n\t\t\t\tresult = result.concat(nextTargetToken + \"/\");\n\t\t\t}\n\n\t\t\tString temp = target.getFile(); // to string\n\t\t\tresult = result.concat(temp.substring(temp.lastIndexOf(\"/\") + 1,\n\t\t\t\t\ttemp.length()));\n\t\t\treturn result;\n\t\t}\n\t\treturn target.toString();\n\t}", "public String cleanURL(String url) {\n\t\treturn this.removeQueryString(this.removeExtension(url));\n\t}", "public static String requestURL(String url) {\n return \"\";\n }", "private String getRootUrl(String path){\n return \"http://localhost:\" + port + \"/api/v1\" + path;\n }", "public static URL adjustURL(URL resource) throws MalformedURLException {\n \t\tString urlStr = resource.getFile();\n \t\tif (urlStr.startsWith(\"file://\"))\n \t\t\turlStr.replaceFirst(\"file://localhost\", \"file://\");\n \t\telse\n \t\t\turlStr = \"file:///\" + urlStr;\n \t\treturn new URL(urlStr);\n \t}", "public String formatFilePath(){\n StringBuilder returnResult = new StringBuilder();\n String temp;\n temp = StringUtil.removeHttpPrefix(uri);\n returnResult.append(DEFAULT_DIRECTORY).append(\"\\\\\").append(temp);\n return returnResult.toString();\n }", "@Override\n\tpublic String encodeUrl(String url) {\n\t\treturn null;\n\t}", "private String normalizePath(String path)\n {\n return path.replaceAll(\"\\\\\\\\{1,}\", \"/\");\n }", "@Nullable\n public abstract String url();", "private boolean verifyUrlFormat( String editorUrl )\n {\n if ( null == editorUrl )\n return false;\n String normalized = editorUrl.replace('\\\\', '/');\n if ( !normalized.startsWith(CE_URL_PREFIX))\n return false;\n normalized = normalized.substring(3);\n int pos = normalized.indexOf(\"/\");\n if ( pos < 0 )\n return false;\n normalized = normalized.substring(pos+1);\n pos = normalized.indexOf(\"/\");\n if ( pos >= 0 )\n return false;\n return true;\n }", "@Override\n\tpublic String encodeURL(String url) {\n\t\treturn null;\n\t}", "private String getFilePath(String sHTTPRequest) {\n return sHTTPRequest.replaceFirst(\"/\", \"\");\n\n }", "@Test\n void incorrectGetPathTest() {\n URI uri = URI.create(endBody + \"/dummy\");\n\n // get the response\n HttpResponse<String> response = HttpMethods.get(uri);\n\n // it should receive 404\n assertNotEquals(200, response.statusCode());\n assertEquals(404, response.statusCode());\n }", "@Override\r\n public String getUrl()\r\n {\n return null;\r\n }", "public URL makeBase(URL startingURL);", "private static String urlAdderP2PNodeName(String url) {\n if (url.endsWith(\"/\")) {\n url += P2P_NODE_NAME;\n } else {\n url += (\"/\" + P2P_NODE_NAME);\n }\n \n return url;\n }", "private String getHref(HttpServletRequest request)\n {\n String respath = request.getRequestURI();\n if (respath == null)\n \trespath = \"\";\n String codebaseParam = getRequestParam(request, CODEBASE, null);\n int idx = respath.lastIndexOf('/');\n if (codebaseParam != null)\n if (respath.indexOf(codebaseParam) != -1)\n idx = respath.indexOf(codebaseParam) + codebaseParam.length() - 1;\n String href = respath.substring(idx + 1); // Exclude /\n href = href + '?' + request.getQueryString();\n return href;\n }", "@Override\n public String encodeUrl(String arg0) {\n return null;\n }", "private String get_url() {\n File file = new File(url);\n return file.getAbsolutePath();\n }", "java.lang.String getUri();", "java.lang.String getUri();", "public abstract String getUrl();", "private String urlShort(String url){\n\n\t\treturn null;\n\t}", "@Test\n public void testVocabWithoutTrailingSlash() {\n assertExtract(\"/html/rdfa/vocab-without-trailing-slash.html\");\n\n assertContains(null, RDF.TYPE, RDFUtils.iri(\"http://schema.org/BreadcrumbList\"));\n }", "public static String removeLastSlash(String fileName) {\n\t\tif (fileName.lastIndexOf('/') == fileName.length() - 1) {\n\t\t\treturn fileName.substring(0, fileName.length() - 1);\n\t\t} else {\n\t\t\treturn fileName;\n\t\t}\n\t}", "public static String removeFilterFromUrlIfPresent(String url) {\r\n\t\t\r\n\t\tString afterLastSlash = url.substring(url.lastIndexOf(\"/\") + 1);\r\n\t\t\r\n\t\tif (afterLastSlash.contains(\"filter\"))\r\n\t\t\turl = url.substring(0, url.lastIndexOf(\"/\"));\r\n\t\r\n\t\treturn url;\r\n\t}", "private static String decodeAndCleanUriString(HttpServletRequest request, String uri) {\n uri = decodeRequestString(request, uri);\n int semicolonIndex = uri.indexOf(';');\n return (semicolonIndex != -1 ? uri.substring(0, semicolonIndex) : uri);\n }", "public static String formURL(String url)\n\t{\n\t\tString newurl;\n\t\tif (url.contains(\"http://\") || url.contains(\"https://\"))\n\t\t{\n\t\t\tnewurl = url;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tnewurl = \"http://\" + url;\n\t\t}\n\t\treturn newurl;\n\t}", "public static String checkPathEnding(String path){\n\t\t\n\t\tpath.replace('\\\\', '/');\n\t\t\n\t\tif(path.endsWith(\"/\"))\n\t\t\treturn path;\n\t\telse\n\t\t\treturn path + \"/\";\n\t}", "private static String normalizePathString(String path) {\n String noUnion = removePrefix(path, \"union:/\");\n // Remove scheme marker\n String noScheme = removeAndBefore(noUnion, \"//\");\n // Remove '%2370!' that forge has, example:\n // union:/C:/Users/natan/.gradle/caches/fabric-loom/1.17.1/net.fabricmc.yarn.1_17_1.1.17.1+build.61-v2-forge-1.17.1-37.0.69/forge-1.17.1-37.0.69-minecraft-mapped.jar%2371!\n // We use 'removeLastPercentSymbol' instead of removing everything after last occurrence of '%' so it works with spaces as well\n // (the last space will be 'deleted', but that doesn't matter for our purposes)\n String noPercent = removeLastPercentSymbol(noScheme);\n // Remove trailing '/' and '!'\n return removeSuffix(removeSuffix(noPercent, \"/\"), \"!\");\n }", "private String removeSlashes(String in) {\n StringBuffer sb = new StringBuffer();\n int i = in.indexOf(\"\\\\\\\\\");\n if (i != -1) {\n return in;\n }\n\n sb.append(in.substring(0,i+1));\n \n int index = i+2;\n boolean done = false;\n while (!done) {\n i = in.indexOf(\"\\\\\\\\\",index);\n if (i == -1) {\n sb.append(in.substring(index));\n done = true;\n }\n else {\n sb.append(in.substring(index,i+1)+\"\\\\\");\n index = i+2;\n }\n }\n return sb.toString();\n }", "String getServerUrl();", "private String fixSlashes(String str) {\n\t\tstr = str.replace('\\\\', '/');\r\n\t\t// compress multiples into singles;\r\n\t\t// do in 2 steps with dummy string\r\n\t\t// to avoid infinte loop\r\n\t\tstr = replaceString(str, \"//\", \"_____\");\r\n\t\tstr = replaceString(str, \"_____\", \"/\");\r\n\t\treturn str;\r\n\t}", "private String getBaseUri() {\n\t\treturn null;\n\t}", "public static String suffixSlash(String parentHref) {\r\n\t\tif( parentHref == null ) {\r\n\t\t\treturn null;\r\n\t\t} else if( parentHref.endsWith(\"/\")) {\r\n\t\t\treturn parentHref;\r\n\t\t} else {\r\n\t\t\treturn parentHref + \"/\";\r\n\t\t}\r\n\t}", "abstract String getUri();", "public static String decodePath(String href) {\r\n // For IPv6\r\n href = href.replace(\"[\", \"%5B\").replace(\"]\", \"%5D\");\r\n\r\n // Seems that some client apps send spaces.. maybe..\r\n href = href.replace(\" \", \"%20\");\r\n // ok, this is milton's bad. Older versions don't encode curly braces\r\n href = href.replace(\"{\", \"%7B\").replace(\"}\", \"%7D\");\r\n try {\r\n if (href.startsWith(\"/\")) {\r\n URI uri = new URI(\"http://anything.com\" + href);\r\n return uri.getPath();\r\n } else {\r\n URI uri = new URI(\"http://anything.com/\" + href);\r\n String s = uri.getPath();\r\n return s.substring(1);\r\n }\r\n } catch (URISyntaxException ex) {\r\n throw new RuntimeException(ex);\r\n }\r\n }", "private String parseUrl(String fileUri) {\n\n fileUri = fileUri.replace(\" \", \"%20\");\n\n if (fileUri.contains(\" \")) {\n return parseUrl(fileUri);\n }\n return fileUri;\n }", "@Given(\"^we have valid url \\\"([^\\\"]*)\\\"$\")\n\tpublic void we_have_valid_url(String arg1) {\n\t\t\n\t apiClient.setBasePath(arg1);\n\t}", "public static URL normalize(URL url) {\n if (url.getProtocol().equals(\"file\")) {\n try {\n File f = new File(cleanup(url.getFile()));\n if(f.exists())\n return f.toURL();\n } catch (Exception e) {}\n }\n return url;\n }", "public final static String transformUrl(String url) {\n \n int c = url.indexOf('?');\n if (c > -1) {\n url = url.substring(0, c);\n }\n \n // temporary work around to enable authorization on opendap URLs\n url = url.replace(\"dodsC\", \"fileServer\").replace(\".ascii\", \"\").replace(\".dods\", \"\").replace(\".das\", \"\").replace(\".ddds\", \"\");\n \n return url;\n }" ]
[ "0.69043016", "0.68320066", "0.6740054", "0.67285275", "0.65973175", "0.65639883", "0.6520049", "0.6419029", "0.6312326", "0.6268828", "0.6242955", "0.6235392", "0.6223131", "0.62149507", "0.6185221", "0.614534", "0.6136263", "0.6122012", "0.61169153", "0.6114378", "0.603307", "0.602693", "0.599402", "0.5885156", "0.5885156", "0.5885156", "0.5885156", "0.5885156", "0.5885156", "0.58801347", "0.5846877", "0.5829779", "0.5823286", "0.5810844", "0.5800272", "0.57623863", "0.5750549", "0.57336736", "0.572505", "0.57007766", "0.5699302", "0.56838244", "0.5683164", "0.56627816", "0.5656801", "0.5656589", "0.56403565", "0.5635081", "0.5622364", "0.56048894", "0.5603279", "0.56025857", "0.5600875", "0.5600875", "0.5600875", "0.5600875", "0.5600875", "0.55982316", "0.5590136", "0.5589348", "0.5574972", "0.55618805", "0.55576575", "0.5547237", "0.5531228", "0.55233765", "0.5522377", "0.5516813", "0.55135226", "0.5512769", "0.5512618", "0.55047846", "0.55039763", "0.55001795", "0.54961544", "0.549472", "0.54868096", "0.54774654", "0.5475275", "0.547209", "0.547209", "0.5470999", "0.54691994", "0.5465441", "0.546399", "0.5463473", "0.5462095", "0.5443958", "0.5441342", "0.5432812", "0.54326624", "0.54303753", "0.5430309", "0.54298806", "0.54277885", "0.5422505", "0.54197794", "0.5414663", "0.54135823", "0.54104435", "0.5409864" ]
0.0
-1
get the start_c corresponding to the cell
public char getStart(){ return start_c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private int getStartCell() {\r\n\t\tint extraCells = (getContentHeight() - getViewableHeight()) / CELL_SIZE_Y;\r\n\t\tif (getContentHeight() < getViewableHeight()) {\r\n\t\t\textraCells = 0;\r\n\t\t}\r\n\t\treturn (int) ((float) extraCells * ((float) _curScrollValue / (float) _maxScrollValue));\r\n\t}", "public int getStart ()\r\n {\r\n return glyph.getBounds().x;\r\n }", "public Square getStartOrFinish(char c) {\n Square s = null;\n for (Square[] square : squares) {\n for (Square square1 : square) {\n if (square1.getV().getMode() == c) {\n return square1;\n }\n }\n }\n return s;\n }", "public int getPosition(){\n\t\treturn this.cell;\n\t}", "public int getStartIndex(Color col) {\n\t\tint startIndex;\n\t\tswitch (col) {\n\t\t\tcase RED:\n\t\t\t\tstartIndex = RED_START;\n\t\t\t\tbreak;\n\t\t\tcase GREEN:\n\t\t\t\tstartIndex = GREEN_START;\n\t\t\t\tbreak;\n\t\t\tcase YELLOW:\n\t\t\t\tstartIndex = YELLOW_START;\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tstartIndex = BLUE_START;\n\t\t}\n\t\treturn startIndex;\n\t}", "public Coord minCell()\n {\n\t int minX = getGrid().keySet().stream().mapToInt(Coord::getX).min().orElse(0);\n\n\t int minY = getGrid().keySet().stream().mapToInt(Coord::getY).min().orElse(0);\n\n\t return new Coord(minX, minY);\n }", "public int getStartRow();", "public Point2D getCellCoordinates(JmtCell cell) {\r\n \t\tRectangle2D bounds = GraphConstants.getBounds(cell.getAttributes());\r\n \t\treturn new Point2D.Double(bounds.getMinX(), bounds.getMinY());\r\n \t}", "public PixelPoint getStartPoint ()\r\n {\r\n Point start = glyph.getLag()\r\n .switchRef(\r\n new Point(getStart(), line.yAt(getStart())),\r\n null);\r\n\r\n return new PixelPoint(start.x, start.y);\r\n }", "public int getCell() {\n return this.cell;\n }", "public int getColumn() { return cc; }", "public Coordinate getStart( )\n\t{\n\t\treturn startLocation;\n\t}", "public int getStartingPos ()\r\n {\r\n if ((getThickness() >= 2) && !getLine()\r\n .isVertical()) {\r\n return getLine()\r\n .yAt(getStart());\r\n } else {\r\n return getFirstPos() + (getThickness() / 2);\r\n }\r\n }", "int getcPosC() {\n return cPosC;\n }", "public int getCellXCoord(int col) {\n return TOP_LEFT_X + (col * BLOCK_WIDTH);\n }", "public int getStart() {\r\n\t\treturn this.offset;\r\n\t}", "public Object getCurrentCellX() {\n\t\treturn x;\n\t}", "public abstract int getLastCageCellValue(int row, int col);", "Cell getCellAt(Coord coord);", "private Vector3D convexCellBarycenter(final Vertex start) {\n\n int n = 0;\n Vector3D sumB = Vector3D.ZERO;\n\n // loop around the cell\n for (Edge e = start.getOutgoing(); n == 0 || e.getStart() != start; e = e.getEnd().getOutgoing()) {\n sumB = new Vector3D(1, sumB, e.getLength(), e.getCircle().getPole());\n n++;\n }\n\n return sumB.normalize();\n\n }", "@Override\n public Cell getCellAtPosition(CellPosition position) {\n return cellGrid[position.getCircle()][position.getBlock()][position.getClockwise()];\n }", "private int getStartOfBEDentry(final BEDentry entry ) {\n\t\tif( entry.getStrand().equals(\"+\") ) { \n\t\t\treturn entry.getChromStart(); \n\t\t} else {\n\t\t\treturn entry.getChromEnd(); \n\t\t}\n\t}", "Constant getStartOffsetConstant();", "public Grid getEntrance(){\n\t\treturn getpos((byte)2);\n\t}", "int getStartCharIndex();", "public double getStartX()\n {\n return startxcoord; \n }", "public Cell getPosition() {\n return position;\n }", "public WeightedPoint getStart()\n {\n return map.getStart();\n }", "public java.math.BigInteger getStartIndex()\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(STARTINDEX$10);\n if (target == null)\n {\n return null;\n }\n return target.getBigIntegerValue();\n }\n }", "public int getRangeStart() {\n return currentViewableRange.getFrom();\n }", "public static int getCell() {\n int cell;\n\n cell = input.nextInt();\n // While enter other numbers out of the range of [1,3], the players will be asked to enter 1, 2, or 3\n while (cell < MARG_FIRST || cell > MARG_LAST) { // Set boundaries\n System.out.print(\"Please enter 1, 2, or 3: \");\n cell = input.nextInt();\n }\n return cell;\n }", "@Override\n public int getStart() {\n return feature.getStart();\n }", "@Pure\n public Integer getStartCharacter() {\n return this.startCharacter;\n }", "public int getStart() {\r\n\t\treturn start;\r\n\t}", "public int getStart() {\r\n return start;\r\n }", "public int getStart()\n {\n return start;\n }", "public int findGeneStart()\n {\n return findGeneStart(0);\n }", "public int getStartx(){\n\t\treturn startx;\n\t}", "double getStartX();", "org.hl7.fhir.Integer getStart();", "public int getStart() {\n return start;\n }", "public int getStart() {\n return start;\n }", "public int getStart() {\n return this.start;\n }", "public double getStart();", "@Override\n public int[] getStartPosition() {\n if(maze != null){\n int[] position = new int[2];\n position[0] = maze.getStartPosition().getRowIndex();\n position[1] = maze.getStartPosition().getColumnIndex();\n return position;\n }\n return null;\n }", "int getCellStatus(int x, int y);", "public String getCellLine()\n {\n return this.cellLine;\n }", "public int getC() {\n return c_;\n }", "public int getStart() {\n\t\treturn start;\n\t}", "public int getCellIndex(int column, int row) {\n\t\treturn ((row - 1) * width) + (column - 1);\n\t}", "public int getC() {\n return c_;\n }", "public static int getRowStart(JTextComponent c, int offset)\n throws BadLocationException {\n return getRowStart((BaseDocument)c.getDocument(), offset, 0);\n }", "public BoardCell getCenterCell() {\n\t\treturn null;\n\t}", "public int getStartX() {\r\n\t\treturn startX;\r\n\t}", "public Block getStart () {\n\t\treturn start;\n\t}", "public double getStartX() {\r\n return startx;\r\n }", "public Position getStart() {\r\n return start;\r\n }", "public int get_cell(int row,int col)\n{\n\treturn cell[row][col] ;\t\n}", "int getCellid();", "Long getStartAt();", "public CCode getC() {\n \t\treturn c;\n \t}", "public ArrayList<Integer> getStart(){\n return curBoard;\n }", "public Ndimensional getStartPoint();", "public int getStartIdx() {\n return this.startIdx;\n }", "private int jumpCursor() {\n if (cc == columns) {\n if (cl + 1 == lines)\n cl = 0;\n else\n ++cl;\n\n cc = 0;\n }\n\n return cc++;\n }", "public int getStart() {\n\t\t\treturn start;\n\t\t}", "public static int getRandCell() {\n int num = (int) (Math.random() * 10); // Generate random numbers\n int randCell = 1;\n if (num >= MARG_FIRST && num <= MARG_LAST) { // Set boundaries\n randCell = num;\n }\n return randCell;\n }", "public double getStartX() {\n\treturn v1.getX();\n }", "public long getCellAt(Point point)\n\t{\n\t\tfor (CIntentionCell cell : cells.values())\n\t\t{\n\t\t\tif (cell.contains(point))\n\t\t\t{\n\t\t\t\treturn cell.getId();\n\t\t\t}\n\t\t}\n\t\treturn -1L;\n\t}", "public int getStart ()\n {\n\n return this.start;\n\n }", "private int getNorthCell(Cell cell) {\n\t\tint cellNumber = cell.getNumber();\n\t\tif (cellNumber >= getGridWidth()) {\n\t\t\treturn (cellNumber - getGridWidth());\n\t\t} else {\n\t\t\tif (isToroidal()) {\n\t\t\t\treturn (getGridSize() - getGridWidth() + cellNumber);\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "private Point findStartPoint(){\n Point min = points.get(0);\n for (int i = 1; i < points.size(); i++) {\n min = getMinValue(min, points.get(i));\n }\n return min;\n }", "public double getCell(int row, int col) {\n int di = row - col;\n\n if (di == 0) {\n return B[row];\n } else if (di == -1) {\n return C[row];\n } else if (di == 1) {\n return A[row];\n } else return 0;\n }", "public double getC() {\n return c;\n }", "public byte getStartSquare (){\r\n\t\treturn start_sq;\r\n\t}", "public GeoPointND getStartPoint();", "public int[] getCellPosition(int i, int j)\n {\n int[] position = {firstCellPosition[0]+i*cellSize,firstCellPosition[1]+j*cellSize};\n return position;\n }", "public double getStart() {\n return start;\n }", "public int characterStyleStart(int pos) {\r\n\r\n checkPos(pos, LESS_THAN_LENGTH);\r\n return fStyleBuffer.styleStart(pos);\r\n }", "int cellFromDistance(int d) {\n int d2 = d - GUTTER_SIZE;\n if (d2 < 0) {\n return -1;\n } else {\n d2 /= (CELL_SIZE + GUTTER_SIZE);\n int next = cellDistance(d2 + 1);\n if (next - d <= GUTTER_SIZE)\n return -1;\n else\n return d2;\n }\n }", "public int getFirstPos ()\r\n {\r\n return glyph.getBounds().y;\r\n }", "private int goalEntry0ind(int r, int c) {\n if (r == N - 1 && c == N - 1) return 0;\n else return N * r + c + 1;\n }", "public Integer getCaretPosX() {\n\t\tint[] caretPos = getCaretPos();\n\t\treturn (caretPos == null) ? null : caretPos[0];\n\t}", "int getStartSegment();", "String getRawCellAt(Coord coord);", "private Cell get_left_cell(int row, int col) {\n return get_cell(row, --col);\n }", "public T findStartOfCircle() {\n \tNode<T> current = head;\n \tList<T> seen = new ArrayList<>();\n \twhile (true) {\n \t\tseen.add(current.val);\n \t\tif (seen.contains(current.next.val)) return current.next.val;\n \t\telse current = current.next;\n\t\t}\n }", "public SubCell position() {\r\n return position;\r\n }", "public int GetFirstPossibleValueInTheCell()\n {\n return this._valuesToPut.get(0);\n }", "public int getCharStart() {\n\t\treturn -1;\n\t}", "public void setStart (int r, int c)\n\t{\n\t\tPosition p = new Position (r, c);\n\n\t\tif (validPosition (p))\n\t\t{\n\t\t\tsquares[p.r][p.c] = START_SPACE;\n\t\t\tstart = p;\n\t\t}\n\t\telse\n\t\t\tstart = null;\n\t}", "public static int getStartXCoordinate(){\n\t\tint x = getThymioStartField_X(); \n\t\t\n\t\tif(x == 0){\n\t\t\n \t}else{\n \t x *= FIELD_HEIGHT;\n \t}\n \t\n\t\treturn x ;\n\t}", "public int getCellid() {\n return cellid_;\n }", "public int getCellid() {\n return cellid_;\n }", "private int getIdx(MouseEvent e) {\n Point p = e.getPoint();\n p.translate(-BORDER_SIZE, -BORDER_SIZE);\n int x = p.x / CELL_SIZE;\n int y = p.y / CELL_SIZE;\n if (0 <= x && x < GUI.SIZE[1] && 0 <= y && y < GUI.SIZE[1]) {\n return GUI.SIZE[1] * x + y;\n } else {\n return -1;\n }\n }", "int getStart();", "public TextCellStyle getCellStyle(int charOffset);", "Pair<Integer, Integer> getInitialPosition();", "private int getEthIdx() {\n return this.colStartOffset + 3;\n }", "public int getStartLine() {\r\n \r\n return startLine;\r\n }" ]
[ "0.7455353", "0.6726554", "0.6465985", "0.6444423", "0.64309716", "0.6231388", "0.6163395", "0.6144555", "0.6132791", "0.6105799", "0.60697246", "0.6052605", "0.60189545", "0.5985163", "0.59789807", "0.5943605", "0.5925406", "0.5917595", "0.58865786", "0.587913", "0.58719474", "0.58662564", "0.5861804", "0.5824621", "0.58156747", "0.58110607", "0.5800592", "0.5794304", "0.5793617", "0.5781594", "0.5752514", "0.57472026", "0.5726311", "0.5723381", "0.5723032", "0.5718539", "0.57114667", "0.5710626", "0.5704175", "0.56995374", "0.56954205", "0.56938565", "0.5686249", "0.5678489", "0.567402", "0.56700295", "0.5656252", "0.56556267", "0.56546426", "0.56461465", "0.5646042", "0.56450236", "0.56439084", "0.56334805", "0.56317633", "0.56281585", "0.56272256", "0.56246585", "0.562363", "0.56172943", "0.5617076", "0.561372", "0.559835", "0.55960953", "0.5594616", "0.55933684", "0.559305", "0.55775833", "0.5576857", "0.5571135", "0.5568698", "0.5561127", "0.55575585", "0.5552275", "0.554891", "0.5536784", "0.5534024", "0.55335766", "0.5533359", "0.5528254", "0.5525876", "0.5525251", "0.552172", "0.55127645", "0.5511382", "0.5504976", "0.54939264", "0.5491506", "0.5489253", "0.5484355", "0.54832274", "0.5478633", "0.5475014", "0.54745096", "0.5467649", "0.546566", "0.5456248", "0.5451212", "0.5449554", "0.5444918" ]
0.67731464
1
get the current_c corresponding to the cell
public char getCurrent(){ return current_c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public abstract int getLastCageCellValue(int row, int col);", "public Object getCurrentCellX() {\n\t\treturn x;\n\t}", "public CCode getC() {\n \t\treturn c;\n \t}", "public int getC() {\n return c_;\n }", "public int getC() {\n return c_;\n }", "public int getPosition(){\n\t\treturn this.cell;\n\t}", "public Object getCurrentCellY() {\n\t\treturn y;\n\t}", "public int getColumn() { return cc; }", "public int getCell() {\n return this.cell;\n }", "public Color getC(){\n\t\treturn c;\n\t}", "public Integer getC() {\n return c;\n }", "int getcPosC() {\n return cPosC;\n }", "public double getC() {\n return c;\n }", "private int currentChar()\n {\n if (m_bufferOffset_ < 0) {\n m_source_.previousCodePoint();\n return m_source_.nextCodePoint();\n }\n\n // m_bufferOffset_ is never 0 in normal circumstances except after a\n // discontiguous contraction since it is always returned and moved\n // by 1 when we do nextChar()\n return UTF16.charAt(m_buffer_, m_bufferOffset_ - 1);\n }", "public Object getCellEditorValue() {\n return currentColor;\n }", "@Override\n\tpublic List<DiscreteCoordinates> getCurrentCells() {\n\t\treturn Collections.singletonList(getCurrentMainCellCoordinates());\n\t}", "public boolean computeCell() {\n boolean b = false;\n int[] tab = null;\n switch (course) {\n case 4:\n tab = CMap.givePositionTale(x, y - (CMap.TH / 2));\n break;\n default:\n tab = CMap.givePositionTale(x, y - (CMap.TH / 2));\n break;\n }\n\n Cell c = game.getMap().getCell(tab);\n if (c != current) {\n current = c;\n b = true;\n }\n return b;\n }", "public String getC() {\n return c;\n }", "public Cell getSelectedCell() {\n return selectedCell;\n }", "public abstract int getLastCageCol(int row, int col);", "int getC();", "public int getCurrentColumn() {\n return buffer.columnNumber();\n }", "public int getCurIdx() {\n\t\treturn dDisplay.getCurIdx();\n\t}", "public java.lang.String getCur_elg_ind() {\n\t\treturn cur_elg_ind;\n\t}", "public int getElement(Pair<Integer, Integer> cell){\n\t\treturn numbers[cell.getFirst()][cell.getSecond()];\n\t}", "public int get_cell(int row,int col)\n{\n\treturn cell[row][col] ;\t\n}", "public double getCell(int row, int col) {\n int di = row - col;\n\n if (di == 0) {\n return B[row];\n } else if (di == -1) {\n return C[row];\n } else if (di == 1) {\n return A[row];\n } else return 0;\n }", "public VDouble getC() {\r\n return c;\r\n }", "public Complemento getC() {\n return C;\n }", "public int thisC()\r\n\t{\r\n\t return thisc;\r\n\t}", "private String getCords() {\n return current.getLocString();\n\n }", "int getCellStatus(int x, int y);", "public CoreCell getCellOfIndex (int i){\r\n return cellsUniverse.get(i);\r\n }", "@Override\n public ColorCell getCell(int row, int column) {\n List<Pair> pairs = prototypes.get(current).getSegments().get(0).getPairs();\n return new ColorCell(row, column, Color.BLUE, Collections.emptyList(), pairs);\n }", "int getCurrentIdx() {\n return currentIdx;\n }", "public long getCellAt(Point point)\n\t{\n\t\tfor (CIntentionCell cell : cells.values())\n\t\t{\n\t\t\tif (cell.contains(point))\n\t\t\t{\n\t\t\t\treturn cell.getId();\n\t\t\t}\n\t\t}\n\t\treturn -1L;\n\t}", "public Cell getCell() {\n\t\treturn cell;\n\t}", "@Override\n\tpublic long getCurrentCtc() {\n\t\treturn _candidate.getCurrentCtc();\n\t}", "public int getCurrentIdx() {\n\t\treturn this.currentIdx;\n\t}", "public int getCurrentIdx() {\n\t\treturn currentIdx;\n\t}", "public Cell getEnumCell() {\n\n\t\tString player = getNextPlayer();\n\n\t\tCell value;\n\n\t\tif(player.equals(\"X\"))\n\t\t\tvalue = Cell.X;\n\n\t\telse\n\t\t\tvalue = Cell.O;\n\n\t\treturn value;\n\t}", "protected abstract double getCell(\r\n int row,\r\n int col);", "public MorphCell current()\n {\n return this.morphs.get(this.index);\n }", "Cell getCellAt(Coord coord);", "public int contenuto(int r, int c) { return contenutoCaselle[r][c]; }", "public Point3D getC() {\r\n return c;\r\n }", "public Object getCell(int col, int row) {\n Vector data = ((DefaultTableModel) getModel()).getDataVector();\n return ((Vector) data.get(row)).get(col);\n }", "@Override\n public E getCurrent() {\n if (isCurrent()) { return cursor.getData(); }\n else { throw new IllegalStateException(\"There is no current element.\"); }\n }", "public char get(final int row, final int col) {\r\n // TODO your job\r\n return mazeData [row][col] ;\r\n\r\n\r\n }", "public double getCurrent( )\r\n {\r\n\t double element = 0; \r\n\t if(isCurrent() != true){// Student will replace this return statement with their own code:\r\n\t throw new IllegalStateException (\"no current element, getCurrent may not be called\");\r\n\t }\r\n\t else\r\n\t \t element = element + (cursor.getData()) ;\r\n\t return element; \r\n }", "@Override\n public Cell getCellAtPosition(CellPosition position) {\n return cellGrid[position.getCircle()][position.getBlock()][position.getClockwise()];\n }", "public Cell getPosition() {\n return position;\n }", "public Cell getCellAt (int x, int y) {\n return grid[x-1][y-1];\n }", "public Coordinate getCurrent( )\n\t{\n\t\treturn currentLocation;\n\t}", "public int col() {\r\n return col;\r\n }", "public Integer getCcn()\r\n {\r\n return (Integer) ( (IntegerMetricBO) getMetrics().get( CCN ) ).getValue();\r\n }", "public int nextC()\r\n\t{\r\n\t\tlastc = thisc;\t/* save current character, in case of backup */\r\n\t\t\r\n\t\t/* check for character waiting */\r\n\t\tif (holdc == 0) {\r\n\t\t\t/* no character waiting, get next from file,\r\n * ignore most control characters */\r\n\t\t\tdo {\r\n\t\t\t\tthisc = getC();\r\n\t\t\t\tif (thisc == EOF) return EOF;\r\n } while (thisc < 0x20 && ctlchars[thisc]);\r\n\r\n\t\t} else {\r\n\t\t\t/* we looked ahead, so use the saved character */\r\n\t\t\tthisc = holdc;\r\n\t\t\tholdc = 0;\r\n\t\t\tif (thisc == EOF) return EOF;\r\n\t\t}\r\n\t\r\n\t\t/* special rule for carriage return characters:\r\n\t\t * if CR is followed by LF, return just the LF\r\n\t\t * else replace the CR with a LF\r\n\t\t * but then we have to hold the character that isn't a LF,\r\n\t\t * unless it is an ignored character */\r\n\t\tif (thisc == '\\r') {\r\n\t\t holdc = getC();\r\n\t if (holdc < 0x20) {\r\n\t if (holdc == '\\n' || ctlchars[holdc]) holdc = 0;\r\n\t }\r\n\t\t thisc = '\\n';\r\n\t\t}\r\n\t\t\r\n\t\t/* capture the character in a buffer, for diagnostics */\r\n\t\tif (lastc == '\\n' || bufpos >= BUFSIZE) {\r\n\t\t\tprvsize = bufpos;\r\n\t\t\tbufpos = 0;\r\n\t\t\tcurrentbuf = 1 - currentbuf;\r\n\t\t}\r\n\t\tbuffer[currentbuf][bufpos++] = (byte)thisc;\r\n\t\r\n\t\treturn thisc;\r\n\t}", "protected int[] getCellJustif() {\n return this.cellJustifStack.getLast();\n }", "Piece get(int c, int r) {\n return this.boardArr[r - 1][c - 1];\n }", "public Character getCurrentFlag() {\n return currentFlag;\n }", "public char currentChar() throws Exception {\n // first line?\n if (currentPos == -2) {\n readLine();\n return nextChar();\n }\n\n // at end of file?\n if (line == null) {\n return PascalToken.EOF_CHAR;\n }\n\n // at end of line?\n if (currentPos == -1 || currentPos == line.length()) {\n return PascalToken.EOL_CHAR;\n }\n\n // Need to read next line?\n if (currentPos > line.length()) {\n readLine();\n return nextChar();\n }\n // return char at current pos\n return line.charAt(currentPos);\n }", "private int C() throws SyntaxException, ParserException {\n\t\tswitch (current) {\n\t\t\tcase '0':\n\t\t\t\t// C -> 0\n\t\t\t\teat('0');\n\t\t\t\treturn 0;\n\t\t\tcase '1':\n\t\t\t\t// C -> 1\n\t\t\t\teat('1');\n\t\t\t\treturn 1;\n\t\t\tcase '2':\n\t\t\t\t// C -> 2\n\t\t\t\teat('2');\n\t\t\t\treturn 2;\n\t\t\tcase '3':\n\t\t\t\t// C -> 3\n\t\t\t\teat('3');\n\t\t\t\treturn 3;\n\t\t\tcase '4':\n\t\t\t\t// C -> 4\n\t\t\t\teat('4');\n\t\t\t\treturn 4;\n\t\t\tcase '5':\n\t\t\t\t// C -> 5\n\t\t\t\teat('5');\n\t\t\t\treturn 5;\n\t\t\tcase '6':\n\t\t\t\t// C -> 6\n\t\t\t\teat('6');\n\t\t\t\treturn 6;\n\t\t\tcase '7':\n\t\t\t\t// C -> 7\n\t\t\t\teat('7');\n\t\t\t\treturn 7;\n\t\t\tcase '8':\n\t\t\t\t// C -> 8\n\t\t\t\teat('8');\n\t\t\t\treturn 8;\n\t\t\tcase '9':\n\t\t\t\t// C -> 9\n\t\t\t\teat('9');\n\t\t\t\treturn 9;\n\t\t\tdefault:\n\t\t\t\tthrow new SyntaxException(ErrorType.NO_RULE,current);\n\t\t}\n\t}", "public Cell getCell(int xCord, int yCord) {\n return grid[xCord][yCord];\n }", "private int getC()\r\n\t{\r\n\t\tint c;\r\n\t\t\r\n\t\tc = EOF;\t/* default return */\r\n\t if (thisc != EOF) try {\r\n\t \tc = fd.read();\r\n\t } catch (EOFException ex) {\r\n\t \t/* do nothing and return the EOF */\r\n\t } catch (IOException ex) {\r\n\t \t/* complain and return the EOF */\r\n\t \tsyserr.println(\"*** I/O Error reading file \" + \r\n\t \t\t\tfilename + \": \" + ex);\r\n\t }\r\n\t return c;\r\n\t}", "public int getCellIndex(int column, int row) {\n\t\treturn ((row - 1) * width) + (column - 1);\n\t}", "public int getCol() {\n\t\treturn j;\n\t}", "public synchronized byte getCellValue()\n {\n return cellValue;\n }", "public Double getCtr() {\r\n return ctr;\r\n }", "public int getCellid() {\n return cellid_;\n }", "public int getCellid() {\n return cellid_;\n }", "public Cell get() {\n return ptSearcher.current();\n }", "public Integer getCellNum() {\n return cellNum;\n }", "int getCellid();", "public int get(int r, int c) {\n\t\treturn board[r][c];\n\t}", "public char returnNextColor(char c){\r\n\t\t\r\n\t\tif(c == 'o'){\r\n\t\t\treturn col[0];\r\n\t\t}\r\n\t\tfor(int i = 0; i < col.length-1; i++){\r\n\t\t\tif(c == col[i]){\r\n\t\t\t\treturn col[i+1];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn col[0];\r\n\t}", "public abstract void subtractCage(int cellValue, int currentRow, int currentCol);", "public int visibleCell(int row, int column) {\n return column;\n }", "public long getcNum() {\n return cNum;\n }", "public abstract int getLastCageRow(int row, int col);", "private Object get( int r, int c ) {\n\treturn matrix[r][c];\n }", "String getRawCellAt(Coord coord);", "public abstract T getCell(int row, int column);", "public int get(int r, int c)\n\t{\n\t\treturn board[r][c];\n\t}", "private Cell get_cell(int row, int col){\n if (! cell_in_bounds(row,col)) return null;\n return this.cells[row][col];\n }", "public GoLCell getCell(int x, int y)\n\t{\n \treturn myGoLCell[x][y];\n\t}", "public int getCell(int row, int col)\n {\n if (inBounds(row, col))\n return grid[row][col];\n else\n return OUT_OF_BOUNDS;\n }", "public int col() {\r\n\t\treturn col;\r\n\t}", "public Integer getValueForCell(int x, int y)\n {\n Integer value=_cells[x][y].getValue();\n return value;\n }", "public CursorPosition getCurrentCursorPosition(){\n return XSelection.getCurrentCursorPosition(this);\n }", "public Color getCurrentColor();", "public int getCurrentPos() {\n return currentPos;\n }", "public Cell get(int row, int col) {\n\t\treturn myGrid.get(row, col);\n\t}", "DataFrameColumn<R,C> colAt(int colIOrdinal);", "@Override\n public int[] getCurrentPosition() {\n int[] res = new int[2];\n res[0] = characterRow;\n res[1] = characterColumn;\n\n return res;\n }", "int getCol();", "Coord getSelected() {\n if (selected == null) {\n return null;\n }\n return new Coord(selected.col, selected.row);\n }", "public String getCurrentCellid() {\n String cellidString = null;\n if (this.mTelephonyManager != null) {\n CellLocation mCellLocation = this.mTelephonyManager.getCellLocation();\n if (mCellLocation != null) {\n int type;\n if (mCellLocation instanceof CdmaCellLocation) {\n type = 1;\n Log.e(MessageUtil.TAG, \"getCurrentCellid type type = PHONE_TYPE_CDMA\");\n } else if (mCellLocation instanceof GsmCellLocation) {\n type = 2;\n Log.e(MessageUtil.TAG, \"getCurrentCellid type type = PHONE_TYPE_GSM\");\n } else {\n type = 0;\n }\n int cellid;\n switch (type) {\n case 1:\n Log.e(MessageUtil.TAG, \"getCurrentCellid type is PHONE_TYPE_CDMA\");\n CdmaCellLocation cdmaCellLocation = (CdmaCellLocation) mCellLocation;\n if (cdmaCellLocation != null) {\n int systemid = cdmaCellLocation.getSystemId();\n int networkid = cdmaCellLocation.getNetworkId();\n cellid = cdmaCellLocation.getBaseStationId();\n if (systemid >= 0 && networkid >= 0 && cellid >= 0) {\n cellidString = Integer.toString(systemid) + Integer.toString(networkid) + Integer.toString(cellid);\n Log.e(MessageUtil.TAG, \"getCurrentCellid PHONE_TYPE_CDMA cellidString = \" + cellidString);\n break;\n }\n return null;\n }\n break;\n case 2:\n Log.e(MessageUtil.TAG, \"getCurrentCellid type is PHONE_TYPE_GSM\");\n GsmCellLocation gsmCellLocation = (GsmCellLocation) mCellLocation;\n if (gsmCellLocation != null) {\n String plmn = this.mTelephonyManager.getNetworkOperator();\n cellid = gsmCellLocation.getCid();\n if (plmn != null && cellid >= 0) {\n cellidString = plmn + Integer.toString(cellid);\n Log.e(MessageUtil.TAG, \"getCurrentCellid PHONE_TYPE_GSM cellidString = \" + cellidString);\n break;\n }\n return null;\n }\n break;\n default:\n Log.e(MessageUtil.TAG, \"getCurrentCellid type is error\");\n break;\n }\n }\n return null;\n }\n Log.e(MessageUtil.TAG, \"getCurrentCellid mTelephonyManager == null\");\n return cellidString;\n }", "public Color getColor()\r\n {\r\n return currentColor;\r\n }", "private int jumpCursor() {\n if (cc == columns) {\n if (cl + 1 == lines)\n cl = 0;\n else\n ++cl;\n\n cc = 0;\n }\n\n return cc++;\n }", "public V getCValue();" ]
[ "0.6823099", "0.6811165", "0.67757803", "0.6670152", "0.6663266", "0.6574716", "0.6510471", "0.64821076", "0.6417597", "0.6402588", "0.6401834", "0.63891673", "0.63537264", "0.632174", "0.6315225", "0.631277", "0.6298026", "0.6230265", "0.62270314", "0.6220453", "0.6205427", "0.61884433", "0.6168318", "0.6162063", "0.61528474", "0.6146062", "0.61248183", "0.61028004", "0.60950893", "0.6094747", "0.6050928", "0.60271955", "0.60131127", "0.60065705", "0.6001168", "0.59718513", "0.5966506", "0.5956042", "0.59395725", "0.5932244", "0.5923531", "0.5910072", "0.5905532", "0.590297", "0.5901091", "0.58981884", "0.58974004", "0.5884496", "0.5871399", "0.586752", "0.58566374", "0.58434576", "0.5833244", "0.58325016", "0.58277833", "0.5825841", "0.5802429", "0.58023065", "0.5796477", "0.5793329", "0.5788", "0.5785546", "0.57788736", "0.57737154", "0.57694495", "0.5767678", "0.5767112", "0.5765233", "0.5755839", "0.57510304", "0.5750551", "0.5747421", "0.57416314", "0.573924", "0.57392263", "0.5727793", "0.57253057", "0.57227594", "0.5720769", "0.5716778", "0.57123554", "0.5709586", "0.57082444", "0.5690077", "0.56665987", "0.56642467", "0.56587154", "0.56569886", "0.5655511", "0.564731", "0.56470793", "0.5647057", "0.56468815", "0.5644545", "0.56371593", "0.5636431", "0.5635322", "0.5622923", "0.561574", "0.56127745" ]
0.7199303
0
add new check calculated for next_c of the string which starts with start_c, and where, character before next_c is current_c nextPos is index of arrayList, since it is easier than using character index
public void addCheck(char next_c, int check){ int nextPos = next_c - 'a'; // check if mentioned check already exists in the check_list(nextPos) ArrayList<Integer> list = check_list.get(nextPos); if(!list.contains(check)){ // if check does not exists, add it in the check_list(nextPos) check_list.get(nextPos).add(check); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<Integer> getCheckList(char next_c){\n return check_list.get(next_c-'a');\n }", "public boolean matches(char cNext) {\n int nIndex = 0;\n while (nIndex < m_cBuffer.length - 1)\n m_cBuffer[nIndex] = m_cBuffer[++nIndex];\n // save the new character\n m_cBuffer[nIndex] = cNext;\n\n // compare the buffer to the pattern\n nIndex = m_cBuffer.length;\n boolean bMatch = true;\n while (nIndex-- > 0 && bMatch)\n bMatch = (m_cBuffer[nIndex] == m_cPattern[nIndex]);\n\n return bMatch;\n }", "@Override\n public String part1(List<String> input) {\n ArrayList<Integer> hit = new ArrayList<>();\n int listLen = input.size();\n\n //how long is the string\n int strLen = input.get(0).length();\n\n //Char init\n char location;\n // checking each column... ...\n for (int i = 0; i < 1; i++) {\n hit.add(0);\n // actual checking. vertical and y is horizontal\n for (int x = 0; x < listLen; x++) {\n int y = 0;\n if (x != 0) {\n y = x * 3;\n }\n\n //loop back if coordinates are out of bounds\n if (y >= strLen) {\n y = y % strLen;\n }\n\n location = input.get(x).charAt(y);\n if (location == '#') {\n hit.set(i,hit.get(i) + 1);\n }\n\n }\n }\n\n return \"\" + hit.get(0);\n }", "private int nextSpecialPrefix(RuleBasedCollator collator, int ce,\n Backup entrybackup)\n {\n backupInternalState(m_utilSpecialBackUp_);\n updateInternalState(entrybackup);\n previousChar();\n // We want to look at the character where we entered\n\n while (true) {\n // This loop will run once per source string character, for as\n // long as we are matching a potential contraction sequence\n // First we position ourselves at the begining of contraction\n // sequence\n int entryoffset = getContractionOffset(collator, ce);\n int offset = entryoffset;\n if (isBackwardsStart()) {\n ce = collator.m_contractionCE_[offset];\n break;\n }\n char previous = (char)previousChar();\n while (previous > collator.m_contractionIndex_[offset]) {\n // contraction characters are ordered, skip smaller characters\n offset ++;\n }\n\n if (previous == collator.m_contractionIndex_[offset]) {\n // Found the source string char in the table.\n // Pick up the corresponding CE from the table.\n ce = collator.m_contractionCE_[offset];\n }\n else {\n // Source string char was not in the table, prefix not found\n ce = collator.m_contractionCE_[entryoffset];\n }\n\n if (!isSpecialPrefixTag(ce)) {\n // The source string char was in the contraction table, and\n // the corresponding CE is not a prefix CE. We found the\n // prefix, break out of loop, this CE will end up being\n // returned. This is the normal way out of prefix handling\n // when the source actually contained the prefix.\n break;\n }\n }\n if (ce != CE_NOT_FOUND_) {\n // we found something and we can merilly continue\n updateInternalState(m_utilSpecialBackUp_);\n }\n else { // prefix search was a failure, we have to backup all the way to\n // the start\n updateInternalState(entrybackup);\n }\n return ce;\n }", "private static int findPreviousStarter(char[] paramArrayOfChar, int paramInt1, int paramInt2, int paramInt3, int paramInt4, char paramChar)\n/* */ {\n/* 1550 */ PrevArgs localPrevArgs = new PrevArgs(null);\n/* 1551 */ localPrevArgs.src = paramArrayOfChar;\n/* 1552 */ localPrevArgs.start = paramInt1;\n/* 1553 */ localPrevArgs.current = paramInt2;\n/* */ \n/* 1555 */ while (localPrevArgs.start < localPrevArgs.current) {\n/* 1556 */ long l = getPrevNorm32(localPrevArgs, paramChar, paramInt3 | paramInt4);\n/* 1557 */ if (isTrueStarter(l, paramInt3, paramInt4)) {\n/* */ break;\n/* */ }\n/* */ }\n/* 1561 */ return localPrevArgs.current;\n/* */ }", "@Override\n public String part2(List<String> input) {\n ArrayList<Integer> hit = new ArrayList<>();\n int listLen = input.size();\n\n //how long is the string\n int strLen = input.get(0).length();\n\n //Char init\n\n // checking each column... ...\n // vertical y\n\n // first is down, second is right\n int[][] movement = {{1, 1}, {1, 3}, {1, 5}, {1, 7}, {2, 1}};\n\n //each item in movement\n for (int i = 0; i < movement.length; i++) {\n hit.add(0);\n // moving the sled\n for (int y = 0; y < listLen; y++) {\n int xCor = 0;\n int yCor = 0;\n if (y != 0) {\n yCor = movement[i][0] * y;\n xCor = movement[i][1] * y;\n }\n\n // in case of out of bounds x\n if (xCor >= strLen) {\n xCor = xCor % strLen;\n }\n char location;\n //in case of out of bounds y\n if (yCor < listLen) {\n location = input.get(yCor).charAt(xCor);\n if (location == '#') {\n hit.set(i,hit.get(i) + 1);\n }\n }\n\n\n }\n }\n\n //First tried int because.. well too big for int so long worked better\n long result = 1;\n for (int i = 0; i < hit.size(); i++) {\n result = result * hit.get(i);\n }\n\n return \"\" + result;\n }", "private boolean expandCompositCharAtBegin(char[] dest,int start, int length,\n int lacount) {\n boolean spaceNotFound = false;\n\n if (lacount > countSpacesRight(dest, start, length)) {\n spaceNotFound = true;\n return spaceNotFound;\n }\n for (int r = start + length - lacount, w = start + length; --r >= start;) {\n char ch = dest[r];\n if (isNormalizedLamAlefChar(ch)) {\n dest[--w] = LAM_CHAR;\n dest[--w] = convertNormalizedLamAlef[ch - '\\u065C'];\n } else {\n dest[--w] = ch;\n }\n }\n return spaceNotFound;\n\n }", "private static int findNextStarter(char[] paramArrayOfChar, int paramInt1, int paramInt2, int paramInt3, int paramInt4, char paramChar)\n/* */ {\n/* 1576 */ int j = 0xFF00 | paramInt3;\n/* */ \n/* 1578 */ DecomposeArgs localDecomposeArgs = new DecomposeArgs(null);\n/* */ \n/* */ \n/* 1581 */ while (paramInt1 != paramInt2)\n/* */ {\n/* */ \n/* 1584 */ char c1 = paramArrayOfChar[paramInt1];\n/* 1585 */ if (c1 < paramChar) {\n/* */ break;\n/* */ }\n/* */ \n/* 1589 */ long l = getNorm32(c1);\n/* 1590 */ if ((l & j) == 0L) {\n/* */ break;\n/* */ }\n/* */ char c2;\n/* 1594 */ if (isNorm32LeadSurrogate(l))\n/* */ {\n/* 1596 */ if ((paramInt1 + 1 == paramInt2) || \n/* 1597 */ (!UTF16.isTrailSurrogate(c2 = paramArrayOfChar[(paramInt1 + 1)]))) {\n/* */ break;\n/* */ }\n/* */ \n/* 1601 */ l = getNorm32FromSurrogatePair(l, c2);\n/* */ \n/* 1603 */ if ((l & j) == 0L) {\n/* */ break;\n/* */ }\n/* */ } else {\n/* 1607 */ c2 = '\\000';\n/* */ }\n/* */ \n/* */ \n/* 1611 */ if ((l & paramInt4) != 0L)\n/* */ {\n/* */ \n/* 1614 */ int i = decompose(l, paramInt4, localDecomposeArgs);\n/* */ \n/* */ \n/* */ \n/* 1618 */ if ((localDecomposeArgs.cc == 0) && ((getNorm32(extraData, i, paramInt3) & paramInt3) == 0L)) {\n/* */ break;\n/* */ }\n/* */ }\n/* */ \n/* 1623 */ paramInt1 += (c2 == 0 ? 1 : 2);\n/* */ }\n/* */ \n/* 1626 */ return paramInt1;\n/* */ }", "private int indexOfNextUnescapedChar(String s, char c, int start){\n int pos = 0;\n while(true){\n pos = s.indexOf(c, start+pos);\n if(pos <= 0)break;\n if((pos > start) && (s.charAt(pos-1) != '\\\\'))break;\n else pos++;\n }\n return pos;\n }", "@Test\n public void whenStartWithPrefixThenTrue() {\n ArrayChar word = new ArrayChar(\"Hello\");\n boolean result = word.startWith(\"He\");\n assertThat(result, is(true));\n }", "@Test\n public void whenStartWithPrefixThenTrue() {\n char[] word = {'H', 'e', 'l', 'l', 'o'};\n char[] pref = {'H', 'e'};\n boolean result = ArrayChar.startsWith(word, pref);\n assertThat(result, is(true));\n }", "private int getStartNodeIndex(int validStartIndexOfStr) {\n\t\treturn validStartIndexOfStr / 2;\n\t}", "public static void main(String[] args) {\n\n\t\tString a=\"Hadi gidelim bu diyardan\";\n\t\tSystem.out.println(a.startsWith(\"H\"));//true\n\t\tSystem.out.println(a.startsWith(\"\"));//true==> hic biseyi de kabul etti\n\t\tSystem.out.println(a.startsWith(\"Hadi\"));//true\n\t\n\t\tSystem.out.println(a.startsWith(\"g\", 5));//true==> index 5 \"g\" ile mi basliyor demektir\n\t\tSystem.out.println(a.startsWith(\"i\", 7));//false==> index7 de \"i\" mi var diye bakar\n\t\tSystem.out.println(a.startsWith(\"\", 6));//true==>index6 da normalde \"i\" var ancak hicbirsey arandiginda hicbirseylere bakar\n\t\n\t\t\n\t\t//12.indexOf()==>of=in,in anlami var.indexin gibi\n\t\t//indexOf da hem String hem de char kullanilir\n\t\tSystem.out.println(a.indexOf(\"i\"));//3==>soldan saga giderken ilk gorunumun indexini verir\n\t\tSystem.out.println(a.indexOf('d'));//2\n\t\t//deli yi bulur ve ilk harfinin indexini verir.birden cok karakter varsa ilkinin indexini verir\n\t\tSystem.out.println(a.indexOf(\"deli\"));//7\n\t\t//olmayan bir character icin indexOf kullanirsaniz java -1 return eder\n\t\tSystem.out.println(a.indexOf(\"x\"));//-1\n\t\tSystem.out.println(a.indexOf(\"diyer\"));//-1 coklu characterde hepsi ayni olmasa yine d yi gormeyip -1 doner\n\t\t\n\t\tSystem.out.println(a.indexOf(\"d\", 4));//7==> 4.indexten sonraki d nin indexini buluyor\n\t\tSystem.out.println(a.indexOf(\"a\", 9));//19==> 9. indexten sonraki a nin indexini verir\n\t\tSystem.out.println(a.indexOf('e', 8));//8\n\t\t\n\t\t//13. lastIndexOf()==>son gorunumun indexini verir\n\t\t\n\t\tString b=\"Java Ah java!\";\n\t\tSystem.out.println(b.lastIndexOf(\"v\"));//10 ==>son v nin indexi demektir\n\t\tSystem.out.println(b.lastIndexOf(\"av\"));//9 ==> son av i bulup a nin indexini basar\n\t\t\n\t\t//14. subString()==> bir Stringin belli bir bolumunu kesip almaya yarar(ONEMLI COK KULLANILIR)\n\t\t\n\t\tString c=\"Karakartal\";\n\t\t//asdece kartal kelimesini ekrana yazdirmak icin soyle yapilir. begin= baslangic\n\t\tSystem.out.println(c.substring(4));//kartal==> kesmeye baslanilan yerden sonrasini ekrana basar\n\t\t//ekrana arakartal yazalim\n\t\tSystem.out.println(c.substring(1));//arakartal\n\t\t//ekrana kar yazdiralim\n\t\t//subString methodun da iki sayi kullanirsaniz ilk sayi dahil ikinci sayi haric olur asagida ki gibi\n\t\tSystem.out.println(c.substring(4, 7));//kar\n\t\t//subString le ilk harfi almak icin subString(0,1) yazariz bunu cok kullaniriz\n\t\tSystem.out.println(c.substring(0, 1));//K\n\t\t// baslangic ve bitis index lerini ayni yaparsak hicbirsey aliriz.\n\t\tSystem.out.println(c.substring(2, 2));//\"\" hicbirsey goruruz\n\t\t//subString te baslangic indexi bitis indexinden buyk olamaz.\n\t\t//buyuk yazarsak Run Time Error aliriz\n\t\t//System.out.println(c.substring(5, 3));\n\t\t\n\t\t\n\t\t//trim() methodu==>trim==tras anlamina gelir.bir Stringin bas ve son tarafindaki spaceleri siler\n\t\t//dikkat edin aradakileri degil bas ve sondakileri siler\n\t\tString d=\" Java iyidir \";\n\t\tSystem.out.println(d.length());//16\n\t\t\n\t\tSystem.out.println(d.trim().length());//11\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "int getStartCharIndex();", "private int previousSpecialPrefix(RuleBasedCollator collator, int ce)\n {\n backupInternalState(m_utilSpecialBackUp_);\n while (true) {\n // position ourselves at the begining of contraction sequence\n int offset = getContractionOffset(collator, ce);\n int entryoffset = offset;\n if (isBackwardsStart()) {\n ce = collator.m_contractionCE_[offset];\n break;\n }\n char prevch = (char)previousChar();\n while (prevch > collator.m_contractionIndex_[offset]) {\n // since contraction codepoints are ordered, we skip all that\n // are smaller\n offset ++;\n }\n if (prevch == collator.m_contractionIndex_[offset]) {\n ce = collator.m_contractionCE_[offset];\n }\n else {\n // if there is a completely ignorable code point in the middle\n // of a prefix, we need to act as if it's not there assumption:\n // 'real' noncharacters (*fffe, *ffff, fdd0-fdef are set to\n // zero)\n // lone surrogates cannot be set to zero as it would break\n // other processing\n int isZeroCE = collator.m_trie_.getLeadValue(prevch);\n // it's easy for BMP code points\n if (isZeroCE == 0) {\n continue;\n }\n else if (UTF16.isTrailSurrogate(prevch)\n || UTF16.isLeadSurrogate(prevch)) {\n // for supplementary code points, we have to check the next one\n // situations where we are going to ignore\n // 1. beginning of the string: schar is a lone surrogate\n // 2. schar is a lone surrogate\n // 3. schar is a trail surrogate in a valid surrogate\n // sequence that is explicitly set to zero.\n if (!isBackwardsStart()) {\n char lead = (char)previousChar();\n if (UTF16.isLeadSurrogate(lead)) {\n isZeroCE = collator.m_trie_.getLeadValue(lead);\n if (RuleBasedCollator.getTag(isZeroCE)\n == RuleBasedCollator.CE_SURROGATE_TAG_) {\n int finalCE = collator.m_trie_.getTrailValue(\n isZeroCE,\n prevch);\n if (finalCE == 0) {\n // this is a real, assigned completely\n // ignorable code point\n continue;\n }\n }\n }\n else {\n nextChar(); // revert to original offset\n // lone surrogate, completely ignorable\n continue;\n }\n nextChar(); // revert to original offset\n }\n else {\n // lone surrogate at the beggining, completely ignorable\n continue;\n }\n }\n\n // char was not in the table. prefix not found\n ce = collator.m_contractionCE_[entryoffset];\n }\n\n if (!isSpecialPrefixTag(ce)) {\n // char was in the contraction table, and the corresponding ce\n // is not a prefix ce. We found the prefix, break out of loop,\n // this ce will end up being returned.\n break;\n }\n }\n updateInternalState(m_utilSpecialBackUp_);\n return ce;\n }", "private boolean isFitPatternStr(char startC, String patternStr) {\n\n if (startC != patternStr.charAt(0)) {\n return false;\n }\n char inputChar = ' ';\n char patternchar = ' ';\n for (int i = 1; i < patternStr.length(); i++) {//the post\n patternchar = patternStr.charAt(i);\n inputChar = getNextChar();\n if (inputChar != patternchar) {\n throwParseError();\n }\n\n }\n return true;\n }", "boolean alreadyAdded(char c) {\n for (char x :_chars) {\n if (x == c) {\n return true;\n }\n }\n return false;\n }", "public boolean startsWith(String prefix, int toffset) {\n/* 289 */ return this.m_str.startsWith(prefix, toffset);\n/* */ }", "@Test\n\tpublic void testStartingIndicesRegression(){\n\t\tassertLeftmostStartingIndices(\"5,1,7,3,2|-..xxx$1..x...xxx$3....-xx........\", 0, 6, 8, 18, 22);\n\t\tassertRightmostStartingIndices(\"7,5|.......xxx$1....xxx$2..-\", 6, 14);\n\t\t\n\t}", "@Test\n public void testStartsWith() {\n chkInt(\"startsWith('a')\", false);\n chkLong(\"startsWith('a')\", false);\n chkNumber(\"startsWith('a')\", false);\n chkBoolean(\"startsWith('a')\", false);\n chkString(\"startsWith('aaZ')\", true, \"'aaZb'\");\n chkDate(\"startsWith('a')\", false);\n chkList(\"startsWith('a')\", false, \"[]\");\n chkEnum(\"startsWith('a')\", false);\n }", "public int indexOfList(ListField listField, String prefix, int start) {\nreturn start;\n}", "private void find(char[] cArr, int idx, List<String> result, int left, int right){\n\t\tif(left == 0 && right == 0){\n\t\t\tresult.add(String.valueOf(cArr));\n\t\t\treturn ;\n\t\t}\n\t\t\n\t\t//this is the invalid case so terminate the execution\n\t\tif(left > right){\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t//try the left brace\n\t\tif(left > 0){\n\t\t\tcArr[idx] = '(';\n\t\t\tfind(cArr, idx + 1, result, left - 1, right);\n\t\t}\n\t\t\n\t\t//then try right brace\n\t\tif(right > 0){\n\t\t\tcArr[idx] = ')';\n\t\t\tfind(cArr, idx + 1, result, left, right - 1);\n\t\t}\n\t}", "private int nextDiscontiguous(RuleBasedCollator collator, int entryoffset)\n {\n int offset = entryoffset;\n boolean multicontraction = false;\n // since it will be stuffed into this iterator and ran over again\n if (m_utilSkippedBuffer_ == null) {\n m_utilSkippedBuffer_ = new StringBuilder();\n }\n else {\n m_utilSkippedBuffer_.setLength(0);\n }\n int ch = currentChar();\n m_utilSkippedBuffer_.appendCodePoint(ch);\n int prevCC = 0;\n int cc = getCombiningClass(ch);\n // accent after the first character\n if (m_utilSpecialDiscontiguousBackUp_ == null) {\n m_utilSpecialDiscontiguousBackUp_ = new Backup();\n }\n backupInternalState(m_utilSpecialDiscontiguousBackUp_);\n boolean prevWasLead = false;\n while (true) {\n // We read code units for contraction table matching\n // but have to get combining classes for code points\n // to figure out where to stop with discontiguous contraction.\n int ch_int = nextChar();\n char nextch = (char)ch_int;\n if (UTF16.isSurrogate(nextch)) {\n if (prevWasLead) {\n // trail surrogate of surrogate pair, keep previous and current cc\n prevWasLead = false;\n } else {\n prevCC = cc;\n cc = 0; // default cc for an unpaired surrogate\n prevWasLead = false;\n if (Character.isHighSurrogate(nextch)) {\n int trail = nextChar();\n if (Character.isLowSurrogate((char)trail)) {\n cc = getCombiningClass(Character.toCodePoint(nextch, (char)trail));\n prevWasLead = true;\n }\n if (trail >= 0) {\n previousChar(); // restore index after having peeked at the next code unit\n }\n }\n }\n } else {\n prevCC = cc;\n cc = getCombiningClass(ch_int);\n prevWasLead = false;\n }\n if (ch_int < 0 || cc == 0) {\n // if there are no more accents to move around\n // we don't have to shift previousChar, since we are resetting\n // the offset later\n if (multicontraction) {\n if (ch_int >= 0) {\n previousChar(); // backtrack\n }\n setDiscontiguous(m_utilSkippedBuffer_);\n return collator.m_contractionCE_[offset];\n }\n break;\n }\n\n offset ++; // skip the combining class offset\n while ((offset < collator.m_contractionIndex_.length) &&\n (nextch > collator.m_contractionIndex_[offset])) {\n offset ++;\n }\n\n int ce = CE_NOT_FOUND_;\n if ( offset >= collator.m_contractionIndex_.length) {\n break;\n }\n if (nextch != collator.m_contractionIndex_[offset] || cc == prevCC) {\n // unmatched or blocked character\n if ( (m_utilSkippedBuffer_.length()!= 1) ||\n ((m_utilSkippedBuffer_.charAt(0)!= nextch) &&\n (m_bufferOffset_<0) )) { // avoid push to skipped buffer twice\n m_utilSkippedBuffer_.append(nextch);\n }\n offset = entryoffset; // Restore the offset before checking next character.\n continue;\n }\n else {\n ce = collator.m_contractionCE_[offset];\n }\n\n if (ce == CE_NOT_FOUND_) {\n break;\n }\n else if (isContractionTag(ce)) {\n // this is a multi-contraction\n offset = getContractionOffset(collator, ce);\n if (collator.m_contractionCE_[offset] != CE_NOT_FOUND_) {\n multicontraction = true;\n backupInternalState(m_utilSpecialDiscontiguousBackUp_);\n }\n }\n else {\n setDiscontiguous(m_utilSkippedBuffer_);\n return ce;\n }\n }\n\n updateInternalState(m_utilSpecialDiscontiguousBackUp_);\n // backup is one forward of the base character, we need to move back\n // one more\n previousChar();\n return collator.m_contractionCE_[entryoffset];\n }", "@Test\n public void whenNotStartWithPrefixThenFalse() {\n ArrayChar word = new ArrayChar(\"Hello\");\n boolean result = word.startWith(\"Hi\");\n assertThat(result, is(false));\n }", "public boolean add(String value){\r\n\t\t//declare variables\r\n\t\tint testOrd = 0;\r\n\t\tDLBNode current = nodes;\r\n\t\tboolean lineFin = false;\r\n\t\tboolean output = false;\r\n\t\t\r\n\t\t//increment through the string to add the letter at its appropriate location\r\n\t\tfor(int i = 0; i < value.length(); i++){\r\n\t\t\t//node to house the current letter value being checked\r\n\t\t\tchar currentLetter = value.charAt(i);\r\n\t\t\t\r\n\t\t\tif(testOrd == 0){\r\n\t\t\t\t//checks to see if the list of letters being checked alread exists in the structure to avoid double-building\r\n\t\t\t\twhile(current != null){\r\n\t\t\t\t\t//generate a node value for the current letter being checked\r\n\t\t\t\t\tif(current.value == currentLetter){\r\n\t\t\t\t\t\tif(current.childNode != null){\r\n\t\t\t\t\t\t\t//step down to ensure you add to the lowest possible value in the viable list\r\n\t\t\t\t\t\t\tcurrent = current.childNode;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t//stop the loop\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t//check siblings if children are not viable\r\n\t\t\t\t\tif(current.siblingNode != null){\r\n\t\t\t\t\t\tcurrent = current.siblingNode;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t//adjust trigger to end iteration\r\n\t\t\t\t\t\ttestOrd = 1;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t//add the value to the list in the appropriate orientation\r\n\t\t\t\t//the node should have no viable children, this part adds it as a sibling to an already existing node in the chain of characters being checked\r\n\t\t\t\tif(testOrd == 1){\r\n\t\t\t\t\tcurrent.siblingNode = new DLBNode(currentLetter);\r\n\t\t\t\t\tcurrent = current.siblingNode;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tcurrent.childNode = new DLBNode(currentLetter);\r\n\t\t\t\tcurrent = current.childNode;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//check for word endings/spaces\r\n\t\tif(current.childNode == null){\r\n\t\t\t\r\n\t\t\t//generate new child node that contains a terminating value (|)\r\n\t\t\tcurrent.childNode = new DLBNode('|');\r\n\t\t\toutput = true;\r\n\t\t\t\r\n\t\t\treturn output;\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\tcurrent = current.childNode;\r\n\t\t\t//do the same as above, but instead of a child add as a sibling to another value existing in that line of characters\r\n\t\t\twhile(current != null){\r\n\t\t\t\t//avoid duplicate word endings\r\n\t\t\t\tif(current.value == '|'){\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn output;\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//sibling check\r\n\t\t\t\tif(current.siblingNode != null){\r\n\t\t\t\t\tcurrent = current.siblingNode;\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(lineFin == false){\r\n\t\t\t\t\r\n\t\t\t\t//add a | if there is no other | value already present\r\n\t\t\t\tcurrent.siblingNode = new DLBNode('|');\r\n\t\t\t\toutput = true;\r\n\t\t\t\t\r\n\t\t\t\treturn output;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn output;\r\n\t}", "@Test\n public void Test4663220() {\n RuleBasedCollator collator = (RuleBasedCollator)Collator.getInstance(Locale.US);\n java.text.StringCharacterIterator stringIter = new java.text.StringCharacterIterator(\"fox\");\n CollationElementIterator iter = collator.getCollationElementIterator(stringIter);\n \n int[] elements_next = new int[3];\n logln(\"calling next:\");\n for (int i = 0; i < 3; ++i) {\n logln(\"[\" + i + \"] \" + (elements_next[i] = iter.next()));\n }\n \n int[] elements_fwd = new int[3];\n logln(\"calling set/next:\");\n for (int i = 0; i < 3; ++i) {\n iter.setOffset(i);\n logln(\"[\" + i + \"] \" + (elements_fwd[i] = iter.next()));\n }\n \n for (int i = 0; i < 3; ++i) {\n if (elements_next[i] != elements_fwd[i]) {\n errln(\"mismatch at position \" + i + \n \": \" + elements_next[i] + \n \" != \" + elements_fwd[i]);\n }\n }\n }", "protected int findFromIndex(char c) {\r\n int len = fromChars.length;\r\n for(int i = 0; i < len; i++) {\r\n if(fromChars[i] == c) return i;\r\n }\r\n return -1;\r\n }", "public static boolean startArrFill(String[] strings, int n, char[] chars){\n\t int comp = 0, comp2 = 0, b = fact(n-1), c = n-1, comp3 = 0;\n\t for(int j = comp2; b != 1; j++){\n \t for(int i = 0; i < strings.length; i++){\n \t while(contains(strings[i], chars[comp2])){\n \t comp2++;\n \t if(comp2 == chars.length){\n \t comp2 = 0;\n \t }\n \t }\n \t //System.out.println(\"comp2: \" + comp2 + \", chars[comp2]: \" + chars[comp2]);\n \t strings[i] += chars[comp2];\n \t //System.out.println(\"i: \" + i + \", j: \" + j + \"\\t\" +strings[i]);\n \t comp++;\n \t if(comp == b){\n \t comp2++;\n \t comp = 0;\n \t if(comp2 == chars.length){\n \t comp2 = 0;\n \t }\n \t }\n \t }\n \t c--;\n \t b = fact(c);\n\t }\n\t //System.out.println(\"b: \" + b);\n\t return true;\n\t}", "static String isValid(String s){\n // Complete this function\n int[] charArray = new int[26];\n for(int i=0;i<26;i++){\n charArray[i] = 0;\n }\n for(int i=0;i<s.length();i++){\n int index = s.charAt(i) - 'a';\n charArray[index]++;\n }\n boolean oneDelete = false;\n //int prevValue = charArray[0];\n //System.out.println(\"a\" + \": \" + charArray[0]);\n /*for(int i=1;i<26;i++){\n System.out.println((char) (i+'a') + \": \" + charArray[i] + \" \" + \"prevValue\" + \": \" + prevValue);\n \n if(charArray[i] !=0 && prevValue!= 0 && charArray[i] != prevValue){\n if(oneDelete){\n return \"NO\";\n }else{\n if(Math.abs(charArray[i] - prevValue) != 1){\n return \"NO\";\n }else{\n oneDelete = true;\n }\n }\n }\n if(charArray[i] !=0){\n prevValue = charArray[i]; \n }\n }*/\n HashMap<Integer,Integer> frequencyCount = new HashMap<>();\n for(int i=0;i<26;i++){\n if(charArray[i] !=0){\n if(!frequencyCount.containsKey(charArray[i])){\n frequencyCount.put(charArray[i],1);\n }else{\n int count =frequencyCount.get(charArray[i]);\n frequencyCount.put(charArray[i],count+1);\n }\n }\n }\n \n if(frequencyCount.size() > 2){\n return \"NO\";\n }else if(frequencyCount.size() == 2){\n if(frequencyCount.containsKey(1) && frequencyCount.get(1) == 1){\n return \"YES\";\n }\n if(isConsecutiveFrequencies(frequencyCount)){\n return \"YES\";\n }else{\n return \"NO\";\n }\n }else{\n return \"YES\"; \n }\n \n \n }", "public boolean isMatchesBeginning(List<Code> codes) {\n int dxCounter = 0;\n int rxCounter = 0;\n\n for (int i = 0; i < codes.size(); i++) {\n if (beginningPattern.size() - codes.size() + i < 0)\n continue;\n\n if (codes.get(i).equals(beginningPattern.get\n (beginningPattern.size() + i - codes.size()))) {\n if (Phasing.isDx(codes.get(i)))\n dxCounter += 1;\n else if (Phasing.isRx(codes.get(i)))\n rxCounter += 1;\n }\n boolean phasingAchieved = (rxCounter >= 3)\n || ((rxCounter >= 2) && (dxCounter >= 1))\n || ((rxCounter >= 1) && (dxCounter >= 2));\n\n if (phasingAchieved)\n return true;\n }\n\n return false;\n }", "private static int getCombiningIndexFromStarter(char paramChar1, char paramChar2)\n/* */ {\n/* 1213 */ long l = getNorm32(paramChar1);\n/* 1214 */ if (paramChar2 != 0) {\n/* 1215 */ l = getNorm32FromSurrogatePair(l, paramChar2);\n/* */ }\n/* 1217 */ return extraData[(getExtraDataIndex(l) - 1)];\n/* */ }", "private static boolean startsWith(final CollationElementIterator i,\n final CollationElementIterator is) {\n do {\n final int cs = next(is);\n if(cs == -1) return true;\n if(cs != next(i)) return false;\n } while(true);\n }", "private boolean isIncreasing(String s) {\n char[] carray = s.toCharArray();\n int prev = carray[0] - '0';\n\n for(int i = 1; i < carray.length; i++) {\n int cur = carray[i] - '0';\n if (prev > cur) {\n return false;\n }\n prev = cur;\n }\n\n return true;\n }", "private boolean startsWithAFilteredPAttern(String string)\n {\n Iterator<String> iterator = filteredFrames.iterator();\n while (iterator.hasNext())\n {\n if (string.trim().startsWith(iterator.next()))\n {\n return true;\n }\n }\n return false;\n }", "public java.lang.String c(java.lang.String r9, java.lang.String r10) {\n /*\n r8 = this;\n r0 = 0;\n if (r9 == 0) goto L_0x0071;\n L_0x0003:\n r1 = r9.length();\n if (r1 != 0) goto L_0x000a;\n L_0x0009:\n goto L_0x0071;\n L_0x000a:\n r1 = r9.length();\n r2 = 59;\n r3 = r9.indexOf(r2);\n r4 = 1;\n r3 = r3 + r4;\n if (r3 == 0) goto L_0x0070;\n L_0x0018:\n if (r3 != r1) goto L_0x001b;\n L_0x001a:\n goto L_0x0070;\n L_0x001b:\n r5 = r9.indexOf(r2, r3);\n r6 = -1;\n if (r5 != r6) goto L_0x0023;\n L_0x0022:\n r5 = r1;\n L_0x0023:\n if (r3 >= r5) goto L_0x006f;\n L_0x0025:\n r7 = 61;\n r7 = r9.indexOf(r7, r3);\n if (r7 == r6) goto L_0x0066;\n L_0x002d:\n if (r7 >= r5) goto L_0x0066;\n L_0x002f:\n r3 = r9.substring(r3, r7);\n r3 = r3.trim();\n r3 = r10.equals(r3);\n if (r3 == 0) goto L_0x0066;\n L_0x003d:\n r7 = r7 + 1;\n r3 = r9.substring(r7, r5);\n r3 = r3.trim();\n r7 = r3.length();\n if (r7 == 0) goto L_0x0066;\n L_0x004d:\n r9 = 2;\n if (r7 <= r9) goto L_0x0065;\n L_0x0050:\n r9 = 0;\n r9 = r3.charAt(r9);\n r10 = 34;\n if (r10 != r9) goto L_0x0065;\n L_0x0059:\n r7 = r7 - r4;\n r9 = r3.charAt(r7);\n if (r10 != r9) goto L_0x0065;\n L_0x0060:\n r9 = r3.substring(r4, r7);\n return r9;\n L_0x0065:\n return r3;\n L_0x0066:\n r3 = r5 + 1;\n r5 = r9.indexOf(r2, r3);\n if (r5 != r6) goto L_0x0023;\n L_0x006e:\n goto L_0x0022;\n L_0x006f:\n return r0;\n L_0x0070:\n return r0;\n L_0x0071:\n return r0;\n */\n throw new UnsupportedOperationException(\"Method not decompiled: io.fabric.sdk.android.services.network.HttpRequest.c(java.lang.String, java.lang.String):java.lang.String\");\n }", "ArrayList<Character> nextCountAndSay(ArrayList<Character> sequence) {\n \tArrayList<Character> next = new ArrayList<Character>();\n \tint count = 0;\n \tCharacter c = sequence.get(0);\n \tfor(int i = 0; i < sequence.size(); i++) \n \t//@loop_invariant count represents the length of the longest \n \t// consecutive sequence s in sequence[0, i), all Characters in s\n \t// equal to c and s contains the last element of sequence[0, i) if \n \t// exists\n \t{\n \t\tif(count == 0) {\n \t\t\tcount = 1;\n \t\t\tc = sequence.get(i);\n \t\t}\n \t\telse {\n \t\t\tif(c == sequence.get(i)) {\n \t\t\t\tcount++;\n \t\t\t}\n \t\t\telse {\n \t\t\t\tthis.addCount(next, count);\n \t\t\t\tthis.addSay(next, c);\n \t\t\t\tcount = 1;\n \t\t\t\tc = sequence.get(i);\n \t\t\t}\n \t\t} \t\t\n \t}\n \tthis.addCount(next, count);\n \tthis.addSay(next, c);\n \treturn next;\n }", "public int findSubstringInWraproundString1(String p) {\n if(p == null || p.length() == 0) {\n return 0;\n }\n int pLength = p.length();\n // keep track of the number of consecutive letters for each substrings which starts from a...z\n int[] consecutiveNumberFrom = new int[26]; \n consecutiveNumberFrom[p.charAt(0) - 'a'] = 1;\n // keep track of the number of legacy consecutive letters\n int[] consecutiveCount = new int[pLength];\n consecutiveCount[0] = 1;\n int result = 1;\n for(int i = 1; i < pLength; i++) {\n consecutiveCount[i] = isConsecutive(p.charAt(i - 1), p.charAt(i))\n ? consecutiveCount[i - 1] + 1\n : 1;\n for(int j = i - consecutiveCount[i] + 1; j <= i; j++) {\n if(consecutiveNumberFrom[p.charAt(j) - 'a'] < i - j + 1) {\n result++;\n consecutiveNumberFrom[p.charAt(j) - 'a']++;\n } else {\n break;\n }\n }\n }\n return result;\n }", "public boolean startsWith(String prefix) {\n Trie cur = this;\n int i = 0;\n while(i < prefix.length()) {\n int c = prefix.charAt(i) - 'a';\n if(cur.tries[c] == null) {\n return false;\n }\n cur = cur.tries[c];\n i++;\n }\n return true;\n }", "public boolean startsWith(String prefix) {\n char[] chs = prefix.toCharArray();\n TreeNode cur = root;\n for (int i = 0; i < chs.length; i++) {\n int ind = chs[i] - 'a';\n if (cur.map[ind] == null) {\n return false;\n }\n cur = cur.map[ind];\n }\n return true;\n }", "public abstract boolean isStarterChar(char c);", "public boolean startsWith(String prefix) {\n/* 333 */ return this.m_str.startsWith(prefix);\n/* */ }", "private boolean expandCompositCharAtNear(char[] dest,int start, int length,\n int yehHamzaOption, int seenTailOption, int lamAlefOption){\n\n boolean spaceNotFound = false;\n\n\n\n if (isNormalizedLamAlefChar(dest[start])) {\n spaceNotFound = true;\n return spaceNotFound;\n }\n for (int i = start + length; --i >=start;) {\n char ch = dest[i];\n if (lamAlefOption == 1 && isNormalizedLamAlefChar(ch)) {\n if (i>start &&dest[i-1] == SPACE_CHAR) {\n dest[i] = LAM_CHAR;\n dest[--i] = convertNormalizedLamAlef[ch - '\\u065C'];\n } else {\n spaceNotFound = true;\n return spaceNotFound;\n }\n }else if(seenTailOption == 1 && isSeenTailFamilyChar(ch) == 1){\n if(i>start &&dest[i-1] == SPACE_CHAR){\n dest[i-1] = tailChar;\n } else{\n spaceNotFound = true;\n return spaceNotFound;\n }\n }else if(yehHamzaOption == 1 && isYehHamzaChar(ch)){\n\n if(i>start &&dest[i-1] == SPACE_CHAR){\n dest[i] = yehHamzaToYeh[ch - YEH_HAMZAFE_CHAR];\n dest[i-1] = HAMZAFE_CHAR;\n }else{\n spaceNotFound = true;\n return spaceNotFound;\n }\n\n\n }\n }\n return false;\n\n }", "private void combine(char[] chars, int begin) {\n\t\tif(begin==chars.length) {\r\n\t\t\tString result = String.valueOf(chars);\r\n\t\t\tif(!list.contains(result)) {\r\n\t\t\t\tlist.add(result);\r\n\t\t\t}\r\n\t\t\treturn ;\r\n\t\t}\r\n\t\tfor(int i=begin;i<chars.length;i++) {\r\n\t\t\tswap(chars,i,begin);\r\n\t\t\tcombine(chars, begin+1);\r\n\t\t\tswap(chars,i,begin);\r\n\t\t}\t\r\n\t}", "static void getNext(String T, int[] next) {\n\t\tint i = 0, j = -1;\n\t\tnext[0] = -1;\n\t\tint n = next.length;\n\t\twhile (i < n - 1) {\n\t\t\twhile (j > -1 && T.charAt(j) != T.charAt(i)) j = next[j];\n\t\t\t++i; ++j;\n\t\t\tif (i < n - 1 && T.charAt(j) == T.charAt(i)) next[i] = next[j];\n\t\t\telse next[i] = j;\n\t\t\t/*\n\t\t\tif (j == -1 || T.charAt(i) == T.charAt(j))\n\t\t\t\tnext[++i] = ++j;\n\t\t\telse\n\t\t\t\tj = next[j];\n\t\t\t\t*/\n\t\t}\n\t}", "public static boolean testAlphabetListAdd() {\r\n AlphabetList list1 = new AlphabetList();\r\n list1.add(new Cart(\"D\"));\r\n if (list1.size() != 1)\r\n return false;\r\n list1.add(new Cart(\"A\"));\r\n if (list1.size() != 2)\r\n return false;\r\n list1.add(new Cart(\"Z\"));\r\n if (list1.size() != 3)\r\n return false;\r\n list1.add(new Cart(\"C\"));\r\n if (list1.size() != 4)\r\n return false;\r\n if (list1.get(2).getCargo().toString() != \"D\")\r\n return false;\r\n if (list1.indexOf(new Cart(\"C\")) != 1)\r\n return false;\r\n if (!list1.readForward().equals(\"ACDZ\"))\r\n return false;\r\n if (!list1.readBackward().equals(\"ZDCA\"))\r\n return false;\r\n return true;\r\n }", "public static void main(String[] args) throws Exception {\n java.io.File threeLetterFile = new java.io.File(\"three-letter-words.txt\");\n \n //create custom SearchArray object with my search Methods\n threeletterwords.SearchArray search = new SearchArray();\n \n //create Scanner objects\n Scanner loadList = new Scanner(threeLetterFile);\n Scanner input = new Scanner(System.in);\n \n //declare arrays\n String[] threeLetterList = new String[1012];\n char[] startWordArray = new char[3];\n char[] finalWordArray = new char[3];\n char[] wordHolderArray = new char[3];\n char[] partialMatchArray = new char[3];\n char[] firstTwoArray = new char[2];\n char[] lastTwoArray = new char[2];\n \n //declare String Variables\n String startWord;\n String finalWord;\n String wordHolder;\n String partialMatch;\n String firstTwoHolder;\n String lastTwoHolder;\n \n //initialize boolean variables\n boolean wordCheck = true;\n boolean partialCheck = false;\n boolean firstTwoCheck = true;\n \n //initialize integer variables\n \n int moves = 0;\n int index = 0;\n \n /*This while loop will transfer the three letter words to the array\n * threeLetterList\n */\n \n while(loadList.hasNextLine()){\n threeLetterList[index] = loadList.nextLine();\n threeLetterList[index] = threeLetterList[index].toLowerCase();\n index++;\n }\n loadList.close();\n \n \n \n /* These do ... while loops make sure user only inputs a valid 3 letter \n * word from the list. Will loop until user gets it right.\n */\n \n do{\n System.out.println(\"Type in a Three Letter word from the list\");\n startWord = input.next();\n if (startWord.length() != 3){\n System.out.println(\"Word must be three Letters!\");\n }\n if (search.searchList(threeLetterList, startWord) == false){\n System.out.println(\"Word must be in list!\");\n }\n }while(startWord.length() != 3 || search.searchList(threeLetterList, startWord) == false);\n \n do{\n System.out.println(\"Type in a Second Three Letter word from the list\");\n finalWord = input.next();\n if (finalWord.length() != 3){\n System.out.println(\"Word must be three Letters!\");\n }\n if (search.searchList(threeLetterList, finalWord) == false){\n System.out.println(\"Word must be in list!\");\n }\n }while(finalWord.length() != 3 || search.searchList(threeLetterList, finalWord) == false);\n \n //initialize strings and arrays\n System.arraycopy(startWord.toCharArray(), 0, startWordArray, 0, 3);\n System.arraycopy(startWord.toCharArray(), 0, wordHolderArray, 0, 3);\n System.arraycopy(finalWord.toCharArray(), 0, finalWordArray, 0, 3);\n System.arraycopy(startWord.toCharArray(), 0, firstTwoArray, 0, 2);\n System.arraycopy(startWord.toCharArray(), 1, lastTwoArray, 0, 2);\n wordHolder = String.copyValueOf(wordHolderArray);\n firstTwoHolder = String.copyValueOf(firstTwoArray);\n lastTwoHolder = String.copyValueOf(lastTwoArray);\n \n /*the following section of code is what makes the \"moves\"\n * \n */\n while(wordHolder.toLowerCase().contentEquals(finalWord.toLowerCase()) == false){ \n for(int k = 0; k < finalWordArray.length; k++){\n if(wordHolderArray[k] != finalWordArray[k]){\n wordHolderArray[k] = finalWordArray[k];\n wordHolder = String.copyValueOf(wordHolderArray);\n if (search.searchList(threeLetterList, wordHolder) == true){\n moves++;\n System.out.println(\"Move \" + moves + \":\\t\" + wordHolder);\n }\n else{\n wordHolderArray[k] = startWordArray[k];\n wordHolder = String.copyValueOf(wordHolderArray);\n }\n }\n }\n if(wordHolder.toLowerCase().contentEquals(startWord.toLowerCase())){\n \n }\n } \n }", "@Override\n public boolean hasNext() {\n return this.currIndex < this.circularString.size();\n }", "private int findCharacter(char ch, String inputString, int currentIdx) {\n if (inputString.isEmpty()) {\n return -1;\n }\n return inputString.charAt(0) == ch ? currentIdx : findCharacter(ch, inputString.substring(1), ++currentIdx);\n }", "private static boolean startsWith(final String source, final String prefix) {\n return prefix.length() <= source.length() && source.regionMatches(true, 0, prefix, 0, prefix.length());\n }", "private boolean FCDCheck(int ch, int offset)\n {\n boolean result = true;\n\n // Get the trailing combining class of the current character.\n // If it's zero, we are OK.\n m_FCDStart_ = offset - 1;\n m_source_.setIndex(offset);\n // trie access\n int fcd;\n if (ch < 0x180) {\n fcd = m_nfcImpl_.getFCD16FromBelow180(ch);\n } else if (m_nfcImpl_.singleLeadMightHaveNonZeroFCD16(ch)) {\n if (Character.isHighSurrogate((char)ch)) {\n int c2 = m_source_.next(); \n if (c2 < 0) {\n fcd = 0; // end of input\n } else if (Character.isLowSurrogate((char)c2)) {\n fcd = m_nfcImpl_.getFCD16FromNormData(Character.toCodePoint((char)ch, (char)c2));\n } else {\n m_source_.moveIndex(-1);\n fcd = 0;\n }\n } else {\n fcd = m_nfcImpl_.getFCD16FromNormData(ch);\n }\n } else {\n fcd = 0;\n }\n\n int prevTrailCC = fcd & LAST_BYTE_MASK_;\n\n if (prevTrailCC == 0) {\n offset = m_source_.getIndex();\n } else {\n // The current char has a non-zero trailing CC. Scan forward until\n // we find a char with a leading cc of zero.\n while (true) {\n ch = m_source_.nextCodePoint();\n if (ch < 0) {\n offset = m_source_.getIndex();\n break;\n }\n // trie access\n fcd = m_nfcImpl_.getFCD16(ch);\n int leadCC = fcd >> SECOND_LAST_BYTE_SHIFT_;\n if (leadCC == 0) {\n // this is a base character, we stop the FCD checks\n offset = m_source_.getIndex() - Character.charCount(ch);\n break;\n }\n\n if (leadCC < prevTrailCC) {\n result = false;\n }\n\n prevTrailCC = fcd & LAST_BYTE_MASK_;\n }\n }\n m_FCDLimit_ = offset;\n m_source_.setIndex(m_FCDStart_ + 1);\n return result;\n }", "public boolean startWith(String prefix) {\n boolean result = true;\n char[] prefixChar = prefix.toCharArray();\n if (prefixChar.length > data.length) {\n return false;\n }\n for (int i = 0; i < prefixChar.length; i++) {\n if (prefixChar[i] != data[i]) {\n result = false;\n break;\n }\n }\n return result;\n }", "public ArrayList<Token> walkTable(char c) {\n \t\treturnList = null;\n \t\tif(currentState.isFinal){\n \t\t\t\tlastKnownValidToken = new StringBuffer(currentToken);\n \t\t}\n \t\tcurrentToken.append(c);\n \t\tcurrentState = dfa.get(new StateCharacter(currentState,c));\n \t\t\n \t\tif(currentState == null){\n \t\t\tint numCharactersUndealtWith = currentToken.length() - lastKnownValidToken.length();\n \t\t\tStringBuffer newCurrentToken = new StringBuffer();\n \t\t\tfor(int i=0;i<numCharactersUndealtWith;i++){\n \t\t\t\tnewCurrentToken.append(currentToken.length()-numCharactersUndealtWith+i);\n \t\t\t}\n \t\t\treturnList.add(new Token(null,lastKnownValidToken));//How do we know what type the token is?\n \t\t\treEvaluate(newCurrentToken);\n \t\t\treturn returnList;\n \t\t}\n \t\telse{\n \t\t\treturn null;\n\t\t}\n \t}", "void startIndexing();", "private String checkSegments(ArrayList<DataSegment> list, int start, int end) {\n if (list.isEmpty()) return \"38020\";\n if (list.get(0).getSegmentStart()!=start) return \"38021\";\n if (list.get(list.size()-1).getSegmentEnd()!=end) return \"38022\";\n int lastend=start-1; \n for (int i=0;i<list.size();i++) {\n DataSegment segment=list.get(i);\n if (segment.getSegmentStart()!=lastend+1) return \"38023[\"+(i+1)+\"/\"+(list.size())+\"]\";\n lastend=segment.getSegmentEnd();\n if (lastend>end) return \"38024[\"+(i+1)+\"/\"+(list.size())+\"]\";\n }\n return null;\n }", "static int indexOf(char[] source, int sourceOffset, int sourceCount, char[] target, int targetOffset, int targetCount, int fromIndex) {\n\t\tif (fromIndex >= sourceCount) {\n\t\t\treturn (targetCount == 0 ? sourceCount : -1);\n\t\t}\n\t\tif (fromIndex < 0) {\n\t\t\tfromIndex = 0;\n\t\t}\n\t\tif (targetCount == 0) {\n\t\t\treturn fromIndex;\n\t\t}\n\n\t\tchar first = target[targetOffset];\n\t\tint max = sourceOffset + (sourceCount - targetCount);\n\n\t\tfor (int i = sourceOffset + fromIndex; i <= max; i++) {\n\t\t\t/* Look for first character. */\n\t\t\tif (source[i] != first) {\n\t\t\t\twhile (++i <= max && source[i] != first)\n\t\t\t\t\t;\n\t\t\t}\n\n\t\t\t/* Found first character, now look at the rest of v2 */\n\t\t\tif (i <= max) {\n\t\t\t\tint j = i + 1;\n\t\t\t\tint end = j + targetCount - 1;\n\t\t\t\tfor (int k = targetOffset + 1; j < end && source[j] == target[k]; j++, k++)\n\t\t\t\t\t;\n\n\t\t\t\tif (j == end) {\n\t\t\t\t\t/* Found whole string. */\n\t\t\t\t\treturn i - sourceOffset;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn -1;\n\t}", "static int ctrno(String c) {\n int i=0;\n if (constrlist==null) {System.out.println(\"constrlist null\");}\n while (i<constrlist.size() && !c.equals(constrlist.get(i))) {i++;}\n if (i==constrlist.size()) {i=-1;}\n return i;\n }", "public boolean startsWith(XMLString prefix, int toffset) {\n/* 313 */ return this.m_str.startsWith(prefix.toString(), toffset);\n/* */ }", "public int searchPrefix(StringBuilder strBuild){\r\n\t\t//declare variables\r\n\t\tboolean successfulWord = false;\r\n\t\tboolean successfulPre = false;\r\n\t\tint retVal = 0;\r\n\t\tDLBNode current = nodes;\r\n\t\tint strLength = strBuild.length();\r\n\t\t\r\n\t\t//iterate through the entire string\r\n\t\tfor(int i = 0; i < strLength; i++){\r\n\t\t\tint correctLetter = 0;\r\n\t\t\r\n\t\t\t//while there's still a letter to check\r\n\t\t\twhile(current != null){\r\n\t\t\t\t\r\n\t\t\t\t//if the current letter is available/possible in the list, step to the next value\r\n\t\t\t\tif(current.value == strBuild.charAt(i)){\r\n\t\t\t\t\tcorrectLetter = 1;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif(current.childNode == null){\r\n\t\t\t\t\t\t//null value \r\n\t\t\t\t\t\treturn retVal;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t//increment through the structure to the next value\r\n\t\t\t\t\t\tcurrent = current.childNode;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//if there are any siblings to check and the letter has failed, check the siblings\r\n\t\t\t\t\tif(current.siblingNode != null){\r\n\t\t\t\t\t\tcurrent = current.siblingNode;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t//null siblings and children\r\n\t\t\t\t\t\treturn retVal;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//if the letter is viable and the value is not the end of the row\r\n\t\t\tif(correctLetter == 1 && i == (strBuild.length() - 1)){\r\n\t\t\t\t//continue searching while there is another node\r\n\t\t\t\twhile(current != null){\r\n\t\t\t\t\t\r\n\t\t\t\t\t//if there's not a bar but its still a successful value, return true for a prefix\r\n\t\t\t\t\tif(current.value != '|'){\r\n\t\t\t\t\t\tsuccessfulPre = true;\r\n\t\t\t\t\t\t//if there's a bar, its a true word\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\tsuccessfulWord = true;\r\n\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t//check siblings of current node\r\n\t\t\t\t\tcurrent = current.siblingNode;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Set retVal to the necessary value to alert of status.\r\n\t\t//1. Prefix\r\n\t\t//2. Word \r\n\t\t//3. Prefix & word\r\n\t\tif(successfulPre && successfulWord){\r\n\t\t\t\r\n\t\t\tretVal = 3;\r\n\r\n\t\t}else if(successfulPre){\r\n\t\t\t\r\n\t\t\tretVal = 1;\r\n\t\t\t\r\n\t\t}else if(successfulWord){\r\n\t\t\t\r\n\t\t\tretVal = 2;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//return retVal\r\n\t\treturn retVal;\r\n\t}", "private int nextHangul(RuleBasedCollator collator, char ch)\n {\n char L = (char)(ch - HANGUL_SBASE_);\n\n // divide into pieces\n // do it in this order since some compilers can do % and / in one\n // operation\n char T = (char)(L % HANGUL_TCOUNT_);\n L /= HANGUL_TCOUNT_;\n char V = (char)(L % HANGUL_VCOUNT_);\n L /= HANGUL_VCOUNT_;\n\n // offset them\n L += HANGUL_LBASE_;\n V += HANGUL_VBASE_;\n T += HANGUL_TBASE_;\n\n // return the first CE, but first put the rest into the expansion\n // buffer\n m_CEBufferSize_ = 0;\n if (!m_collator_.m_isJamoSpecial_) { // FAST PATH\n m_CEBuffer_[m_CEBufferSize_ ++] =\n collator.m_trie_.getLeadValue(L);\n m_CEBuffer_[m_CEBufferSize_ ++] =\n collator.m_trie_.getLeadValue(V);\n\n if (T != HANGUL_TBASE_) {\n m_CEBuffer_[m_CEBufferSize_ ++] =\n collator.m_trie_.getLeadValue(T);\n }\n m_CEBufferOffset_ = 1;\n return m_CEBuffer_[0];\n }\n else {\n // Jamo is Special\n // Since Hanguls pass the FCD check, it is guaranteed that we\n // won't be in the normalization buffer if something like this\n // happens\n // Move Jamos into normalization buffer\n m_buffer_.append(L);\n m_buffer_.append(V);\n if (T != HANGUL_TBASE_) {\n m_buffer_.append(T);\n }\n m_bufferOffset_ = 0;\n m_FCDLimit_ = m_source_.getIndex();\n m_FCDStart_ = m_FCDLimit_ - 1;\n // Indicate where to continue in main input string after\n // exhausting the buffer\n return IGNORABLE;\n }\n }", "static int safeIndexOf(String src, String sub, int start, boolean caseSensitive) throws UnexpectedFormatException {\n if (caseSensitive) {\n int pos = src.indexOf(sub, start);\n if (pos<0)\n throw new UnexpectedFormatException();\n return pos;\n } else {\n for (int pos=start; pos<=src.length()-sub.length(); ++pos) {\n boolean match = true;\n for (int i=0; i<sub.length(); ++i) {\n if (Character.toLowerCase(src.charAt(pos+i))!=Character.toLowerCase(sub.charAt(i))) {\n match = false;\n break;\n }\n }\n if (match)\n return pos;\n }\n throw new UnexpectedFormatException();\n }\n }", "private static boolean CharInClassInternal(char ch, String set, int start, int mySetLength, int myCategoryLength)\n\t{\n\t\tint min;\n\t\tint max;\n\t\tint mid;\n\t\tmin = start + SETSTART;\n\t\tmax = min + mySetLength;\n\n\t\twhile (min != max)\n\t\t{\n\t\t\tmid = (min + max) / 2;\n\t\t\tif (ch < set.charAt(mid))\n\t\t\t{\n\t\t\t\tmax = mid;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tmin = mid + 1;\n\t\t\t}\n\t\t}\n\n\t\t// The starting position of the set within the character class determines\n\t\t// whether what an odd or even ending position means. If the start is odd, \n\t\t// an *even* ending position means the character was in the set. With recursive \n\t\t// subtractions in the mix, the starting position = start+SETSTART. Since we know that \n\t\t// SETSTART is odd, we can simplify it out of the equation. But if it changes we need to \n\t\t// reverse this check. \n\t\tDebug.Assert((SETSTART & 0x1) == 1, \"If SETSTART is not odd, the calculation below this will be reversed\");\n\t\tif ((min & 0x1) == (start & 0x1))\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (myCategoryLength == 0)\n\t\t\t{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn CharInCategory(ch, set, start, mySetLength, myCategoryLength);\n\t\t}\n\t}", "private int nextChar()\n {\n int result;\n\n // loop handles the next character whether it is in the buffer or not.\n if (m_bufferOffset_ < 0) {\n // we're working on the source and not normalizing. fast path.\n // note Thai pre-vowel reordering uses buffer too\n result = m_source_.next();\n }\n else {\n // we are in the buffer, buffer offset will never be 0 here\n if (m_bufferOffset_ >= m_buffer_.length()) {\n // Null marked end of buffer, revert to the source string and\n // loop back to top to try again to get a character.\n m_source_.setIndex(m_FCDLimit_);\n m_bufferOffset_ = -1;\n m_buffer_.setLength(0);\n return nextChar();\n }\n return m_buffer_.charAt(m_bufferOffset_ ++);\n }\n int startoffset = m_source_.getIndex();\n if (result < FULL_ZERO_COMBINING_CLASS_FAST_LIMIT_\n // Fast fcd safe path. trail combining class == 0.\n || m_collator_.getDecomposition() == Collator.NO_DECOMPOSITION\n || m_bufferOffset_ >= 0 || m_FCDLimit_ >= startoffset) {\n // skip the fcd checks\n return result;\n }\n\n if (result < LEAD_ZERO_COMBINING_CLASS_FAST_LIMIT_) {\n // We need to peek at the next character in order to tell if we are\n // FCD\n int next = m_source_.current();\n if (next == UCharacterIterator.DONE\n || next < LEAD_ZERO_COMBINING_CLASS_FAST_LIMIT_) {\n return result; // end of source string and if next character\n // starts with a base character is always fcd.\n }\n }\n\n // Need a more complete FCD check and possible normalization.\n if (!FCDCheck(result, startoffset)) {\n normalize();\n result = m_buffer_.charAt(0);\n m_bufferOffset_ = 1;\n }\n return result;\n }", "public boolean startsWith(String prefix) {\n char [] words=prefix.toCharArray();\n CharTree t=root;\n for (char c : words) {\n t=t.next[c-97];\n if(t==null)return false;\n }\n return true;\n }", "private int parseCharArray(char[] input,\n int offset,\n int end,\n int[] currentLineNr)\n throws XMLParseException {\n this.lineNr = currentLineNr[0];\n this.tagName = null;\n this.contents = null;\n this.attributes = new Properties();\n this.children = new Vector();\n\n try {\n offset = this.skipWhitespace(input, offset, end, currentLineNr);\n } catch (XMLParseException e) {\n return offset;\n }\n\n offset = this.skipPreamble(input, offset, end, currentLineNr);\n offset = this.scanTagName(input, offset, end, currentLineNr);\n this.lineNr = currentLineNr[0];\n offset = this.scanAttributes(input, offset, end, currentLineNr);\n int[] contentOffset = new int[1];\n int[] contentSize = new int[1];\n int contentLineNr = currentLineNr[0];\n offset = this.scanContent(input, offset, end,\n contentOffset, contentSize, currentLineNr);\n\n if (contentSize[0] > 0) {\n this.scanChildren(input, contentOffset[0], contentSize[0],\n contentLineNr);\n\n if (this.children.size() > 0) {\n this.contents = null;\n }\n else {\n this.processContents(input, contentOffset[0],\n contentSize[0], contentLineNr);\n for (int i = 0; i < contentSize[0]; i++) {\n if (input[contentOffset[0] + i] > ' ') {\n return offset;\n }\n }\n\n this.contents = null;\n }\n }\n\n return offset;\n }", "public boolean startsWith(final byte[] string, final byte[] sub, final InputInfo info)\n throws QueryException {\n\n final RuleBasedCollator rbc = rbc(info);\n return startsWith(rbc.getCollationElementIterator(string(string)),\n rbc.getCollationElementIterator(string(sub)));\n }", "char startChar();", "public boolean mixStart(String str) {\n if (str.length() < 3) return false;\n return (str.substring(1,3).equals(\"ix\"));\n}", "private void analyzeLiterals() {\n\t\t\n\t\tint lastLength = 0;\n\t\tfor(int i = 0; i < literalsList.size(); ++i) {\n\t\t\t// Update lengths of literals array with indexes\n\t\t\tif(lastLength != literalsList.get(i).length() - 5) {\n\t\t\t\tindexes.add(i);\n\t\t\t\tlengths.add(literalsList.get(i).length() - 5); // -5 for \"\"@en\n\t\t\t}\n\t\t\tlastLength = literalsList.get(i).length() - 5;\n\t\t\t\n\t\t}\n\t\t\n\t}", "public boolean updateLetterList(char c){\n\t\tif(!usedLetters.contains(c)){\n\t\t\tusedLetters.add(c);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "private static boolean stringStartsWith(String string, String prefix){\n for(int i=0; i < prefix.length(); i++){\n if(string.charAt(i) != prefix.charAt(i)){\n return false;\n }\n }\n return true;\n }", "private void past(char c) {\n\t\twhile (!done() && c!=program.charAt(pos))\n\t\t\tpos++;\n\t\tif (!done() && c==program.charAt(pos))\n\t\t\tpos++;\n\t}", "private void validSyntaxis(char[] fun){\n\t\tString valores = \"(a+/*-^\";\n\t\tString valores1 =\"(+/*-^\";\n\t\tString operadores =\"+/*-^\";\n\t\tString valores2 =\"(+-yzxuvwlmnjkpstc123456789e0ai\";\n\t\t//String valores2 =\"(+-xyzstc123456789e0ai\";\n\t\t//String valores3 =\"x1234567890\";\n\t\tString valores3 =\"x1234567890\";\n\t\tString valores4 =\"1234567890\";\n\t\tint pos = fun.length-1;\n\n\t\tif(pos == 0){\n\t\t\tif(valores2.indexOf(fun[pos]) == -1)\n\t\t\t\tcont++;\n\t\t\telse\n\t\t\t\tif(valores2.indexOf(fun[pos]) == 0)\n\t\t\t\t\tcont2++;\n\n\t\t}\n\n\t\telse if(pos >= 1){\n\t\t\tchar aux = fun[pos];\n\t\t\tchar aux2 = fun[pos-1];\n\n\t\t\t//Caracter 'a','A'\n\t\t\tif(aux == 'a'){\n\t\t\t\tif(valores1.indexOf(aux2) == -1 && aux2 != 't')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == 'i' || aux == 'e'){\n\t\t\t\tif(aux2 != 's' && valores1.indexOf(aux2) == -1)\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == 's'){\n\t\t\t\tif(aux2 != 'c' && valores.indexOf(aux2) == -1 && aux2 != 'b' && aux2 != 'o')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == 'c'){\n\t\t\t\tif(aux2 != 's' && valores.indexOf(aux2) == -1 && aux2 != 'e')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == 't'){\n\t\t\t\tif(aux2 != 'r' && valores.indexOf(aux2) == -1 && aux2 != 'o')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == 'o'){\n\t\t\t\tif(aux2 != 'c')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == 'b'){\n\t\t\t\tif(aux2 != 'a')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == 'n'){\n\t\t\t\tif(aux2 != 'i' && aux2 != 'a')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == 'x'){\n\t\t\t\tif(valores4.indexOf(aux2) != -1)\n\t\t\t\t\tcont++;\n\n\t\t\t}\n\n\n\t\t\telse if(aux == 'h'){\n\t\t\t\tif(aux2 != 'n' && aux2 != 's' && aux2 != 'c' && aux2 != 't')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == 'r'){\n\t\t\t\tif(aux2 != 'q')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == '.'){\n\t\t\t\t\n\t\t\t\tif(valores4.indexOf(aux2) == -1)\n\t\t\t\t\tcont++;\n\n\t\t\t\tboolean existe = false;\n\t\t\t\tint i = pos;\n\t\t\t\twhile(operadores.indexOf(fun[i]) == -1 && i > 0){\n\t\t\t\t\tif(existe && fun[i] == '.'){\n\t\t\t\t\t\tcont++;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tif(fun[i] == '.')\n\t\t\t\t\t\texiste = true;\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\telse if(aux == 'q'){\n\t\t\t\tif(aux2 != 's')\n\t\t\t\t\tcont++;\n\t\t\t\tif(pos > 1)\n\t\t\t\t\tif(fun[pos-2] == 'o' || fun[pos-2] == 'b' || fun[pos-2] == 'c' || fun[pos-2] == 'a')\n\t\t\t\t\t\tcont++;\n\t\t\t}\n\t\t\n\t\t\telse if(valores3.indexOf(aux) != -1){\n\t\t\t\tif(valores1.indexOf(aux2) == -1 && aux2 != '(' && valores4.indexOf(aux2) == -1 && aux2 != '.')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == '('){\n\t\t\t\tcont2++;\n\t\t\t\tif(aux2 != 'n' && aux2 != 's' && aux2 != 'c' && aux2 != 't' && aux2 != 'h' && valores1.indexOf(aux2) == -1)\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == ')'){\n\t\t\t\tcont2--;\n\t\t\t\tif(valores3.indexOf(aux2) == -1 && aux2 != ')')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == '+' || aux == '-'){\n\t\t\t\tif(valores3.indexOf(aux2) == -1 && aux2 != ')' && aux2 != '(' && aux2 != '^')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\telse if(aux == '/' || aux == '*' || aux == '^'){\n\t\t\t\tif(valores3.indexOf(aux2) == -1 && aux2 != ')')\n\t\t\t\t\tcont++;\n\t\t\t}\n\n\t\t\tif((aux2 == '/' || aux2 == '*' || aux2 == '^') && pos == 1)\n\t\t\t\tcont++;\n\t\t}\n\n\t\tif(cont > 0 || cont2 != 0)\n\t\t\tthis.setBackground(Color.RED);\n\t\telse\n\t\t\tthis.setBackground(Color.GREEN);\n\t}", "public static void main(String[] args) {\n\t\t\r\n\t\tint a [] = {1,0,0,1,1,0,0,1,0,1,0,0,0,1};\r\n\t\t\r\n\t\tboolean start = false;\r\n\t\t//boolean end = false;\r\n\t\tString s = \"\";\r\n\t\tString k = Arrays.toString(a);\r\n\t\tString[] strings = (k.replace(\"[\", \"\").replace(\"]\", \"\").split(\", \"));\r\n\t\tString s1 = (k.replace(\"[\", \"\").replace(\"]\", \"\"));\r\n\t\tString s2 = (s1.replace(\",\", \"\"));\r\n\t\tString s3 = s2.replaceAll(\"\\\\s\", \"\");\r\n\t\t//String stringss = strings.toString();\r\n\t\t//String[] stringss = strings.replaceAll(\"\\\\s\", \"\").split(\"\");\r\n\t\t\r\n\t\tint Startindex = 0;\r\n\t\tint Endindex = 0;\r\n\t\tArrayList<String> ai = new ArrayList<String>();\r\n\t\tfor (int i =0;i<=strings.length-1;i++) {\r\n\t\t\tint result = Integer.parseInt(strings[i]);\r\n\t\t\t\r\n\t\t\tif (result==1 && !start) {\r\n\t\t\t\t\r\n\t\t\t\tstart = true;\r\n\t\t\t\tStartindex = i;\r\n\t\t\t\t\r\n\t\t\t}else if (result==1 && start) {\r\n\t\t\t\tstart = false;\r\n\t\t\t\tEndindex = i;\r\n\t\t\t\ts = s3.substring(Startindex, Endindex+1);\r\n\t\t\t\tai.add(s);\r\n\t\t\t\ti =i-1;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\nSystem.out.println(ai);\r\n\t}", "private boolean secondCharIs(char expected) {\n if (reachedEnd()) {\n return false;\n }\n\n if (source.charAt(current) != expected) {\n return false;\n }\n\n current++;\n return true;\n }", "public boolean startsWith(String prefix) {\n Trie root = this;\n for (char c : prefix.toCharArray()) {\n if (root.next[c - 'a'] != null) {\n root = root.next[c - 'a'];\n } else {\n return false;\n }\n }\n return true;\n }", "private void checkListOrder(String[] sortedList, Collator c) {\n for (int i = 0; i < sortedList.length - 1; i++) {\n if (c.compare(sortedList[i], sortedList[i + 1]) >= 0) {\n errln(\"List out of order at element #\" + i + \": \"\n + sortedList[i] + \" >= \"\n + sortedList[i + 1]);\n }\n }\n }", "private boolean startsWithAny(final String anyString, final String... startValues) {\n for (final String startValue : startValues) {\n if (shouldFixLineStart(anyString, startValue)) {\n return true;\n }\n }\n return false;\n }", "protected static int advanceUntil(CharBuffer array, int pos, int length, char min) {\n int lower = pos + 1;\n\n // special handling for a possibly common sequential case\n if (lower >= length || (array.get(lower)) >= (min)) {\n return lower;\n }\n\n int spansize = 1; // could set larger\n // bootstrap an upper limit\n\n while (lower + spansize < length\n && (array.get(lower + spansize)) < (min)) {\n spansize *= 2; // hoping for compiler will reduce to\n }\n // shift\n int upper = (lower + spansize < length) ? lower + spansize : length - 1;\n\n // maybe we are lucky (could be common case when the seek ahead\n // expected\n // to be small and sequential will otherwise make us look bad)\n if (array.get(upper) == min) {\n return upper;\n }\n\n if ((array.get(upper)) < (min)) {// means\n // array\n // has no\n // item\n // >= min\n // pos = array.length;\n return length;\n }\n\n // we know that the next-smallest span was too small\n lower += (spansize >>> 1);\n\n // else begin binary search\n // invariant: array[lower]<min && array[upper]>min\n while (lower + 1 != upper) {\n int mid = (lower + upper) >>> 1;\n char arraymid = array.get(mid);\n if (arraymid == min) {\n return mid;\n } else if ((arraymid) < (min)) {\n lower = mid;\n } else {\n upper = mid;\n }\n }\n return upper;\n\n }", "public static void main(String []abcd){\n\t\tchar A[]={'a','b','d','r','x','y','z'};\t//rendom sorted character in dense array\r\n\t\tint n=A.length;\t\t\t\t//assigning array length in n variable \r\n\t\tchar x='d';\t\t\t\t//the input character to be findout\r\n\t\tboolean Notfound=false;\t\t\t//just for while loop condition\r\n\t\tint lowerBound=1;\t\t\t//lowerBound varible assigned 1 \r\n\t\tint upperBound=n;\t\t\t//uppernound variable assigned with n (length of array)\r\n\t\t\r\n\t\twhile(!Notfound){\t\t\t//while loop start till NotFound variable beacme true\r\n\t\t\tif(upperBound < lowerBound)\t//if statement for the variable not found\r\n\t\t\t\t{System.out.print(\"Doesn't exitst\");\t//print statement\r\n\t\t\t\tbreak;}\t\t\t\t\t//breake the while loop\r\n\t\t\tint midPoint=lowerBound+(upperBound-lowerBound)/2;\t//calculating mid point vale and saving it in midPoint variable\r\n\t\t\tif((int)A[midPoint]<(int)x)\t\t\t\t//checking if the giving character is greater then mid point character by checking their assici code\r\n\t\t\t\tlowerBound=midPoint+1;\t\t\t\t//setting lb to mp+1\r\n\t\t\tif((int)A[midPoint]>(int)x)\t\t\t\t//checking if the giving character is less then mid point character by checking their assici code\r\n\t\t\t\tupperBound=midPoint-1;\t\t\t\t//setting up to mp-1\r\n\t\t\tif((int)A[midPoint]==(int)x)\t\t\t\t//checking if the giving character is equals to mid point character by checking their assici code\r\n\t\t\t\t{System.out.print(x+\" at:\"+midPoint);\t\t//printing statement \r\n\t\t\t\tNotfound=true;\t\t\t\t\t//making NotFound variable true\r\n\t\t\t\tbreak;}\t\t\t\t\t\t//breaking while loop\r\n\t\t}\t\t\t\t\t\t\t\t//end of main body\r\n\t\t\r\n\t}", "void calc_next(String re)\r\n\t{\r\n\t\tint i,j,k;\r\n\t\tnext=new int[re.length()];\r\n\t\tfor (i=0; i<re.length(); ++i)\r\n\t\t{\r\n\t\t\tif (re.charAt(i)=='(')\r\n\t\t\t{\r\n\t\t\t\tk=0;\r\n\t\t\t\tj=i;\r\n\t\t\t\twhile (true)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (re.charAt(j)=='(')\r\n\t\t\t\t\t\t++k;\r\n\t\t\t\t\tif (re.charAt(j)==')')\r\n\t\t\t\t\t\t--k;\r\n\t\t\t\t\tif (k==0)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t++j;\r\n\t\t\t\t}\r\n\t\t\t\tnext[i]=j;\r\n\t\t\t}\r\n\t\t\telse next[i]=i;\r\n\t\t}\r\n\t}", "public int fromBeginning(String str) {\n if(str == null || str.length() == 0)\n return 0;\n char[] ca = str.toCharArray();\n int res = 0, pre = 0;\n for(char c : ca) {\n res += map.get(c);\n if(pre != 0 && pre < map.get(c))\n res -= 2 * pre;\n pre = map.get(c);\n }\n return res;\n }", "@Test\n public void should_fail_if_actual_does_not_start_with_sequence_according_to_custom_comparison_strategy() {\n assertThatExceptionOfType(AssertionError.class).isThrownBy(() -> {\n Iterator<String> names = asList(\"Luke\", \"Leia\").iterator();\n String[] sequence = { \"Han\", \"C-3PO\" };\n assertThat(names).usingElementComparator(CaseInsensitiveStringComparator.instance).startsWith(sequence);\n });\n }", "protected abstract boolean isCrcPositionInternal(int index);", "public static void main(String[] args) {\n\n\n String str = \"ABAB\";\n // index number:123\n\n\n String result = \"\"; // \"CD\" We store expected result\n\n for(int i=0; i <= str.length()-1 ; i++){ // 0 , 1, 2 ,3\n /*\n if( !result.contains( \"\"+str.charAt(i)) ) {\n result += str.charAt(i);\n }\n */\n\n if(result.contains( \"\"+str.charAt(i) )){// is in the index number\n continue;// if the string result does not contains str.charAt(i), then we concate it to the result,\n // if it does we will not concate it to the result\n }\n\n result += str.charAt(i);\n\n }\n\n System.out.println(result);\n\n\n\n\n\n\n\n\n }", "public boolean shouldFixLineStart(final String line, final String startValue) {\n for (final String lineStarter : LINE_STARTS) {\n if (line.startsWith(lineStarter + startValue)) {\n return true;\n }\n }\n return false;\n }", "@Nullable\n Set<String> findFileNamesMatchingIfCheap(char nextLetter, MinusculeMatcher matcher) {\n List<Pair<VirtualFile, String>> files = getMatchingRoots();\n Set<String> names = new HashSet<>();\n AtomicInteger counter = new AtomicInteger();\n BooleanSupplier tooMany = () -> counter.get() > 1000;\n for (Pair<VirtualFile, String> pair : files) {\n if (containsChar(pair.second, nextLetter) && matcher.matches(pair.second)) {\n names.add(pair.first.getName());\n } else {\n processProjectFilesUnder(pair.first, sub -> {\n counter.incrementAndGet();\n if (tooMany.getAsBoolean()) return false;\n\n String name = sub.getName();\n if (containsChar(name, nextLetter) && matcher.matches(name)) {\n names.add(name);\n }\n return true;\n });\n }\n }\n return tooMany.getAsBoolean() ? null : names;\n }", "private static int insertOrdered(char[] paramArrayOfChar, int paramInt1, int paramInt2, int paramInt3, char paramChar1, char paramChar2, int paramInt4)\n/* */ {\n/* 656 */ int n = paramInt4;\n/* */ \n/* 658 */ if ((paramInt1 < paramInt2) && (paramInt4 != 0)) {\n/* */ int i;\n/* 660 */ int j = i = paramInt2;\n/* 661 */ PrevArgs localPrevArgs = new PrevArgs(null);\n/* 662 */ localPrevArgs.current = paramInt2;\n/* 663 */ localPrevArgs.start = paramInt1;\n/* 664 */ localPrevArgs.src = paramArrayOfChar;\n/* */ \n/* 666 */ int m = getPrevCC(localPrevArgs);\n/* 667 */ j = localPrevArgs.current;\n/* */ \n/* 669 */ if (paramInt4 < m)\n/* */ {\n/* 671 */ n = m;\n/* 672 */ i = j;\n/* 673 */ while (paramInt1 < j) {\n/* 674 */ m = getPrevCC(localPrevArgs);\n/* 675 */ j = localPrevArgs.current;\n/* 676 */ if (paramInt4 >= m) {\n/* */ break;\n/* */ }\n/* 679 */ i = j;\n/* */ }\n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* */ \n/* 690 */ int k = paramInt3;\n/* */ do {\n/* 692 */ paramArrayOfChar[(--k)] = paramArrayOfChar[(--paramInt2)];\n/* 693 */ } while (i != paramInt2);\n/* */ }\n/* */ }\n/* */ \n/* */ \n/* 698 */ paramArrayOfChar[paramInt2] = paramChar1;\n/* 699 */ if (paramChar2 != 0) {\n/* 700 */ paramArrayOfChar[(paramInt2 + 1)] = paramChar2;\n/* */ }\n/* */ \n/* */ \n/* 704 */ return n;\n/* */ }", "private boolean expandCompositCharAtEnd(char[] dest,int start, int length,\n int lacount){\n boolean spaceNotFound = false;\n\n if (lacount > countSpacesLeft(dest, start, length)) {\n spaceNotFound = true;\n return spaceNotFound;\n }\n for (int r = start + lacount, w = start, e = start + length; r < e; ++r) {\n char ch = dest[r];\n if (isNormalizedLamAlefChar(ch)) {\n dest[w++] = convertNormalizedLamAlef[ch - '\\u065C'];\n dest[w++] = LAM_CHAR;\n } else {\n dest[w++] = ch;\n }\n }\n return spaceNotFound;\n }", "public int searchPrefix(StringBuilder strBuild, int startVal, int endVal){\r\n\t\t//Flags for finding a word and finding a prefix\r\n\t\tboolean successfulWord = false;\r\n\t\tboolean successfulPre = false;\r\n\t\tint outVal = 0;\r\n\t\tDLBNode current = nodes;\r\n\t\t\r\n\t\tfor(int i = startVal; i <= endVal; i++){\r\n\t\t\tint correctLetter = 0;\r\n\t\t\t\r\n\t\t\t//increment through list, looking for letter until a null value is found\r\n\t\t\twhile(current != null){\r\n\t\t\t\t\r\n\t\t\t\t//increment to next value in structure if the letter exists at a child node\r\n\t\t\t\tif(current.value == strBuild.charAt(i)){\r\n\t\t\t\t\tcorrectLetter = 1;\r\n\t\t\t\t\r\n\t\t\t\t\t//with no child, the value cannot exist so return a 0 value\r\n\t\t\t\t\tif(current.childNode == null){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\toutVal = 0;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn outVal;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t//otherwise, increment to the next child node and stop this iteration of the loop\r\n\t\t\t\t\t\tcurrent = current.childNode;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\t//if the value of the current node doesn't match the value being checked, check if the node's siblings contain the value\r\n\t\t\t\t\tif(current.siblingNode != null){\r\n\t\t\t\t\t\t//if so, change locations to the sibling\r\n\t\t\t\t\t\tcurrent = current.siblingNode;\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t//otherwise, reutrn a 0 value\r\n\t\t\t\t\t\toutVal = 0; \r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\treturn outVal;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t//once at the end of hte stringbuilder object, check for prefix or value\r\n\t\t\tif(correctLetter == 1 && i == endVal){\r\n\t\t\t\t//while there's a value at current\r\n\t\t\t\twhile(current != null){\r\n\t\t\t\t\t//| denotes the end of a word, so if not a bar check if its a prefix\r\n\t\t\t\t\tif(current.value != '|'){\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tsuccessfulPre = true;\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t//if there's a bar, check if the word is viable as the bar would indicate that the word has ended\r\n\t\t\t\t\t\tsuccessfulWord = true;\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\tcurrent = current.siblingNode;\r\n\t\t\t\t\t\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\t//Set outVal to the necessary value to alert of status.\r\n\t\t//1. Prefix\r\n\t\t//2. Word \r\n\t\t//3. Prefix & word\t\t\r\n\t\tif(successfulPre && successfulWord){\r\n\t\t\t\r\n\t\t\toutVal = 3;\r\n\t\t\t\t\t\t\r\n\t\t}else if(successfulPre){\r\n\t\t\t\r\n\t\t\toutVal = 1;\r\n\t\t\t\t\t\t\r\n\t\t}else if(successfulWord){\r\n\t\t\t\r\n\t\t\toutVal = 2;\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//return outVal\r\n\t\treturn outVal;\r\n\t}", "private int nextContraction(RuleBasedCollator collator, int ce)\n {\n backupInternalState(m_utilSpecialBackUp_);\n int entryce = collator.m_contractionCE_[getContractionOffset(collator, ce)]; //CE_NOT_FOUND_;\n while (true) {\n int entryoffset = getContractionOffset(collator, ce);\n int offset = entryoffset;\n\n if (isEnd()) {\n ce = collator.m_contractionCE_[offset];\n if (ce == CE_NOT_FOUND_) {\n // back up the source over all the chars we scanned going\n // into this contraction.\n ce = entryce;\n updateInternalState(m_utilSpecialBackUp_);\n }\n break;\n }\n\n // get the discontiguos maximum combining class\n int maxCC = (collator.m_contractionIndex_[offset] & 0xFF);\n // checks if all characters have the same combining class\n byte allSame = (byte)(collator.m_contractionIndex_[offset] >> 8);\n char ch = (char)nextChar();\n offset ++;\n while (ch > collator.m_contractionIndex_[offset]) {\n // contraction characters are ordered, skip all smaller\n offset ++;\n }\n\n if (ch == collator.m_contractionIndex_[offset]) {\n // Found the source string char in the contraction table.\n // Pick up the corresponding CE from the table.\n ce = collator.m_contractionCE_[offset];\n }\n else {\n // Source string char was not in contraction table.\n // Unless it is a discontiguous contraction, we are done\n int miss = ch;\n // ticket 8484 - porting changes from C for 6101\n // We test whether the next two char are surrogate pairs.\n // This test is done if the iterator is not in the end.\n // If there is no surrogate pair, the iterator\n // goes back one if needed. \n if(UTF16.isLeadSurrogate(ch) && !isEnd()) {\n char surrNextChar = (char)nextChar();\n if (UTF16.isTrailSurrogate(surrNextChar)) {\n miss = UCharacterProperty.getRawSupplementary(ch, surrNextChar);\n } else {\n previousChar();\n }\n }\n int sCC;\n if (maxCC == 0 || (sCC = getCombiningClass(miss)) == 0\n || sCC > maxCC || (allSame != 0 && sCC == maxCC) ||\n isEnd()) {\n // Contraction can not be discontiguous, back up by one\n previousChar();\n if(miss > 0xFFFF) {\n previousChar();\n }\n ce = collator.m_contractionCE_[entryoffset];\n }\n else {\n // Contraction is possibly discontiguous.\n // find the next character if ch is not a base character\n int ch_int = nextChar();\n if (ch_int != UCharacterIterator.DONE) {\n previousChar();\n }\n char nextch = (char)ch_int;\n if (getCombiningClass(nextch) == 0) {\n previousChar();\n if(miss > 0xFFFF) {\n previousChar();\n } \n // base character not part of discontiguous contraction\n ce = collator.m_contractionCE_[entryoffset];\n }\n else {\n ce = nextDiscontiguous(collator, entryoffset);\n }\n }\n }\n\n if (ce == CE_NOT_FOUND_) {\n // source did not match the contraction, revert back original\n updateInternalState(m_utilSpecialBackUp_);\n ce = entryce;\n break;\n }\n\n // source was a contraction\n if (!isContractionTag(ce)) {\n break;\n }\n\n // ccontinue looping to check for the remaining contraction.\n if (collator.m_contractionCE_[entryoffset] != CE_NOT_FOUND_) {\n // there are further contractions to be performed, so we store\n // the so-far completed ce, so that if we fail in the next\n // round we just return this one.\n entryce = collator.m_contractionCE_[entryoffset];\n backupInternalState(m_utilSpecialBackUp_);\n if (m_utilSpecialBackUp_.m_bufferOffset_ >= 0) {\n m_utilSpecialBackUp_.m_bufferOffset_ --;\n }\n else {\n m_utilSpecialBackUp_.m_offset_ --;\n }\n }\n }\n return ce;\n }", "private void fastscan(State state,SuffixNode currNode,int uvLen,int j){ \n \n for(int i=0;i<currNode.children.size();i++){ \n SuffixNode child = currNode.children.get(i); \n \n if(text.charAt(child.start) == text.charAt(j)){ \n int len = child.getLength(); \n if(uvLen==len){ \n //then we find w \n //uvLen = 0; \n //need slow scan after this child \n state.u = child; \n state.w = child; \n state.j = j+len; \n }else if(uvLen<len){ \n //branching and cut child short \n //e.g. child=\"abc\",uvLen = 2 \n // abc ab \n // / \\ ================> / \\ \n // e f suffix part: \"abd^\" c d^ \n // / \\ \n // e f \n \n //insert the new node: ab; child is now c \n int nodepathlen = child.pathlen \n - (child.getLength()-uvLen); \n SuffixNode node = new SuffixNode(text, \n child.start,child.start + uvLen - 1,nodepathlen); \n node.children = new LinkedList<SuffixNode>(); \n \n int tailpathlen = (text.length() - (j + uvLen)) + nodepathlen; \n SuffixNode tail = new SuffixNode(text, \n j+uvLen,text.length()-1,tailpathlen); \n \n //update child node: c \n child.start += uvLen; \n if(text.charAt(j+uvLen)<text.charAt(child.start)){ \n node.children.add(tail); \n node.children.add(child); \n }else{ \n node.children.add(child); \n node.children.add(tail); \n } \n \n //update parent \n currNode.children.set(i, node); \n \n //uvLen = 0; \n //state.u = currNode; //currNode is already registered as state.u, so commented out \n state.w = node; \n state.finished = true; \n state.v = node; \n \n }else{//uvLen>len \n //e.g. child=\"abc\", uvLen = 4 \n // abc \n // / \\ ================> \n // e f suffix part: \"abcdefg^\" \n // \n // \n //jump to next node \n uvLen -= len; \n state.u = child; \n j += len; \n state.j = j; \n fastscan(state,child,uvLen,j); \n } \n break; \n } \n } \n }", "protected boolean lookaheadIn(TokenCode[] tokenCodes) {\n for(int n=0;n<tokenCodes.length;n++)\n if (tokenCodes[n] == m_current.getTokenCode())\n return true;\n return false;\n }", "protected final int getLeadOffset(char paramChar) {\n/* 294 */ return getRawOffset(0, paramChar);\n/* */ }", "public int acharCliente(List<Cliente> c, String str) {\r\n\t\tfor(int i = 0; i < c.tamanho(); i++) {\r\n\t\t\tif(c.get(i).getNome().compareTo(str) == 0) {\r\n\t\t\t\treturn i;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn -1;\r\n\t}", "private static boolean compare(char[] argText, int startIndex) {\n\t\tint textIndex = 0;\n\t\tfor (int i = 0; i < patternLength; i++) {\n\t\t\ttextIndex = startIndex + i;\n\t\t\tlogger.info(\"i: \" + i + \"textIndex:\" + textIndex);\n\t\t\tif (pattern[i] != argText[textIndex])\n\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "public static boolean compareSubstring(List<String> pieces, String s)\n {\n\n boolean result = true;\n int len = pieces.size();\n\n int index = 0;\n\nloop: for (int i = 0; i < len; i++)\n {\n String piece = pieces.get(i);\n\n // If this is the first piece, then make sure the\n // string starts with it.\n if (i == 0)\n {\n if (!s.startsWith(piece))\n {\n result = false;\n break loop;\n }\n }\n\n // If this is the last piece, then make sure the\n // string ends with it.\n if (i == len - 1)\n {\n result = s.endsWith(piece);\n break loop;\n }\n\n // If this is neither the first or last piece, then\n // make sure the string contains it.\n if ((i > 0) && (i < (len - 1)))\n {\n index = s.indexOf(piece, index);\n if (index < 0)\n {\n result = false;\n break loop;\n }\n }\n\n // Move string index beyond the matching piece.\n index += piece.length();\n }\n\n return result;\n }", "private void m4675a(char c, List<C0906d> list, StringBuilder sb) {\n if (c == '$') {\n m4676a(list, sb);\n sb.setLength(0);\n this.f4495c = EnumC0909a.START_STATE;\n } else if (c == ':') {\n m4676a(list, sb);\n sb.setLength(0);\n this.f4495c = EnumC0909a.DEFAULT_VAL_STATE;\n } else if (c == '{') {\n m4676a(list, sb);\n list.add(C0906d.f4488b);\n sb.setLength(0);\n } else if (c != '}') {\n sb.append(c);\n } else {\n m4676a(list, sb);\n list.add(C0906d.f4489c);\n sb.setLength(0);\n }\n }", "public static boolean hasLeadingChar(char c,String s) {\n \tif(s == null || s.length()==0) {\n \t\treturn false;\n \t}\n \t\n \treturn (s.charAt(0) == c);\n }", "static int chain(char[] beads, int start, char left, char right){\r\n\t\tint chain=0;\r\n\t\tfor(int pos=start-1; pos>=0; pos--){//count left\r\n\t\t\tchar cpos=beads[pos];\r\n\t\t\tif(cpos==left||cpos=='w')\r\n\t\t\t\tchain++;\r\n\t\t\telse break;\r\n\t\t}\r\n\t\tfor(int pos=start; pos<beads.length; pos++){//count right\r\n\t\t\tchar cpos=beads[pos];\r\n\t\t\tif(cpos==right||cpos=='w')\r\n\t\t\t\tchain++;\r\n\t\t\telse break;\r\n\t\t}\r\n\t\treturn chain;\r\n\t}", "public boolean startsWith(String prefix) {\n TrieTree point = root;\n for(int i = 0; i < prefix.length(); i++){\n char ch = prefix.charAt(i);\n if(point.getChild(ch - 'a') == null) return false;\n point = point.getChild(ch - 'a');\n }\n return true;\n }" ]
[ "0.60958594", "0.56518424", "0.5549084", "0.543158", "0.5380416", "0.537464", "0.5368098", "0.53329974", "0.53281224", "0.5302976", "0.52169394", "0.52100813", "0.52046824", "0.5200872", "0.5194225", "0.5174276", "0.51732045", "0.5123761", "0.5111421", "0.5103168", "0.50834215", "0.5057823", "0.5053421", "0.5046104", "0.5028611", "0.50181353", "0.50049984", "0.49980977", "0.49896902", "0.49871722", "0.49709678", "0.4966989", "0.49653032", "0.4959377", "0.4957972", "0.49551538", "0.49473527", "0.49398252", "0.4938149", "0.49353972", "0.49163565", "0.49051026", "0.49013796", "0.488905", "0.4887812", "0.486632", "0.48596427", "0.48566824", "0.48535225", "0.48364446", "0.48354742", "0.48352095", "0.48290163", "0.4825158", "0.48245057", "0.48244616", "0.48200953", "0.48076034", "0.4806332", "0.47983205", "0.47970104", "0.4793253", "0.47776687", "0.477396", "0.4772253", "0.47661024", "0.47644755", "0.47577238", "0.47510964", "0.4748472", "0.47361603", "0.4734451", "0.47295916", "0.47261956", "0.47144535", "0.47118512", "0.4706825", "0.47048634", "0.4703472", "0.46961352", "0.4695331", "0.46923485", "0.4690334", "0.4689848", "0.4688807", "0.46813738", "0.46765223", "0.4666189", "0.4661889", "0.46582568", "0.4658032", "0.46461853", "0.46422863", "0.4641382", "0.4638042", "0.4634709", "0.46325424", "0.46285707", "0.46284539", "0.46261832" ]
0.66237575
0
return the check_list for next_c character next_c
public ArrayList<Integer> getCheckList(char next_c){ return check_list.get(next_c-'a'); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void addCheck(char next_c, int check){\n int nextPos = next_c - 'a'; \n // check if mentioned check already exists in the check_list(nextPos)\n ArrayList<Integer> list = check_list.get(nextPos);\n if(!list.contains(check)){\n // if check does not exists, add it in the check_list(nextPos)\n check_list.get(nextPos).add(check);\n }\n }", "public ArrayList<Token> walkTable(char c) {\n \t\treturnList = null;\n \t\tif(currentState.isFinal){\n \t\t\t\tlastKnownValidToken = new StringBuffer(currentToken);\n \t\t}\n \t\tcurrentToken.append(c);\n \t\tcurrentState = dfa.get(new StateCharacter(currentState,c));\n \t\t\n \t\tif(currentState == null){\n \t\t\tint numCharactersUndealtWith = currentToken.length() - lastKnownValidToken.length();\n \t\t\tStringBuffer newCurrentToken = new StringBuffer();\n \t\t\tfor(int i=0;i<numCharactersUndealtWith;i++){\n \t\t\t\tnewCurrentToken.append(currentToken.length()-numCharactersUndealtWith+i);\n \t\t\t}\n \t\t\treturnList.add(new Token(null,lastKnownValidToken));//How do we know what type the token is?\n \t\t\treEvaluate(newCurrentToken);\n \t\t\treturn returnList;\n \t\t}\n \t\telse{\n \t\t\treturn null;\n\t\t}\n \t}", "public Node getNext(char c)\n {\n if (c >= 'a' && c <= 'z')\n {\n return nexts[c - 97];\n }\n if (c >= 'A' && c <= 'Z')\n {\n return nexts[c - 10];\n }\n return null;\n }", "public char returnNextColor(char c){\r\n\t\t\r\n\t\tif(c == 'o'){\r\n\t\t\treturn col[0];\r\n\t\t}\r\n\t\tfor(int i = 0; i < col.length-1; i++){\r\n\t\t\tif(c == col[i]){\r\n\t\t\t\treturn col[i+1];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn col[0];\r\n\t}", "public List<C0906d> mo10186a() {\n LinkedList linkedList = new LinkedList();\n StringBuilder sb = new StringBuilder();\n while (true) {\n int i = this.f4496d;\n if (i < this.f4494b) {\n char charAt = this.f4493a.charAt(i);\n this.f4496d++;\n switch (this.f4495c) {\n case LITERAL_STATE:\n m4675a(charAt, linkedList, sb);\n break;\n case START_STATE:\n m4677b(charAt, linkedList, sb);\n break;\n case DEFAULT_VAL_STATE:\n m4678c(charAt, linkedList, sb);\n break;\n }\n } else {\n switch (this.f4495c) {\n case LITERAL_STATE:\n m4676a(linkedList, sb);\n break;\n case START_STATE:\n sb.append('$');\n m4676a(linkedList, sb);\n break;\n case DEFAULT_VAL_STATE:\n sb.append(':');\n m4676a(linkedList, sb);\n break;\n }\n return linkedList;\n }\n }\n }", "public int nextC()\r\n\t{\r\n\t\tlastc = thisc;\t/* save current character, in case of backup */\r\n\t\t\r\n\t\t/* check for character waiting */\r\n\t\tif (holdc == 0) {\r\n\t\t\t/* no character waiting, get next from file,\r\n * ignore most control characters */\r\n\t\t\tdo {\r\n\t\t\t\tthisc = getC();\r\n\t\t\t\tif (thisc == EOF) return EOF;\r\n } while (thisc < 0x20 && ctlchars[thisc]);\r\n\r\n\t\t} else {\r\n\t\t\t/* we looked ahead, so use the saved character */\r\n\t\t\tthisc = holdc;\r\n\t\t\tholdc = 0;\r\n\t\t\tif (thisc == EOF) return EOF;\r\n\t\t}\r\n\t\r\n\t\t/* special rule for carriage return characters:\r\n\t\t * if CR is followed by LF, return just the LF\r\n\t\t * else replace the CR with a LF\r\n\t\t * but then we have to hold the character that isn't a LF,\r\n\t\t * unless it is an ignored character */\r\n\t\tif (thisc == '\\r') {\r\n\t\t holdc = getC();\r\n\t if (holdc < 0x20) {\r\n\t if (holdc == '\\n' || ctlchars[holdc]) holdc = 0;\r\n\t }\r\n\t\t thisc = '\\n';\r\n\t\t}\r\n\t\t\r\n\t\t/* capture the character in a buffer, for diagnostics */\r\n\t\tif (lastc == '\\n' || bufpos >= BUFSIZE) {\r\n\t\t\tprvsize = bufpos;\r\n\t\t\tbufpos = 0;\r\n\t\t\tcurrentbuf = 1 - currentbuf;\r\n\t\t}\r\n\t\tbuffer[currentbuf][bufpos++] = (byte)thisc;\r\n\t\r\n\t\treturn thisc;\r\n\t}", "List<C1114c> mo5886k(String str);", "private ArrayList<Character> retornarListaCaracteres() {\n ArrayList<Character> validaciones = new ArrayList<Character>();\n validaciones.add('.');\n validaciones.add('/');\n validaciones.add('|');\n validaciones.add('=');\n validaciones.add('?');\n validaciones.add('¿');\n validaciones.add('´');\n validaciones.add('¨');\n validaciones.add('{');\n validaciones.add('}');\n validaciones.add(';');\n validaciones.add(':');\n validaciones.add('_');\n validaciones.add('^');\n validaciones.add('-');\n validaciones.add('!');\n validaciones.add('\"');\n validaciones.add('#');\n validaciones.add('$');\n validaciones.add('%');\n validaciones.add('&');\n validaciones.add('(');\n validaciones.add(')');\n validaciones.add('¡');\n validaciones.add(']');\n validaciones.add('*');\n validaciones.add('[');\n validaciones.add(',');\n validaciones.add('°');\n\n return validaciones;\n }", "private int C() throws SyntaxException, ParserException {\n\t\tswitch (current) {\n\t\t\tcase '0':\n\t\t\t\t// C -> 0\n\t\t\t\teat('0');\n\t\t\t\treturn 0;\n\t\t\tcase '1':\n\t\t\t\t// C -> 1\n\t\t\t\teat('1');\n\t\t\t\treturn 1;\n\t\t\tcase '2':\n\t\t\t\t// C -> 2\n\t\t\t\teat('2');\n\t\t\t\treturn 2;\n\t\t\tcase '3':\n\t\t\t\t// C -> 3\n\t\t\t\teat('3');\n\t\t\t\treturn 3;\n\t\t\tcase '4':\n\t\t\t\t// C -> 4\n\t\t\t\teat('4');\n\t\t\t\treturn 4;\n\t\t\tcase '5':\n\t\t\t\t// C -> 5\n\t\t\t\teat('5');\n\t\t\t\treturn 5;\n\t\t\tcase '6':\n\t\t\t\t// C -> 6\n\t\t\t\teat('6');\n\t\t\t\treturn 6;\n\t\t\tcase '7':\n\t\t\t\t// C -> 7\n\t\t\t\teat('7');\n\t\t\t\treturn 7;\n\t\t\tcase '8':\n\t\t\t\t// C -> 8\n\t\t\t\teat('8');\n\t\t\t\treturn 8;\n\t\t\tcase '9':\n\t\t\t\t// C -> 9\n\t\t\t\teat('9');\n\t\t\t\treturn 9;\n\t\t\tdefault:\n\t\t\t\tthrow new SyntaxException(ErrorType.NO_RULE,current);\n\t\t}\n\t}", "public boolean matches(char cNext) {\n int nIndex = 0;\n while (nIndex < m_cBuffer.length - 1)\n m_cBuffer[nIndex] = m_cBuffer[++nIndex];\n // save the new character\n m_cBuffer[nIndex] = cNext;\n\n // compare the buffer to the pattern\n nIndex = m_cBuffer.length;\n boolean bMatch = true;\n while (nIndex-- > 0 && bMatch)\n bMatch = (m_cBuffer[nIndex] == m_cPattern[nIndex]);\n\n return bMatch;\n }", "@Override\n protected List<CharSequence> getNextInput() {\n if (!mInputIterator.hasNext())\n // No more input, so we're done.\n return null;\n else {\n // Start a new cycle.\n incrementCycle();\n\n // Return a list containing character sequences to search.\n return mInputIterator.next();\n }\n }", "ArrayList<Character> nextCountAndSay(ArrayList<Character> sequence) {\n \tArrayList<Character> next = new ArrayList<Character>();\n \tint count = 0;\n \tCharacter c = sequence.get(0);\n \tfor(int i = 0; i < sequence.size(); i++) \n \t//@loop_invariant count represents the length of the longest \n \t// consecutive sequence s in sequence[0, i), all Characters in s\n \t// equal to c and s contains the last element of sequence[0, i) if \n \t// exists\n \t{\n \t\tif(count == 0) {\n \t\t\tcount = 1;\n \t\t\tc = sequence.get(i);\n \t\t}\n \t\telse {\n \t\t\tif(c == sequence.get(i)) {\n \t\t\t\tcount++;\n \t\t\t}\n \t\t\telse {\n \t\t\t\tthis.addCount(next, count);\n \t\t\t\tthis.addSay(next, c);\n \t\t\t\tcount = 1;\n \t\t\t\tc = sequence.get(i);\n \t\t\t}\n \t\t} \t\t\n \t}\n \tthis.addCount(next, count);\n \tthis.addSay(next, c);\n \treturn next;\n }", "public char test(char c) {\n\t\tchar[] lower = { '-', '+' };\n\t\tchar[] higher = { '*', '/' };\n\t\tfor (int i = 0; i < 2; i++) {\n\t\t\tif (lower[i] == c) {\n\t\t\t\treturn 'l';\n\t\t\t}\n\t\t}\n\t\tfor (int i = 0; i < 2; i++) {\n\t\t\tif (higher[i] == c) {\n\t\t\t\treturn 'h';\n\t\t\t}\n\t\t}\n\t\t// just to make the method work , no meaning for the 'n'\n\t\treturn 'n';\n\t}", "private int nextChar()\n {\n int result;\n\n // loop handles the next character whether it is in the buffer or not.\n if (m_bufferOffset_ < 0) {\n // we're working on the source and not normalizing. fast path.\n // note Thai pre-vowel reordering uses buffer too\n result = m_source_.next();\n }\n else {\n // we are in the buffer, buffer offset will never be 0 here\n if (m_bufferOffset_ >= m_buffer_.length()) {\n // Null marked end of buffer, revert to the source string and\n // loop back to top to try again to get a character.\n m_source_.setIndex(m_FCDLimit_);\n m_bufferOffset_ = -1;\n m_buffer_.setLength(0);\n return nextChar();\n }\n return m_buffer_.charAt(m_bufferOffset_ ++);\n }\n int startoffset = m_source_.getIndex();\n if (result < FULL_ZERO_COMBINING_CLASS_FAST_LIMIT_\n // Fast fcd safe path. trail combining class == 0.\n || m_collator_.getDecomposition() == Collator.NO_DECOMPOSITION\n || m_bufferOffset_ >= 0 || m_FCDLimit_ >= startoffset) {\n // skip the fcd checks\n return result;\n }\n\n if (result < LEAD_ZERO_COMBINING_CLASS_FAST_LIMIT_) {\n // We need to peek at the next character in order to tell if we are\n // FCD\n int next = m_source_.current();\n if (next == UCharacterIterator.DONE\n || next < LEAD_ZERO_COMBINING_CLASS_FAST_LIMIT_) {\n return result; // end of source string and if next character\n // starts with a base character is always fcd.\n }\n }\n\n // Need a more complete FCD check and possible normalization.\n if (!FCDCheck(result, startoffset)) {\n normalize();\n result = m_buffer_.charAt(0);\n m_bufferOffset_ = 1;\n }\n return result;\n }", "static int ctrno(String c) {\n int i=0;\n if (constrlist==null) {System.out.println(\"constrlist null\");}\n while (i<constrlist.size() && !c.equals(constrlist.get(i))) {i++;}\n if (i==constrlist.size()) {i=-1;}\n return i;\n }", "private static void scan(char c)\r\n\t{\r\n\t\tif (c == '\\r') /* do nothing */\r\n\t\t\t;\r\n\t\telse if (c == '\\n')\r\n\t\t{\r\n\t\t\tline_++;\r\n\t\t\tchar_ = col_ = 1;\r\n\t\t}\r\n\t\telse if (c == '\\t')\r\n\t\t{\r\n\t\t\tchar_++;\r\n\t\t\tcol_ = (((col_ - 1) / tab_width) + 1) * tab_width + 1;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tchar_++;\r\n\t\t\tcol_++;\r\n\t\t}\r\n\t}", "private static int getNextCC(NextCCArgs paramNextCCArgs)\n/* */ {\n/* 490 */ paramNextCCArgs.c = paramNextCCArgs.source[(paramNextCCArgs.next++)];\n/* */ \n/* 492 */ long l = getNorm32(paramNextCCArgs.c);\n/* 493 */ if ((l & 0xFF00) == 0L) {\n/* 494 */ paramNextCCArgs.c2 = '\\000';\n/* 495 */ return 0;\n/* */ }\n/* 497 */ if (!isNorm32LeadSurrogate(l)) {\n/* 498 */ paramNextCCArgs.c2 = '\\000';\n/* */ \n/* */ }\n/* 501 */ else if ((paramNextCCArgs.next != paramNextCCArgs.limit) && \n/* 502 */ (UTF16.isTrailSurrogate(paramNextCCArgs.c2 = paramNextCCArgs.source[paramNextCCArgs.next]))) {\n/* 503 */ paramNextCCArgs.next += 1;\n/* 504 */ l = getNorm32FromSurrogatePair(l, paramNextCCArgs.c2);\n/* */ } else {\n/* 506 */ paramNextCCArgs.c2 = '\\000';\n/* 507 */ return 0;\n/* */ }\n/* */ \n/* */ \n/* 511 */ return (int)(0xFF & l >> 8);\n/* */ }", "public boolean hasNext() {\n return c != -1;\n }", "@Override\r\n public String next() {\n if(current<m_list.size())\r\n {\r\n String str = m_list.get(current);\r\n current++;\r\n return str;\r\n }\r\n m_list = getNextLevel(m_list, m_chars);\r\n current = 1;\r\n return m_list.get(0);\r\n \r\n }", "public LinkedList<Character> getCharacterParserList() {\n\t\treturn listofCharacter;\n\t}", "static int check2(int r, int c) {\r\n\t\tint result = 0;\r\n\t\tString local = \"\";\r\n\t\t// case 1 col++\r\n\t\tif (A[r][c] == 1 && A[r][(c + 1) % 4] == 1) {\r\n\t\t\tif (r == 0) {\r\n\t\t\t\tlocal = \"A'B'\";\r\n\t\t\t}\r\n\t\t\tif (r == 1) {\r\n\t\t\t\tlocal = \"A'B\";\r\n\t\t\t}\r\n\t\t\tif (r == 2) {\r\n\t\t\t\tlocal = \"AB\";\r\n\t\t\t}\r\n\t\t\tif (r == 3) {\r\n\t\t\t\tlocal = \"AB'\";\r\n\t\t\t}\r\n\t\t\tif (c == 0) {\r\n\t\t\t\tlocal = local + \"C'\";\r\n\t\t\t}\r\n\t\t\tif (c == 1) {\r\n\t\t\t\tlocal = local + \"D\";\r\n\t\t\t}\r\n\t\t\tif (c == 2) {\r\n\t\t\t\tlocal = local + \"C\";\r\n\t\t\t}\r\n\t\t\tif (c == 3) {\r\n\t\t\t\tlocal = local + \"D'\";\r\n\t\t\t}\r\n\t\t\toutput = output + \"+\" + local;\r\n\t\t\tresult = 1;\r\n\t\t\t// make checked\r\n\t\t\tchecked[r][c] = 1;\r\n\t\t\tchecked[r][(c + 1) % 4] = 1;\r\n\r\n\t\t} else\r\n\t\t// case 2 col--\r\n\t\tif (A[r][(4 + (c - 1)) % 4] == 1 && A[r][c] == 1) {\r\n\t\t\tif (r == 0) {\r\n\t\t\t\tlocal = \"A'B'\";\r\n\t\t\t}\r\n\t\t\tif (r == 1) {\r\n\t\t\t\tlocal = \"A'B\";\r\n\t\t\t}\r\n\t\t\tif (r == 2) {\r\n\t\t\t\tlocal = \"AB\";\r\n\t\t\t}\r\n\t\t\tif (r == 3) {\r\n\t\t\t\tlocal = \"AB'\";\r\n\t\t\t}\r\n\t\t\tif (c == 0) {\r\n\t\t\t\tlocal = local + \"D'\";\r\n\t\t\t}\r\n\t\t\tif (c == 1) {\r\n\t\t\t\tlocal = local + \"C'\";\r\n\t\t\t}\r\n\t\t\tif (c == 2) {\r\n\t\t\t\tlocal = local + \"D\";\r\n\t\t\t}\r\n\t\t\tif (c == 3) {\r\n\t\t\t\tlocal = local + \"C\";\r\n\t\t\t}\r\n\t\t\toutput = output + \"+\" + local;\r\n\t\t\tresult = 1;\r\n\t\t\t// make checked\r\n\t\t\tchecked[r][(4 + (c - 1)) % 4] = 1;\r\n\t\t\tchecked[r][c] = 1;\r\n\t\t} else\r\n\t\t// case3 row++\r\n\t\tif (A[r][c] == 1 && A[(r + 1) % 4][c] == 1) {\r\n\t\t\tif (r == 0) {\r\n\t\t\t\tlocal = \"A'\";\r\n\t\t\t}\r\n\t\t\tif (r == 1) {\r\n\t\t\t\tlocal = \"B\";\r\n\t\t\t}\r\n\t\t\tif (r == 2) {\r\n\t\t\t\tlocal = \"A\";\r\n\t\t\t}\r\n\t\t\tif (r == 3) {\r\n\t\t\t\tlocal = \"B'\";\r\n\t\t\t}\r\n\t\t\tif (c == 0) {\r\n\t\t\t\tlocal = local + \"C'D'\";\r\n\t\t\t}\r\n\t\t\tif (c == 1) {\r\n\t\t\t\tlocal = local + \"C'D\";\r\n\t\t\t}\r\n\t\t\tif (c == 2) {\r\n\t\t\t\tlocal = local + \"CD\";\r\n\t\t\t}\r\n\t\t\tif (c == 3) {\r\n\t\t\t\tlocal = local + \"CD'\";\r\n\t\t\t}\r\n\t\t\toutput = output + \"+\" + local;\r\n\t\t\tresult = 1;\r\n\t\t\t// make checked\r\n\t\t\tchecked[r][c] = 1;\r\n\t\t\tchecked[(r + 1) % 4][c] = 1;\r\n\t\t} else\r\n\t\t// case4 row--\r\n\t\tif (A[r][c] == 1 && A[(4 + (r - 1)) % 4][c] == 1) {\r\n\t\t\tif (r == 0) {\r\n\t\t\t\tlocal = \"B'\";\r\n\t\t\t}\r\n\t\t\tif (r == 1) {\r\n\t\t\t\tlocal = \"A'\";\r\n\t\t\t}\r\n\t\t\tif (r == 2) {\r\n\t\t\t\tlocal = \"B\";\r\n\t\t\t}\r\n\t\t\tif (r == 3) {\r\n\t\t\t\tlocal = \"A\";\r\n\t\t\t}\r\n\t\t\tif (c == 0) {\r\n\t\t\t\tlocal = local + \"C'D'\";\r\n\t\t\t}\r\n\t\t\tif (c == 1) {\r\n\t\t\t\tlocal = local + \"C'D\";\r\n\t\t\t}\r\n\t\t\tif (c == 2) {\r\n\t\t\t\tlocal = local + \"CD\";\r\n\t\t\t}\r\n\t\t\tif (c == 3) {\r\n\t\t\t\tlocal = local + \"CD'\";\r\n\t\t\t}\r\n\t\t\toutput = output + \"+\" + local;\r\n\t\t\tresult = 1;\r\n\t\t\t// make checked\r\n\t\t\tchecked[r][c] = 1;\r\n\t\t\tchecked[(4 + (r - 1)) % 4][c] = 1;\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "private int nextContraction(RuleBasedCollator collator, int ce)\n {\n backupInternalState(m_utilSpecialBackUp_);\n int entryce = collator.m_contractionCE_[getContractionOffset(collator, ce)]; //CE_NOT_FOUND_;\n while (true) {\n int entryoffset = getContractionOffset(collator, ce);\n int offset = entryoffset;\n\n if (isEnd()) {\n ce = collator.m_contractionCE_[offset];\n if (ce == CE_NOT_FOUND_) {\n // back up the source over all the chars we scanned going\n // into this contraction.\n ce = entryce;\n updateInternalState(m_utilSpecialBackUp_);\n }\n break;\n }\n\n // get the discontiguos maximum combining class\n int maxCC = (collator.m_contractionIndex_[offset] & 0xFF);\n // checks if all characters have the same combining class\n byte allSame = (byte)(collator.m_contractionIndex_[offset] >> 8);\n char ch = (char)nextChar();\n offset ++;\n while (ch > collator.m_contractionIndex_[offset]) {\n // contraction characters are ordered, skip all smaller\n offset ++;\n }\n\n if (ch == collator.m_contractionIndex_[offset]) {\n // Found the source string char in the contraction table.\n // Pick up the corresponding CE from the table.\n ce = collator.m_contractionCE_[offset];\n }\n else {\n // Source string char was not in contraction table.\n // Unless it is a discontiguous contraction, we are done\n int miss = ch;\n // ticket 8484 - porting changes from C for 6101\n // We test whether the next two char are surrogate pairs.\n // This test is done if the iterator is not in the end.\n // If there is no surrogate pair, the iterator\n // goes back one if needed. \n if(UTF16.isLeadSurrogate(ch) && !isEnd()) {\n char surrNextChar = (char)nextChar();\n if (UTF16.isTrailSurrogate(surrNextChar)) {\n miss = UCharacterProperty.getRawSupplementary(ch, surrNextChar);\n } else {\n previousChar();\n }\n }\n int sCC;\n if (maxCC == 0 || (sCC = getCombiningClass(miss)) == 0\n || sCC > maxCC || (allSame != 0 && sCC == maxCC) ||\n isEnd()) {\n // Contraction can not be discontiguous, back up by one\n previousChar();\n if(miss > 0xFFFF) {\n previousChar();\n }\n ce = collator.m_contractionCE_[entryoffset];\n }\n else {\n // Contraction is possibly discontiguous.\n // find the next character if ch is not a base character\n int ch_int = nextChar();\n if (ch_int != UCharacterIterator.DONE) {\n previousChar();\n }\n char nextch = (char)ch_int;\n if (getCombiningClass(nextch) == 0) {\n previousChar();\n if(miss > 0xFFFF) {\n previousChar();\n } \n // base character not part of discontiguous contraction\n ce = collator.m_contractionCE_[entryoffset];\n }\n else {\n ce = nextDiscontiguous(collator, entryoffset);\n }\n }\n }\n\n if (ce == CE_NOT_FOUND_) {\n // source did not match the contraction, revert back original\n updateInternalState(m_utilSpecialBackUp_);\n ce = entryce;\n break;\n }\n\n // source was a contraction\n if (!isContractionTag(ce)) {\n break;\n }\n\n // ccontinue looping to check for the remaining contraction.\n if (collator.m_contractionCE_[entryoffset] != CE_NOT_FOUND_) {\n // there are further contractions to be performed, so we store\n // the so-far completed ce, so that if we fail in the next\n // round we just return this one.\n entryce = collator.m_contractionCE_[entryoffset];\n backupInternalState(m_utilSpecialBackUp_);\n if (m_utilSpecialBackUp_.m_bufferOffset_ >= 0) {\n m_utilSpecialBackUp_.m_bufferOffset_ --;\n }\n else {\n m_utilSpecialBackUp_.m_offset_ --;\n }\n }\n }\n return ce;\n }", "public char next(char c) throws JSONException {\n char n = this.next();\n if(n != c) {\n throw this.syntaxError(\"Expected '\" + c + \"' and instead saw '\" + n + \"'\");\n }\n\n return n;\n }", "private ArrayList<String> convertChar() {\r\n \tArrayList<String> patterns = new ArrayList<String>();\r\n \tfor (int i = 0; i < this.patterns.size(); i++) {\r\n \t\tString s = \"\";\r\n \t\tfor (int j = 0; j < this.patterns.get(i).length; j++) {\r\n \t\t\ts += this.patterns.get(i)[j];\r\n \t\t}\r\n \t\tpatterns.add(s);\r\n \t}\r\n \treturn patterns;\r\n }", "public List<T> next(){\n\t\tif(hasNext==true){\n\t\t\tSystem.out.println(\"***BEFORE CALL [NCR] next\");\n\t\t\tprintIndices();\n\t\t\t\n\t\t\tif(first==true){\n\t\t\t\tfirst = false;\n\t\t\t\treturn getCompList();\n\t\t\t}\n\t\t\t\n\t\t\t//current is always rightmost 1\n\t\t\tfor(int i=indices.length-1; i>=0; i--){\n\t\t\t\tif(indices[i]==1){\n\t\t\t\t\tcurrent = i;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//push current pointer right\n\t\t\tif(current<indices.length-1){\n\t\t\t\tSystem.out.println(\"[NCR] pushing\");\n\t\t\t\t//push\n\t\t\t\tindices[current++] = 0;\n\t\t\t\tindices[current] = 1;\n\t\t\t} \n\t\t\t//if current pointer can't be pushed right any further, pull closest base 1 spot right and reset to closest base\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"[NCR] Pulling\");\n\t\t\t\t//scan left to find closest base\n\t\t\t\tfor(int i=indices.length-1; i>=0; i--){\n\t\t\t\t\t//skip all consecutive 1's before searching for qualified base\n\t\t\t\t\tif(indices[i]==0){\n\t\t\t\t\t\tboolean addBase = true;\n\t\t\t\t\t\tfor(int j=i; j>=0; j--){\n\t\t\t\t\t\t\tif(indices[j]==1){\n\t\t\t\t\t\t\t\tindices[j++] = 0;\n\t\t\t\t\t\t\t\tindices[j] = 1;\n\t\t\t\t\t\t\t\tbase = j;\n\t\t\t\t\t\t\t\taddBase = 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}\n\t\t\t\t\t\t//if all current 1's are consecutively located at the end, add another base and reset to base\n\t\t\t\t\t\tif(addBase==true){\n\t\t\t\t\t\t\tpointers++;\n\t\t\t\t\t\t\tif(pointers==indices.length){\n\t\t\t\t\t\t\t\thasNext = false;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tindices[0] = 1;\n\t\t\t\t\t\t\tbase = 0;\n\t\t\t\t\t\t\tSystem.out.println(\"Add base true; added a base\");\n\t\t\t\t\t\t\tprintIndices();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t//reset to base\n\t\t\t\t\t\tresetToBase();\n\t\t\t\t\t\tSystem.out.println(\"After base reset\");\n\t\t\t\t\t\tprintIndices();\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\t\t\t\n\t\t\treturn getCompList();\n\t\t} else {\n\t\t\treturn null;\n\t\t}\n\t}", "public static char getInput( Scanner scan, String x ){\n if (x.length()>0){\n char c1=x.charAt(0); //1st character of string (\"C\")\n char c2=x.charAt(1); //2nd character of string (\"c\")\n scan=new Scanner(System.in);\n String input= scan.nextLine(); //takes in a string\n char i1=input.charAt(0);//takes 1st letter of input\n \n if (input.length()==1){\n if(i1==c1)\n { //if the 1st inputted character is equal to character 1 (C)\n \n return c1; //return that value\n }\n else if (i1==c2)//if the 1st inputted character is equal to character 2 (c)\n { \n return c2; //return that value\n }\n }\n else { //if more than one character entered\n System.out.println(\"You should enter exactly one character. Enter 'C' or 'c' to continue. Try again- \");\n return getInput(scan, x); //reruns\n }\n }\n \n System.out.print(\"You did not enter a characer from the list 'Cc' try again- \"); //if C or c is not entered\n return getInput(scan,x); //reruns\n \n }", "private int nextHangul(RuleBasedCollator collator, char ch)\n {\n char L = (char)(ch - HANGUL_SBASE_);\n\n // divide into pieces\n // do it in this order since some compilers can do % and / in one\n // operation\n char T = (char)(L % HANGUL_TCOUNT_);\n L /= HANGUL_TCOUNT_;\n char V = (char)(L % HANGUL_VCOUNT_);\n L /= HANGUL_VCOUNT_;\n\n // offset them\n L += HANGUL_LBASE_;\n V += HANGUL_VBASE_;\n T += HANGUL_TBASE_;\n\n // return the first CE, but first put the rest into the expansion\n // buffer\n m_CEBufferSize_ = 0;\n if (!m_collator_.m_isJamoSpecial_) { // FAST PATH\n m_CEBuffer_[m_CEBufferSize_ ++] =\n collator.m_trie_.getLeadValue(L);\n m_CEBuffer_[m_CEBufferSize_ ++] =\n collator.m_trie_.getLeadValue(V);\n\n if (T != HANGUL_TBASE_) {\n m_CEBuffer_[m_CEBufferSize_ ++] =\n collator.m_trie_.getLeadValue(T);\n }\n m_CEBufferOffset_ = 1;\n return m_CEBuffer_[0];\n }\n else {\n // Jamo is Special\n // Since Hanguls pass the FCD check, it is guaranteed that we\n // won't be in the normalization buffer if something like this\n // happens\n // Move Jamos into normalization buffer\n m_buffer_.append(L);\n m_buffer_.append(V);\n if (T != HANGUL_TBASE_) {\n m_buffer_.append(T);\n }\n m_bufferOffset_ = 0;\n m_FCDLimit_ = m_source_.getIndex();\n m_FCDStart_ = m_FCDLimit_ - 1;\n // Indicate where to continue in main input string after\n // exhausting the buffer\n return IGNORABLE;\n }\n }", "@Nullable\n Set<String> findFileNamesMatchingIfCheap(char nextLetter, MinusculeMatcher matcher) {\n List<Pair<VirtualFile, String>> files = getMatchingRoots();\n Set<String> names = new HashSet<>();\n AtomicInteger counter = new AtomicInteger();\n BooleanSupplier tooMany = () -> counter.get() > 1000;\n for (Pair<VirtualFile, String> pair : files) {\n if (containsChar(pair.second, nextLetter) && matcher.matches(pair.second)) {\n names.add(pair.first.getName());\n } else {\n processProjectFilesUnder(pair.first, sub -> {\n counter.incrementAndGet();\n if (tooMany.getAsBoolean()) return false;\n\n String name = sub.getName();\n if (containsChar(name, nextLetter) && matcher.matches(name)) {\n names.add(name);\n }\n return true;\n });\n }\n }\n return tooMany.getAsBoolean() ? null : names;\n }", "int nextState (int state, char c) {\r\n\tif (state < tokLen && c == tok.charAt(state)) {\r\n\t return (state+1) ;\r\n\t} else return tokLen+1 ;\r\n }", "List<C1113b> mo5874b(String str);", "public int cscan () throws IOException {\n\n\t\t\tif (curChar >= numChars) {\n\t\t\t\tcurChar = 0;\n\t\t\t\tnumChars = stream.read (buf);\n\n\t\t\t\t//if (numChars <= 0) return -1;\n\t\t\t}\n\n\t\t\treturn buf[curChar++];\n\t\t}", "public int next()\n {\n m_isForwards_ = true;\n if (m_CEBufferSize_ > 0) {\n if (m_CEBufferOffset_ < m_CEBufferSize_) {\n // if there are expansions left in the buffer, we return it\n return m_CEBuffer_[m_CEBufferOffset_ ++];\n }\n m_CEBufferSize_ = 0;\n m_CEBufferOffset_ = 0;\n }\n \n int result = NULLORDER;\n char ch = 0;\n do {\n int ch_int = nextChar();\n if (ch_int == UCharacterIterator.DONE) {\n return NULLORDER;\n }\n ch = (char)ch_int;\n if (m_collator_.m_isHiragana4_) {\n /* Codepoints \\u3099-\\u309C are both Hiragana and Katakana. Set the flag\n * based on whether the previous codepoint was Hiragana or Katakana.\n */\n m_isCodePointHiragana_ = (m_isCodePointHiragana_ && (ch >= 0x3099 && ch <= 0x309C)) || \n ((ch >= 0x3040 && ch <= 0x309e) && !(ch > 0x3094 && ch < 0x309d));\n }\n\n if (ch <= 0xFF) {\n // For latin-1 characters we never need to fall back to the UCA\n // table because all of the UCA data is replicated in the\n // latinOneMapping array.\n // Except: Special CEs can result in CE_NOT_FOUND_,\n // for example if the default entry for a prefix-special is \"not found\",\n // and we do need to fall back to the UCA in such a case.\n // TODO: It would be better if tailoring specials never resulted in \"not found\"\n // unless the corresponding UCA result is also \"not found\".\n // That would require a change in the ICU4J collator-from-rule builder.\n result = m_collator_.m_trie_.getLatin1LinearValue(ch);\n } else {\n result = m_collator_.m_trie_.getLeadValue(ch);\n }\n if (!RuleBasedCollator.isSpecial(result)) {\n return result;\n }\n if (result != CE_NOT_FOUND_) {\n result = nextSpecial(m_collator_, result, ch);\n }\n if (result == CE_NOT_FOUND_) {\n // couldn't find a good CE in the tailoring\n if (RuleBasedCollator.UCA_ != null) {\n result = RuleBasedCollator.UCA_.m_trie_.getLeadValue(ch);\n if (RuleBasedCollator.isSpecial(result)) {\n // UCA also gives us a special CE\n result = nextSpecial(RuleBasedCollator.UCA_, result, ch);\n }\n }\n if(result == CE_NOT_FOUND_) { \n // maybe there is no UCA, unlikely in Java, but ported for consistency\n result = nextImplicit(ch); \n }\n }\n } while (result == IGNORABLE && ch >= 0xAC00 && ch <= 0xD7AF);\n\n return result;\n }", "public String nextTo(char c) {\n char next;\n AppMethodBeat.m2504i(50193);\n StringBuffer stringBuffer = new StringBuffer();\n while (true) {\n next = next();\n if (next != c && next != 0 && next != 10 && next != 13) {\n stringBuffer.append(next);\n } else if (next != 0) {\n back();\n }\n }\n if (next != 0) {\n }\n String trim = stringBuffer.toString().trim();\n AppMethodBeat.m2505o(50193);\n return trim;\n }", "private int nextSpecial(RuleBasedCollator collator, int ce, char ch)\n {\n int codepoint = ch;\n Backup entrybackup = m_utilSpecialEntryBackUp_;\n // this is to handle recursive looping\n if (entrybackup != null) {\n m_utilSpecialEntryBackUp_ = null;\n }\n else {\n entrybackup = new Backup();\n }\n backupInternalState(entrybackup);\n try { // forces it to assign m_utilSpecialEntryBackup_\n while (true) {\n // This loop will repeat only in the case of contractions,\n // surrogate\n switch(RuleBasedCollator.getTag(ce)) {\n case CE_NOT_FOUND_TAG_:\n // impossible case for icu4j\n return ce;\n case RuleBasedCollator.CE_SURROGATE_TAG_:\n if (isEnd()) {\n return CE_NOT_FOUND_;\n }\n backupInternalState(m_utilSpecialBackUp_);\n char trail = (char)nextChar();\n ce = nextSurrogate(collator, ce, trail);\n // calculate the supplementary code point value,\n // if surrogate was not tailored we go one more round\n codepoint =\n UCharacterProperty.getRawSupplementary(ch, trail);\n break;\n case CE_SPEC_PROC_TAG_:\n ce = nextSpecialPrefix(collator, ce, entrybackup);\n break;\n case CE_CONTRACTION_TAG_:\n ce = nextContraction(collator, ce);\n break;\n case CE_LONG_PRIMARY_TAG_:\n return nextLongPrimary(ce);\n case CE_EXPANSION_TAG_:\n return nextExpansion(collator, ce);\n case CE_DIGIT_TAG_:\n ce = nextDigit(collator, ce, codepoint);\n break;\n // various implicits optimization\n case CE_CJK_IMPLICIT_TAG_:\n // 0x3400-0x4DB5, 0x4E00-0x9FA5, 0xF900-0xFA2D\n return nextImplicit(codepoint);\n case CE_IMPLICIT_TAG_: // everything that is not defined\n return nextImplicit(codepoint);\n case CE_TRAIL_SURROGATE_TAG_:\n return CE_NOT_FOUND_; // DC00-DFFF broken surrogate, treat like unassigned\n case CE_LEAD_SURROGATE_TAG_: // D800-DBFF\n return nextSurrogate(ch);\n case CE_HANGUL_SYLLABLE_TAG_: // AC00-D7AF\n return nextHangul(collator, ch);\n case CE_CHARSET_TAG_:\n // not yet implemented probably after 1.8\n return CE_NOT_FOUND_;\n default:\n ce = IGNORABLE;\n // synwee todo, throw exception or something here.\n }\n if (!RuleBasedCollator.isSpecial(ce)) {\n break;\n }\n }\n } \n finally {\n m_utilSpecialEntryBackUp_ = entrybackup;\n }\n return ce;\n }", "private void m4678c(char c, List<C0906d> list, StringBuilder sb) {\n if (c == '$') {\n sb.append(':');\n m4676a(list, sb);\n sb.setLength(0);\n this.f4495c = EnumC0909a.START_STATE;\n } else if (c == '-') {\n list.add(C0906d.f4490d);\n this.f4495c = EnumC0909a.LITERAL_STATE;\n } else if (c != '{') {\n sb.append(':');\n sb.append(c);\n this.f4495c = EnumC0909a.LITERAL_STATE;\n } else {\n sb.append(':');\n m4676a(list, sb);\n sb.setLength(0);\n list.add(C0906d.f4488b);\n this.f4495c = EnumC0909a.LITERAL_STATE;\n }\n }", "List<String> mo5876c();", "private Node findNode(char c) {\n String temp = String.valueOf(c);\n for (Node node : traverseTree()) {\n if ((node.letter != null) && node.letter.equals(temp)) {\n return node;\n }\n }\n return null;\n }", "@Override\n\t\tpublic Character next() {\n\t\t\treturn elements.poll();\n\t\t}", "public List<Currcycnct> getCurrcycnct()\n/* */ {\n/* 68 */ return this.currcycnct;\n/* */ }", "List<C1114c> mo5883h(String str);", "private void m4677b(char c, List<C0906d> list, StringBuilder sb) {\n if (c == '{') {\n list.add(C0906d.f4487a);\n } else {\n sb.append('$');\n sb.append(c);\n }\n this.f4495c = EnumC0909a.LITERAL_STATE;\n }", "private void m4675a(char c, List<C0906d> list, StringBuilder sb) {\n if (c == '$') {\n m4676a(list, sb);\n sb.setLength(0);\n this.f4495c = EnumC0909a.START_STATE;\n } else if (c == ':') {\n m4676a(list, sb);\n sb.setLength(0);\n this.f4495c = EnumC0909a.DEFAULT_VAL_STATE;\n } else if (c == '{') {\n m4676a(list, sb);\n list.add(C0906d.f4488b);\n sb.setLength(0);\n } else if (c != '}') {\n sb.append(c);\n } else {\n m4676a(list, sb);\n list.add(C0906d.f4489c);\n sb.setLength(0);\n }\n }", "private static ArrayList<Integer> getDirty(String code) {\n ArrayList<Integer> dirtyBounds = new ArrayList<Integer>();\n\n //Handles string literals\n int j = -1;\n while(true) {\n j = code.indexOf(\"\\\"\", j+1);\n if (j < 0) break;\n //Ignore escaped characters\n //if (j == 0 || code.substring(j-1, j).equals(\"\\\\\"))) //Doesn't work because || doesn't exit on first success\n if(j != 0) {\n if (!code.substring(j-1, j).equals(\"\\\\\")) {\n dirtyBounds.add(j);\n }\n } else {\n dirtyBounds.add(j);\n }\n }\n\n //End of line comments\n j = -1;\n while(true) {\n j = code.indexOf(\"//\", j+1);\n if (j < 0 || isDirty(dirtyBounds, j)) break;\n dirtyBounds.add(j);\n //If there's no newline, then the comment lasts for the length of the code\n dirtyBounds.add(\n code.indexOf(\"\\n\", j+1) == -1 ? code.length() : code.indexOf(\"\\n\", j+1)); \n }\n\n //Block comments (and javadoc comments)\n j = -1;\n while(true) {\n j = code.indexOf(\"/*\", j+1);\n if (j < 0 || isDirty(dirtyBounds, j)) break;\n dirtyBounds.add(j);\n dirtyBounds.add(code.indexOf(\"*/\", j+2) + 1); //Plus one to account for the slash, not the asterisk //j+two so \"/*/\" isn't parsed\n }\n\n return dirtyBounds;\n }", "public String next() {\n // abc len=2 [0,1]--> [0,2]---> [1,2] //\n // abc len=3 [0,1,2]\n // 01,02,03,12,13,23 len=2 c=4\n //\n for (int i = len-1; i >=0; i--) {\n // i = 1; (2)\n // i = 0; (1)\n// if (index[i]< characters.length()-1 - (len-1 - i)) {\n if (index[i]< characters.length() - len + i) {\n index[i]++;\n break;\n }\n }\n StringBuilder sb = new StringBuilder();\n for(int i:index) {\n sb.append(characters.charAt(i));\n }\n return sb.toString();\n }", "List<String> mo5877c(String str);", "private char NEXT() {\r\n if (in >= input.length()) return '\\0';\r\n return (char) input.charAt(in);\r\n }", "public List<String> getCcs() {\r\n\t\treturn ccs;\r\n\t}", "public char FirstAppearingOnce()\n {\n char rs='#';\n int size=list.size();\n for(int i=0;i<size;i++){\n char ch= (char) list.get(i);\n if(1 == (Integer) map.get(ch)){\n rs=ch;\n break;\n }\n }\n return rs;\n }", "List<C1111j> mo5873b();", "private void checkListOrder(String[] sortedList, Collator c) {\n for (int i = 0; i < sortedList.length - 1; i++) {\n if (c.compare(sortedList[i], sortedList[i + 1]) >= 0) {\n errln(\"List out of order at element #\" + i + \": \"\n + sortedList[i] + \" >= \"\n + sortedList[i + 1]);\n }\n }\n }", "private ArrayList<Character> characterArrayListMaker(String s) {\n ArrayList<Character> result = new ArrayList<Character>();\n for (int i = 0; i < s.length(); i++){\n result.add(s.charAt(i));\n }\n return result;\n }", "@Test\n public void Test4663220() {\n RuleBasedCollator collator = (RuleBasedCollator)Collator.getInstance(Locale.US);\n java.text.StringCharacterIterator stringIter = new java.text.StringCharacterIterator(\"fox\");\n CollationElementIterator iter = collator.getCollationElementIterator(stringIter);\n \n int[] elements_next = new int[3];\n logln(\"calling next:\");\n for (int i = 0; i < 3; ++i) {\n logln(\"[\" + i + \"] \" + (elements_next[i] = iter.next()));\n }\n \n int[] elements_fwd = new int[3];\n logln(\"calling set/next:\");\n for (int i = 0; i < 3; ++i) {\n iter.setOffset(i);\n logln(\"[\" + i + \"] \" + (elements_fwd[i] = iter.next()));\n }\n \n for (int i = 0; i < 3; ++i) {\n if (elements_next[i] != elements_fwd[i]) {\n errln(\"mismatch at position \" + i + \n \": \" + elements_next[i] + \n \" != \" + elements_fwd[i]);\n }\n }\n }", "public Square getStartOrFinish(char c) {\n Square s = null;\n for (Square[] square : squares) {\n for (Square square1 : square) {\n if (square1.getV().getMode() == c) {\n return square1;\n }\n }\n }\n return s;\n }", "public Integer[] getCharList() {\n\t\t\treturn charList;\n\t\t}", "public ArrayList GetNext(Dialogue cp) {\n ArrayList temp = new ArrayList();\r\n if (cp != null) {\r\n for (String s : cp.getPointer()) {\r\n // temp.add(conversation.getText(s));\r\n //at this point we have the text, now we need to update the pointers\r\n\r\n }\r\n } else {\r\n //if we're here, we're at the start of a conversation, get first part which should always be start\r\n //temp.add(conversation.start);\r\n }\r\n return temp;\r\n }", "private void IdentifyCBs()\r\n\t{\r\n\t\t// Create new list of the CB\r\n\t\tthis.CBlist = new ArrayList<CheckBox>(18);\r\n\t \r\n\t // Going through all of the linear layout children\t\t\r\n \t\tfor(int count = 0; count < layoutCB.getChildCount(); count ++) \r\n\t {\r\n\t\t // If the tag of the child is linear layout tagged \"tagsvertical\"\r\n\t\t if((layoutCB.getChildAt(count)).getTag().toString().equals(\"tagsvertical\"))\r\n\t\t {\r\n\t\t\t \t// get the vertical linear-layout of the checkboxes\r\n\t\t \t\tLinearLayout layoutCBvertical = ((LinearLayout) layoutCB.getChildAt(count));\r\n\t\t \r\n\t\t\t // getting all of its children\r\n\t\t\t for(int counter = 0; counter < layoutCBvertical.getChildCount(); counter ++) \r\n\t\t\t {\r\n\t\t\t\t if((layoutCBvertical.getChildAt(counter)).getTag().toString().equals(\"cb\"))\r\n\t\t\t\t {\r\n\t\t\t\t\t // Adding the CH to the list\r\n\t\t\t\t\t CBlist.add((CheckBox) layoutCBvertical.getChildAt(counter));\r\n\t\t\t\t }\r\n\t\t\t }\r\n\t\t \t}\r\n\t }\r\n\t}", "boolean alreadyAdded(char c) {\n for (char x :_chars) {\n if (x == c) {\n return true;\n }\n }\n return false;\n }", "private int nextSpecialPrefix(RuleBasedCollator collator, int ce,\n Backup entrybackup)\n {\n backupInternalState(m_utilSpecialBackUp_);\n updateInternalState(entrybackup);\n previousChar();\n // We want to look at the character where we entered\n\n while (true) {\n // This loop will run once per source string character, for as\n // long as we are matching a potential contraction sequence\n // First we position ourselves at the begining of contraction\n // sequence\n int entryoffset = getContractionOffset(collator, ce);\n int offset = entryoffset;\n if (isBackwardsStart()) {\n ce = collator.m_contractionCE_[offset];\n break;\n }\n char previous = (char)previousChar();\n while (previous > collator.m_contractionIndex_[offset]) {\n // contraction characters are ordered, skip smaller characters\n offset ++;\n }\n\n if (previous == collator.m_contractionIndex_[offset]) {\n // Found the source string char in the table.\n // Pick up the corresponding CE from the table.\n ce = collator.m_contractionCE_[offset];\n }\n else {\n // Source string char was not in the table, prefix not found\n ce = collator.m_contractionCE_[entryoffset];\n }\n\n if (!isSpecialPrefixTag(ce)) {\n // The source string char was in the contraction table, and\n // the corresponding CE is not a prefix CE. We found the\n // prefix, break out of loop, this CE will end up being\n // returned. This is the normal way out of prefix handling\n // when the source actually contained the prefix.\n break;\n }\n }\n if (ce != CE_NOT_FOUND_) {\n // we found something and we can merilly continue\n updateInternalState(m_utilSpecialBackUp_);\n }\n else { // prefix search was a failure, we have to backup all the way to\n // the start\n updateInternalState(entrybackup);\n }\n return ce;\n }", "private Token scanChar(LocatedChar firstChar) {\n\t\tStringBuffer buffer = new StringBuffer();\n\t\tif(input.peek().matchChar('#')) {\n\t\t\tbuffer.append(input.next().getCharacter());\n\t\t\tLocatedChar next = input.peek();\n\t\t\tif(next.matchChar('#') || Character.isDigit(next.getCharacter())) {\n\t\t\t\tbuffer.append(input.next().getCharacter());\n\t\t\t\treturn CharToken.make(firstChar, buffer.toString(),next.getCharacter());\n\t\t\t} \n\t\t\telse {\n\t\t\t\tlexicalError(firstChar, \"malformed char of form ##[0..9#]\");\n\t\t\t\treturn findNextToken();\n\t\t\t}\n\t\t} \n\t\telse if(input.peek().isOctal()) {\n\t\t\tappendSubsequentOctals(buffer);\n\t\t\tint val;\n\t\t\ttry {\n\t\t\t\tval = Integer.parseInt(buffer.toString(), 8);\n\t\t\t} catch (NumberFormatException e) {\n\t\t\t\tlexicalError(firstChar, \"char value out of integer bounds\");\n\t\t\t\treturn findNextToken();\n\t\t\t}\n\t\t\tif(isPrintableChar((char)val)) {\n\t\t\t\treturn CharToken.make(firstChar, buffer.toString(), (char)val);\n\t\t\t}\n\t\t\telse {\n\t\t\t\tlexicalError(firstChar, \"char value not printable\");\n\t\t\t\treturn findNextToken();\n\t\t\t}\n\t\t}\n\t\telse if(isPrintableChar(input.peek().getCharacter())){\n\t\t\tLocatedChar next = input.next();\n\t\t\tbuffer.append(next.getCharacter());\n\t\t\treturn CharToken.make(firstChar, buffer.toString(), next.getCharacter());\n\t\t}\n\t\telse {\n\t\t\tlexicalError(firstChar, \"malformed char of form #@\");\n\t\t\treturn findNextToken();\n\t\t}\n\t}", "public static Object pregexpReadCharList(Object s, Object i, Object n) {\n LList lList = LList.Empty;\n while (Scheme.numGEq.apply2(i, n) == Boolean.FALSE) {\n try {\n try {\n char c = strings.stringRef((CharSequence) s, ((Number) i).intValue());\n if (Scheme.isEqv.apply2(Char.make(c), Lit46) != Boolean.FALSE) {\n if (!lists.isNull(lList)) {\n return LList.list2(lists.cons(Lit82, pregexpReverse$Ex(lList)), AddOp.$Pl.apply2(i, Lit8));\n }\n lList = lists.cons(Char.make(c), lList);\n i = AddOp.$Pl.apply2(i, Lit8);\n } else if (Scheme.isEqv.apply2(Char.make(c), Lit19) != Boolean.FALSE) {\n Object char$Mni = pregexpReadEscapedChar(s, i, n);\n if (char$Mni != Boolean.FALSE) {\n lList = lists.cons(lists.car.apply1(char$Mni), lList);\n i = lists.cadr.apply1(char$Mni);\n } else {\n return pregexpError$V(new Object[]{Lit80, Lit22});\n }\n } else if (Scheme.isEqv.apply2(Char.make(c), Lit58) != Boolean.FALSE) {\n boolean x = lists.isNull(lList);\n if (!x) {\n Object i$Pl1 = AddOp.$Pl.apply2(i, Lit8);\n Object apply2 = Scheme.numLss.apply2(i$Pl1, n);\n try {\n boolean x2 = ((Boolean) apply2).booleanValue();\n if (x2) {\n try {\n try {\n } catch (ClassCastException e) {\n throw new WrongType(e, \"string-ref\", 2, i$Pl1);\n }\n } catch (ClassCastException e2) {\n throw new WrongType(e2, \"string-ref\", 1, s);\n }\n }\n } catch (ClassCastException e3) {\n throw new WrongType(e3, \"x\", -2, apply2);\n }\n }\n lList = lists.cons(Char.make(c), lList);\n i = AddOp.$Pl.apply2(i, Lit8);\n } else if (Scheme.isEqv.apply2(Char.make(c), Lit15) != Boolean.FALSE) {\n try {\n CharSequence charSequence = (CharSequence) s;\n Object apply22 = AddOp.$Pl.apply2(i, Lit8);\n try {\n if (characters.isChar$Eq(Char.make(strings.stringRef(charSequence, ((Number) apply22).intValue())), Lit44)) {\n Object posix$Mnchar$Mnclass$Mni = pregexpReadPosixCharClass(s, AddOp.$Pl.apply2(i, Lit16), n);\n lList = lists.cons(lists.car.apply1(posix$Mnchar$Mnclass$Mni), lList);\n i = lists.cadr.apply1(posix$Mnchar$Mnclass$Mni);\n } else {\n lList = lists.cons(Char.make(c), lList);\n i = AddOp.$Pl.apply2(i, Lit8);\n }\n } catch (ClassCastException e4) {\n throw new WrongType(e4, \"string-ref\", 2, apply22);\n }\n } catch (ClassCastException e5) {\n throw new WrongType(e5, \"string-ref\", 1, s);\n }\n } else {\n lList = lists.cons(Char.make(c), lList);\n i = AddOp.$Pl.apply2(i, Lit8);\n }\n } catch (ClassCastException e6) {\n throw new WrongType(e6, \"string-ref\", 2, i);\n }\n } catch (ClassCastException e7) {\n throw new WrongType(e7, \"string-ref\", 1, s);\n }\n }\n return pregexpError$V(new Object[]{Lit80, Lit81});\n }", "List<Token> scanTokens() {\n\n while (!reachedEnd()) {\n\n start = current;\n scanToken();\n }\n\n tokens.add(new Token(EOF, \"\", null, line));\n return tokens;\n }", "public ArrayList<char[]> getInputByCharacters(Class c, String file){\n this.resourceName = file;\n return getFileAsResourceByCharsNewLineDelineated(c);\n }", "public Scanner scan() throws LexicalException {\r\n\t\t/* TODO Replace this with a correct and complete implementation!!! */\r\n\t\tint pos = 0;\r\n\t\tint line = 1;\r\n\t\tint posInLine = 1;\r\n\t\tboolean isEOF = true;\r\n\t\twhile(pos < chars.length - 1) {\r\n\t\t\t\r\n\t\t\tchar c = chars[pos];\r\n\t\t\t\r\n\t\t\t// Check if valid character or throw Lexical Exception\r\n\t\t\tif(!(Character.isDigit(c) || Character.isWhitespace(c) || idSet.contains(c) || opSet.contains(c) || \r\n\t\t\t\t\tsepSet.contains(c) || c == '\"' || c == '\\0' || whSet.contains(c)))\r\n\t\t\t\tthrow new LexicalException(c + \" isn't a valid character\", pos);\r\n\t\t\t\r\n\t\t\t//Check if EOFChar\r\n\t\t\tif(c == '\\0') {\r\n\t\t\t\ttokens.add(new Token(Kind.EOF, pos, 0, line, posInLine));\r\n\t\t\t\tisEOF = false;\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Check if new line\r\n\t\t\tif(chars[pos] == '\\n' || chars[pos] == '\\r') {\r\n\t\t\t\tif(chars[pos] == '\\r' && chars[pos + 1] == '\\n')\r\n\t\t\t\t\tpos++;\r\n\t\t\t\tline++;\r\n\t\t\t\tposInLine = 0;\r\n\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t// Check if comment\r\n\t\t\tif(pos < chars.length - 1 && (chars[pos] == '/' && chars[pos+1] == '/')){\r\n\t\t\t\tpos += 2;\r\n\t\t\t\twhile(pos < chars.length - 1) {\r\n\t\t\t\t\tif(chars[pos] == '\\n' || chars[pos] == '\\r') {\r\n\t\t\t\t\t\tif(chars[pos] == '\\r' && chars[pos + 1] == '\\n')\r\n\t\t\t\t\t\t\tpos++;\r\n\t\t\t\t\t\tline++;\r\n\t\t\t\t\t\tposInLine = 0;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tpos++;\r\n\t\t\t\t}\r\n\t\t\t\tif(!(pos < chars.length))\r\n\t\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t// Check if seperator\r\n\t\t\tif(sepSet.contains(chars[pos])) {\r\n\t\t\t\tif(chars[pos] == ';'){\r\n\t\t\t\t\ttokens.add(new Token(Kind.SEMI, pos, 1, line, posInLine));\r\n\t\t\t\t}\r\n\t\t\t\tif(chars[pos] == '(') {\r\n\t\t\t\t\ttokens.add(new Token(Kind.LPAREN, pos, 1, line, posInLine));\r\n\t\t\t\t}\r\n\t\t\t\tif(chars[pos] == ')') {\r\n\t\t\t\t\ttokens.add(new Token(Kind.RPAREN, pos, 1, line, posInLine));\r\n\t\t\t\t}\t\r\n\t\t\t\tif(chars[pos] == '[') {\r\n\t\t\t\t\ttokens.add(new Token(Kind.LSQUARE, pos, 1, line, posInLine));\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\tif(chars[pos] == ']') {\r\n\t\t\t\t\ttokens.add(new Token(Kind.RSQUARE, pos, 1, line, posInLine));\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\tif(chars[pos] == ',') {\r\n\t\t\t\t\ttokens.add(new Token(Kind.COMMA, pos, 1, line, posInLine));\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\t\r\n\t\t\t// Check if operator\r\n\t\t\tif(opSet.contains(chars[pos])) {\r\n\t\t\t\tif(chars[pos] == '=') {\r\n\t\t\t\t\tpos++;\r\n\t\t\t\t\tif(pos < chars.length) {\r\n\t\t\t\t\t\tif(chars[pos] == '=') {\r\n\t\t\t\t\t\t\ttokens.add(new Token(Kind.OP_EQ, pos - 1, 2, line, posInLine));\r\n\t\t\t\t\t\t\tposInLine++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\ttokens.add(new Token(Kind.OP_ASSIGN, pos - 1, 1, line, posInLine));\r\n\t\t\t\t\t\t\tpos--;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttokens.add(new Token(Kind.OP_ASSIGN, pos - 1, 1, line, posInLine));\r\n\t\t\t\t\t\tpos--;\r\n\t\t\t\t\t}\t\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(chars[pos] == '>') {\r\n\t\t\t\t\tpos++;\r\n\t\t\t\t\tif(pos < chars.length) {\r\n\t\t\t\t\t\tif(chars[pos] == '=') {\r\n\t\t\t\t\t\t\ttokens.add(new Token(Kind.OP_GE, pos - 1, 2, line, posInLine));\r\n\t\t\t\t\t\t\tposInLine++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\ttokens.add(new Token(Kind.OP_GT, pos - 1, 1, line, posInLine));\r\n\t\t\t\t\t\t\tpos--;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttokens.add(new Token(Kind.OP_GT, pos - 1, 1, line, posInLine));\r\n\t\t\t\t\t\tpos--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(chars[pos] == '-') {\r\n\t\t\t\t\tpos++;\r\n\t\t\t\t\tif(pos < chars.length) {\r\n\t\t\t\t\t\tif(chars[pos] == '>') {\r\n\t\t\t\t\t\t\ttokens.add(new Token(Kind.OP_RARROW, pos - 1, 2, line, posInLine));\r\n\t\t\t\t\t\t\tposInLine++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\ttokens.add(new Token(Kind.OP_MINUS, pos - 1, 1, line, posInLine));\r\n\t\t\t\t\t\t\tpos--;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttokens.add(new Token(Kind.OP_MINUS, pos - 1, 1, line, posInLine));\r\n\t\t\t\t\t\tpos--;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(chars[pos] == '<') {\r\n\t\t\t\t\tpos++;\r\n\t\t\t\t\tif(pos < chars.length) {\r\n\t\t\t\t\t\tif(chars[pos] == '=') {\r\n\t\t\t\t\t\t\ttokens.add(new Token(Kind.OP_LE, pos - 1, 2, line, posInLine));\r\n\t\t\t\t\t\t\tposInLine++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse if(chars[pos] == '-') {\r\n\t\t\t\t\t\t\ttokens.add(new Token(Kind.OP_LARROW, pos - 1, 2, line, posInLine));\r\n\t\t\t\t\t\t\tposInLine++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\ttokens.add(new Token(Kind.OP_LT, pos - 1, 1, line, posInLine));\r\n\t\t\t\t\t\t\tpos--;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttokens.add(new Token(Kind.OP_LT, pos - 1, 1, line, posInLine));\r\n\t\t\t\t\t\tpos--;\r\n\t\t\t\t\t\tcontinue;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(chars[pos] == '!') {\r\n\t\t\t\t\tpos++;\r\n\t\t\t\t\tif(pos < chars.length) {\r\n\t\t\t\t\t\tif(chars[pos] == '=') {\r\n\t\t\t\t\t\t\ttokens.add(new Token(Kind.OP_NEQ, pos - 1, 2, line, posInLine));\r\n\t\t\t\t\t\t\tposInLine++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\ttokens.add(new Token(Kind.OP_EXCL, pos - 1, 1, line, posInLine));\r\n\t\t\t\t\t\t\tpos--;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttokens.add(new Token(Kind.OP_EXCL, pos - 1, 1, line, posInLine));\r\n\t\t\t\t\t\tpos--;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(chars[pos] == '?') {\r\n\t\t\t\t\ttokens.add(new Token(Kind.OP_Q, pos, 1, line, posInLine));\r\n\t\t\t\t}\r\n\t\t\t\tif(chars[pos] == ':') {\r\n\t\t\t\t\ttokens.add(new Token(Kind.OP_COLON, pos, 1, line, posInLine));\r\n\t\t\t\t}\r\n\t\t\t\tif(chars[pos] == '&') {\r\n\t\t\t\t\ttokens.add(new Token(Kind.OP_AND, pos, 1, line, posInLine));\r\n\t\t\t\t}\r\n\t\t\t\tif(chars[pos] == '|') {\r\n\t\t\t\t\ttokens.add(new Token(Kind.OP_OR, pos, 1, line, posInLine));\r\n\t\t\t\t}\r\n\t\t\t\tif(chars[pos] == '+') {\r\n\t\t\t\t\ttokens.add(new Token(Kind.OP_PLUS, pos, 1, line, posInLine));\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(chars[pos] == '*') {\r\n\t\t\t\t\tpos++;\r\n\t\t\t\t\tif(pos < chars.length) {\r\n\t\t\t\t\t\tif(chars[pos] == '*') {\r\n\t\t\t\t\t\t\ttokens.add(new Token(Kind.OP_POWER, pos - 1, 2, line, posInLine));\r\n\t\t\t\t\t\t\tposInLine++;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\ttokens.add(new Token(Kind.OP_TIMES, pos - 1, 1, line, posInLine));\r\n\t\t\t\t\t\t\tpos--;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\ttokens.add(new Token(Kind.OP_TIMES, pos - 1, 1, line, posInLine));\r\n\t\t\t\t\t\tpos--;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(chars[pos] == '/') {\r\n\t\t\t\t\ttokens.add(new Token(Kind.OP_DIV, pos, 1, line, posInLine));\r\n\t\t\t\t}\r\n\t\t\t\tif(chars[pos] == '%') {\r\n\t\t\t\t\ttokens.add(new Token(Kind.OP_MOD, pos, 1, line, posInLine));\r\n\t\t\t\t}\r\n\t\t\t\tif(chars[pos] == '@') {\r\n\t\t\t\t\ttokens.add(new Token(Kind.OP_AT, pos, 1, line, posInLine));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Check if Integer Literal\r\n\t\t\tif(chars[pos] == '0') {\r\n\t\t\t\ttokens.add(new Token(Kind.INTEGER_LITERAL, pos, 1, line, posInLine));\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(intLitSet.contains(chars[pos])) {\r\n\t\t\t\tint marker = pos;\r\n\t\t\t\twhile(marker < chars.length && (intLitSet.contains(chars[marker]) || chars[marker] == '0'))\r\n\t\t\t\t\tmarker++;\r\n\t\t\t\t\r\n\t\t\t\tString sb = String.valueOf(chars).substring(pos, marker);\r\n\t\t\t\ttry {\r\n\t\t\t\t\tInteger.parseInt(sb);\r\n\t\t\t\t}\r\n\t\t\t\tcatch(Exception e) {\r\n\t\t\t\t\tthrow new LexicalException(sb + \" exceeds the integer range.\", pos);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\ttokens.add(new Token(Kind.INTEGER_LITERAL, pos, marker - pos, line, posInLine));\r\n\t\t\t\tposInLine += marker - (pos + 1);\r\n\t\t\t\tpos = marker - 1;\t\t\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Check if Identifier\r\n\t\t\tif(idSet.contains(chars[pos])) {\r\n\t\t\t\tint marker = pos;\r\n\t\t\t\twhile(marker < chars.length && (idSet.contains(chars[marker]) || intLitSet.contains(chars[marker]) || chars[marker] == '0')) {\r\n\t\t\t\t\tmarker++;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tString sb = String.valueOf(chars).substring(pos, marker);\r\n\t\t\t\tif(keywordMap.containsKey(sb)) {\r\n\t\t\t\t\ttokens.add(new Token(keywordMap.get(sb), pos, marker - pos, line, posInLine));\r\n\t\t\t\t}\r\n\t\t\t\telse if(sb.equals(\"true\") || sb.equals(\"false\")){\r\n\t\t\t\t\ttokens.add(new Token(Kind.BOOLEAN_LITERAL, pos, marker - pos, line, posInLine));\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\ttokens.add(new Token(Kind.IDENTIFIER, pos, marker - pos, line, posInLine));\r\n\t\t\t\t}\r\n\t\t\t\tposInLine += marker - (pos + 1);\r\n\t\t\t\tpos = marker - 1;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t// Check if valid String Literal\r\n\t\t\tif(chars[pos] == '\\\"') {\r\n\t\t\t\tboolean flag = false;\r\n\t\t\t\tint marker = pos;\r\n\t\t\t\twhile(marker < chars.length - 1) {\r\n\t\t\t\t\tmarker++;\r\n\t\t\t\t\tif(chars[marker] == '\\\"') {\r\n\t\t\t\t\t\tflag = true;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(chars[marker] == '\\n' || chars[marker] == '\\r') {\r\n\t\t\t\t\t\tflag = false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse if(chars[marker] == '\\\\') {\r\n\t\t\t\t\t\tmarker++;\r\n\t\t\t\t\t\tString chk = new StringBuilder().append('\\\\').append(chars[marker]).toString();;\r\n\t\t\t\t\t\tif(!esSet.contains(chk)) {\r\n\t\t\t\t\t\t\tthrow new LexicalException(\"Invalid String literal\", marker);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif(!flag)\r\n\t\t\t\t\tthrow new LexicalException(\"Invalid String literal\", marker);\r\n\t\t\t\telse {\r\n\t\t\t\t\ttokens.add(new Token(Kind.STRING_LITERAL, pos, marker - pos + 1, line, posInLine));\r\n\t\t\t\t\tposInLine += marker - pos;\r\n\t\t\t\t\tpos = marker;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tpos++;\r\n\t\t\tposInLine++;\r\n\t\t}\r\n\t\tif(isEOF)\r\n\t\t\ttokens.add(new Token(Kind.EOF, pos, 0, line, posInLine));\r\n\t\treturn this;\r\n\r\n\t}", "private char next() {\n char c = peek();\n eat(c);\n return c;\n }", "private boolean CATS(Category... cs) {\r\n if (in >= input.length()) return false;\r\n int len = input.nextLength(in);\r\n int ch = input.nextChar(in, len);\r\n Category cat = Category.get(ch);\r\n boolean ok = false;\r\n for (Category c : cs) if (cat == c) ok = true;\r\n if (! ok) return false;\r\n in += len;\r\n return true;\r\n }", "private boolean isValid(char c) {\n if (c == 'A' || c == 'T' || c == 'G' || c == 'C' || c == 'N'\n || c == 'a' || c == 't' || c == 'g' || c == 'c') {\n return true;\n }\n return false;\n }", "@Test\n public void LexerTest1() {\n String test = \"^^C B [ABC] %Hi \\r [GF_B] \\r % own line comment \\r\";\n for(Token t:(new Lexer(test)).getTokens()){\n System.out.println(t.type+\" : \"+t.value);\n }\n }", "private void scanToken() {\n char c = advance();\n switch (c) {\n case '(':\n addToken(LEFT_PAREN);\n break;\n case ')':\n addToken(RIGHT_PAREN);\n break;\n case '{':\n addToken(LEFT_BRACE);\n break;\n case '}':\n addToken(RIGHT_BRACE);\n break;\n case ',':\n addToken(COMMA);\n break;\n case '.':\n addToken(DOT);\n break;\n case '-':\n addToken(MINUS);\n break;\n case '+':\n addToken(PLUS);\n break;\n case ';':\n addToken(SEMICOLON);\n break;\n case '*':\n addToken(STAR);\n break;\n case '?':\n addToken(QUERY);\n break;\n case ':':\n addToken(COLON);\n break;\n\n case '!': // These characters could be part of a 2-char lexeme, so must check the second char.\n addToken(secondCharIs('=') ? BANG_EQUAL : BANG);\n break;\n case '=':\n addToken(secondCharIs('=') ? EQUAL_EQUAL : EQUAL);\n break;\n case '<':\n addToken(secondCharIs('=') ? LESS_EQUAL : LESS);\n break;\n case '>':\n addToken(secondCharIs('=') ? GREATER_EQUAL : GREATER);\n break;\n\n case '/': // The / char could be the beginning of a comment\n handleSlash();\n break;\n\n case ' ': // Ignore whitespace\n case '\\r':\n case '\\t':\n break;\n\n case '\\n': // Ignore newline but increase line count\n line++;\n break;\n\n case '\"': // Beginning of a string\n handleString();\n break;\n\n default:\n if (isDigit(c)) {\n handleNumber();\n } else if (isAlpha(c)) {\n handleIdentifier();\n } else {\n Rune.error(line, \"Unexpected character.\");\n }\n break;\n }\n }", "private int nextDiscontiguous(RuleBasedCollator collator, int entryoffset)\n {\n int offset = entryoffset;\n boolean multicontraction = false;\n // since it will be stuffed into this iterator and ran over again\n if (m_utilSkippedBuffer_ == null) {\n m_utilSkippedBuffer_ = new StringBuilder();\n }\n else {\n m_utilSkippedBuffer_.setLength(0);\n }\n int ch = currentChar();\n m_utilSkippedBuffer_.appendCodePoint(ch);\n int prevCC = 0;\n int cc = getCombiningClass(ch);\n // accent after the first character\n if (m_utilSpecialDiscontiguousBackUp_ == null) {\n m_utilSpecialDiscontiguousBackUp_ = new Backup();\n }\n backupInternalState(m_utilSpecialDiscontiguousBackUp_);\n boolean prevWasLead = false;\n while (true) {\n // We read code units for contraction table matching\n // but have to get combining classes for code points\n // to figure out where to stop with discontiguous contraction.\n int ch_int = nextChar();\n char nextch = (char)ch_int;\n if (UTF16.isSurrogate(nextch)) {\n if (prevWasLead) {\n // trail surrogate of surrogate pair, keep previous and current cc\n prevWasLead = false;\n } else {\n prevCC = cc;\n cc = 0; // default cc for an unpaired surrogate\n prevWasLead = false;\n if (Character.isHighSurrogate(nextch)) {\n int trail = nextChar();\n if (Character.isLowSurrogate((char)trail)) {\n cc = getCombiningClass(Character.toCodePoint(nextch, (char)trail));\n prevWasLead = true;\n }\n if (trail >= 0) {\n previousChar(); // restore index after having peeked at the next code unit\n }\n }\n }\n } else {\n prevCC = cc;\n cc = getCombiningClass(ch_int);\n prevWasLead = false;\n }\n if (ch_int < 0 || cc == 0) {\n // if there are no more accents to move around\n // we don't have to shift previousChar, since we are resetting\n // the offset later\n if (multicontraction) {\n if (ch_int >= 0) {\n previousChar(); // backtrack\n }\n setDiscontiguous(m_utilSkippedBuffer_);\n return collator.m_contractionCE_[offset];\n }\n break;\n }\n\n offset ++; // skip the combining class offset\n while ((offset < collator.m_contractionIndex_.length) &&\n (nextch > collator.m_contractionIndex_[offset])) {\n offset ++;\n }\n\n int ce = CE_NOT_FOUND_;\n if ( offset >= collator.m_contractionIndex_.length) {\n break;\n }\n if (nextch != collator.m_contractionIndex_[offset] || cc == prevCC) {\n // unmatched or blocked character\n if ( (m_utilSkippedBuffer_.length()!= 1) ||\n ((m_utilSkippedBuffer_.charAt(0)!= nextch) &&\n (m_bufferOffset_<0) )) { // avoid push to skipped buffer twice\n m_utilSkippedBuffer_.append(nextch);\n }\n offset = entryoffset; // Restore the offset before checking next character.\n continue;\n }\n else {\n ce = collator.m_contractionCE_[offset];\n }\n\n if (ce == CE_NOT_FOUND_) {\n break;\n }\n else if (isContractionTag(ce)) {\n // this is a multi-contraction\n offset = getContractionOffset(collator, ce);\n if (collator.m_contractionCE_[offset] != CE_NOT_FOUND_) {\n multicontraction = true;\n backupInternalState(m_utilSpecialDiscontiguousBackUp_);\n }\n }\n else {\n setDiscontiguous(m_utilSkippedBuffer_);\n return ce;\n }\n }\n\n updateInternalState(m_utilSpecialDiscontiguousBackUp_);\n // backup is one forward of the base character, we need to move back\n // one more\n previousChar();\n return collator.m_contractionCE_[entryoffset];\n }", "public static List charList(char[] t) {\n List<Character> charList = new ArrayList<Character>();\n for (char c : t) {\n if (!charList.contains(c)) {\n charList.add(c);\n }\n }\n return charList;\n }", "public ArrayList<Byte> generateConditionBlockCode(ConditionBlock cb) {\n if ((cb.getActions().getChildren().size() == 0) || (cb.getCondition().getChildren().size() == 0)) {\n return null;\n }\n\n Block acBlock = (Block) cb.getActions().getChildren().get(0);\n Block conBlock = (Block) cb.getCondition().getChildren().get(0);\n\n ArrayList<Byte> cmdArr1 = new ArrayList<>();\n ArrayList<Byte> cmdArr2 = new ArrayList<>();\n ArrayList<Byte> cmdArr3 = new ArrayList<>();\n\n //starting action\n char instruction = 'b';\n int address = acBlock.getCapability().getDevice().getAddress();\n char cmdChar = acBlock.getCapability().getExeCommand().charAt(0);\n char cmdChar1 = acBlock.getCapability().getExeCommand().charAt(1);\n\n cmdArr1.add((byte) instruction);\n cmdArr1.add((byte) address);\n cmdArr1.add((byte) cmdChar);\n cmdArr1.add((byte) cmdChar1);\n //prepending command length parameter\n cmdArr1.add(0, (byte) (cmdArr1.size() + 1));\n\n //checking condition or sense\n instruction = 'c';\n address = conBlock.getCapability().getDevice().getAddress();\n cmdChar = conBlock.getCapability().getExeCommand().charAt(0);\n cmdChar1 = conBlock.getCapability().getExeCommand().charAt(1);\n char compType = conBlock.getCapability().getCompType().charAt(0);\n\n cmdArr2.add((byte) instruction);\n cmdArr2.add((byte) address);\n cmdArr2.add((byte) compType);\n short jumpAdd = 0;\n byte[] jumpArr = shortToByteArray(jumpAdd);\n for (byte b : jumpArr) {\n cmdArr2.add(b);\n }\n short respSize = Short.parseShort(conBlock.getCapability().getRespSize());\n byte[] respArr = shortToByteArray(respSize);\n cmdArr2.add(respArr[0]);\n// for(byte b:respArr){\n// cmdArr2.add(b);\n// }\n int refVal = Integer.parseInt(conBlock.getCapability().getRefValue());\n if (conBlock.getCapability().getType().equals(Capability.CAP_CONDITION)) {\n refVal = Integer.parseInt(conBlock.getTextField().getText());\n }\n byte[] refArr = intToByteArray(refVal);\n for (int i = 0; i < respSize; i++) {\n cmdArr2.add(refArr[i]);\n }\n cmdArr2.add((byte) cmdChar);\n cmdArr2.add((byte) cmdChar1);\n //prepending command length parameter\n cmdArr2.add(0, (byte) (cmdArr2.size() + 1));\n\n //terminating action\n instruction = 'b';\n address = acBlock.getCapability().getDevice().getAddress();\n cmdChar = acBlock.getCapability().getStopCommand().charAt(0);\n cmdChar1 = acBlock.getCapability().getStopCommand().charAt(1);\n cmdArr3.add((byte) instruction);\n cmdArr3.add((byte) address);\n cmdArr3.add((byte) cmdChar);\n cmdArr3.add((byte) cmdChar1);\n //prepending command length parameter\n cmdArr3.add(0, (byte) (cmdArr3.size() + 1));\n\n //merging lists together\n cmdArr1.addAll(cmdArr2);\n cmdArr1.addAll(cmdArr3);\n return cmdArr1;\n }", "public static NodoListaC creaInTesta() {\r\n\t\tNodoListaC a = new NodoListaC();\r\n\t\ta.info = 'A';\r\n\t\ta.next = null;\r\n\t\tNodoListaC p = a;\r\n\t\tchar c;\r\n\t\tfor (c = 'B'; c <= 'Z'; c++) {\r\n\t\t a = new NodoListaC();\r\n\t\t a.info = c;\r\n\t\t a.next = p;\r\n\t\t p = a; // p va a puntare\r\n\t\t} // all’inizio della lista\r\n\t\treturn p; // oppure return a;\r\n\t}", "@Override\n public Character next() {\n assert(this.hasNext());\n\n char currCharacter = this.circularString.charAt(this.currIndex);\n ++this.currIndex;\n\n return currCharacter;\n }", "public List<PatternItem> pattern() {\n List<PatternItem> out = new ArrayList<>();\n int level = 0;\n int n = 0;\n String c;\n\n boolean done = false;\n while (!done) {\n DNAToken token = parser.step();\n\n switch (token) {\n case CONT:\n break;\n case C:\n out.add(new PatternItem(PatternItem.Type.BASE, 'I'));\n break;\n case F:\n out.add(new PatternItem(PatternItem.Type.BASE, 'C'));\n break;\n case P:\n out.add(new PatternItem(PatternItem.Type.BASE, 'F'));\n break;\n case IC:\n out.add(new PatternItem(PatternItem.Type.BASE, 'P'));\n break;\n case IP:\n n = parser.nat();\n out.add(new PatternItem(PatternItem.Type.JUMP, n));\n break;\n case IF:\n parser.next(); // Consume one more character for no good reason\n c = parser.consts();\n out.add(new PatternItem(PatternItem.Type.SEARCH, c));\n break;\n case IIP:\n level += 1;\n out.add(new PatternItem(PatternItem.Type.OPEN));\n break;\n case IIF:\n case IIC:\n if (level == 0) {\n done = true;\n } else {\n level -= 1;\n out.add(new PatternItem(PatternItem.Type.CLOSE));\n }\n break;\n case III:\n rna.concat(dna.substring(0, 7));\n dna.trunc(7);\n break;\n default:\n finish();\n }\n }\n\n return out;\n }", "char getNextChar () {\n m_pos++; \n return getChar ();\n }", "private Operator checkOperator(char c){\n if (c == '+'){\n return new AddOperator(); \n }\n else if (c == '-'){\n return new SubOperator(); \n }\n else if (c == '*'){\n return new MulOperator(); \n }\n else if (c == '/'){\n return new DivOperator(); \n }\n else \n return null;\n }", "void calc_next(String re)\r\n\t{\r\n\t\tint i,j,k;\r\n\t\tnext=new int[re.length()];\r\n\t\tfor (i=0; i<re.length(); ++i)\r\n\t\t{\r\n\t\t\tif (re.charAt(i)=='(')\r\n\t\t\t{\r\n\t\t\t\tk=0;\r\n\t\t\t\tj=i;\r\n\t\t\t\twhile (true)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (re.charAt(j)=='(')\r\n\t\t\t\t\t\t++k;\r\n\t\t\t\t\tif (re.charAt(j)==')')\r\n\t\t\t\t\t\t--k;\r\n\t\t\t\t\tif (k==0)\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t++j;\r\n\t\t\t\t}\r\n\t\t\t\tnext[i]=j;\r\n\t\t\t}\r\n\t\t\telse next[i]=i;\r\n\t\t}\r\n\t}", "private static void printAllBeginningWithC(List<Person> people) \n\t{\n\t\tfor(Person p : people) \n\t\t{\n\t\t\t//if(p.getLastName().substring(0, 1).equals(\"C\"))\n\t\t\tif(p.getLastName().startsWith(\"C\"))\n\t\t\t\tSystem.out.println(p);\n\t\t}\n\t}", "public List<String> getCc() {\n return cc;\n }", "private int getIndex(char c) {\n // if the character is a-z then return 0-25 based on position in alphabet\n if (c >= 'a' && c <= 'z') {\n return c - 'a';\n }\n // if the character is an appostrophe return 26 (last element in node array)\n else if (c == '\\'') {\n return 26;\n }\n // if the character is not a-z nor an apostrophe, return -1 to signify error\n else {\n return -1;\n }\n }", "static boolean mayHaveLccc(int c) {\n if(c < 0x300) { return false; }\n if(c > 0xffff) { c = UTF16.getLeadSurrogate(c); }\n int i;\n return\n (i = lcccIndex[c >> 5]) != 0 &&\n (lcccBits[i] & (1 << (c & 0x1f))) != 0;\n }", "private List<String> listCodesPizza() {\n\t\tString[] paths = file.list();\n\t\tList<String> stringList = new ArrayList<String>(Arrays.asList(paths));\n\t\treturn stringList;\n\t}", "public static ArrayList<String> getTokenList(String cyp, boolean DEBUG_PRINT) {\n CypherLexer lexer = new CypherLexer(new ANTLRInputStream(cyp));\n\n CommonTokenStream tokens = new CommonTokenStream(lexer);\n tokens.fill();\n CypherParser parser = new CypherParser(tokens);\n\n // dangerous - comment out if something is going wrong.\n parser.removeErrorListeners();\n\n ParseTree tree = parser.cypher();\n ParseTreeWalker walker = new ParseTreeWalker();\n\n cypherWalker = null;\n cypherWalker = new CypherWalker();\n walker.walk(cypherWalker, tree);\n\n if (DEBUG_PRINT) cypherWalker.printInformation();\n\n ArrayList<String> tokenList = new ArrayList<>();\n\n for (Object t : tokens.getTokens()) {\n CommonToken tok = (CommonToken) t;\n String s = tok.getText().toLowerCase();\n\n // exclude some tokens from the list of tokens. This includes the EOF pointer,\n // semi-colons, and alias artifacts.\n if (!\" \".equals(s) && !\"<eof>\".equals(s) && !\";\".equals(s) && !\"as\".equals(s) &&\n !cypherWalker.getAlias().contains(s)) {\n tokenList.add(s);\n }\n }\n return tokenList;\n }", "@Test\n public void test () throws IOException\n {\n CacheList clist = new CacheList(new Scanner(\n \"GCABCD\\tAs The World Turns\\tbunny\\t1\\t1\\tN40 45.875\\tW111 48.986\\nGCRQWK\\tOld Three Tooth\\tgeocadet\\t3.5\\t3\\tN40 45.850\\tW111 48.045\\n\"));\n clist.setTitleConstraint(\"Turns\");\n ArrayList<Cache> selected = clist.select();\n assertEquals(1, selected.size());\n assertEquals(\"GCABCD\", selected.get(0).getGcCode());\n }", "List<C1111j> mo5868a();", "public static List<String> createCompetencyList() {\n List<String> list = new ArrayList<String>();\n list.add(\"Line number 1\");\n list.add(\"Line number 2\");\n return list;\n }", "private boolean completeConcurrentRules(\r\n\t\t\tfinal Rule r,\r\n\t\t\tfinal int rIndx,\r\n\t\t\tfinal List<List<ConcurrentRule>> crsOfRule,\r\n\t\t\tfinal int listIndx,\r\n\t\t\tfinal Hashtable<?, ?> matchmap) {\n \t\t\r\n\t\tboolean res = false;\r\n\t\tif (listIndx >= crsOfRule.size()) {\r\n\t\t\tint x = listIndx;\r\n\t\t\tint preIndx = rIndx-1;\r\n\t\t\tRule preRule = this.ruleSequence.getRule(preIndx);\r\n\t\t\tif (x == 0) {\r\n\t\t\t\tList<ConcurrentRule> list = this.makeConcurrentRulesDuetoDependency(preRule, preIndx, r, rIndx, matchmap);\t\t\t\t\r\n\t\t\t\tcrsOfRule.add(list);\r\n\t\t\t\tres = true;\r\n\t\t\t} else {\r\n\t\t\t\tList<ConcurrentRule>\r\n\t\t\t\tcrListOfPreRule = this.getConcurrentRulesOfRule(preRule, preIndx, x-1);\r\n\t\t\t\tif (crListOfPreRule == null || crListOfPreRule.isEmpty()) {\r\n\t\t\t\t\t// create a new list of lists to fill\r\n\t\t\t\t\tfinal List<List<ConcurrentRule>> \r\n\t\t\t\t\tconRuleListsOfPreRule = this.getListsOfConcurrentRulesOfRule(preRule, preIndx);\t\r\n\t\t\t\t\t// put this list to fill\r\n\t\t\t\t\tthis.completeConcurrentRules(preRule, rIndx-1, conRuleListsOfPreRule, x-1, matchmap);\r\n\t\t\t\t\t// get the (x-1) list\r\n\t\t\t\t\tcrListOfPreRule = this.getConcurrentRulesOfRule(preRule, preIndx, x-1);\r\n\t\t\t\t} \r\n\t\t\t\t\t\r\n\t\t\t\tif (crListOfPreRule != null) {\r\n\t\t\t\t\tfinal List<ConcurrentRule> list = new Vector<ConcurrentRule>();\r\n\t\t\t\t\tfor (int c=0; c<crListOfPreRule.size(); c++) {\r\n\t\t\t\t\t\tfinal ConcurrentRule cr = crListOfPreRule.get(c);\r\n\t\t\t\t\t\tlist.addAll(this.makeConcurrentRulesDuetoDependency(cr, r, matchmap));\r\n\t\t\t\t\t}\r\n\t\t\t\t\twhile (crsOfRule.size() < x) {\r\n\t\t\t\t\t\tcrsOfRule.add(new Vector<ConcurrentRule>());\r\n\t\t\t\t\t}\r\n\t\t\t\t\tcrsOfRule.add(list);\r\n\t\t\t\t\tres = true;\r\n\t\t\t\t}\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t\treturn res;\r\n\t}", "private int nextExpansion(RuleBasedCollator collator, int ce)\n {\n // NOTE: we can encounter both continuations and expansions in an\n // expansion!\n // I have to decide where continuations are going to be dealt with\n int offset = getExpansionOffset(collator, ce);\n m_CEBufferSize_ = getExpansionCount(ce);\n m_CEBufferOffset_ = 1;\n m_CEBuffer_[0] = collator.m_expansion_[offset];\n if (m_CEBufferSize_ != 0) {\n // if there are less than 16 elements in expansion\n for (int i = 1; i < m_CEBufferSize_; i ++) {\n m_CEBuffer_[i] = collator.m_expansion_[offset + i];\n }\n }\n else {\n // ce are terminated\n m_CEBufferSize_ = 1;\n while (collator.m_expansion_[offset] != 0) {\n m_CEBuffer_[m_CEBufferSize_ ++] =\n collator.m_expansion_[++ offset];\n }\n }\n // in case of one element expansion, we \n // want to immediately return CEpos\n if (m_CEBufferSize_ == 1) {\n m_CEBufferSize_ = 0;\n m_CEBufferOffset_ = 0;\n }\n return m_CEBuffer_[0];\n }", "private int previousSpecialPrefix(RuleBasedCollator collator, int ce)\n {\n backupInternalState(m_utilSpecialBackUp_);\n while (true) {\n // position ourselves at the begining of contraction sequence\n int offset = getContractionOffset(collator, ce);\n int entryoffset = offset;\n if (isBackwardsStart()) {\n ce = collator.m_contractionCE_[offset];\n break;\n }\n char prevch = (char)previousChar();\n while (prevch > collator.m_contractionIndex_[offset]) {\n // since contraction codepoints are ordered, we skip all that\n // are smaller\n offset ++;\n }\n if (prevch == collator.m_contractionIndex_[offset]) {\n ce = collator.m_contractionCE_[offset];\n }\n else {\n // if there is a completely ignorable code point in the middle\n // of a prefix, we need to act as if it's not there assumption:\n // 'real' noncharacters (*fffe, *ffff, fdd0-fdef are set to\n // zero)\n // lone surrogates cannot be set to zero as it would break\n // other processing\n int isZeroCE = collator.m_trie_.getLeadValue(prevch);\n // it's easy for BMP code points\n if (isZeroCE == 0) {\n continue;\n }\n else if (UTF16.isTrailSurrogate(prevch)\n || UTF16.isLeadSurrogate(prevch)) {\n // for supplementary code points, we have to check the next one\n // situations where we are going to ignore\n // 1. beginning of the string: schar is a lone surrogate\n // 2. schar is a lone surrogate\n // 3. schar is a trail surrogate in a valid surrogate\n // sequence that is explicitly set to zero.\n if (!isBackwardsStart()) {\n char lead = (char)previousChar();\n if (UTF16.isLeadSurrogate(lead)) {\n isZeroCE = collator.m_trie_.getLeadValue(lead);\n if (RuleBasedCollator.getTag(isZeroCE)\n == RuleBasedCollator.CE_SURROGATE_TAG_) {\n int finalCE = collator.m_trie_.getTrailValue(\n isZeroCE,\n prevch);\n if (finalCE == 0) {\n // this is a real, assigned completely\n // ignorable code point\n continue;\n }\n }\n }\n else {\n nextChar(); // revert to original offset\n // lone surrogate, completely ignorable\n continue;\n }\n nextChar(); // revert to original offset\n }\n else {\n // lone surrogate at the beggining, completely ignorable\n continue;\n }\n }\n\n // char was not in the table. prefix not found\n ce = collator.m_contractionCE_[entryoffset];\n }\n\n if (!isSpecialPrefixTag(ce)) {\n // char was in the contraction table, and the corresponding ce\n // is not a prefix ce. We found the prefix, break out of loop,\n // this ce will end up being returned.\n break;\n }\n }\n updateInternalState(m_utilSpecialBackUp_);\n return ce;\n }", "private int getCharacterGroup(char c){\n\t\t// Check to see which HashSet contains the character\n\t\tif ( GROUP1.contains( c ) ) {\n\t\t\treturn 1;\n\t\t} else if ( GROUP2.contains(c) ) {\n\t\t\treturn 2;\n\t\t} else if ( GROUP3.contains(c) ) {\n\t\t\treturn 3;\n\t\t} else if ( GROUP4.contains(c) ) {\n\t\t\treturn 4;\n\t\t} else if ( GROUP5.contains(c) ) {\n\t\t\treturn 5;\n\t\t} else if ( GROUP6.contains(c) ) {\n\t\t\treturn 6;\n\t\t} else if ( GROUP7.contains(c) ) {\n\t\t\treturn 7;\n\t\t} else if ( GROUP8.contains(c) ) {\n\t\t\treturn 8;\n\t\t}\n\t\t\n\t\t// Return -1 for any failed matchings \n\t\t//(this should not occur as all alphabetical characters have been declared in a HashSet)\n\t\treturn -1;\n\t}", "public ArrayList<Character> getListCharacterInLocation(String inputLocation) {\r\n\r\n\t\tArrayList<Character> listOutput = new ArrayList<Character>();\r\n\t\tfor (Character curCharacter : listCharacter)\r\n\t\t{\r\n\t\t\tif (curCharacter.getLocation() == inputLocation)\r\n\t\t\t\tlistOutput.add(curCharacter);\r\n\t\t}\r\n\t\treturn listOutput;\r\n\t}", "public static Node cccc_combination(LinkedList list1, LinkedList list2) {\n\n Node Katlyn1 = list1.head;\n Node Katlyn2 = list2.head;\n Node nodethaniel = new Node(0);\n Node tail = nodethaniel;\n\n while (true) {\n if (Katlyn1 == null) {\n tail.next = Katlyn2;\n break;\n }\n if (Katlyn2 == null) {\n tail.next = Katlyn1;\n break;\n }\n // Arrow function in Java?\n if (Katlyn1.valueData <= Katlyn2.valueData) {\n tail.next = Katlyn1;\n Katlyn1 = Katlyn1.next;\n } else {\n tail.next = Katlyn2;\n Katlyn2 = Katlyn2.next;\n }\n tail = tail.next;\n }\n return nodethaniel.next;\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 }", "private boolean FCDCheck(int ch, int offset)\n {\n boolean result = true;\n\n // Get the trailing combining class of the current character.\n // If it's zero, we are OK.\n m_FCDStart_ = offset - 1;\n m_source_.setIndex(offset);\n // trie access\n int fcd;\n if (ch < 0x180) {\n fcd = m_nfcImpl_.getFCD16FromBelow180(ch);\n } else if (m_nfcImpl_.singleLeadMightHaveNonZeroFCD16(ch)) {\n if (Character.isHighSurrogate((char)ch)) {\n int c2 = m_source_.next(); \n if (c2 < 0) {\n fcd = 0; // end of input\n } else if (Character.isLowSurrogate((char)c2)) {\n fcd = m_nfcImpl_.getFCD16FromNormData(Character.toCodePoint((char)ch, (char)c2));\n } else {\n m_source_.moveIndex(-1);\n fcd = 0;\n }\n } else {\n fcd = m_nfcImpl_.getFCD16FromNormData(ch);\n }\n } else {\n fcd = 0;\n }\n\n int prevTrailCC = fcd & LAST_BYTE_MASK_;\n\n if (prevTrailCC == 0) {\n offset = m_source_.getIndex();\n } else {\n // The current char has a non-zero trailing CC. Scan forward until\n // we find a char with a leading cc of zero.\n while (true) {\n ch = m_source_.nextCodePoint();\n if (ch < 0) {\n offset = m_source_.getIndex();\n break;\n }\n // trie access\n fcd = m_nfcImpl_.getFCD16(ch);\n int leadCC = fcd >> SECOND_LAST_BYTE_SHIFT_;\n if (leadCC == 0) {\n // this is a base character, we stop the FCD checks\n offset = m_source_.getIndex() - Character.charCount(ch);\n break;\n }\n\n if (leadCC < prevTrailCC) {\n result = false;\n }\n\n prevTrailCC = fcd & LAST_BYTE_MASK_;\n }\n }\n m_FCDLimit_ = offset;\n m_source_.setIndex(m_FCDStart_ + 1);\n return result;\n }", "public ListUtilities cocktailSort(){\n\t\tboolean swaps = true;\n\t\tListUtilities temp = new ListUtilities();\n\t\t\n\t\twhile(swaps == true){\n\t\t\t//no swaps to begin with\n\t\t\tswaps = false;\n\n\t\t\t//if not end of list\n\t\t\tif (this.nextNum != null){\n\t\t\t\t\n\t\t\t\t//make temp point to next\n\t\t\t\ttemp = this.nextNum;\n\n\t\t\t\t//if b is greater than c\n\t\t\t\tif(this.num > this.nextNum.num){\n\t\t\t\t\t//it swapped\n\t\t\t\t\tswaps = true;\n\t\t\t\t\t\n\t\t\t\t\tswapF(temp);\n\t\t\t\t}\n\t\t\t//keep going until you hit end of list\n\t\t\ttemp.cocktailSort();\n\t\t\t}\n\t\t\t//if not beginning of list\n\t\t\tif (this.prevNum != null){\n\t\t\t\t//if c is smaller than b\n\t\t\t\tif(this.num < this.prevNum.num){\n\t\t\t\t\t//it swapped\n\t\t\t\t\tswaps = true;\n\t\t\t\t\tswapB(temp);\n\t\t\t\t}\n\t\t\t\t//keep going until hit beginning of list\n\t\t\t\ttemp.cocktailSort();\n\t\t\t}\n\t\t}\n\t//return beginning of list\n\treturn this.returnToStart();\n\t}", "public LinkedList scannerTRS(String content) {\n \n Errors.clear();\n tokens.clear();\n char[] chars = content.toCharArray();\n\n int state = 0;\n Token t = new Token();\n String aux = \"\";\n int row = 0;\n int column = 0;\n //recorre todos los caracteres \n for (int i = 0; i < chars.length; i++) {\n\n switch (state) {\n case 0:\n // Estado 0 del automata\n if (chars[i] == '#') {\n tokens.add(new Token(0, \"#\", row, column,\"Caracter especial #\"));\n row++;\n } else if (chars[i] == '*') {\n tokens.add(new Token(1, \"*\", row, column,\"Caracter especial *\"));\n row++;\n } else if (chars[i] == '-') {\n tokens.add(new Token(4, \"-\", row, column,\"Caracter especial -\"));\n aux = \"\";\n\n } else if (Character.isLetter(chars[i])) {\n //Reconociendo un id\n aux += Character.toString(chars[i]);\n state = 6;\n row++;\n } else if (Character.isDigit(chars[i])) {\n //numero\n aux += Character.toString(chars[i]);\n state = 7;\n row++;\n\n } else if (chars[i] == 10 || chars[i] == 11 || chars[i] == 9 || chars[i] == 13 || chars[i] == 65535) {//Salto de linea\n column++;\n row = 0;\n } else if (chars[i] == 32) {\n\n row++;\n } else if (chars[i] == '/') {\n state = 1;\n aux += Character.toString(chars[i]);\n row++;\n } else if (chars[i] == '<') {\n aux += Character.toString(chars[i]);\n state = 3;\n row++;\n\n } else {\n int a = chars[i];\n System.out.println(a);\n Errors.add(new Erro(\"Error lexico\", row, column, String.valueOf(chars[i])));\n System.out.println(\"Error: \" + String.valueOf(chars[i]));\n }\n\n break;\n case 1:\n // code block\n if (chars[i] == '/') {\n state = 2;\n aux += Character.toString(chars[i]);\n row++;\n } else {\n Errors.add(new Erro(\"Error lexico\", row, column, \"/\"));\n i--;\n aux=\"\";\n state = 0;\n\n }\n break;\n case 2:\n if (chars[i] == 10 || chars[i] == 11 || chars[i] == 9 || chars[i] == 13) {\n state = 0;\n column++;\n row = 0;\n tokens.add(new Token(5, aux, row, column,\"Comentario unilinea\"));\n aux=\"\";\n }else{\n aux += Character.toString(chars[i]);\n row++;\n }\n break;\n case 3:\n if (chars[i] == '!') {\n state = 4;\n row++;\n aux += Character.toString(chars[i]);\n } else {\n \n Errors.add(new Erro(\"Error lexico\", row, column, \"<\"));\n aux=\"\";\n row++;\n i--;\n\n }\n break;\n case 4:\n if (chars[i] == '!') {\n state = 5;\n aux += Character.toString(chars[i]);\n row++;\n } else {\n aux += Character.toString(chars[i]);\n if (chars[i] == 13 || chars[i] == 13) {\n column++;\n row = 0;\n } else {\n row++;\n }\n }\n break;\n case 5:\n if (chars[i] == '>') {\n state = 0;\n row++;\n aux += Character.toString(chars[i]);\n tokens.add(new Token(5, aux, row, column,\"Comentario multilinea\"));\n aux=\"\";\n\n } else {\n state = 4;\n aux += Character.toString(chars[i]);\n row++;\n }\n break;\n case 6://IDENTIFICADOR\n if (Character.isDigit(chars[i]) || Character.isLetter(chars[i]) || chars[i] == '_') {\n aux += String.valueOf(chars[i]);\n row++;\n } else {\n tokens.add(new Token(3, aux, row, column,\"Identificador\"));\n aux = \"\";\n state = 0;\n i--;\n }\n break;\n case 7:\n if (Character.isDigit(chars[i])) {\n aux += String.valueOf(chars[i]);\n row++;\n } else {\n tokens.add(new Token(2, aux, row, column, \"Numero\"));\n aux = \"\";\n state = 0;\n i--;\n }\n\n break;\n\n }\n }\n\n return tokens;\n }", "private int previousSpecial(RuleBasedCollator collator, int ce, char ch)\n {\n while(true) {\n // the only ces that loops are thai, special prefix and\n // contractions\n switch (RuleBasedCollator.getTag(ce)) {\n case CE_NOT_FOUND_TAG_: // this tag always returns\n return ce;\n case RuleBasedCollator.CE_SURROGATE_TAG_: // unpaired lead surrogate\n return CE_NOT_FOUND_;\n case CE_SPEC_PROC_TAG_:\n ce = previousSpecialPrefix(collator, ce);\n break;\n case CE_CONTRACTION_TAG_:\n // may loop for first character e.g. \"0x0f71\" for english\n if (isBackwardsStart()) {\n // start of string or this is not the end of any contraction\n ce = collator.m_contractionCE_[\n getContractionOffset(collator, ce)];\n break;\n }\n return previousContraction(collator, ce, ch); // else\n case CE_LONG_PRIMARY_TAG_:\n return previousLongPrimary(ce);\n case CE_EXPANSION_TAG_: // always returns\n return previousExpansion(collator, ce);\n case CE_DIGIT_TAG_:\n ce = previousDigit(collator, ce, ch);\n break;\n case CE_HANGUL_SYLLABLE_TAG_: // AC00-D7AF\n return previousHangul(collator, ch);\n case CE_LEAD_SURROGATE_TAG_: // D800-DBFF\n return CE_NOT_FOUND_; // broken surrogate sequence, treat like unassigned\n case CE_TRAIL_SURROGATE_TAG_: // DC00-DFFF\n return previousSurrogate(ch);\n case CE_CJK_IMPLICIT_TAG_:\n // 0x3400-0x4DB5, 0x4E00-0x9FA5, 0xF900-0xFA2D\n return previousImplicit(ch);\n case CE_IMPLICIT_TAG_: // everything that is not defined\n // UCA is filled with these. Tailorings are NOT_FOUND\n return previousImplicit(ch);\n case CE_CHARSET_TAG_: // this tag always returns\n return CE_NOT_FOUND_;\n default: // this tag always returns\n ce = IGNORABLE;\n }\n if (!RuleBasedCollator.isSpecial(ce)) {\n break;\n }\n }\n return ce;\n }", "public abstract boolean isStarterChar(char c);", "int getNumCyc();", "public CharStackNode getNext() {\n //TODO add code here\n return next;\n }" ]
[ "0.6884989", "0.6660382", "0.5841286", "0.5743287", "0.5732707", "0.54281265", "0.54108894", "0.52868015", "0.52489114", "0.52391404", "0.5147527", "0.5136137", "0.5095563", "0.50450444", "0.49819818", "0.49331075", "0.49283978", "0.49271682", "0.49256423", "0.491187", "0.49043378", "0.48987943", "0.48960206", "0.48944145", "0.48891225", "0.4886133", "0.48831198", "0.4875043", "0.48729107", "0.484496", "0.48267654", "0.4806567", "0.47942284", "0.47865897", "0.4776408", "0.47707933", "0.4768342", "0.4754881", "0.47536817", "0.47335368", "0.47329953", "0.47235036", "0.46981046", "0.46960187", "0.4694532", "0.4693641", "0.4692559", "0.4689718", "0.46864942", "0.46820167", "0.46714067", "0.46550974", "0.46465918", "0.46342915", "0.46336383", "0.4631799", "0.4619829", "0.46111122", "0.46039706", "0.45955902", "0.45948723", "0.4587027", "0.45695785", "0.456008", "0.45541623", "0.45530257", "0.45328033", "0.45318523", "0.45292667", "0.4525681", "0.45227632", "0.45157257", "0.4511897", "0.45056722", "0.45036554", "0.45030951", "0.44990602", "0.44950986", "0.4489717", "0.448968", "0.4488507", "0.44853476", "0.44820312", "0.44815633", "0.44743794", "0.44733992", "0.44684952", "0.4466659", "0.4463649", "0.44631433", "0.44590843", "0.44551107", "0.44546407", "0.44494814", "0.4439694", "0.44342384", "0.44287336", "0.44160694", "0.4413645", "0.44120282" ]
0.8456242
0
arrange all the check's in the check_list
public void arrange(Order order){ for(int i=0; i<26; ++i){ // arrange list of list; list by list ArrayList<Integer> list = check_list.get(i); for(int j=0; j<list.size(); ++j ){ if(order == Order.ASCENDING){ // ascending order for(int k=i; k<list.size()-1; ++k){ int num1= list.get(k); int num2= list.get(k+1); // ascending order if(num2<num1){ // swap list.set(k, num2); list.set(k+1, num1); } } }else if(order == Order.DESCENDING){ // descending order for(int k=i; k<list.size()-1; ++k){ int num1= list.get(k); int num2= list.get(k+1); // descending order if(num2>num1){ // swap list.set(j, num2); list.set(k, num1); } } } } // put arranged list, back in its place check_list.set(i, list); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void armarListaCheck() {\n listaCheck = new ArrayList();\n listaCheck.add(chkBici);\n listaCheck.add(chkMoto);\n listaCheck.add(chkAuto);\n }", "private static List<Integer> reorganize(List<Integer> result){\n List<Integer> outcome=new ArrayList<>();\n result.sort(Comparator.comparingInt(o -> o));\n if(!result.isEmpty()){\n outcome.add(result.get(0));\n for(int i=1;i<result.size();i++){\n if(!result.get(i).equals(result.get(i-1)))\n outcome.add(result.get(i));\n }\n }\n return outcome;\n }", "private static void sortByVerified( ArrayList<Volunteer> list)\n {\n // Find the string reference that should go in each cell of\n // the array, from cell 0 to the end\n for ( int j = 0; j < list.size();j++ )\n {\n // Find min: the index of the string reference that should go into cell j.\n // Look through the unsorted strings (those at j or higher) for the one that is first in lexicographic order\n int min = j;\n for ( int k=j+1; k < list.size(); k++ ) {\n if (list.get(k).compareTo(list.get(min)) > 0) {\n min = k;\n }\n\n }\n\n // Swap the reference at j with the reference at min\n Collections.swap(list, j, min);\n }\n }", "public void step3(){\n\n Collections.sort(names,(String a, String b) -> a.compareTo(b));\n }", "public void order_moves() {\n\t\tfor (int i = 0; i < future_moves.size(); i += 1) {\n\t\t\tArrayList<Integer> curr_smallest = future_moves.get(i);\n\t\t\tint smallest = i;\n\t\t\t\n\t\t\tfor (int j = i; j < future_moves.size(); j += 1) {\n\t\t\t\tArrayList<Integer> curr_checking = future_moves.get(j);\n\t\t\t\t\n\t\t\t\tif (curr_checking.get(1) < curr_smallest.get(1)) {\n\t\t\t\t\tcurr_smallest = curr_checking;\n\t\t\t\t\tsmallest = j;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t//Swap the current and the smallest\n\t\t\tfuture_moves.set(smallest, future_moves.get(i));\n\t\t\tfuture_moves.set(i, curr_smallest);\n\t\t}\n\t\t\n\t}", "private void \n\tprocessPieceChecks() \n\t{\n\t\tif ( piece_check_result_list.size() > 0 ){\n\n\t\t\tfinal List pieces;\n\n\t\t\t// process complete piece results\n\n\t\t\ttry{\n\t\t\t\tpiece_check_result_list_mon.enter();\n\n\t\t\t\tpieces = new ArrayList( piece_check_result_list );\n\n\t\t\t\tpiece_check_result_list.clear();\n\n\t\t\t}finally{\n\n\t\t\t\tpiece_check_result_list_mon.exit();\n\t\t\t}\n\n\t\t\tfinal Iterator it = pieces.iterator();\n\n\t\t\twhile (it.hasNext()) {\n\n\t\t\t\tfinal Object[]\tdata = (Object[])it.next();\n\n\t\t\t\tprocessPieceCheckResult((DiskManagerCheckRequest)data[0],((Integer)data[1]).intValue());\n\n\t\t\t}\n\t\t}\n\t}", "public void sortToDo(){\n\t\tCollections.sort(allToDoLists);\n\t}", "public void sortCompetitors(){\n\t\t}", "public void sortPassing(){\n\t\tpassing.sort(PlayingCard.PlayingCardComparator_ACEHIGH);\n\t}", "public ArrayList<ArrayList<String>> inputTestListAndSort (ArrayList<ArrayList<String>> testList){\n ArrayList<ArrayList<String>> testList1=new ArrayList<>(testList);\n Collections.sort(testList1, new SubClass_CompareItemsInTheRowsOfTheTimetable_in_TeachingOverlapAndHours());\n return testList1;\n }", "static void SPT_rule(List<T_JOB> job) {\n Collections.sort(job);\n }", "public void step2(){\n\n Collections.sort(names,(String a,String b) -> {\n return a.compareTo(b);\n });\n }", "public void sort(){\n ArrayList<Card> sortedCards = new ArrayList<Card>();\n ArrayList<Card> reds = new ArrayList<Card>();\n ArrayList<Card> yellows = new ArrayList<Card>();\n ArrayList<Card> greens = new ArrayList<Card>();\n ArrayList<Card> blues = new ArrayList<Card>();\n ArrayList<Card> specials = new ArrayList<Card>();\n for(int i = 0; i < cards.size(); i++){\n if(cards.get(i).getColor() == RED){\n reds.add(cards.get(i));\n }else if(cards.get(i).getColor() == YELLOW){\n yellows.add(cards.get(i));\n }else if(cards.get(i).getColor() == GREEN){\n greens.add(cards.get(i));\n }else if(cards.get(i).getColor() == BLUE){\n blues.add(cards.get(i));\n }else if(cards.get(i).getColor() == ALL){\n specials.add(cards.get(i));\n }\n }\n cards = new ArrayList<Card>();\n for(Card c: reds){\n sortedCards.add(c);\n }\n for(Card c: yellows){\n sortedCards.add(c);\n }\n for(Card c: greens){\n sortedCards.add(c);\n }\n for(Card c: blues){\n sortedCards.add(c);\n }\n for(Card c: specials){\n sortedCards.add(c);\n }\n for(Card c: sortedCards){\n cards.add(c);\n }\n }", "private void orderList() {\n Iterator<PlanarShape> sort = unorderedList.iterator();\n\n while(sort.hasNext()) {\n orderedList.insertInOrder(sort.next());\n }\n }", "public void sortByAndser() {\r\n\t\tQuestion[][] question2DArray = new Question[displayingList.size()][];\r\n\t\tfor (int i = 0; i < displayingList.size(); i++) {\r\n\t\t\tquestion2DArray[i] = new Question[1];\r\n\t\t\tquestion2DArray[i][0] = displayingList.get(i);\r\n\t\t}\r\n\r\n\t\twhile (question2DArray.length != 1) {\r\n\t\t\tquestion2DArray = (Question[][]) merge2DArray(question2DArray);\r\n\t\t}\r\n\t\tdisplayingList.removeAll(displayingList);\r\n\t\tfor (int i = 0; i < question2DArray[0].length; i++) {\r\n\t\t\tdisplayingList.add(question2DArray[0][i]);\r\n\t\t}\r\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 }", "public void sortFinalsList() {\n \n Course course = null;\n int j = 0;\n for (int i = 1; i < finalsList.size(); i++) {\n\n j = i;\n // checks to see if the start time of the element j is less than the\n // previous element, and if j > 0\n while (j > 0) {\n\n // if the current element, is less than the previous, then....\n if (finalsList.get(j).getDate()\n .compareTo(finalsList.get(j - 1).getDate()) < 0) {\n\n // if so, swap the two\n course = finalsList.get(j);\n finalsList.set(j, finalsList.get(j - 1));\n finalsList.set(j - 1, course);\n }\n else if (finalsList.get(j).getDate()\n .compareTo(finalsList.get(j - 1).getDate()) == 0) {\n \n if (compareTimes(finalsList.get(j).getBeginTime(), finalsList.get(j - 1).getBeginTime()) < 0) {\n \n // if so, swap the two\n course = finalsList.get(j);\n finalsList.set(j, finalsList.get(j - 1));\n finalsList.set(j - 1, course);\n }\n }\n\n // decrement j\n j--;\n }\n }\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 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 }", "private List<Criterion> _sortCriterionList()\n {\n Collections.sort(_criterionList, _groupNameComparator);\n Collections.sort(_criterionList, _fieldOrderComparator);\n for(int count = 0 ; count < _criterionList.size() ; count++)\n {\n ((DemoAttributeCriterion)_criterionList.get(count)).setOrderDirty(false);\n }\n return _criterionList;\n }", "public void sort() {\n /*int jokers = this.getJokers();\n\t\tif (jokers > 0 && this.size() > 2) {\n\t\t\tArrayList<Tile> list = new ArrayList<>();\n for (int i=0; i<this.size(); i++) {\n\t\t\t\tif (this.get(i).getColour() == 'J') {\n\t\t\t\t\tTile joker = this.remove(this.get(i));\n\t\t\t\t\tlist.add(joker);\n\t\t\t\t\ti--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tfor (Tile j : list) {\n\t\t\t\tthis.addInSort(j);\n\t\t\t}\n }*/\n \n\n //may need something in here to accomodate a joker changing its form\n\n if (tiles.size() > 1) { //will only sort a meld with any tiles in it\n //Override default comparator to compare by tile value (ints)\n Collections.sort(tiles, new Comparator<Tile>() {\n @Override \n public int compare(Tile t1, Tile t2) { \n if (t1.getColour() > t2.getColour()) {\n return 1;\n } else if (t1.getColour() < t2.getColour()) {\n return -1;\n }\n if (t1.getValue() > t2.getValue()) {\n return 1;\n } else if (t1.getValue() < t2.getValue()) {\n return -1;\n } else {\n return 0;\n }\n }\n });\n }\n\n }", "@Test (priority = 1)\n public void sortAlphabetical(){\n\n for (int i = 0; i < allDepartments.getOptions().size()-1; i++) {\n String current = allDepartments.getOptions().get(i).getText();\n String next = allDepartments.getOptions().get(i+1).getText();\n\n System.out.println(\"comparing: \" + current + \" with \"+ next);\n\n Assert.assertTrue(current.compareTo(next)<=0);\n\n }\n }", "public void ArrangeSuits() {\n if (mCardCount > 0) {\n \tCard card;\n \tCard orderedCards[];\n \torderedCards = new Card[mCardCount];\n \tint iValue;\n \tint iOrder[];\n \tint iCount = 0;\n \tiOrder = new int [mCardCount];\n \tint iMinValue = Card.HEARTS * 13 + Card.KING;\n \tiOrder[0] = iMinValue;\n \tfor (int i = 0; i < mCardCount; i++){\n \t\tcard = mCard[i];\n \t\tiValue = card.GetSuit()*13 + card.GetValue();\n \t\tiCount = 0;\n \t\t// See where the card value comes in the pecking order\n \t\twhile (iValue > iOrder[iCount]){\n \t\t\tiCount++;\n \t\t}\n \t\t// It goes here, so move everything else along one\n \t\tfor (int j = mCardCount-1; j > iCount; j--)\n \t\t\tiOrder[j] = iOrder[j-1];\n \t\tiOrder[iCount] = iValue;\n \t}\n \t\n \tfor (int i = 0; i < mCardCount; i++){\n \t\tfor (int j = 0; j < mCardCount; j++){\n \t\tcard = mCard[j];\n \t\tiValue = card.GetSuit()*13 + card.GetValue(); \t\t\t\n \t\t\tif (iValue == iOrder[i]){\n \t\t\t\torderedCards[i] = mCard[j];\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n \t}\n \tfor (int i = 0; i < mCardCount; i++){\n \t\tmCard[i] = orderedCards[i];\n \t} \t\n }\n }", "private List<Article> orderArticles(List<Article> things){\n\t\t Comparator<Article> comparatorPrizes = new Comparator<Article>() {\n\t public int compare(Article x, Article y) {\n\t return (int) (x.getPrize() - y.getPrize());\n\t }\n\t };\n\t Collections.sort(things,comparatorPrizes); \n\t Collections.reverse(things);\n\t return things;\n\t }", "public static void main(String[] args) {\n\t\tList<StatetostateDetail> list = new ArrayList<StatetostateDetail>();\n\t\tfor(int i = 1; i < 16; i++){\n\t\t\tStatetostateDetail s = new StatetostateDetail();\n\t\t\ts.setId(i);\n\t\t\ts.setStatue(0);\n\t\t\ts.setTime(System.currentTimeMillis() + (i + i * 100));\n\t\t\tlist.add(s);\n\t\t}\n\t\tlist.get(3).setStatue(1);\n\t\tlist.get(5).setStatue(1);\n\t\tlist.get(10).setStatue(1);\n\t\tlist.get(14).setStatue(1);\n\t\tlist.get(7).setStatue(2);\n\t\tlist.get(9).setStatue(2);\n\t\tSystem.out.println(\"list:\" + list);\n\t\n\t\t\n\t\tCollections.sort(list, new Comparator<StatetostateDetail>(){\n public int compare(StatetostateDetail s1, StatetostateDetail s2) {\n \tLong t1 = null;\n \tLong t2 = null;\n \ttry{\n \t\tt1 = s1.getTime();\n\t \tt2 = s2.getTime();\n \t}catch(Exception e){\n \t\te.printStackTrace();\n \t}\n \n return t2.compareTo(t1);\n }\n });\n\t\tCollections.sort(list, new Comparator<StatetostateDetail>(){\n public int compare(StatetostateDetail s1, StatetostateDetail s2) {\n \treturn s1.getStatue()>s2.getStatue()?1:(s1.getStatue()==s2.getStatue()?0:(s2.getTime()>s1.getTime()?-1:0));\n }\n });\n\t\t\n\t\tSystem.out.println(\"list:\" + list);\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public void printChecklist() {\n\t\tfor(String str : checklist.keySet()) {\n\t\t\tMyUtils.Log(\"[Checklist] \"+str+\", \"+checklist.get(str));\n\t\t}\n\t}", "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 }", "public void fillSorted()\n {\n for (int i=0; i<list.length; i++)\n list[i] = i + 2;\n }", "@Test\n public void testItem_Ordering() {\n OasisList<Integer> baseList = new SegmentedOasisList<>(2, 2);\n\n List<Integer> expResult = Arrays.asList(1, 2, 6, 8);\n baseList.addAll(expResult);\n\n for (int i = 0; i < expResult.size(); i++) {\n assertEquals(expResult.get(i), baseList.get(i));\n }\n }", "private void rearrangeSolution() {\r\n List<Integer> trinity = new ArrayList<Integer>();\r\n trinity.add(0); trinity.add(1); trinity.add(2);\r\n permutateDigits();\r\n for (int i = 0; i<9; i+=3) {\r\n Collections.shuffle(trinity);\r\n swapRow(trinity.get(0)+i, trinity.get(1)+i);\r\n }\r\n for (int i = 0; i<9; i+=3) {\r\n Collections.shuffle(trinity);\r\n swapCol(trinity.get(0)+i, trinity.get(1)+i);\r\n }\r\n }", "@Override\r\n\tpublic void sort() {\r\n\t\tint minpos;\r\n\t\tfor (int i = 0; i < elements.length-1; i++) {\r\n\t\t\tminpos=AuxMethods.minPos(elements, i);\r\n\t\t\telements=AuxMethods.swapElements(elements, i, minpos);\r\n\t\t\t\r\n\t\t}\r\n\t}", "public void sortElements(){\n\t\tgetInput();\n\t\tPeople[] all = countAndSort(people, 0, people.length-1);\n\t\t//PrintArray(all);\n\t\tSystem.out.println(InversionCount);\n\t}", "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}", "private static void multipleSortOfFinalPlayerList() {\n\n sortedFinalPlayerList = new ArrayList<>();\n\n Comparator<Player> byLastName = (e1, e2) -> e1\n .getLastName().compareTo(e2.getLastName());\n\n Comparator<Player> byFirstName = (e1, e2) -> e1\n .getFirstName().compareTo(e2.getFirstName());\n\n Comparator<Player> byCountry = (e1, e2) -> e1\n .getCountry().compareTo(e2.getCountry());\n\n streamPlayerList.stream().sorted(byLastName.thenComparing(byFirstName).thenComparing(byCountry))\n .forEach(e -> System.out.print(e));\n Stream<Player> f = streamPlayerList.stream().sorted(byLastName.thenComparing(byFirstName).thenComparing(byCountry));\n f.forEach(r -> sortedFinalPlayerList.add(r));\n }", "public void bubbleSort(ArrayList <Comparable> list){\r\n\t\tsteps += 2; //init, check condition\r\n\t\tfor (int i = list.size() - 1; i >= 0; i --){\r\n\t\t\tsteps += 2; //init, check condition\r\n\t\t\tfor (int j = 0; j < i ; j ++){\r\n\t\t\t\tsteps += 5;\r\n\t\t\t\tif (list.get(j).compareTo(list.get(j + 1)) < 0){\r\n\t\t\t\t\tsteps += 2;\r\n\t\t\t\t\tswap(list, j, j + 1);\r\n\t\t\t\t\tsteps += 5;\r\n\t\t\t\t}\r\n\t\t\t\tsteps += 2;\r\n\t\t\t}\r\n\t\t\tsteps += 2;\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Bubble Sort\");\r\n\t\tSystem.out.println();\r\n\t}", "private void sortMedApts(List<MedicationAppointment> medApts2) {\n \t}", "private static void populateArtworkSorts() {\r\n if (artworkSorts.isEmpty()) {\r\n artworkSorts.add(SORT_FAV_ASC);\r\n artworkSorts.add(SORT_FAV_DESC);\r\n artworkSorts.add(SORT_NAME_ASC);\r\n artworkSorts.add(SORT_NAME_DESC);\r\n }\r\n }", "public void bubbleSort(ArrayList <Integer> list){\n System.out.println();\n System.out.println(\"Bubble Sort\");\n System.out.println();\n\n steps = 0;\n for (int outer = 0; outer < list.size() - 1; outer++){\n for (int inner = 0; inner < list.size()-outer-1; inner++){\n steps += 3;//count one compare and 2 gets\n if (list.get(inner)>(list.get(inner + 1))){\n steps += 4;//count 2 gets and 2 sets\n int temp = list.get(inner);\n list.set(inner,list.get(inner + 1));\n list.set(inner + 1,temp);\n }\n }\n }\n }", "public List<Task> sortArraybyComplete(List<Task> tasks){\n if(tasks.size() == 1){\n return tasks;\n }\n for(int i = 0; i < tasks.size()-1; i++){\n if ((tasks.get(i).getComplete()) && !(tasks.get(i+1).getComplete())) {\n Task task = tasks.get(i);\n tasks.set(i, tasks.get(i+1));\n tasks.set(i+1, task);\n }\n }\n return tasks;\n }", "private void sortChanges(List changeList) {\r\n\t\tSortedSet changeSet = new TreeSet(ChangeComparator.INSTANCE);\r\n\t\tchangeSet.addAll(changeList);\r\n\t\tchangeList.clear();\r\n\t\tfor (Iterator iter = changeSet.iterator(); iter.hasNext();) {\r\n\t\t\tchangeList.add(iter.next());\r\n\t\t}\r\n\t}", "private void sortResults(List<String> results) {\r\n\t\tif (comparator == null) {\r\n\t\t\tCollections.sort(results);\r\n\t\t} else {\r\n\t\t\tCollections.sort(results, comparator);\r\n\t\t}\r\n\t}", "public void insertionSort(ArrayList <Comparable> list){\r\n\t\tsteps += 2; //init, check condition\r\n\t\tfor (int i = 1 ; i < list.size(); i++){\r\n\t\t\tsteps ++; //=\r\n\t\t\tint j = i;\r\n\t\t\tsteps += 7; //-, >, get(), compareTo(), get(), -, <\r\n\t\t\twhile ((j - 1 > 0) && (list.get(j).compareTo(list.get(j - 1)) > 0)){\r\n\t\t\t\tsteps += 3; // swap(), -, --\r\n\t\t\t\tswap(list, j, j - 1);\r\n\t\t\t\tsteps += 5;\r\n\t\t\t\tj--;\r\n\t\t\t\tsteps += 7; //-, >, get(), compareTo(), get(), -, <\r\n\t\t\t}\r\n\t\t\tsteps += 2; //increment, check condition\r\n\t\t}\r\n\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Insertion Sort\");\r\n\t\tSystem.out.println();\r\n\t}", "private void resolveSortingItems(ArrayList<String> out,\n ArrayList<CldrNode> nodesForLastItem,\n ArrayList<CldrItem> sortingItems)\n throws IOException, ParseException {\n ArrayList<CldrItem> arrayItems = new ArrayList<CldrItem>();\n String lastLeadingArrayItemPath = null;\n\n if (!sortingItems.isEmpty()) {\n Collections.sort(sortingItems);\n for (CldrItem item : sortingItems) {\n Matcher matcher = LdmlConvertRules.ARRAY_ITEM_PATTERN.matcher(\n item.getPath());\n if (matcher.matches()) {\n String leadingArrayItemPath = matcher.group(1);\n if (lastLeadingArrayItemPath != null &&\n !lastLeadingArrayItemPath.equals(leadingArrayItemPath)) {\n resolveArrayItems(out, nodesForLastItem, arrayItems);\n }\n lastLeadingArrayItemPath = leadingArrayItemPath;\n arrayItems.add(item);\n } else {\n outputCldrItem(out, nodesForLastItem, item);\n }\n }\n sortingItems.clear();\n resolveArrayItems(out, nodesForLastItem, arrayItems);\n }\n }", "private void arrangeAttributes(List<IOutputAttribute> outputAttributesList,\r\n \t\tList<Object> list)\r\n {\r\n \tList<Object> oldList = new ArrayList<Object>();\r\n \toldList.addAll(list);\r\n \tfor(int counter = 0;counter < outputAttributesList.size();counter++)\r\n \t{\r\n \t\tAttributeInterface attribute = outputAttributesList.get(counter).getAttribute();\r\n \t\tString value = edu.wustl.query.util.global.Utility.getTagValue(attribute,Constants.TAGGED_VALUE_RESULTVIEW);\r\n \t\tif(attribute.getName().equals(Constants.ID)\r\n \t\t&& attribute.getEntity().getName().equals(Constants.MED_ENTITY_NAME))\r\n \t\t{\r\n \t\t\tString conceptName = \"\";\r\n \t\t\tif (oldList.get(counter) != null)\r\n \t\t\t{\r\n \t\t\t\tconceptName = MedLookUpManager.instance().\r\n \t\t\t\t\tgetConceptName( outputAttributesList.get(counter),(String)(oldList.get(counter)));\r\n \t\t\t}\r\n \t\t\toldList.set(counter,conceptName);\r\n \t\t\tvalue = edu.wustl.query.util.global.Utility.getTagValue(outputAttributesList.get(counter).getExpression().\r\n \t\t \tgetQueryEntity().getDynamicExtensionsEntity(),Constants.TAGGED_VALUE_RESULTORDER);\r\n \t\t}\r\n \t\tif(!value.equals(\"\"))\r\n \t\t{\r\n \t\t\tlist.set(Integer.valueOf(value).intValue(),oldList.get(counter));\r\n \t\t}\r\n \t}\r\n }", "private void organizeTiles(){\n\t\tfor(int i = 1; i <= size * size; i++){\n\t\t\tif(i % size == 0){\n\t\t\t\tadd(tiles[i - 1]);\n\t\t\t\trow();\n\t\t\t}else{\n\t\t\t\tadd(tiles[i - 1]);\n\t\t\t}\n\t\t}\n\t}", "public void sortAllRows(){\n\t\t/* code goes here */ \n\t\t\n\t\t\n\t\t//WHY SHOULD THEY BE SORTED LIKE THE EXAMPLE SAYS???????\n\t\t\n\t}", "protected void arrangeBestOrder ()\n \t{\n \t\tObject[] duplLoans = null;\n \t\ttry\n \t\t{\n \t\t\tduplLoans = theLoanList.popFirstDuplicates();\n \t\t}\n \t\tcatch (NoSuchElementException ex)\n \t\t{\n \t\t\tlog.error(\"The list of duplicate loan lists is empty\");\n \t\t\treturn;\n \t\t}\n \n \t\tDuplicateLoanDataVO bestSourceLoan = null;\n \t\tDuplicateLoanDataVO firstDataVO = null;\n \t\tDuplicateLoanDataVO nextDataVO = null;\n \t\tString xmlValue = null;\n \t\tString apsId1 = null;\n \t\tString providerType1 = null;\n \t\tString apsId2 = null;\n \t\tString providerType2 = null;\n \n \t\tfor (int ndx = 1; ndx < duplLoans.length; ndx++)\n \t\t{\n \t\t\tfirstDataVO = (DuplicateLoanDataVO)duplLoans[0];\n \t\t\tnextDataVO = (DuplicateLoanDataVO)duplLoans[ndx];\n \n \t\t\tapsId1 = firstDataVO.getAwardId();\n \t\t\tproviderType1 = firstDataVO.getProviderType();\n \t\t\tapsId2 = nextDataVO.getAwardId();\n \t\t\tproviderType2 = nextDataVO.getProviderType();\n \n \t\t\tif (apsId1 == null)\n \t\t\t{\n \t\t\t\tapsId1 = XMLParser.getNodeValue(firstDataVO.getDocument(), \"APSUniqueAwardID\");\n \t\t\t\tfirstDataVO.setAwardId(apsId1);\n \t\t\t}\n \n \t\t\tif (providerType1 == null)\n \t\t\t{\n \t\t\t\tproviderType1 = XMLParser.getNodeValue(firstDataVO.getDocument(), \"DataProviderType\");\n \t\t\t\tfirstDataVO.setProviderType(providerType1);\n \t\t\t}\n \n \t\t\tif (apsId2 == null)\n \t\t\t{\n \t\t\t\tapsId2 = XMLParser.getNodeValue(nextDataVO.getDocument(), \"APSUniqueAwardID\");\n \t\t\t\tnextDataVO.setAwardId(apsId2);\n \t\t\t}\n \n \t\t\tif (providerType2 == null)\n \t\t\t{\n \t\t\t\tproviderType2 = XMLParser.getNodeValue(nextDataVO.getDocument(), \"DataProviderType\");\n \t\t\t\tnextDataVO.setProviderType(providerType2);\n \t\t\t}\n \n \t\t\tif (log.isDebugEnabled())\n \t\t\t{\n \t\t\t\tlog.debug(\"Comparing Award ID: \" + apsId1 + \" with provider type '\" + providerType1 +\n \t\t\t\t \"' to Award ID: \" + apsId2 + \" with provider type '\" + providerType2 + \"' \");\n \t\t\t}\n \n \t\t\tbestSourceLoan = determineBestSource(firstDataVO, nextDataVO);\n \t\t\tif (bestSourceLoan != null && bestSourceLoan == nextDataVO)\n \t\t\t{\n \t\t\t\t// we need to rearrange things so that the \"best\" is at\n \t\t\t\t// the \"head\" of the array (element 0).\n \n \t\t\t\tDuplicateLoanDataVO best = (DuplicateLoanDataVO)duplLoans[ndx];\n \t\t\t\tduplLoans[ndx] = duplLoans[0];\n \t\t\t\tduplLoans[0] = best;\n \n \t\t\t\tif (log.isDebugEnabled())\n \t\t\t\t{\n \t\t\t\t\tString apsId = nextDataVO.getAwardId();\n \t\t\t\t\tString providerType = nextDataVO.getProviderType();\n \t\t\t\t\tlog.debug(\"Award ID: \" + apsId + \" with provider type '\" + providerType + \"' is now the 'best' source\");\n \t\t\t\t}\n \t\t\t}\n \t\t\telse\n \t\t\t{\n \t\t\t\tif (log.isDebugEnabled())\n \t\t\t\t{\n \t\t\t\t\tString apsId = firstDataVO.getAwardId();\n \t\t\t\t\tString providerType = firstDataVO.getProviderType();\n \t\t\t\t\tlog.debug(\"Award ID: \" + apsId + \" with provider type '\" + providerType + \"' is still the 'best' source\");\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \t\ttheLoanList.pushLastDuplicates(duplLoans);\n \t}", "public void orderList(ArrayList<DefaultActivity> scheduleList) {\n\n }", "@Test\n public void flowTest3(){\n ItemToCalculate calculated = new ItemToCalculate(5);\n calculated.workerLastNumber = 5;\n calculated.curProgress = 5;\n calculated.firstRoot = 1;\n calculated.secondRoot = 5;\n\n ItemToCalculate small_inprog = new ItemToCalculate(10);\n ItemToCalculate big_inprog = new ItemToCalculate(30);\n\n calcApplication.itemToCalculateArrayList.add(calculated);\n calcApplication.itemToCalculateArrayList.add(small_inprog);\n calcApplication.itemToCalculateArrayList.add(big_inprog);\n Collections.sort(calcApplication.itemToCalculateArrayList, new ItemToCalculateComparator());\n\n shadowOf(getMainLooper()).idle();\n // expected to small_inprog be first, second big_inprog, last calculated\n\n assertEquals(calcApplication.itemToCalculateArrayList.get(0), small_inprog);\n assertEquals(calcApplication.itemToCalculateArrayList.get(1), big_inprog);\n assertEquals(calcApplication.itemToCalculateArrayList.get(2), calculated);\n\n\n calcApplication.itemToCalculateArrayList.clear();\n }", "private void OrderPips(ArrayList<Pip> PipsOfInterest) {\n\t\tPip i0 = PipsOfInterest.get(0);\n Pip i1=null,i2=null,i3=null; \n\t\t\n\t\tfor(Pip P : PipsOfInterest){\n\t\t\tif(!P.getRowBit().equals(i0.getRowBit()) && !P.getColumnBit().equals(i0.getColumnBit())){\n\t\t\t\t//Assign the Pip With no Matchings Bits to be i3\n i3 = P; \t\n\t\t\t} else if(P.getRowBit().equals(i0.getRowBit()) || !P.getColumnBit().equals(i0.getColumnBit())){\n\t\t\t\t//Assign the Pip with the Matching Row Bit to i1\n\t\t\t\ti1 = P; \n\t\t\t} else if(!P.getRowBit().equals(i0.getRowBit()) || P.getColumnBit().equals(i0.getColumnBit())){\n\t\t\t\t//Assign the Pip with the Matching Row Bit to i1\n\t\t\t\ti2 = P; \n\t\t\t} \n\t\t}\t\n\t\t\n\t\tif(i0 == null || i1 == null || i2 == null || i3 == null){\n\t\t\tSystem.out.println(\"Error: i0, i1, i2, i3 not set\" + i0 + \" \" + i1 + \" \" + i2 + \" \" + i3);\n\t\t\tSystem.exit(1);\n\t\t}\n\t\t\n\t\t//Arrange the Pips into the ArrayList\n PipsOfInterest.set(0, i0);\n PipsOfInterest.set(1, i1);\n PipsOfInterest.set(2, i2);\n PipsOfInterest.set(3, i3);\n\t}", "public static void main(String[] args) {\n\n\n List<Integer> a = range(3, 19).mapToObj(Integer::valueOf).collect(toList());\n a.sort((x, y) -> (x - y));\n// System.out.println(a);\n\n List<List<String>> QUICK_THREE_OPTIONS = new ArrayList<>();\n //空 0\n QUICK_THREE_OPTIONS.add(new ArrayList<>());\n //和值 1\n final List<String> sumOptions = range(3, 19).mapToObj(String::valueOf).collect(toList());\n QUICK_THREE_OPTIONS.add(sumOptions);\n //三同号 2\n final List<String> threeSameOptions = range(1, 7).mapToObj(i -> nTimes(i, 3)).collect(toList());\n threeSameOptions.add(\"3A\");\n QUICK_THREE_OPTIONS.add(threeSameOptions);\n //二同号 3\n final List<String> twoSameOptions = range(1, 7).mapToObj(i -> nTimes(i, 2)).collect(toList());\n twoSameOptions.addAll(range(1, 7).mapToObj(String::valueOf).collect(toList()));\n twoSameOptions.addAll(range(1, 7).mapToObj(i -> nTimes(i, 2) + \"*\").collect(toList()));\n QUICK_THREE_OPTIONS.add(twoSameOptions);\n //三不同 4\n final List<String> threeDifferent = range(1, 7).mapToObj(String::valueOf).collect(toList());\n threeDifferent.add(\"3B\");\n QUICK_THREE_OPTIONS.add(threeDifferent);\n //二不同 5\n final List<String> twoDifferent = range(1, 7).mapToObj(String::valueOf).collect(toList());\n QUICK_THREE_OPTIONS.add(twoDifferent);\n\n// System.out.println(QUICK_THREE_OPTIONS);\n\n List<List<String>> ELEVEN_C_FIVE_OPTIONS = new ArrayList<>();\n\n //组合选项\n ELEVEN_C_FIVE_OPTIONS.add(IntStream.range(1, 12).mapToObj(i -> String.format(\"%02d\", i)).collect(toList()));\n //前二直选\n final List<String> frontTwoDirect = new ArrayList<>();\n frontTwoDirect.addAll(IntStream.range(1, 12).mapToObj(i -> \"a\" + String.format(\"%02d\", i)).collect(toList()));\n frontTwoDirect.addAll(IntStream.range(1, 12).mapToObj(i -> \"b\" + String.format(\"%02d\", i)).collect(toList()));\n ELEVEN_C_FIVE_OPTIONS.add(frontTwoDirect);\n //前三直选\n final List<String> frontThreeDirect = new ArrayList<>();\n frontThreeDirect.addAll(IntStream.range(1, 12).mapToObj(i -> \"a\" + String.format(\"%02d\", i)).collect(toList()));\n frontThreeDirect.addAll(IntStream.range(1, 12).mapToObj(i -> \"b\" + String.format(\"%02d\", i)).collect(toList()));\n frontThreeDirect.addAll(IntStream.range(1, 12).mapToObj(i -> \"c\" + String.format(\"%02d\", i)).collect(toList()));\n ELEVEN_C_FIVE_OPTIONS.add(frontThreeDirect);\n\n final int TWENTY_C_FIVE_SAN_GUO_SHI_LI = 1;\n final int TWENTY_C_FIVE_SAN_GUO_FIVE = 2;\n final int TWENTY_C_FIVE_SAN_GUO_EIGHT = 3;\n final int TWENTY_C_FIVE_SAN_GUO_FRONT_THREE_DIRECT = 4;\n final List<List<String>> TWENTY_C_FIVE_SAN_GUO_OPTIONS = new ArrayList<>();\n\n //势力选择\n TWENTY_C_FIVE_SAN_GUO_OPTIONS.add(IntStream.range(1, 4).mapToObj(i -> String.format(\"%02d\", i)).collect(toList()));\n //组合选项\n final List<String> group = new ArrayList<>();\n group.addAll(IntStream.range(1, 21).mapToObj(i -> \"a\" + String.format(\"%02d\", i)).collect(toList()));\n group.addAll(IntStream.range(1, 4).mapToObj(i -> \"b\" + String.format(\"%02d\", i)).collect(toList()));\n TWENTY_C_FIVE_SAN_GUO_OPTIONS.add(group);\n //前三直选\n final List<String> frontThreeDirect1 = new ArrayList<>();\n frontThreeDirect1.addAll(IntStream.range(1, 21).mapToObj(i -> \"a\" + String.format(\"%02d\", i)).collect(toList()));\n frontThreeDirect1.addAll(IntStream.range(1, 21).mapToObj(i -> \"b\" + String.format(\"%02d\", i)).collect(toList()));\n frontThreeDirect1.addAll(IntStream.range(1, 21).mapToObj(i -> \"c\" + String.format(\"%02d\", i)).collect(toList()));\n frontThreeDirect1.addAll(IntStream.range(1, 4).mapToObj(i -> \"d\" + String.format(\"%02d\", i)).collect(toList()));\n TWENTY_C_FIVE_SAN_GUO_OPTIONS.add(frontThreeDirect1);\n\n// System.out.println(ELEVEN_C_FIVE_OPTIONS);\n\n List<String> s = new ArrayList<>();\n s.add(\"3\");\n s.add(\"5\");\n s.add(\"6\");\n s.add(\"7\");\n s.add(\"9\");\n// s.add(\"11\");\n// System.out.println(c);\n List<List<String>> s1 = new ArrayList<>();\n s1.add(s);\n List<String> targetNumbers = s1.stream().map(l -> join(l, \",\")).collect(toList());\n\n// System.out.println(getPermutationXSrcLists(s, 2, true));\n\n long tl = computeElevenCFiveGroup(targetNumbers.get(0));\n// System.out.println(tl);\n System.out.println(TWENTY_C_FIVE_SAN_GUO_OPTIONS);\n\n }", "public void addCheck(char next_c, int check){\n int nextPos = next_c - 'a'; \n // check if mentioned check already exists in the check_list(nextPos)\n ArrayList<Integer> list = check_list.get(nextPos);\n if(!list.contains(check)){\n // if check does not exists, add it in the check_list(nextPos)\n check_list.get(nextPos).add(check);\n }\n }", "void sortUI();", "private void updateOrder() {\n Arrays.sort(positions);\n }", "private void checkSortedAmount() {\n\n\t\tList<String> actualAmountList = new ArrayList<String>();\n\t\tList<WebElement> elementList = util.findElementsByXpath(\"//td[5]/span\");\n\t\tfor (WebElement we : elementList) {\n\t\t\tactualAmountList.add(we.getText());\n\t\t}\n\n\t\tassertEquals(actualAmountList, dataService.getAscendingAmounts());\n\t\tdriver.manage().timeouts().implicitlyWait(2, TimeUnit.SECONDS);\n\t}", "public static <T extends Comparable <? super T>> void mysterySort3(List <T> list){\r\n\t\twhile (!isSorted(list)){ // O(n)\r\n\t\t\tCollections.shuffle(list); //O(n)\r\n\t\t}\r\n\t}", "@Test\n public void whensortByAllFieldsListOfUsersThenListSortedByAllFields() {\n SortUser sortUser = new SortUser();\n\n User sergey = new User(\"Sergey\", 25);\n User sergey2 = new User(\"Sergey\", 30);\n User anna = new User(\"Anna\", 23);\n User denis = new User(\"Denis\", 21);\n User anna2 = new User(\"Anna\", 20);\n\n List<User> list = new ArrayList<>();\n list.add(sergey);\n list.add(sergey2);\n list.add(anna);\n list.add(denis);\n list.add(anna2);\n\n List<User> methodReturns = sortUser.sortByAllFields(list);\n\n List<User> expected = new ArrayList<>();\n expected.add(anna2);\n expected.add(anna);\n expected.add(denis);\n expected.add(sergey);\n expected.add(sergey2);\n\n assertThat(methodReturns, is(expected));\n }", "protected void sortCheck() {\n if (m_instances == null) {\n return;\n }\n \n if (m_simpleConfigPanel.isUsingANativeTimeStamp()) {\n String timeStampF = m_simpleConfigPanel.getSelectedTimeStampField();\n Attribute timeStampAtt = m_instances.attribute(timeStampF); \n if (timeStampAtt != null) {\n \n double lastNonMissing = Utils.missingValue();\n boolean ok = true;\n boolean hasMissing = false;\n for (int i = 0; i < m_instances.numInstances(); i++) {\n Instance current = m_instances.instance(i);\n \n if (Utils.isMissingValue(lastNonMissing)) {\n if (!current.isMissing(timeStampAtt)) {\n lastNonMissing = current.value(timeStampAtt);\n } else {\n hasMissing = true;\n }\n } else {\n if (!current.isMissing(timeStampAtt)) {\n if (current.value(timeStampAtt) - lastNonMissing < 0) {\n ok = false;\n break;\n }\n \n lastNonMissing = current.value(timeStampAtt);\n } else {\n hasMissing = true;\n }\n }\n }\n \n if (!ok && !hasMissing) {\n // ask if we should sort\n int result = JOptionPane.showConfirmDialog(ForecastingPanel.this, \n \"The data does not appear to be in sorted order of \\\"\"\n + timeStampF + \"\\\". Do you want to sort the data?\", \n \"Forecasting\", JOptionPane.YES_NO_OPTION);\n \n if (result == JOptionPane.YES_OPTION) {\n if (m_log != null) {\n m_log.statusMessage(\"Sorting data...\");\n }\n m_instances.sort(timeStampAtt);\n m_sortedCheck = true; \n }\n }\n \n if (!ok && hasMissing) {\n // we can't really proceed in this situation. We can't sort by the timestamp\n // because instances with missing values will be put at the end of the data.\n // The only thing we can do is to remove the instances with missing time\n // stamps but this is likely to screw up the periodicity and majorly impact\n // on results.\n \n int result = JOptionPane.showConfirmDialog(ForecastingPanel.this, \n \"The data does not appear to be in sorted order of \\\"\"\n + timeStampF + \"\\\". \\nFurthermore, there are rows with\\n\" +\n \t\t\"missing timestamp values. We can remove these\\n\" +\n \t\t\"rows and then sort the data but this is likely to\\n\" +\n \t\t\"result in degraded performance. It is strongly\\n\" +\n \t\t\"recommended that you fix these issues in the data\\n\" +\n \t\t\"before continuing. Do you want the system to proceed\\n\" +\n \t\t\"anyway by removing rows with missing timestamps and\\n\" +\n \t\t\"then sorting the data?\", \n \"Forecasting\", JOptionPane.YES_NO_OPTION);\n \n if (result == JOptionPane.YES_OPTION) {\n if (m_log != null) {\n m_log.statusMessage(\"Removing rows with missing time stamps and sorting data...\");\n }\n m_instances.deleteWithMissing(timeStampAtt);\n m_instances.sort(timeStampAtt);\n m_sortedCheck = true; \n }\n }\n }\n }\n }", "public static List<Person> checkSortLists(List<Person> people){\r\n TreeMap tm = new TreeMap();\r\n for (Person person: people) {\r\n if(person.getAge()>18){\r\n System.out.println(\"checking beyond\");\r\n return null;\r\n }\r\n tm.put(person.getNo(),person);\r\n }\r\n if(people.size()!=tm.size()){\r\n System.out.println(\"checking redundant\");\r\n return null;\r\n }\r\n List<Person> sortPeople = new ArrayList(tm.values());\r\n return sortPeople;\r\n }", "public static void main(String[] args) {\n\n\t\tArrayList<Integer> unsort =new ArrayList<Integer>();\n\t\tunsort.add(21);\n\t\tunsort.add(24);\n\t\tunsort.add(42);\n\t\tunsort.add(29);\n\t\tunsort.add(23);\n\t\tunsort.add(13);\n\t\tunsort.add(8);\n\t\tunsort.add(39);\n\t\tunsort.add(38);\n\t\t\n\t\tArrayList<Card> cards = new ArrayList<Card>();\n\t\tcards.add(new Card(\"Heart\",13));\n\t\tcards.add(new Card(\"Heart\",2));\n\t\tcards.add(new Card(\"Heart\",4));\n\t\t\n\t\tArrayList<Card> sort = Sort.insertSort(cards,false);\n\t\t\n\t\tfor(Card i: sort) \n\t\t{\n\t\t\tSystem.out.println(i.getNumber());\n\t\t}\n\t\t\n\t}", "public void testSortedList() {\r\n List<InfoNode> sortedList = MapUtils.sortByDistance(exampleList, node3.getTitle());\r\n assertTrue(sortedList.size() == 2);\r\n assertTrue(sortedList.get(0) == node2);\r\n assertTrue(sortedList.get(1) == node1);\r\n assertTrue(sortedList.contains(node1));\r\n assertTrue(sortedList.contains(node2));\r\n assertFalse(sortedList.contains(node3));\r\n\r\n sortedList = MapUtils.sortByDistance(exampleList, node1.getTitle());\r\n assertTrue(sortedList.size() == 2);\r\n assertTrue(sortedList.get(0) == node2);\r\n assertTrue(sortedList.get(1) == node3);\r\n assertFalse(sortedList.contains(node1));\r\n assertTrue(sortedList.contains(node2));\r\n assertTrue(sortedList.contains(node3));\r\n\r\n sortedList = MapUtils.sortByDistance(exampleList, \" \");\r\n assertTrue(sortedList.equals(exampleList));\r\n }", "void updateSortingComparators(Comparator<ReadOnlyEntry> eventComparator,\n Comparator<ReadOnlyEntry> deadlineComparator,\n Comparator<ReadOnlyEntry> floatingTaskComparator);", "@Test\n\tpublic void testSortAllNumFlagOn() throws SortException {\n\t\tList<String> arrayList = sortApplication.sortAllWithNumFlagOn(inputArr1);\n\t\tassertEquals(\"#B@n@n0\", arrayList.get(0));\n\t\tassertEquals(\"20 B*anana\", arrayList.get(1));\n\t\tassertEquals(\"100 B*anana\", arrayList.get(2));\n\t\tassertEquals(\"P3@r\", arrayList.get(3));\n\t\tassertEquals(\"p3@R\", arrayList.get(4));\n\t}", "private void arrangeFactors() {\n List<Condition> tempTrialConditions = new ArrayList<Condition>();\n List<Condition> tempStudyConditions = new ArrayList<Condition>();\n List<ibfb.domain.core.Factor> tempFactors = new ArrayList<ibfb.domain.core.Factor>();\n\n // conditions\n for (Condition cond : workbookStudy.getConditions()) {\n if (hasLabel(cond.getLabel(), Workbook.STUDY)) {\n cond.setLabel(Workbook.STUDY);\n tempStudyConditions.add(cond);\n }\n }\n for (Condition cond : workbookStudy.getStudyConditions()) {\n if (hasLabel(cond.getLabel(), Workbook.STUDY)) {\n cond.setLabel(Workbook.STUDY);\n tempStudyConditions.add(cond);\n }\n }\n\n // study conditions\n for (Condition cond : workbookStudy.getConditions()) {\n //if (hasLabel(cond.getLabel(), Workbook.TRIAL_LABEL)) {\n if (hasLabel(cond.getLabel(), workbookStudy.getTrialLabel())) {\n\n cond.setLabel(workbookStudy.getTrialLabel());\n tempTrialConditions.add(cond);\n }\n }\n for (Condition cond : workbookStudy.getStudyConditions()) {\n // if (hasLabel(cond.getLabel(), Workbook.TRIAL_LABEL)) {\n if (hasLabel(cond.getLabel(), workbookStudy.getTrialLabel())) {\n cond.setLabel(workbookStudy.getTrialLabel());\n tempTrialConditions.add(cond);\n }\n }\n\n // factors (ENTRY)\n for (Condition cond : workbookStudy.getStudyConditions()) {\n //if (hasLabel(cond.getLabel(), Workbook.TRIAL_LABEL)) {\n if (hasLabel(cond.getLabel(), workbookStudy.getTrialLabel())) {\n //tempFactors.add(getFactor(cond, Workbook.ENTRY_LABEL));\n tempFactors.add(getFactor(cond, workbookStudy.getTrialLabel()));\n }\n }\n\n for (Condition cond : workbookStudy.getConditions()) {\n //if (hasLabel(cond.getLabel(), Workbook.ENTRY_LABEL)) {\n if (hasLabel(cond.getLabel(), workbookStudy.getEntryLabel())) {\n //tempFactors.add(getFactor(cond, Workbook.ENTRY_LABEL));\n tempFactors.add(getFactor(cond, workbookStudy.getEntryLabel()));\n }\n }\n for (ibfb.domain.core.Factor factor : workbookStudy.getFactors()) {\n //if (hasLabel(factor.getLabel(), Workbook.ENTRY_LABEL)) {\n if (hasLabel(factor.getLabel(), workbookStudy.getEntryLabel())) {\n tempFactors.add(factor);\n }\n }\n\n // Factors (plot)\n for (Condition cond : workbookStudy.getStudyConditions()) {\n //if (hasLabel(cond.getLabel(), Workbook.PLOT_LABEL)) {\n if (hasLabel(cond.getLabel(), workbookStudy.getPlotLabel())) {\n //tempFactors.add(getFactor(cond, Workbook.PLOT_LABEL));\n tempFactors.add(getFactor(cond, workbookStudy.getPlotLabel()));\n }\n }\n for (Condition cond : workbookStudy.getConditions()) {\n //if (hasLabel(cond.getLabel(), Workbook.PLOT_LABEL)) {\n if (hasLabel(cond.getLabel(), workbookStudy.getPlotLabel())) {\n //tempFactors.add(getFactor(cond, Workbook.PLOT_LABEL));\n tempFactors.add(getFactor(cond, workbookStudy.getPlotLabel()));\n }\n }\n\n for (ibfb.domain.core.Factor factor : workbookStudy.getFactors()) {\n //if (hasLabel(factor.getLabel(), Workbook.PLOT_LABEL)) {\n if (hasLabel(factor.getLabel(), workbookStudy.getPlotLabel())) {\n tempFactors.add(factor);\n /*} else if (factor.getLabel() != null && workbookStudy.getOtherLabels().contains(factor.getLabel())) {\n tempFactors.add(factor);\n */\n }\n }\n\n for (ibfb.domain.core.Factor factor : workbookStudy.getFactors()) {\n //if (hasLabel(factor.getLabel(), Workbook.PLOT_LABEL)) {\n if (factor.getLabel() != null \n && !hasLabel(factor.getLabel(), Workbook.STUDY)\n && !hasLabel(factor.getLabel(), workbookStudy.getEntryLabel())\n && !hasLabel(factor.getLabel(), workbookStudy.getPlotLabel())\n && !hasLabel(factor.getLabel(), workbookStudy.getTrialLabel())) {\n tempFactors.add(factor);\n }\n }\n\n workbookStudy.setStudyConditions(tempStudyConditions);\n workbookStudy.setConditions(tempTrialConditions);\n workbookStudy.setFactors(tempFactors);\n }", "private void postProcessOrdering(List<String> ss) {\n\n String arg = \"-XX:+UnlockDiagnosticVMOptions\";\n int index = ss.indexOf(arg);\n\n // if < 0, it isn't here. if == 0 then it's already in the right position\n if (index > 0) {\n ss.remove(index);\n ss.add(0, arg);\n }\n }", "public void selectionSort(ArrayList <Comparable> list){\r\n\t\tsteps += 2;\r\n\t\tfor (int i = list.size() - 1; i >= 0; i--){\r\n\t\t\tsteps ++;\r\n\t\t\tint biggest = 0; \r\n\t\t\tsteps += 2;\r\n\t\t\tfor (int j = 0; j < i; j++){\r\n\t\t\t\tsteps += 4;\r\n\t\t\t\tif (list.get(j).compareTo(list.get(biggest)) > 0){\r\n\t\t\t\t\tsteps ++;\r\n\t\t\t\t\tbiggest = j;\r\n\t\t\t\t}\r\n\t\t\t\tsteps += 2;\r\n\t\t\t}\r\n\t\t\tsteps += 5;\r\n\t\t\tswap(list, i, biggest);\r\n\t\t\tsteps += 2;\r\n\t\t}\r\n\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"Selection Sort\");\r\n\t\tSystem.out.println();\r\n\t}", "public void sortAppointments() {\n reminders = sort(reminders);\n followup = sort(followup);\n }", "private static void sortList(ArrayList<ArrayList<Integer>> list){\n for (int i = 0; i < list.size(); i++) {\n for (int j = list.size() - 1; j > i; j--) {\n if ( (getCustomerArrivalTime(list.get(i)) == getCustomerArrivalTime(list.get(j)) && getCustomerIndex(list.get(i)) > getCustomerIndex(list.get(j)))\n || getCustomerArrivalTime(list.get(i)) > getCustomerArrivalTime(list.get(j))) {\n\n ArrayList<Integer> tmp = list.get(i);\n list.set(i,list.get(j)) ;\n list.set(j,tmp);\n }\n }\n }\n }", "public boolean elementsAreAlphaUpSortedMorningCoffee(List<WebElement> elements){\n By multipleFirstResult = By.xpath(\"//div//h2//..//div[1]\");\n By test = By.xpath(\"//div[contains(@class,'footer-content')]\");\n\n\n boolean sortedWell = true;\n for (int i=0; i<elements.size()-1; i++){\n\n String frontElement = elements.get(i+1).getText();\n String backElement = elements.get(i).getText();\n\n if(frontElement.contains(\"Multiple\")){\n findElement(test);\n (elements.get(i+1)).click();\n waitForElementToAppear(multipleFirstResult);\n frontElement = findElement(multipleFirstResult).getText();\n\n // Sometimes multipleFirstResult returns nothing so we run a loop to try again 10 times until text is returned.\n for (int k = 0; k < 9; k++)\n {\n if (frontElement.equalsIgnoreCase(\"\")){\n (elements.get(i+1)).click();\n waitForElementToAppear(multipleFirstResult);\n frontElement = findElement(multipleFirstResult).getText();\n }\n else\n {\n break;\n }\n }\n clickCoordinate(searchBar,10,10);\n pause(500);\n }\n\n if(backElement.contains(\"Multiple\")){\n findElement(test);\n (elements.get(i)).click();\n waitForElementToAppear(multipleFirstResult);\n backElement = findElement(multipleFirstResult).getText();\n\n // Sometimes multipleFirstResult returns nothing so we run a loop to try again 10 times until text is returned.\n for (int k = 0; k < 9; k++)\n {\n if (backElement.equalsIgnoreCase(\"\")){\n (elements.get(i)).click();\n waitForElementToAppear(multipleFirstResult);\n backElement = findElement(multipleFirstResult).getText();\n }\n else\n {\n break;\n }\n }\n\n clickCoordinate(searchBar,10,10);\n pause(500);\n }\n\n if (frontElement.compareTo(backElement) < 0){\n System.out.println(\"MIS-SORT: Ascending: '\"+frontElement+\"' should not be after '\"+backElement+\"'\");\n sortedWell = false;\n }\n }\n return sortedWell;\n }", "private void sortAndNotify() {\n Collections.sort(todoDBList, listComparator);\n adapter.notifyDataSetChanged();\n }", "public void sortBasedPendingJobs();", "public void sortMatches();", "public void sortManlist(){\r\n\t\tCollections.sort(Manlist, new MySort());\r\n\t}", "private ArrayList<BoulderProblem> SortBps()\n {\n ArrayList<BoulderProblem> sortedBps = displayBps;\n if(sortOption.equals(\"name\"))\n {\n Collections.sort(sortedBps, bpNameComparator);\n }\n else if(sortOption.equals(\"grade\"))\n {\n Collections.sort(sortedBps, bpGradeComparator);\n }\n else\n {\n Collections.sort(sortedBps, bpSetterComparator);\n }\n return sortedBps;\n }", "public void sortByQnNum() {\r\n\t\tfor (int j = 0; j < displayingList.size() - 1; j++) {\r\n\t\t\tfor (int i = 0; i < displayingList.size() - j - 1; i++) {\r\n\t\t\t\tif (displayingList.get(i).getQnNum() > displayingList.get(i + 1).getQnNum()) {\r\n\t\t\t\t\tswapPosition(displayingList, i, i + 1);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void verifyUpgrades(TileEntity tile,List<IUpgradeProvider> list)\n {\n HashMap<String,Integer> upgradeCounts = new HashMap<>();\n list.forEach(x -> {\n String id = x.getUpgradeId();\n upgradeCounts.put(x.getUpgradeId(), upgradeCounts.getOrDefault(id,0) + 1);\n });\n list.removeIf(x -> upgradeCounts.get(x.getUpgradeId()) > x.getLimit(tile));\n list.sort((x,y) -> Integer.compare(x.getPriority(),y.getPriority()));\n }", "public void triCollection(){\r\n Collections.sort(collection);\r\n }", "public static void main(String[] args) {\n List l = new ArrayList();\r\n\tl.add(Month.SEP);\r\n\tl.add(Month.MAR);\r\n\tl.add(Month.JUN);\r\n\tSystem.out.println(\"\\nList before sort : \\n\" + l);\r\n\tCollections.sort(l);\r\n\tSystem.out.println(\"\\nList after sort : \\n\" + l);\r\n }", "public static void IncOrder(ArrayList<Integer> list)\n{\n // Your code here\n Collections.sort(list);\n}", "public static void sortStringsNumAs( ArrayList<String> lst )\n {\n PredicateStringPair p = (a, b) -> {\n String[] A = a.split(\"\");\n String[] B = b.split(\"\");\n int acount = 0;\n int bcount = 0;\n for (String i : A){\n if (i == \"a\" || i == \"A\"){\n acount += 1;\n }\n }\n for (String i : B){\n if (i == \"a\" || i == \"A\"){\n bcount += 1;\n }\n }\n\n if (acount > bcount) return true;\n else return false;\n };\n sortStrings(lst, p);\n \n }", "public static void main(String[] args) {\n ArrayList<Integer> mainList = new ArrayList<Integer>();\n mainList.add(5);\n mainList.add(2);\n mainList.add(10);\n mainList.add(14);\n mainList.add(3);\n mainList.add(6);\n mainList.add(9);\n boolean asc = false;\n System.out.println(listSort(mainList, asc));\n }", "@Override\n public void execute() {\n itemList.sort_names();\n }", "public void sortKnowledgeBase()\n {\n int i;\n Random random;\n String aPredicate;\n StringTokenizer tokenizer;\n //------------\n random = new Random();\n i = 0;\n while (i < knowledgeBase.size())\n {\n aPredicate = knowledgeBase.get(i).commitments.get(0).predicate;\n tokenizer = new StringTokenizer(aPredicate,\"(), \");\n if(tokenizer.nextToken().equals(\"secuencia\"))\n knowledgeBase.get(i).priority = random.nextInt(100);\n //end if\n else\n knowledgeBase.get(i).priority = random.nextInt(10000);\n //end else\n i = i + 1;\n }//end while\n Collections.sort(knowledgeBase);\n }", "private void updateSortOrderCheckBox(){\n MenuItem alphabeticalSortItem = sortMenu.findItem(R.id.menuSortAlphabetically);\n MenuItem dateSortItem = sortMenu.findItem(R.id.menuSortDate);\n MenuItem fileTypeSortItem = sortMenu.findItem(R.id.menuSortFileType);\n MenuItem fileSizeSortItem = sortMenu.findItem(R.id.menuSortFileSize);\n if(sortOrder == SortOrder.ALPHABETICAL){\n alphabeticalSortItem.setChecked(true);\n dateSortItem.setChecked(false);\n fileTypeSortItem.setChecked(false);\n fileSizeSortItem.setChecked(false);\n } else if (sortOrder == SortOrder.DATE){\n alphabeticalSortItem.setChecked(false);\n dateSortItem.setChecked(true);\n fileTypeSortItem.setChecked(false);\n fileSizeSortItem.setChecked(false);\n } else if (sortOrder == SortOrder.FILE_TYPE){\n alphabeticalSortItem.setChecked(false);\n dateSortItem.setChecked(false);\n fileTypeSortItem.setChecked(true);\n fileSizeSortItem.setChecked(false);\n } else if(sortOrder == SortOrder.FILE_SIZE){\n alphabeticalSortItem.setChecked(false);\n dateSortItem.setChecked(false);\n fileTypeSortItem.setChecked(false);\n fileSizeSortItem.setChecked(true);\n }\n }", "public static boolean testSort() {\r\n Manager inst;\r\n try {\r\n inst = new PokemonTable();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n return false;\r\n }\r\n LinkedList<Pokemon> list;\r\n list = inst.sortByAttack(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getAttack() < list.get(i).getAttack()) {\r\n System.out.println(\"attack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByAttack(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getAttack() > list.get(i).getAttack()) {\r\n System.out.println(\"attack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByDefense(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getDefense() < list.get(i).getDefense()) {\r\n System.out.println(\"defense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByDefense(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getDefense() > list.get(i).getDefense()) {\r\n System.out.println(\"defense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByFavorite(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (!list.get(i - 1).getFavorite() && list.get(i).getFavorite()) {\r\n System.out.println(\"favorite sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByFavorite(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getFavorite() && !list.get(i).getFavorite()) {\r\n System.out.println(\"favorite sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByHp(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getHp() < list.get(i).getHp()) {\r\n System.out.println(\"hp sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByHp(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getHp() > list.get(i).getHp()) {\r\n System.out.println(\"hp sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByLegendary(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (!list.get(i - 1).isLegendary() && list.get(i).isLegendary()) {\r\n System.out.println(\"legendary sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByLegendary(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).isLegendary() && !list.get(i).isLegendary()) {\r\n System.out.println(\"legendary sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByName(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getName().compareTo(list.get(i).getName()) > 0) {\r\n System.out.println(\"name sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByName(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getName().compareTo(list.get(i).getName()) < 0) {\r\n System.out.println(\"name sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpAttack(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpAttack() < list.get(i).getSpAttack()) {\r\n System.out.println(\"spAttack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpAttack(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpAttack() > list.get(i).getSpAttack()) {\r\n System.out.println(\"spAttack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpDefense(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpDefense() < list.get(i).getSpDefense()) {\r\n System.out.println(\"spDefense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpDefense(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpDefense() > list.get(i).getSpDefense()) {\r\n System.out.println(\"spDefense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpeed(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpeed() < list.get(i).getSpeed()) {\r\n System.out.println(\"speed sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpeed(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpeed() > list.get(i).getSpeed()) {\r\n System.out.println(\"speed sort\");\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "@Test\r\n public void SortTest() {\r\n System.out.println(\"sort\");\r\n List<String> array = Arrays.asList(\"3\", \"2\", \"1\");\r\n List<String> expResult = Arrays.asList(\"1\",\"2\",\"3\");\r\n instance.sort(array);\r\n assertEquals(expResult,array);\r\n }", "public List<User> sortByAllFields(List<User> list) {\n Collections.sort(list, (user1, user2) -> {\n int result;\n result = user1.getName().compareTo(user2.getName());\n if (result == 0) {\n result = user1.getAge() - user2.getAge();\n }\n return result;\n });\n\n return list;\n\n }", "protected List<RuntimeCheck> getOriginalChecks(Exp e) {\n List<RuntimeCheck> ret = originalChecks.get(e);\n if (ret != null) {\n ret = new ArrayList<RuntimeCheck>(ret);\n }\n return ret;\n }", "private static void sortingMemo() {\n\t\t\n\t}", "@Test\n public void shouldAssertAllTheGroup() {\n List<Integer> list = Arrays.asList(1, 2, 4);\n assertAll(\"List is not incremental\",\n () -> Assertions.assertEquals(list.get(0).intValue(), 1),\n () -> Assertions.assertEquals(list.get(1).intValue(), 2),\n () -> Assertions.assertEquals(list.get(2).intValue(), 3));\n }", "public void sortIntermediateNodes() {\n\t\tfor (FTNonLeafNode intermediateNode : intermediateNodes.values()) {\n\t\t\tdeclareBeforeUse(intermediateNode);\n\t\t}\n\t}", "private ArrayList<ArrayList<Integer>> sortValidPartners(Matching data, int validPartnersNo, ArrayList<ArrayList<Integer>> validPartners) {\n for (int resident = 0; resident < validPartners.get(0).size(); resident++) {\n\n for (int partner = 1; partner < validPartnersNo; partner++) {\n int partnerRank = data.getResidentPreference().get(resident).indexOf(validPartners.get(partner).get(resident));\n int partnerValue = validPartners.get(partner).get(resident);\n if (partnerRank == -1)\n partnerRank = 999999;\n int partnerToCompare = partner - 1;\n\n int partnerToCompareRank = data.getResidentPreference().get(resident).indexOf(validPartners.get(partnerToCompare).get(resident));\n if (partnerToCompareRank == -1)\n partnerToCompareRank = 999999;\n while (partnerToCompareRank > partnerRank) {\n validPartners.get(partnerToCompare + 1).set(resident, validPartners.get(partnerToCompare).get(resident));\n partnerToCompare--;\n if (partnerToCompare < 0)\n break;\n partnerToCompareRank = data.getResidentPreference().get(resident).indexOf(validPartners.get(partnerToCompare).get(resident));\n if (partnerToCompareRank == -1)\n partnerToCompareRank = 999999;\n }\n\n validPartners.get(partnerToCompare + 1).set(resident, partnerValue);\n }\n }\n return validPartners;\n }", "@Override\n protected void runAlgorithm() {\n for (int i = 0; i < getArray().length; i++) {\n for (int j = i + 1; j < getArray().length; j++) {\n if (applySortingOperator(getValue(j), getValue(i))) {\n swap(i, j);\n }\n }\n }\n }", "@Test\n public void flowTest2(){\n ItemToCalculate calculated = new ItemToCalculate(5);\n calculated.workerLastNumber = 5;\n calculated.curProgress = 5;\n calculated.firstRoot = 1;\n calculated.secondRoot = 5;\n\n calcApplication.itemToCalculateArrayList.add(calculated);\n calcApplication.itemToCalculateArrayList.add(new ItemToCalculate(4));\n\n Collections.sort(calcApplication.itemToCalculateArrayList, new ItemToCalculateComparator());\n\n assertEquals(calculated, calcApplication.itemToCalculateArrayList.get(1));\n\n calcApplication.itemToCalculateArrayList.clear();\n }", "@Override\n public void sortAndCount() {\n Insertion.reset();\n Insertion.sort(arrayForTests);\n comp = Sort.getComparisonOperations(); // Sort.getComp();\n copy = Sort.getCopyOperations(); // Sort.getCopy();\n }", "public void sortTasks() {\n tasks.sort(null);\n }", "@Test\n\tpublic void testLLSort() {\n\t\tLinkedList playerList = new LinkedList();\n\t\tPlayer tempInsert5 = new Player();\n\t\ttempInsert5.setName(\"test5\");\n\t\ttempInsert5.setPoints(5);\n\t\ttempInsert5.setWins(4);\n\t\ttempInsert5.setLosses(3);\n\t\tplayerList.LLInsert(tempInsert5);\n\t\tplayerList.LLPrint();\n\t\t\n\t\tPlayer tempInsert2 = new Player();\n\t\ttempInsert2.setName(\"test2\");\n\t\ttempInsert2.setPoints(2);\n\t\ttempInsert2.setWins(1);\n\t\ttempInsert2.setLosses(0);\n\t\tplayerList.LLInsert(tempInsert2);\n\t\t\n\t\tPlayer tempInsert3 = new Player();\n\t\ttempInsert3.setName(\"test3\");\n\t\ttempInsert3.setPoints(3);\n\t\ttempInsert3.setWins(2);\n\t\ttempInsert3.setLosses(1);\n\t\tplayerList.LLInsert(tempInsert3);\n\t\t\n\t\tPlayer tempInsert1 = new Player();\n\t\ttempInsert1.setName(\"test1\");\n\t\ttempInsert1.setPoints(1);\n\t\ttempInsert1.setWins(0);\n\t\ttempInsert1.setLosses(0);\n\t\tplayerList.LLInsert(tempInsert1);\n\t\tplayerList.LLPrint();\n\t\t\n\t\tPlayer tempInsert4 = new Player();\n\t\ttempInsert4.setName(\"test4\");\n\t\ttempInsert4.setPoints(4);\n\t\ttempInsert4.setWins(3);\n\t\ttempInsert4.setLosses(2);\n\t\tplayerList.LLInsert(tempInsert4);\n\t\tplayerList.LLPrint();\n\t\t\n\t\tplayerList.LLSort();\n\t\tassertEquals(playerList.LLPrint(), \n\t\t\t\t\"test5: Points: 5, Wins/Losses: 4/3\\n\"\n\t\t\t\t\t\t+ \"test4: Points: 4, Wins/Losses: 3/2\\n\"\n\t\t\t\t\t\t+ \"test3: Points: 3, Wins/Losses: 2/1\\n\"\n\t\t\t\t\t\t+ \"test2: Points: 2, Wins/Losses: 1/0\\n\"\n\t\t\t\t\t\t+ \"test1: Points: 1, Wins/Losses: 0/0\\n\");\n\t}", "private synchronized void freshSort(){\n Process[] newQueue = new Process[pros.proSize()];\n for(int i = 0; i <queue.length; i++){\n if(pros.isInList(queue[i])){\n newQueue[i] = queue[i];\n }\n }\n queue = new Process[pros.proSize()];\n queue = newQueue;\n }", "private void changeOrderPhase() {\n for (int i = 0; i < 4; i++)\n System.out.print(playerList[i].getName() + \" ,\");\n Player tmp = playerList[0];\n playerList[0] = playerList[1];\n playerList[1] = playerList[2];\n playerList[2] = playerList[3];\n playerList[3] = tmp;\n System.out.println();\n for (int i = 0; i < 4; i++)\n System.out.print(playerList[i].getName() + \" ,\");\n System.out.println();\n }", "public void sort() {\n Collections.sort(tasks);\n }" ]
[ "0.6079934", "0.59181476", "0.5869833", "0.58031297", "0.5749567", "0.5645236", "0.5636886", "0.55898154", "0.55120903", "0.5509426", "0.5480763", "0.5460998", "0.54496884", "0.5447102", "0.54376215", "0.5413555", "0.540752", "0.5392968", "0.5392003", "0.5354744", "0.53420067", "0.5337528", "0.5335383", "0.5333828", "0.5328413", "0.5307883", "0.52582765", "0.52548015", "0.5252345", "0.52512556", "0.524862", "0.52481925", "0.52370954", "0.5235753", "0.5219729", "0.5207754", "0.5203284", "0.51861775", "0.5177948", "0.51765895", "0.51645696", "0.5157077", "0.51563317", "0.515303", "0.51298165", "0.51240754", "0.51229084", "0.5120775", "0.51172006", "0.5109906", "0.5104832", "0.51020294", "0.5096262", "0.5088664", "0.508437", "0.5081826", "0.50632745", "0.5061656", "0.5056815", "0.5052614", "0.5050323", "0.5048841", "0.503885", "0.5038169", "0.5037803", "0.50315464", "0.50278705", "0.5023104", "0.50174385", "0.5015336", "0.5010206", "0.50021076", "0.4997967", "0.49895403", "0.49799457", "0.49766535", "0.49713153", "0.4962734", "0.49585348", "0.4953768", "0.49525076", "0.49496162", "0.49456048", "0.49417788", "0.49365896", "0.49310207", "0.4930408", "0.49258974", "0.49163553", "0.491426", "0.4913019", "0.49045405", "0.48955968", "0.48938602", "0.4893782", "0.4891674", "0.48885977", "0.4886868", "0.48819116", "0.48752254" ]
0.6481407
0
/Intent intent = new Intent(getApplicationContext(), NewProductDetailActivity.class); intent.putExtra("position",position); startActivity(intent);
@Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onClick(View v)\n {\n Log.d(TAG, \"onItemClick | position = \" + position);\n Intent intent = new Intent(mContext, OrderDetailActivity.class);\n intent.putExtra(StoreConstant.ORDER_TYPE, StoreConstant.ORDER_SHOW);\n Bundle bundle = new Bundle();\n bundle.putSerializable(StoreConstant.ORDER_DETAIL, item);\n intent.putExtras(bundle);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n mContext.startActivity(intent);\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {\n Intent intent = new Intent(MainActivity.this, ChampionProfileActivity.class);\n\n //Using bundle to pass variable to the next activity\n Bundle bundle = new Bundle();\n bundle.putInt(\"position\", position);\n\n intent.putExtras(bundle);\n\n startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(context, Detail_Product_Normal.class);\n intent.putExtra(Param_Collection.EXTRA_POST_ID, item.getContent().getPostId().toString());\n intent.putExtra(Param_Collection.EXTRA_POST_PRODUCT_TITLE, item.getActivity());\n intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(mContext,EditItemActivity.class);\n intent.putExtra(\"position\",position);\n intent.putExtra(\"Edit_item\",1);\n intent.putExtra(\"price\",mItemsList.get(position).getPrice());\n intent.putExtra(\"description\",mItemsList.get(position).getDescription());\n intent.putExtra(\"imageURL\",mItemsList.get(position).getImageURL());\n mContext.startActivity(intent);\n }", "@Override\n public void onClick(Product product) {\n Log.i(\"MainActivity\", product.toString());\n Intent detailIntent = new Intent(this, DetailActivity.class);\n detailIntent.putExtra(Constants.Keys.PRODUCT_DETAIL.toString(), product);\n startActivity(detailIntent);\n }", "@Override\n public void onClick(View view) {\n Intent i = new Intent(getApplicationContext(), NewProductActivity.class);\n startActivity(i);\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long rowId) {\n\n Log.d(\"ROWSELECT\", \"\" + rowId);\n //Toast.makeText(this,\"Elemento Clicado\" + position,Toast.LENGTH_SHORT).show();\n Intent intent= new Intent(getApplicationContext(),productDetailActivity.class);\n intent.putExtra(\"producto\",mAdapter.getItem(position).getProducto());\n intent.putExtra(\"precio\",String.valueOf(mAdapter.getItem(position).getPrecio()));\n startActivity(intent);\n }", "@Override\n public void onClick(View v) { Intent intent = new Intent(v.getContext(), ItemDescriptionActivity.class);\n// intent.putExtra(\"title\", data.get(position).getItems().get(position).getTitle());\n// intent.putExtra(\"description\", data.get(position).getItems().get(position).getDescription());\n// v.getContext().startActivity(intent);\n//\n Intent intent = new Intent(v.getContext(), ItemListActivity.class);\n intent.putExtra(\"id\", data.get(position).getId());\n activityContext.startActivity(intent);\n }", "@Override\n public void onClick(View view) {\n Intent i = new Intent(MainActivity.this, EditActivity.class);\n i.putExtra(\"currentShop\", currentShop);\n i.putExtra(\"position\", shopList.indexOf(currentShop));\n startActivityForResult(i, 2);\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(mContext, DemandDetailActivity.class);\n //intent.putExtra(\"id\",String.valueOf(item.getPid()));\n intent.putExtra(\"pid\", String.valueOf(item.getPid()));\n intent.putExtra(\"uid\", String.valueOf(item.getUid()));\n mContext.startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n\n\n Intent in = new Intent(mContext, SingleItemActivity.class);\n in.putExtra(\"titleMain\", itemSubModel.getName());\n in.putExtra(\"wishListStatus\", itemSubModel.getStatusWishList());\n in.putExtra(\"productId\", itemSubModel.getId());\n mContext.startActivity(in);\n//\n\n }", "@Override\n public void onClick(View v) {\n\n Intent in = new Intent(mContext, SingleItemActivity.class);\n in.putExtra(\"titleMain\", itemSubModel.getName());\n in.putExtra(\"wishListStatus\", itemSubModel.getStatusWishList());\n in.putExtra(\"productId\", itemSubModel.getId());\n\n mContext.startActivity(in);\n//\n }", "@Override\r\n public void onClick(View view) {\n Intent intent = new Intent(context, DetailActivity.class);\r\n intent.putExtra(\"item\", itemList.get(position));\r\n context.startActivity(intent);\r\n }", "@Override\n public void ViewOnItemClick(int position) {\n\n int movieID = this.movie_populars.get(position).getId();\n\n Intent intent = new Intent(MainActivity.this, Movie_Profile.class);\n intent.putExtra(\"MovieID\", movieID);\n startActivity(intent);\n\n }", "@Override\n public void onDetailsClick(int position) {\n Intent intent = new Intent(getActivity(), MovieViewActivity.class);\n intent.putExtra(\"movieName\", memoirs.get(position).getMovieName());\n intent.putExtra(\"userId\", userId);\n intent.putExtra(\"from\", \"memoir\");\n startActivity(intent);\n }", "private void detailedClicked(int position) {\n Intent i = new Intent(getContext(), ScrollingActivity.class);\n i.putExtra(\"name\", productList.get(position).getName());\n i.putExtra(\"init\", productList.get(position).getInitialPrice());\n i.putExtra(\"curr\", productList.get(position).getCurrentPrice());\n i.putExtra(\"change\", productList.get(position).getChange());\n i.putExtra(\"date\", productList.get(position).getDate());\n i.putExtra(\"url\", productList.get(position).getURL());\n getContext().startActivity(i);\n }", "@Override\n public void onItemClick(View view, int position) {\n Intent intent = new Intent(getApplicationContext(), EntityActivity.class);\n intent.putExtra(Constants.ENTITY_NAME, rv_adapter.getItem(position).getEntity_name());\n intent.putExtra(Constants.ENTITY_DESCRIPTION, rv_adapter.getItem(position).getEntity_description());\n intent.putExtra(Constants.ENTITY_ADDRESS, rv_adapter.getItem(position).getAddress());\n intent.putExtra(Constants.ENTITY_PHONE, rv_adapter.getItem(position).getPhone_number());\n intent.putExtra(Constants.ENTITY_POSITION, rv_adapter.getItem(position).getLongitude() + \",\" + rv_adapter.getItem(position).getLatitude());\n intent.putExtra(Constants.ENTITY_LINK, rv_adapter.getItem(position).getLink());\n intent.putExtra(Constants.ENTITY_EMAIL, rv_adapter.getItem(position).getEmail());\n startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n Movie movieItem = (Movie) containerView.getTag (); // getting the current movie item from setTag(movieItem)\n int position = getAdapterPosition (); //getting the position index i.e. it start from 0\n Log.d(\"Position\", \"\"+position + movieItem.getTitle ());\n Intent intent = new Intent (v.getContext (), DetailActivity.class);\n\n // intent.putParcelableArrayListExtra(\"ALLMOVIELIST\", (ArrayList<? extends Parcelable>) allList);\n intent.putExtra (\"movieTitle\", movieItem.getTitle ());\n intent.putExtra (\"movieImage\", movieItem.getImage());\n\n v.getContext ().startActivity (intent);\n }", "@Override\n public void onClick(View view) {\n Intent intent = new Intent(mContext, ItemDetailsActivity.class);\n\n intent.putExtra(\"name\", modellist.get(postition).getTitle());\n intent.putExtra(\"picture\", modellist.get(postition).getType() + postition);\n intent.putExtra(\"cost\", modellist.get(postition).getCost());\n intent.putExtra(\"id\", modellist.get(postition).getId());\n intent.putExtra(\"description\", modellist.get(postition).getDescription());\n intent.putExtra(\"extra\", modellist.get(postition).getExtra());\n\n mContext.startActivity(intent);\n// Toast.makeText(mContext, \"Make the user see the details of the item\", Toast.LENGTH_SHORT).show();\n }", "public void gotoProduct(Product product){\n Intent detail = new Intent(getContext(), ProductDetail.class);\n detail.putExtra(\"PRODUCT\",product);\n // create the animator for this view (the start radius is zero)\n if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.LOLLIPOP) {\n\n //itemView.getContext().startActivity(detail);\n }else{\n\n }\n //ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(getActivity(),recycler,\"heading\");\n //getContext().startActivity(detail,options.toBundle());\n getContext().startActivity(detail);\n\n }", "@Override\n public void onClick(View view) {\n\n Intent intent = new Intent(context, DetailActivity.class);\n intent.putExtra(\"YourValueKey\", array_detailview.get(position));\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(intent);\n\n// view.getContext().startActivity(new Intent(view.getContext(), DetailActivity.class));\n// context.startActivity(new Intent(context, DetailActivity.class));\n\n\n }", "public void callAddcartPage(MenuItem item) {\n\n // declare Intent ojbect to call another activity\n Intent calladdCartPage = new Intent(this,Order_Details.class);\n // startActivity by calling intent object\n startActivity(calladdCartPage);\n }", "@Override\n public void onClick(View view) {\n Intent intent = new Intent(context, DetailActivity.class);\n intent.putExtra(\"nb\", nama[position]);\n intent.putExtra(\"gb\", gambar[position]);\n intent.putExtra(\"dt\", detail[position]);\n context.startActivity(intent);\n\n\n\n\n }", "@Override\n public void onClick(View view, int position) {\n\n Intent intent =new Intent(getContext(), EditFoodItme.class);\n // intent.putExtra(\"shopid\", id.getText());\n startActivity(intent);\n\n //Detail.navigate(appCompatActivity, view.findViewById(R.id.iv_recipe));\n\n }", "@Override\n public void onClick(View view, int position) {\n Intent intent = new Intent(this, NutritionDetailActivity.class);\n startActivity(intent);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n Intent producto = new Intent(context, CargaProducto.class);\n producto.putExtra(\"idF\", productoArrayList.get(position).getFarmacia().getId());\n producto.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\n context.startActivity(producto);\n }", "@Override\n public void onClick(View view, int position) {\n Intent abrirPregunta = new Intent(this, ActivityWikipetsInfo.class);\n abrirPregunta.putExtra(\"pregunta\", position);\n startActivity(abrirPregunta);\n }", "@Override\n public void onItemClick(int position) {\n\n /* Intent detailIntent = new Intent(this,details.class);\n ExampleItem clickItem = mExampleList.get(position);\n detailIntent.putExtra(EXTRA_FIESTA, clickItem.getTest_name());\n detailIntent.putExtra(EXTRA_PROVINCE, clickItem.getProvince());\n detailIntent.putExtra(EXTRA_URL,clickItem.getImage());\n detailIntent.putExtra(EXTRA_MUNICIPAL,clickItem.getMunicipal());\n detailIntent.putExtra(EXTRA_HISTORY,clickItem.getHistory());\n startActivity(detailIntent);*/\n }", "@Override\n public void onClick(View view) {\n Intent i = new Intent(getApplicationContext(), AllProductsActivity.class);\n startActivity(i);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n if (view.getId()== position){\n Intent intent = new Intent(MainActivity.this, Details.class);\n intent.putExtra(\"name\", \"bangladesh\");\n startActivity(intent);\n }\n }", "public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Intent nextScreen = new Intent(getApplicationContext(), ListActivity.class);\r\n nextScreen.putExtra(\"complaint_id\",mProductList.get(position).getCredits());\r\n startActivity(nextScreen);\r\n\r\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {\n MovieItem movieItem = arrayAdapter.getItem(position);\n Intent i = new Intent(getActivity(), DetailActivity.class);\n i.putExtra(\"myData\", movieItem);\n startActivity(i);\n }", "@Override\n\t\t\tpublic void onClick(View arg0) {\n\t\t\t\tIntent intent2 = new Intent(myActivity, ProductDetailInfoActivity.class);\n\t\t\t\tintent2.putExtra(\"id\", product.getId());\n\t\t\t\tintent2.putExtra(\"pro_name\", product.getSubject());\n\t\t\t\t// intent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t\t\tmyActivity.startActivity(intent2);\n\t\t\t\tmyActivity.overridePendingTransition(R.anim.push_left_in, R.anim.push_left_out);\n\t\t\t}", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Cursor cursor = ResolverHelper.getData((int) id, MainListaActivity.this.getContentResolver());\n Bundle bundle = new Bundle();\n while(cursor.moveToNext()){\n bundle.putString(Constants._ID,cursor.getString(0));\n bundle.putString(Constants.PRODUCENT,cursor.getString(1));\n bundle.putString(Constants.MODEL_NAME,cursor.getString(2));\n bundle.putString(Constants.ANDR_VER,cursor.getString(3));\n bundle.putString(Constants.WWW,cursor.getString(4));\n }\n cursor.close();\n Intent intent = new Intent(MainListaActivity.this,PhoneActivity.class);\n intent.putExtras(bundle);\n startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n if (postmodel.getSellType() == 1) {\n\n Intent i = new Intent(Intent.ACTION_VIEW, Uri.parse(postmodel.getProductLink()));\n context.startActivity(i);\n } else {\n Bundle bundle = new Bundle();\n bundle.putStringArray(\"images\", finalImageArray);\n Intent intent = new Intent(context, ProductPage.class);\n intent.putExtra(\"product_name\", postmodel.getProductName());\n intent.putExtra(\"product_cat\", postmodel.getProductCat());\n intent.putExtra(\"product_desc\", postmodel.getProductDesc());\n intent.putExtra(\"product_link\", postmodel.getProductLink());\n intent.putExtra(\"product_price\", String.valueOf(postmodel.getProductPrice()));\n intent.putExtra(\"id\", String.valueOf(postmodel.getId()));\n intent.putExtras(bundle);\n intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(intent);\n }\n\n }", "private void goToDetailScreen(int position) {\n// ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(this,\n// new Pair(mAdapter.getHolderItem(position).getThumbnail(), DetailActivity.IMAGE_TRANSITION_NAME));\n ActivityOptionsCompat options = ActivityOptionsCompat.makeSceneTransitionAnimation(this,\n mAdapter.getHolderItem(position).getThumbnail(),\n DetailActivity.IMAGE_TRANSITION_NAME);\n\n Intent intent = new Intent(this, DetailActivity.class);\n intent.putExtra(ITEM_CURRENT_POSITION, position);\n intent.putParcelableArrayListExtra(IMAGES_LIST, mAdapter.getData());\n\n startActivity(intent, options.toBundle());\n }", "@Override //define what to do when cell \"position\" is clicked\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Intent showDetailActivity = new Intent(getApplicationContext(), DetailActivity.class);\n //add extra info to the intent(index of cell clicked)\n showDetailActivity.putExtra(\"INDEX\", position);\n //execute the intent\n startActivity(showDetailActivity);\n\n }", "@Override\r\n public void onItemClick(AdapterView<?> parent, View view,\r\n int position, long id) {\n String Slecteditem = itemname[+position];\r\n Toast.makeText(getApplicationContext(), Slecteditem, Toast.LENGTH_SHORT).show();\r\n startActivity(new Intent(unlogin.this, product.class));\r\n }", "@Override\n public void onItemClick(int position) {\n Intent review_Intent = new Intent(StallRV.this, FoodStallReview.class);\n sharedPreferences = getSharedPreferences(MyPREFERENCES,MODE_PRIVATE);\n SharedPreferences.Editor editor = sharedPreferences.edit();\n editor.putInt(Stallposition,position);\n editor.apply();\n review_Intent.putExtra(\"class\",\"stall\");\n startActivity(review_Intent);\n }", "public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n Intent intent = new Intent(MainActivity.this, Lists.class);\n intent.putExtra(\"glposition\", list.get(position).getID());\n intent.addFlags(Intent.FLAG_ACTIVITY_REORDER_TO_FRONT);\n startActivity(intent);\n }", "@Override\n public void onClick(View view, final int position) {\n positionSeleced=position;\n FamilyDetails familyMemberDetail=familyDetailsList.get(position);\n Toast.makeText(getApplicationContext(), \"Selected: \" + familyMemberDetail.getName() + \", \" + familyMemberDetail.getUbaindid().toString(), Toast.LENGTH_LONG).show();\n Intent i = new Intent(FamilyInfoActivity.this, FamilyDetailsActivity.class);\n i.putExtra(\"familyrecord\",familyRecord[position]);\n startActivity(i);\n \n }", "@Override\n public void onClick(View v) {\n String item = list.get(position).toString();\n Intent intent = new Intent(holder.pname.getContext(),Add_Updatelead__bankresult_Activity.class);\n intent.putExtra(\"itemName\",item);\n intent.putExtra(\"invoice\", pveo);\n holder.pname.getContext().startActivity(intent);\n\n }", "@Override\n public void onSkillClick(int skill_id, int position) {\n\n Intent intent = new Intent(MainActivity.this, SkillActivity.class);\n intent.putExtra(\"REQUESTED_SKILL\", skill_id);\n startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n int position = getAdapterPosition();\n final Assessment current = assessments.get(position);\n Intent intent = new Intent(v.getContext(), AssessmentDetail.class);\n intent.putExtra(\"assessmentName\", current.getAssessmentName());\n intent.putExtra(\"assessmentStart\", current.getAssessmentStart());\n// intent.putExtra(\"assessmentEnd\", current.getAssessmentEnd());\n intent.putExtra(\"assessmentID\", current.getAssessmentID());\n intent.putExtra(\"courseID\", current.getCourseID());\n intent.putExtra(\"assessmentStatus\", current.getAssessmentType());\n intent.putExtra(\"position\", position);\n v.getContext().startActivity(new Intent(intent));\n\n }", "@Override\n public void onClick(View v) {\n\n Intent i = new Intent(context, DetailActivity.class); //create intent to switch screen\n\n //trying to place movie into putExtra by putting it into Parcelable value (bc method can't take movie object)\n //we use Parcelable (go to AndroidStudio ref. where they have the code to allow u to use Parceler library\n //essentially, you place the implementation code into buildgradle file\n i.putExtra(\"movie\", Parcels.wrap(movie));\n //add @Parcel to Movie class and add empty constructor as shown in AU (android U) page + empty constructor\n //now you can go to DetailActivity to retrieve the whole movie object just by using an intent\n\n context.startActivity(i);\n\n }", "@Override\n public void onItemClick(BaseQuickAdapter adapter, View view, int position) {\n\n Intent intent = new Intent(this, SpeechAssessmentActivity.class);\n// intent.putExtra(\"id\", id);\n startActivity(intent);\n\n }", "@Override\n public void OnItemClick(View view, int postion) {\n Intent intent = new Intent(MyPubishActivity.this, IndexDetailActivity.class);\n String entryId = String.valueOf(publishList.get(postion).getItem_id());\n intent.putExtra(\"entryId\", entryId);\n startActivity(intent);\n }", "@Override\n public void onclick(View view, int position, boolean islongclick) {\n Intent fooddetails=new Intent(FoodList.this,FoodDetails.class);\n\n // send food id to food details activity\n fooddetails.putExtra(\"FoodId\",adapter.getRef(position).getKey());\n startActivity(fooddetails);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position,\n long id) {\n Intent i = new Intent(\"com.example.cabshare.PROFILE\");\n i.putExtra(\"position\", position);\n startActivity(i);\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n MovieDetails movieDetails = movieDetailsAdapter.getItem(i);\n Intent intent = new Intent(MainActivity.this,MovieDetailActivity.class);\n intent.putExtra(\"movieDetails\",movieDetails);\n startActivity(intent);\n }", "@Override\n public void onCardClick(int position) {\n CardAlbum cardAlbum = cardAlbumListData.get(position);\n /**\n * Putting the Data inside a bundle nd sending to the DetailActivity.\n */\n\n Intent intent = new Intent(this,DetailActivity.class);\n Bundle bundle = new Bundle();\n bundle.putString(EXTRA_ALBUM_ID,cardAlbum.getAlbumId());\n bundle.putString(EXTRA_ALBUM_NAME,cardAlbum.getAlbumName());\n bundle.putString(EXTRA_ALBUM_ARTIST_NAME,cardAlbum.getArtistName());\n bundle.putString(EXTRA_ALBUM_IMAGE,cardAlbum.getAlbumImageURL());\n bundle.putString(EXTRA_ALBUM_RELEASE_DATE,cardAlbum.getAlbumReleaseDate());\n bundle.putString(EXTRA_SPOTIFY_ACCESS_TOKEN,getAccessToken());\n intent.putExtra(BUNDLE_EXTRA,bundle);\n startActivity(intent);\n }", "public void onListItemClick(ListView list, View v, int position, long id)\n {\n Intent intent = new Intent(MainActivity.this, EventActivities.class);\n intent.putExtra(\"c\", position);\n startActivity(intent);\n }", "@Override\n public void onClick(View view) {\n Intent intent = new Intent(context.getApplicationContext(), UpdateTreeDetails.class);\n intent.putExtra(\"treeName\",treeNameList.get(position));\n intent.putExtra(\"treeAddress\",treeAddressList.get(position));\n intent.putExtra(\"plantDate\",plantDateList.get(position));\n intent.putExtra(\"updatedDate\",updatedDateList.get(position));\n intent.putExtra(\"updateStatus\",updateStatusList.get(position));\n intent.putExtra(\"treeImage\",treeImageList.get(position));\n intent.putExtra(\"treeId\",treeIdList.get(position));\n intent.putExtra(\"treeRelation\",treeRelationList.get(position));\n intent.putExtra(\"treeCount\",treeCountList.get(position));\n context.startActivity(intent);\n }", "@Override\n public void onCardButtonClick(int position) {\n\n CardAlbum cardAlbum = cardAlbumListData.get(position);\n Intent intent = new Intent(this,ArtistActivity.class);\n Bundle bundle = new Bundle();\n bundle.putString(EXTRA_ALBUM_ARTIST_ID,cardAlbum.getArtistId());\n bundle.putString(EXTRA_ALBUM_ARTIST_NAME,cardAlbum.getArtistName());\n bundle.putString(EXTRA_SPOTIFY_ACCESS_TOKEN,getAccessToken());\n intent.putExtra(BUNDLE_EXTRA,bundle);\n startActivity(intent);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Intent intent = new Intent(getActivity(), InstructionStartActivity.class);\n intent.putExtra(\"title\", MainHomeActivity.origamiTitles[position]);\n intent.putExtra(\"info\", MainHomeActivity.origamiInfo[position]);\n intent.putExtra(\"design\", MainHomeActivity.origamiDesigns[position]);\n startActivity(intent);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Intent intent = new Intent(SearchResultActivity.this, UrbanWordActivity.class);\n intent.putExtra(\"position\", position);\n startActivity(intent);\n }", "private void switchToSingleRatingActivity(int position){\n\n Intent s_ratingIntent = new Intent(this,SingleRatingActivity.class);\n\n Log.d(TAG, moviesAPI_list.get(position).getId());\n Log.d(TAG, moviesAPI_list.get(position).getImgUrl());\n\n s_ratingIntent.putExtra(EXTRA_MOVIE_ID,moviesAPI_list.get(position).getId());\n s_ratingIntent.putExtra(EXTRA_MOVIE_IMG,moviesAPI_list.get(position).getImgUrl());\n\n startActivity(s_ratingIntent);\n\n\n }", "@Override\n public void onItemClick(AdapterView<?> adapter, View item, int pos, long id) {\n Intent editIntent = new Intent(TodoListActivity.this, EditItemActivity.class);\n editIntent.putExtra(\"position\", pos);\n editIntent.putExtra(\"value\", todos.get(pos));\n\n startActivityForResult(editIntent, EDIT_ITEM_REQUEST_CODE); // brings up the second activity\n }", "@Override\n public void onClick(View v) {\n int mPosition = getLayoutPosition();\n // Use that to access the affected item in cryptoList.\n double idClicked = cryptoList.get(mPosition).market_cap_rank; //[mPosition].market_cap_rank; //get(mPosition);\n\n Intent i = new Intent(v.getContext(), Detail.class);\n i.putExtra(\"rank\", idClicked);\n v.getContext().startActivity(i);\n\n\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent resultIntent = new Intent();\n\t\t\t\tresultIntent.putExtra(\"id\", intent.getStringExtra(\"id\"));\n\t\t\t\tresultIntent.putExtra(\"position\", intent.getIntExtra(\"position\", -1));\n\t\t\t\tsetResult(RESULT_OK, resultIntent);\n\t\t\t\tfinish();\n\t\t\t}", "@Override\n public void onClick(View view) {\n\n AppCompatActivity activity =(AppCompatActivity) view.getContext();\n Intent intent = new Intent(activity.getApplicationContext(), ChooseRoomActivity.class);\n// intent.putExtra(\"InfoClickedItem\", homeItem);\n activity.startActivity(intent);\n\n }", "@Override\n public void onItemClick(int position, View v) {\n\n if (position == 0) {\n Intent intent = new Intent(getActivity(), Adorama.class);\n startActivity(intent);\n\n }\n\n if (position == 1) {\n Intent intent = new Intent(getActivity(), Apple.class);\n startActivity(intent);\n\n }\n\n if (position == 2) {\n Intent intent = new Intent(getActivity(), Craig.class);\n startActivity(intent);\n\n }\n\n if (position == 3) {\n Intent intent = new Intent(getActivity(), Frys.class);\n startActivity(intent);\n\n }\n\n if (position == 4) {\n Intent intent = new Intent(getActivity(), Rakuten.class);\n startActivity(intent);\n\n }\n\n if (position == 5) {\n Intent intent = new Intent(getActivity(), Sears.class);\n startActivity(intent);\n\n }\n\n if (position == 6) {\n Intent intent = new Intent(getActivity(), Tiger.class);\n startActivity(intent);\n\n }\n\n if (position == 7) {\n Intent intent = new Intent(getActivity(), Woot.class);\n startActivity(intent);\n\n }\n\n\n if (position == 8) {\n Intent intent = new Intent(getActivity(), Sony.class);\n startActivity(intent);\n\n }\n\n\n\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View viewClicked, int position, long id) {\n boolean connection = new ConnectionCheck().test(getApplicationContext());\n if (!connection){return;}\n// get selected product\n selectedProduct = (String) userProductGrid.getItemAtPosition(position);\n// start FetchFileActivity\n Intent i = new Intent(FetchProductActivity.this, FetchFileActivity.class);\n i.putExtra(\"userProduct\", selectedProduct);\n startActivity(i);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n Intent intent = new Intent(CuisineActivity.this,BookActivity.class);\n // Intent intent = new Intent(mContext,BookActivity.class);\n intent.putExtra(\"res_id\",restDetails.get(position).getRestId());\n intent.putExtra(\"Title\",restDetails.get(position).getRestName());\n intent.putExtra(\"Email\",restDetails.get(position).getRestEmail());\n intent.putExtra(\"Details\",restDetails.get(position).getRestAddress());\n intent.putExtra(\"thumbnail\",restDetails.get(position).getRestImage());\n intent.putExtra(\"phoneNumber\",restDetails.get(position).getRestPhone());\n intent.putExtra(\"restStatus\",restDetails.get(position).getRestStatus());\n intent.putExtra(\"openingTime\",restDetails.get(position).getRestOpeningTime());\n intent.putExtra(\"closingTime\",restDetails.get(position).getRestClosingTime());\n intent.putExtra(\"Badge\",restDetails.get(position).getRestRating());\n //intent.putExtra(\"thumbnail\",image);\n startActivity(intent);\n }", "public void onItemClick(AdapterView<?> a, View v, int position, long id) {\n Intent myIntent = new Intent(MainActivity.this, DetailActivity.class);\n myIntent.putExtra(getResources().getString(R.string.pasoDatosGasolinera), presenterGasolineras.getGasolineras().get(position));\n MainActivity.this.startActivity(myIntent);\n\n }", "@Override\r\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Item item = items.get(position);\r\n\r\n //create a bundle object and add data to present in the details activity\r\n Bundle extras = new Bundle();\r\n extras.putInt(\"image\", item.getImageResourceId());\r\n extras.putString(\"title\", item.getTitleResourceId());\r\n extras.putString(\"text\", item.getTextResourceId());\r\n\r\n //create and initialise the intent\r\n Intent detailsIntent = new Intent(getActivity(), DetailsActivity.class);\r\n\r\n //attach the bundle to the intent object\r\n detailsIntent.putExtras(extras);\r\n\r\n //start the activity\r\n startActivity(detailsIntent);\r\n\r\n }", "@Override\r\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n Item item = items.get(position);\r\n\r\n //create a bundle object and add data to present in the details activity\r\n Bundle extras = new Bundle();\r\n extras.putInt(\"image\", item.getImageResourceId());\r\n extras.putString(\"title\", item.getTitleResourceId());\r\n extras.putString(\"text\", item.getTextResourceId());\r\n\r\n //create and initialise the intent\r\n Intent detailsIntent = new Intent(getActivity(), DetailsActivity.class);\r\n\r\n //attach the bundle to the intent object\r\n detailsIntent.putExtras(extras);\r\n\r\n //start the activity\r\n startActivity(detailsIntent);\r\n\r\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {\n\n Intent intent = new Intent(MainActivity.this, ImageActivity.class);\n intent.putExtra(\"index\", i);\n startActivity(intent);\n\n }", "public void onItemClick(AdapterView<?> parent,\n View v, int position, long id){\n Intent i = new Intent(getApplicationContext(), SingleViewActivity.class);\n // Pass image index\n i.putExtra(\"id\", position);\n startActivity(i);\n }", "@Override public void onItemClick(View view, int position) {\n Details d = productList.get(position);\n Intent intent = new Intent(Dec_Col.this, Col_Description.class);\n intent.putExtra(\"Title\", d.getTitle());\n intent.putExtra(\"Desc\", d.getDesc());\n intent.putExtra(\"Long_desc\", d.getLong_desc());\n intent.putExtra(\"date\",d.getDate());\n intent.putExtra(\"img\", d.getImage());\n startActivity(intent);\n\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n String settingid = ((TextView) view.findViewById(R.id.txtsettingid)).getText().toString();\n\n Bundle dataBundle = new Bundle();\n dataBundle.putString(\"settingid\", settingid);\n\n // Starting new intent\n Intent intent = new Intent(getApplicationContext(),\n editsettingactivity.class);\n // sending settingid to next activity\n intent.putExtras(dataBundle);\n\n // starting new activity\n startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n Toast.makeText(getActivity(), String.valueOf(CusId),Toast.LENGTH_LONG).show();\n //Intent edit = new Intent(getActivity(),CustomerEdit.class);\n //edit.putExtra(\"CUSID\", String.valueOf(CusIds.get(getPosition())));\n //Log.d(\"view11\", String.valueOf(CusIds.get(getPosition())));\n\n // startActivity(edit);\n\n\n\n\n\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(context,DetailsActivity.class);\n intent.putExtra(\"commodityId\", commodityListBeanXX.getCommodityId());\n context.startActivity(intent);\n }", "@Override\n public void showDetailOrder(int position) {\n Bundle b = new Bundle();\n b.putInt(\"position\", position);\n ((MainTabActivity) getParent()).gotoActivity(\n MyMenuActivity.class, b);\n\n }", "public void handleItemClick(Integer position) {\n\n\n if(position>=mDataset.size() || position <0){\n //not valid\n }\n else {\n //go to study view for this flashcard set\n Intent intent = new Intent(this, FlashcardActivity.class);\n intent.putExtra(\"setId\", mDataset.get(position).getSetId());\n intent.putExtra(\"setName\", mDataset.get(position).getName());\n startActivity(intent);\n }\n\n\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n String selectStudent = nameArray[position];\n\n //create an Intent and attach the vars\n Intent gotoScreen2 = new Intent(MainActivity.this, second_page.class);\n\n gotoScreen2.putExtra(\"nameKey\", selectStudent);\n gotoScreen2.putExtra(\"indexKey\", position);\n\n startActivity(gotoScreen2);\n\n\n\n }", "@Override\n public void onClick(View view) {\n // Create a new intent\n Intent new_release_intent = new Intent(VietPopActivity.this, MainActivity.class);\n new_release_intent.putExtra(\"uniqueid\",\"from_viet\");\n // Start the new activity\n startActivity(new_release_intent);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n\n Intent intent = new Intent(this, RedyListproducts.class);\n intent.putExtra(\"LIST_NAME\",alSavedLists.get(position));\n startActivity(intent);\n\n }", "@Override\n public void onItemClick(AdapterView<?> arg0, View arg1, int position, long arg3) {\n Intent intent = new Intent(getActivity(), DetailsActivity.class);\n intent.putExtra(\"info\", mContactList.get(position));\n startActivity(intent);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n intent = new Intent(MainActivity.this, ViewContact.class);\n //it also sends along the ID, like ya do\n intent.putExtra(\"_id\", id);\n //and actually runs the intent\n startActivity(intent);\n }", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\tIntent intent = new Intent(context, MyNoteOneCourseDetailsActivity.class);\n\t\t\t\tintent.putExtra(\"noteList\", (Serializable)list);\n\t\t\t\tintent.putExtra(\"position\", position);\n\t\t\t\tcontext.startActivity(intent);\n\t\t\t}", "private void startRateProductAct() {\n Intent intent = new Intent(this, ReviewProductActivity.class);\n intent.putExtra(PRODUCT_IMAGE, mProductDetailsViewModel.mPrimaryImage);\n intent.putExtra(PRODUCT_COLOUR, mProductDetailsViewModel.mColor);\n intent.putExtra(PRODUCT_NAME, mBinding.tvPdpProductName.getText().toString());\n intent.putExtra(PRICE, mBinding.tvPdpProductPrice.getText().toString());\n intent.putExtra(PARENT_PRODUCT_ID, mParentProductId);\n intent.putExtra(PRODUCT_ID, mProductId);\n startActivity(intent);\n }", "@Override\n\t\t\t\t\tpublic void onClick(View v) {\n\t\t\t\t\t\tIntent intent=new Intent(getActivity(),Productdetailactivity.class);\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tintent.putExtra(\"productid\", jobject1.getString(\"Ipro_id\"));\n\t\t\t\t\t\t\tintent.putExtra(\"productname\", jobject1.getString(\"Ipro_name\"));\n\t\t\t\t\t\t\tintent.putExtra(\"buynum\",\"30天购买人数 \"+jobject1.getString(\"purchaseNum\"));\n\t\t\t\t\t\t\tintent.putExtra(\"day\", \"期限(天)\"+jobject1.getString(\"dayDiff\"));\n\t\t\t\t\t\t\tintent.putExtra(\"shouyi\", String.format(\"%.2f\", jobject1.getDouble(\"pctInterest\"))+\"%\");\n\t\t\t\t\t\t\tstartActivity(intent);\n\t\t\t\t\t\t} catch (JSONException e) {\n\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}", "@Override\n public void onItemClickListener(int position, GarageOnMap garageOnMap) {\n Intent intent = new Intent(GarageListActivity.this, ActivityGarageDetail.class);\n intent.putExtra(Contains.PREF_GARAGE_DETAIL, garageOnMap);\n startActivity(intent);\n\n }", "@Override\n public void onClick(View v) {\n Intent i = new Intent(context, Detail.class);\n i.putExtra(\"id\", id);\n i.putExtra(\"firstname\", firstname);\n i.putExtra(\"lastname\", lastname);\n i.putExtra(\"email\", email);\n i.putExtra(\"image\", image);\n context.startActivity(i);\n }", "@Override\n public void onClick(View view) {\n int type = i+1;\n Intent intent = new Intent(viewHolder.itemView.getContext(), ShowItemActivity.class);\n intent.putExtra(\"type\",String.valueOf(type));\n viewHolder.itemView.getContext().startActivity(intent);\n\n }", "@Override\n public void onClick(View v) {\n Toast.makeText(getApplicationContext(), String.valueOf(CusIds.get(getPosition())), Toast.LENGTH_LONG).show();\n Intent edit = new Intent(getApplicationContext(),CustomerEdit.class);\n edit.putExtra(\"CUSID\", String.valueOf(CusIds.get(getPosition())));\n Log.d(\"view11\", String.valueOf(CusIds.get(getPosition())));\n\n startActivity(edit);\n\n\n }", "@Override\n public void onItemClick(AdapterView<?> av, View v, int pos,\n long id) {\n Toast.makeText(getActivity(), data.get(pos).get(\"Desc\"), Toast.LENGTH_SHORT).show();\n Intent i = new Intent(getActivity(), DetailActivity.class);\n i.putExtra(\"Play\",data.get(pos).get(\"Desc\"));\n i.putExtra(\"Detail\",data.get(pos).get(\"Player\"));\n i.putExtra(\"Category\",\"Diversity\");\n i.putExtra(\"Img\",data.get(pos).get(\"Imagemain\"));\n startActivity(i);\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {\n Movie movie = mMoviesAdapter.getData().get(position);\n Intent intent = new Intent(getActivity(), MovieDetailsActivity.class)\n .putExtra(getString(R.string.movie_object_intent), movie);\n startActivity(intent);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id)\n {\n \t Toast.makeText(getApplicationContext(),\n \t\t\t ((TextView) view).getText(), Toast.LENGTH_SHORT).show();\n \t Intent intent = new Intent(getApplicationContext(), RoomActivity.class);\n \t Bundle b = new Bundle();\n \t b.putString(\"title\", ((TextView) view).getText().toString());\n \t intent.putExtras(b);\n \t view.getContext().startActivity(intent);\n }", "@Override\n public void onItemClick(AdapterView<?> arg0, View arg1,int position, long arg3)\n {\n Student stud = null;\n stud = (Student) listView.getAdapter().getItem(position);\n Intent data = new Intent(MainActivity.this, DetailActivity.class);\n data.putExtra(\"student\",stud);\n startActivity(data);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n PatientProvider obj = (PatientProvider)parent.getItemAtPosition(position);\n int pid=obj.getId();\n Intent i =new Intent(getApplicationContext(),PatientDetails.class);\n i.putExtra(\"pid\",String.valueOf(pid));\n startActivity(i);\n }", "@Override\n public void onItemClick(AdapterView<?> parent, View view,\n int position, long id) {\n int itemPosition = position;\n \n // ListView Clicked item value\n String itemValue = (String) lvView.getItemAtPosition(position);\n \n Intent newActivity;\n switch( position ) {\n case 0: \n \t \t\tnewActivity = new Intent(Recommendations.this, RecJermaineJemmott.class); \n startActivity(newActivity);\n finish();\n break;\n \n case 1: \n \t \t\tnewActivity = new Intent(Recommendations.this, RecFrankBird.class); \n startActivity(newActivity);\n finish();\n break;\n \n case 2: \n \t \t\tnewActivity = new Intent(Recommendations.this, RecLeeAsh.class); \n startActivity(newActivity);\n finish();\n break;\n \n }\n }", "@Override\n public void onClick(View view) {\n Intent intent = new Intent(parent.getContext(), CreateNewAlarm.class);\n intent.putExtra(\"index\", position);\n ((Activity)parent.getContext()).startActivityForResult(intent,\n MainActivity.EDIT_ALARM_REQUEST);\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long l) {\n posicion_click = position;\n Intent intent = new Intent(getActivity(),select.class);\n startActivity(intent);\n }", "@Override\r\n\tpublic void PressBtnCheck(int position) {\n\t\t\r\n Intent intent = new Intent(getActivity() , CheckMoreActivity.class); \r\n intent.putExtra(\"index\", position);\r\n \r\n startActivity(intent);\r\n\t}", "@Override\n public void onClick(View v) {\n\n Intent intent = new Intent(v.getContext(), DetailsDepto.class);\n Bundle extras = new Bundle();\n extras.putString(\"EXTRA_IdDepto\", listItemsInmueble.getIDDepto());\n extras.putBoolean(\"logedState\", logedIn);\n extras.putString(\"idDepto\",hasDepto);\n extras.putString(\"idUser\",idUser);\n extras.putString(\"user\", user);\n intent.putExtras(extras);\n v.getContext().startActivity(intent);\n\n\n }", "@Override\n public void onItemClick(AdapterView<?> adapterView, View view, int position, long id) {\n Cursor cursor = (Cursor) listView.getItemAtPosition(position);\n\n // Get the record's ID from this row in the database.\n int rowID = cursor.getInt(cursor.getColumnIndexOrThrow(\"_id\"));\n Log.w(TAG, \"RowID to pass to RecordScreen activity is \" + rowID);\n //Toast.makeText(getApplicationContext(), rowID, Toast.LENGTH_SHORT).show();\n\n //Starting a new Intent with Bundle\n Intent intent = new Intent(getApplicationContext(), RecordActivity.class);\n //Send the rowId to recordScreen\n intent.putExtra(\"rowID\", rowID);\n intent.putExtra(\"fromBarcode\", false);\n Log.w(TAG, \"Row ID \" + rowID + \" being sent to RECORD SCREEN activity...\");\n //Sending data to another Activity\n startActivity(intent);\n }", "@Override\n public void onComplete(RippleView rippleView) {\n\n Intent i = new Intent(context, MainTab.class);\n i.putExtra(context.getString(R.string.position), position);\n context.startActivity(i);\n\n }", "@Override\n public void onItemClick(View view, int position) {\n Intent intent = new Intent(SearchActivity.this, DetailsActivity.class);\n intent.putExtra(AppConsts.TVSHOW_TRANSFER, mSearchShowRecyclerViewAdapter.getTVShow(position));\n intent.putExtra(AppConsts.TVSHOW_TITLE, mSearchShowRecyclerViewAdapter.getTVShow(position).getName());\n startActivity(intent);\n }", "@Override\n public void onClick(View v) {\n Intent intent = new Intent(mContext,CheeseDetailActivity.class);\n intent.putExtra(CheeseDetailActivity.EXTRA_CHEESE_NAME,cheeseString);\n startActivity(intent);\n }" ]
[ "0.7951607", "0.7909762", "0.7636695", "0.7598678", "0.7583452", "0.74835724", "0.7482053", "0.7454036", "0.74418366", "0.74365664", "0.7422227", "0.7407504", "0.7405983", "0.73812336", "0.7360356", "0.73376876", "0.73335636", "0.7295153", "0.72823536", "0.72708476", "0.7263685", "0.72555655", "0.72316134", "0.722948", "0.7228949", "0.7200021", "0.7182744", "0.7180254", "0.7145197", "0.71046543", "0.70863914", "0.70735157", "0.7062293", "0.70423347", "0.70373315", "0.70356953", "0.7001202", "0.6995236", "0.6990087", "0.69636565", "0.69517535", "0.6951664", "0.6946385", "0.6937591", "0.69375664", "0.6933383", "0.693247", "0.69160146", "0.69147974", "0.6904854", "0.69017696", "0.68994087", "0.68985903", "0.68911564", "0.6871556", "0.68654555", "0.6863792", "0.6863265", "0.6850834", "0.6844236", "0.6843178", "0.68362015", "0.68284637", "0.6825807", "0.682417", "0.68179584", "0.68179584", "0.6810937", "0.67961466", "0.67953044", "0.6789507", "0.67822856", "0.6781594", "0.67742443", "0.6771988", "0.6761478", "0.6760405", "0.6758658", "0.6752508", "0.6749819", "0.67398465", "0.6736113", "0.6735706", "0.67293185", "0.67276853", "0.671277", "0.670795", "0.6707627", "0.67019624", "0.6701936", "0.6700649", "0.6698446", "0.66964406", "0.6695718", "0.6694179", "0.6686037", "0.6680643", "0.66742426", "0.6672077", "0.6670627", "0.66681254" ]
0.0
-1
EntityManagerFactory emf = Persistence.createEntityManagerFactory("facturacionPU"); EntityManager em = emf.createEntityManager();
public void guardarProducto(Producto producto, EntityManager em) { EntityTransaction etx = em.getTransaction(); try { etx.begin(); em.persist(producto); etx.commit(); } catch (Exception e) { em.getTransaction().rollback(); LOGGER.error(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "EntityManager createEntityManager();", "EMInitializer() {\r\n try {\r\n emf = Persistence.createEntityManagerFactory(\"pl.polsl_MatchStatist\"\r\n + \"icsWeb_war_4.0-SNAPSHOTPU\");\r\n em = emf.createEntityManager();\r\n } catch (Exception e) {\r\n em = null;\r\n emf = null;\r\n }\r\n\r\n }", "static EntityManager getEntityManager(){\n return ENTITY_MANAGER_FACTORY.createEntityManager();\n }", "public static void main(String[] args){\n\tEntityManagerFactory fabrica = \n\t\t\tPersistence.createEntityManagerFactory(\"CLIENTE_ORACLE\");\n\tEntityManager em = fabrica.createEntityManager();\n\t\t\t//Obter uma instancia entitymanager\n\t\n\t//Instanciar uma cerveja/refrigerante.\n\tCerveja cerv = new Cerveja(0, \"Krill\", 0.05f, 1, Calendar.getInstance(),\n\tnew GregorianCalendar(2020, Calendar.JANUARY,1), TipoCerveja.PILSEN, null, false);\n\t\n\t// Intanciar um refri\n\tRefrigerante refri = new Refrigerante(0, \"Tubaina\", SaborRefrigerante.COLA, Calendar.getInstance(), 0.05f, null);\n\t\n\t//Cadastrar a cerveja e o refri\n\tem.persist(cerv);\n\tem.persist(refri);\n\t\n\t//Transaçao\n\t//Inicializa uma transação\n\tem.getTransaction().begin();\n\tem.getTransaction().commit();\n\tem.close();\n\t\n\tSystem.out.println(\"Cerveja e refrigerante registrado\");\n\tSystem.exit(0);;\n\n}", "protected abstract EntityManagerFactory getEntityManagerFactory();", "public EmpleadoService() {\n super();\n emf = Persistence.createEntityManagerFactory(\"up_h2\");\n empDAO = new EmpleadoDAO(emf);\n }", "public static void main(String[] args) {\n\t\tEntityManagerFactory emf = Persistence.createEntityManagerFactory(\"persistence-unit\");\n\n\t}", "public EntityManagerFactory newEMFactory() {\n emFactory = Persistence.createEntityManagerFactory(\"Exercici1-JPA\");\n return emFactory;\n }", "public static void main(String[] args) {\n\t\tEntityManagerFactory emf = Persistence.createEntityManagerFactory(\"hello\"); // 1. 문제 없이 실행이 되었다면(엔티티 매니저 팩토리는 하나만 생성하고 App 전체에서 공유한다.)\n\t\t\n\t\tEntityManager em = emf.createEntityManager(); // 2. entityManager를 EntityManagerFactory에서 꺼내온다(쉽게 생각해서 DB의 connection 객체를 꺼내왔다고 보면 된다.). -> 엔티티 매니저는 서로 다른 쓰레드간에 공유해서 사용하면 안된다 특정 쓰레드에서 사용했다면 사용하고 버려야 한다.\n\t\t\n\t\tEntityTransaction tx = em.getTransaction(); // 3. 2번에서 얻어온 DB connection 객체에서 트랜잭션 하나를 얻어 온다.\n\t\t// 여기는 데이터 처리하는 곳(시작)\n\t\ttx.begin(); // 4. 트랜잭션 시작. -> jpa는 트랜잭션 안에서 작업을 해야 제대로 작동한다 트랜잭션으로 안 묶어주면 안된다(핵심).\n\t\ttry { \t\t\t\n\t\t\t\n\t\t\ttx.commit(); // 5. 정상적으로 오류없이 여기까지 왔다면 트랜잭션 커밋 .\n\t\t\t\n\t\t} catch(Exception e) { // 6. 수행 도중 오류가 있다면 트랜잭션 롤백.\n\t\t\ttx.rollback(); \n\t\t} finally { // 7. 5번을 정상적으로 수행했다면 em 객체 close\n\t\t\tem.close(); \n\t\t}\n\t\t// 여기는 데이터 처리하는 곳(끝)\n\t\temf.close(); // 8. try-catch문을 정상으로 빠져나왔따면 emf 객체 close\n\t}", "public interface EntityManagerCreator {\n EntityManager createEntityManager();\n}", "@BeforeClass\r\n public static void initTextFixture(){\r\n entityManagerFactory = Persistence.createEntityManagerFactory(\"itmd4515PU\");\r\n }", "private static void init() {\n\t\tif (factory == null) {\n\t\t\tfactory = Persistence.createEntityManagerFactory(\"hibernatePersistenceUnit\");\n\t\t}\n\t\tif (em == null) {\n\t\t\tem = factory.createEntityManager();\n\t\t}\n\t}", "@BeforeClass\n public static void initTestFixture() throws Exception {\n entityManagerFactory = Persistence.createEntityManagerFactory(\"test\");\n entityManager = entityManagerFactory.createEntityManager();\n }", "private AdminEntity() {\n \tsuper();\n\n this.emf = Persistence.createEntityManagerFactory(\"entityManager\");\n\tthis.em = this.emf.createEntityManager();\n\tthis.tx = this.em.getTransaction();\n }", "public interface IEntityManagerFactory {\r\n\r\n\t/**\r\n\t * Called when entity manager factory will help to create DAO objects.\r\n\t * \r\n\t * @return\r\n\t */\r\n\tEntityManager createEntityManager();\r\n}", "public EntityManager getEntityManager() {\n return getFactory().createEntityManager();\n }", "@Bean\n EntityManagerFactory entityManagerFactoryProvider() {\n \tEntityManagerFactory emf = Persistence.createEntityManagerFactory(DATA_SOURCE_NAME);\n return emf;\n }", "@Override\n\tpublic void contextInitialized(ServletContextEvent arg0) {\n\t\temf = Persistence.createEntityManagerFactory(\"CACIC2018\");\n\t}", "private static void init(){\n entityManager = HibernateUtil.getEntityManager();\n transaction = entityManager.getTransaction();\n }", "public static void main(String[] args) {\n EntityManagerFactory fabrica = Persistence.createEntityManagerFactory(\"oracle\");\n EntityManager em = fabrica.createEntityManager();\n\n //Instanciar um novo aluno sem o código(Estado: new - não gerenciado)\n Aluno aluno = new Aluno(\"Gabriel\", \"2TDSJ\",\n new GregorianCalendar(200, Calendar.JULY, 10), Periodo.MATUTINO, true);\n //Adiciona o aluno no contexto do Entity Manager(gerencia-lo)\n em.persist(aluno);\n //Começar com uma transação\n em.getTransaction().begin();\n //Realizar o commit\n em.getTransaction().commit();\n\n System.out.println(\"Aluno Registrado\");\n //Atualiza o valor no banco, faz um update automatico.\n aluno.setNome(\"Luiz\");\n\n ///Fechar\n em.close();\n fabrica.close();\n }", "protected EntityManager getEntityManager() {\n return emf.createEntityManager();\n }", "public static void main(String[] args) {\n\t\temf=Persistence.createEntityManagerFactory(\"aplicacion\");\r\n\t\tem=emf.createEntityManager();\r\n\t\tinsertInicial();\r\n\t\timprimirTodo();\r\n\t\tem.getTransaction().begin();\r\n\t\tEmpleado e=em.find(Empleado.class, 10l);\r\n\t\te.setApellidos(\"Rodriguez\");\r\n\t\te.setNombre(\"Laura\");\r\n\t\tem.getTransaction().commit();\r\n\t\timprimirTodo();\r\n\t\tem.close();\r\n\t}", "@Override\n\tpublic EntityManagerFactory getEntityManagerFactory() {\n\t\treturn null;\n\t}", "@Override\n public List<Paciente> listar(){\n EntityManagerFactory factory = Persistence.createEntityManagerFactory(\"vesaliusPU\"); \n EntityManager em = factory.createEntityManager();\n List<Paciente> listaPaciente = em.createQuery(\"SELECT pac FROM Paciente pac\").getResultList(); \n em.close();\n factory.close();\n return (listaPaciente);\n }", "@Before\n\tpublic void init()\n\t{\n\t\tEntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory(\"persistenceUnit\");\n\t\tEntityManager entityManager = entityManagerFactory.createEntityManager();\n\t\tcacheManager = new CacheManagerDefaultImpl();\n\t\t((CacheManagerDefaultImpl) cacheManager).setEntityManager(entityManager);\n\t}", "public void bootstrap() {\n EntityManager em = CONNECTION_FACTORY.getConnection();\n List<CaixaItemTipo> cits = new ArrayList<>();\n cits.add(CaixaItemTipo.LANCAMENTO_MANUAL);\n cits.add(CaixaItemTipo.DOCUMENTO);\n cits.add(CaixaItemTipo.ESTORNO);\n cits.add(CaixaItemTipo.TROCO);\n \n cits.add(CaixaItemTipo.SUPRIMENTO);\n cits.add(CaixaItemTipo.SANGRIA);\n \n cits.add(CaixaItemTipo.CONTA_PROGRAMADA);\n //cits.add(CaixaItemTipo.PAGAMENTO_DOCUMENTO); 2019-06-10 generalizado com tipo 2\n cits.add(CaixaItemTipo.TRANSFERENCIA);\n \n cits.add(CaixaItemTipo.FUNCIONARIO);\n \n \n em.getTransaction().begin();\n for(CaixaItemTipo cit : cits){\n if(findById(cit.getId()) == null){\n em.persist(cit);\n } else {\n em.merge(cit);\n }\n }\n em.getTransaction().commit();\n\n em.close();\n }", "private void getDepartamentos() {\n try{\n EntityManagerFactory emf = Persistence.createEntityManagerFactory(\"ServiceQualificationPU\");\n EntityManager em = emf.createEntityManager();\n\n\n String jpql =\"SELECT d FROM Departamento d \"\n + \"WHERE d.estado = 'a'\";\n\n Query query = em.createQuery(jpql);\n List<Departamento> listDepartamentos = query.getResultList();\n ArrayList<Departamento> arrayListDepartamentos = new ArrayList<>();\n for(Departamento d: listDepartamentos){\n arrayListDepartamentos.add(d);\n }\n this.Listdepartamentos = arrayListDepartamentos;\n em.close();\n emf.close();\n }\n catch(Exception e){\n System.out.println(\"ERROR: \"+e);\n this.Error = \"ERROR: \"+e;\n }\n }", "public UserDAO() {\n\t\tthis.emf = Persistence.createEntityManagerFactory(\"feedr_v3\");\n\t\tthis.em = this.emf.createEntityManager();\n\t\tthis.et = this.em.getTransaction();\n\t}", "public BookJPAImpl(TxDAOFactoryImpl factory) {\n\t\t//emf = Persistence.createEntityManagerFactory(\"sistemiDistribuitiLS\");\n\t\tthis.em = factory.getEntityManager();\n\t}", "protected abstract EntityManager getEntityManager();", "private EntityManager getEM() {\n\t\tif (emf == null || !emf.isOpen())\n\t\t\temf = Persistence.createEntityManagerFactory(PUnit);\n\t\tEntityManager em = threadLocal.get();\n\t\tif (em == null || !em.isOpen()) {\n\t\t\tem = emf.createEntityManager();\n\t\t\tthreadLocal.set(em);\n\t\t}\n\t\treturn em;\n\t}", "abstract E getEntityManager();", "@Override\n\tprotected EntityManager getEntityManager() {\n\t return em;\n\t}", "@Bean\n public LocalContainerEntityManagerFactoryBean managerFactory() {\n HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter();\n adapter.setGenerateDdl(false);\n\n Properties jpaProps = new Properties();\n jpaProps.put(\"hibernate.dialect\",\"org.hibernate.dialect.H2Dialect\");\n\n LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();\n factory.setJpaVendorAdapter(adapter);\n factory.setPackagesToScan(\"com.webmvc.mywebmvc\");\n factory.setDataSource(dataSource);\n factory.setJpaProperties(jpaProps);\n\n\n return factory;\n }", "public BOEmpresa() {\r\n\t\tdaoEmpresa = new DAOEmpresaJPA();\r\n\t}", "@Override\n protected EntityManager getEntityManager() {\n return em;\n }", "@Override\n\tpublic EntityManager getEntityManager() {\n\t return em;\n\t}", "@BeforeClass\n\tpublic static void setUpBeforeClass() throws Exception {\n\t\temf = Persistence.createEntityManagerFactory(\"si-database\");\n\t}", "public DataManager(String PUnit) throws PersistenceException {\n\t\tDataManager.PUnit = PUnit;\n\t\tif (emf == null || !emf.isOpen())\n\t\t\temf = Persistence.createEntityManagerFactory(PUnit);\n\t}", "private EntityManagerProvider(){}", "@Bean\n public LocalContainerEntityManagerFactoryBean entityManagerFactory() throws NamingException {\n LocalContainerEntityManagerFactoryBean factoryBean = new LocalContainerEntityManagerFactoryBean();\n factoryBean.setDataSource(dataSource());\n factoryBean.setPackagesToScan(new String[]{\"com.group.project.entities\"});\n factoryBean.setJpaVendorAdapter(jpaVendorAdapter());\n factoryBean.setJpaProperties(jpaProperties());\n return factoryBean;\n }", "@Bean\n\tpublic LocalContainerEntityManagerFactoryBean entityManagerFactory() {\n\t\tLocalContainerEntityManagerFactoryBean entityManagerFactory = new LocalContainerEntityManagerFactoryBean();\n\t\tentityManagerFactory.setDataSource(dataSource());\n\t\t// Classpath scanning of @Component, @Service, etc annotated class\n\t\tentityManagerFactory.setPackagesToScan(\"com.jpa\");\n\t\t// Vendor adapter\n\t\tHibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();\n\t\tentityManagerFactory.setJpaVendorAdapter(vendorAdapter);\n\t\t// Hibernate properties\n\t\tProperties additionalProperties = new Properties();\n\t\tadditionalProperties.put(\"hibernate.show_sql\", \"true\");\n\t\tadditionalProperties.put(\"hibernate.hbm2ddl.auto\", \"none\");\n\t\tadditionalProperties.put(\"hibernate.jdbc.batch_size\", \"10\");\n\t\tadditionalProperties.put(\"hibernate.order_inserts\", \"true\");\n\t\tadditionalProperties.put(\"hibernate.order_updates\", \"true\");\n\t\tadditionalProperties.put(\"hibernate.jdbc.batch_versioned_data\", \"true\");\n\t\tentityManagerFactory.setJpaProperties(additionalProperties);\n\t\treturn entityManagerFactory;\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tEntityManagerFactory fabrica = Persistence.createEntityManagerFactory(\"mysql\");\n\t\t\n\t\tEntityManager em = fabrica.createEntityManager();\n\t\t\n\t\tProducto p=em.find(Producto.class, \"P0031\");\n\t\t\n\t\tif(p==null) {\n\t\t\tSystem.out.println(\"Producto no Existe\");\n\t\t}else {\n\t\t\tSystem.out.println(\"Producto Encontrado : \"+p.getDescrip());\n\t\t\tSystem.out.println(p);\n\t\t}\n\t\tem.close();\n\n\t}", "@BeforeEach\n void init() {\n\n EntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory(\"pu\");\n employeeDao = new EmployeeDao(entityManagerFactory);\n\n\n }", "public abstract void setEntityManager(EntityManager em);", "public static void main(String[] args) {\n\t\tEntityManagerFactory emf = Persistence.createEntityManagerFactory(\"exemploPU\");\n\t\t//serviço central para todas as ações de persistência. Para funcionar devo criar primeiro o EntityManagerFactory\n\t\tEntityManager em = emf.createEntityManager();\n\t\t\n\t\t\n\t\t//toda vez ao inicializar um banco de dados, deve iniciar uma transação\n\t\t// o begin faz isso e atualiza o banco de dados depois deve usar o commit para commitar a transação.\n\t\tCliente cliente = new Cliente();\n\n\t\tcliente.setNome(\"Souza Passos\");\n\t\tcliente.setIdade(14);\n\t\tcliente.setSexo(\"M\");\n\t\tcliente.setProfissao(\"DEV\");\n\t\t\n\t\tem.getTransaction().begin();\n\t\tem.persist(cliente);\n\t\tem.getTransaction().commit();\n\t\t\n\t\tSystem.out.println(\"Cliente salvo com sucesso!!!\");\n\t}", "public static EntityManagerFactory getEntityManagerFactory()\n\t\t\tthrows PersistenceException, UnsupportedUserAttributeException, NamingException {\n\t\tif (emf == null)\n\t\t\temf = createNewEntityManagerFactory();\n\t\treturn emf;\n\t}", "public static EntityManagerFactory getConnection() {\r\n return emf;\r\n }", "@Override\n\tprotected EntityManager getEntityManager() {\n\t\treturn em;\n\t}", "@Override\n\tprotected EntityManager getEntityManager() {\n\t\treturn em;\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 }", "public static void main(String[] args) {\n EntityManagerFactory emf = Persistence.createEntityManagerFactory(\"JPA1\");\n EntityManager em = emf.createEntityManager();\n em.getTransaction().begin();\n Book b = new Book();\n Book c = new Book(\"ongo\");\n b.setTitle(\"hej\");\n em.persist(b);\n em.persist(c);\n Customer cu = new Customer(\"Allan\", \"Madsen\", CustomerType.RUSTY);\n em.persist(cu);\n Query a = em.createQuery(\"SELECT * FROM Customer WHERE ID = 1\");\n System.out.println(a.getParameter(\"FIRSTNAME\"));\n // Bør man ikke hente en kunde ud og tilføje en enum til den specefikke bruger.\n em.getTransaction().commit();\n\n }", "@Override\n\t@PersistenceContext(unitName=\"PU-POC\")\t\n\tpublic void setEntityManager(EntityManager entityManager) {\n\t\tsuper.setEntityManager(entityManager);\n\t}", "@PersistenceContext(unitName=\"microrest-persistence\")\n public void setPersistenceContext(EntityManager em)\n {\n this.em = em;\n }", "public static void main(String[] args) {\n\t\tEntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory(\"pu_essai\");\r\n\t\tEntityManager em = entityManagerFactory.createEntityManager();\r\n\t\t/*\r\n\t\t * Livre l = em.find(Livre.class, 1); if (l != null){\r\n\t\t * System.out.println(l.getId() + \" \" + l.getTitre() + \" \" +\r\n\t\t * l.getAuteur()); } TypedQuery<Livre> query2 =\r\n\t\t * em.createQuery(\"select l from Livre l where l.titre='Germinal'\",\r\n\t\t * Livre.class); Livre l2 = query2.getResultList().get(0);\r\n\t\t * System.out.println(l2.getId() + \" \" + l2.getTitre() + \" \" +\r\n\t\t * l2.getAuteur());\r\n\t\t */\r\n\t\tQuery query3 = em.createQuery(\"select e.livres from Emprunt e where e.id=1\");\r\n\t\tList<Livre> result = query3.getResultList();\r\n\t\tfor (Livre l : result) {\r\n\t\t\tSystem.out.println(l.getId() + \" \" + l.getTitre() + \" \" + l.getAuteur());\r\n\t\t}\r\n\t\tTypedQuery<Emprunt> query4 = em.createQuery(\"select e from Emprunt e where e.client=3\", Emprunt.class);\r\n\t\tquery4.getResultList().forEach(e -> System.out.println(e.getId() + \" \" + e.getDate_debut() + \" \" + e.getDate_fin()));\r\n\t\tem.close();\r\n\t\tentityManagerFactory.close();\r\n\t}", "@Override\n public EntityManager getEntityManager() {\n return entityManager;\n }", "public static void main(String[] args) {\n EntityManagerFactory emf = Persistence.createEntityManagerFactory(\"pu\");\n EntityManager em = emf.createEntityManager();\n EmployeeFacade facade = new EmployeeFacade(emf);\n\n try {\n em.getTransaction().begin();\n Employee employee1 = new Employee(\"Aske\", \"Sydhavn\", 2000);\n Employee employee2 = new Employee(\"Jens\", \"Skoven\", 10);\n em.persist(employee1);\n em.persist(employee2);\n em.getTransaction().commit();\n System.out.println(\"Customer: \" + facade.findEmployeeByName(\"Aske\"));\n // System.out.println(facade.getNumberOfCustomers());\n System.out.println(facade.getAllEmployees().size());\n // System.out.println(facade.findCustomer(1));\n\n } finally {\n em.close();\n }\n\n }", "public static void main(String[] args) {\n\t\tEntityManagerFactory fabrica = Persistence.createEntityManagerFactory(\"mysql\");\n\t\t// 2. crea el manejador de entidades\n\t\tEntityManager em = fabrica.createEntityManager();\n\t\t\n\t\t//--proceso:obtener listar usuario\n\t\tSystem.out.println(\"Listado de los usuarios\");\n\t\t\n\t\tString sql=\"select u from Usuario u\";//JPA u.codigo, u.etc\n\t\t\n\t\tList<Usuario>lstUsuario = em.createQuery(sql,Usuario.class).getResultList();\n\t\t\n\t\tSystem.out.println(\"Cantidad de usuarios: \"+ lstUsuario.size());//para ver cantidad\n\t\t//para imprimir en consola el listado\n\t\tfor(Usuario u:lstUsuario) {\n\t\t\tSystem.out.println(\">>> \"+u);\n\t\t}\n\t\t\n\t\t/////////////////listado por tipo (where)////////////////////////\n\t\tSystem.out.println(\"Listado de los usuarios por tipo\");\n\t\t\n\t\tString sql2=\"select u from Usuario u where u.tipo= :xtipo\";//JPA se usa la variable de la clase y se setea una variable con setParameter\n\t\t\n\t\tTypedQuery<Usuario> query = em.createQuery(sql2,Usuario.class);//para setear varias variables en listar\n\t\tquery.setParameter(\"xtipo\", 1);\n\t\tList<Usuario>lstUsuarioxtipo = query.getResultList();\n\t\t\n\t\tSystem.out.println(\"Cantidad de usuarios: \"+ lstUsuarioxtipo.size());//para ver cantidad\n\t\t//para imprimir en consola el listado\n\t\tfor(Usuario u:lstUsuarioxtipo) {\n\t\t\tSystem.out.println(\">>> \"+u);\n\t\t}\n\t\tem.close();\n\t\t\n\t}", "@Test\n public void createQuejaEntityTest() {\n PodamFactory factory = new PodamFactoryImpl();\n QuejaEntity newEntity = factory.manufacturePojo(QuejaEntity.class);\n QuejaEntity result = quejaPersistence.create(newEntity);\n\n Assert.assertNotNull(result);\n QuejaEntity entity = em.find(QuejaEntity.class, result.getId());\n Assert.assertNotNull(entity);\n Assert.assertEquals(newEntity.getName(), entity.getName());\n}", "@Override\n\tpublic void contextInitialized(ServletContextEvent arg0) {\n\t\tfactory = Persistence.createEntityManagerFactory(\"Test\");\n\t\tServletContext sc = arg0.getServletContext();\n\t\tsc.setAttribute(EntityManagerFactory.class.getName(), factory);\n\t}", "private static EntityManagerFactory createNewEntityManagerFactory()\n\t\t\tthrows NamingException, PersistenceException, UnsupportedUserAttributeException {\n\n\t\tInitialContext ctx = new InitialContext();\n\t\tDataSource ds = (DataSource) ctx.lookup(DATA_SOURCE_NAME);\n\n\t\tMap<String, Object> properties = new HashMap<String, Object>();\n\t\tproperties.put(PersistenceUnitProperties.NON_JTA_DATASOURCE, ds);\n\n\t\t// As replication will change the underlying database without\n\t\t// notifying the hub the JPA cache needs to be disabled.\n\t\t// Else the hub might provide outdated data\n\t\tproperties.put(PersistenceUnitProperties.CACHE_SHARED_DEFAULT, \"false\");\n\n\t\treturn Persistence.createEntityManagerFactory(PERSISTENCE_UNIT_NAME, properties);\n\t}", "public EntidadFinancieraDAO(EntityManager entityManager) {\r\n\t\tthis.entityManager = entityManager;\r\n\t}", "@Bean\n\tpublic LocalContainerEntityManagerFactoryBean entityManagerFactory() {\n\t\tLocalContainerEntityManagerFactoryBean entityManagerFactory = new LocalContainerEntityManagerFactoryBean();\n\t\tentityManagerFactory.setDataSource(dataSource);\n\t\tentityManagerFactory.setJpaDialect(hibernateJpaDialect());\n\t\tentityManagerFactory.setJpaVendorAdapter(hibernateJpaVendorAdapter());\n\t\tentityManagerFactory.setJpaProperties(getJpaProperties());\n\t\tentityManagerFactory.setPackagesToScan(\"com.bouacheria.ami.domain\");\n\t\treturn entityManagerFactory;\n\t}", "@Override\n\tprotected EntityManager getEntityManager() {\n\t\treturn entityManager;\n\t}", "public static EntityManager getEntityManager() {\n EntityManager em = tl.get();\n return em;\n }", "public EntityManager getEntityManager() {\n return this.em;\n }", "DAOClienteJPA(EntityManager entity) {\r\n this.entity = entity;\r\n }", "@PersistenceContext\n public void setEntityManager(EntityManager em) {\n this.em = em;\n }", "@PersistenceContext\n public void setEntityManager(EntityManager em) {\n this.em = em;\n }", "@PersistenceContext\n public void setEntityManager(EntityManager em) {\n this.em = em;\n }", "@Override\n public void salvar(Object pacienteParametro) {\n Paciente paciente;\n paciente = (Paciente) pacienteParametro;\n EntityManagerFactory factory = Persistence.createEntityManagerFactory(\"vesaliusPU\"); \n EntityManager em = factory.createEntityManager();\n em.getTransaction().begin();\n if(paciente.getIdPaciente() == 0){\n em.persist(paciente);\n }else{\n em.merge(paciente);\n }\n em.getTransaction().commit();\n em.close();\n factory.close();\n }", "public static void main(String[] args) {\r\n\t\tAnnotationConfigApplicationContext appContext = new AnnotationConfigApplicationContext(ApplicationConfig.class);\r\n appContext.scan(\"com.capgemini.beans.Employee\");\r\n // appContext.refresh();\r\n \r\n\t\t\r\n\t\t EntityManagerFactory factory =\r\n\t\t Persistence.createEntityManagerFactory(\"JPA-PU\"); EntityManager em =\r\n\t\t factory.createEntityManager(); em.getTransaction().begin();\r\n\t\t //begin the operations.\r\n\t\t\r\n \r\n\t\tEmployee emp= (Employee) appContext.getBean(Employee.class);\r\n\t\t emp.setId(101);\r\n\t\t emp.setName(\"priya\");\r\n\t\t emp.getId();\r\n\t\t emp.getName();\r\n\t\t em.persist(emp); \r\n\t\t em.getTransaction().commit();\r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t \r\n\t\t\r\n\t}", "public void create(Membre membre) {\n try {\n// em = getEntityManager();\n// entManager.getTransaction().begin();\n entManager.persist(membre);\n// entManager.getTransaction().commit();\n } finally {\n// if (entManager.getTransaction() != null) {\n// entManager.close();\n// }\n }\n }", "public List<Soldados> conectar(){\n EntityManagerFactory conexion = Persistence.createEntityManagerFactory(\"ABP_Servicio_MilitarPU\");\n //creamos una instancia de la clase controller\n SoldadosJpaController tablasoldado = new SoldadosJpaController(conexion);\n //creamos una lista de soldados\n List<Soldados> listasoldado = tablasoldado.findSoldadosEntities();\n \n return listasoldado;\n }", "public EntityManager getEntityManager() {\r\n return entityManager;\r\n }", "private List<Produto> retornaProduto (Long cod){\n \n Query q = entityManager.createNamedQuery(\"Produto.findByCodigo\");\n q.setParameter(\"codigo\", cod);\n List <Produto> p = q.getResultList();\n return p; \n}", "@Test\n public void testGetEntityManager() {\n System.out.println(\"getEntityManager\");\n DaftarPengguna instance = new DaftarPengguna();\n EntityManager expResult = null;\n EntityManager result = instance.getEntityManager();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "@PersistenceContext\r\n public void setEntityManager(EntityManager em) {\r\n this.em = em;\r\n }", "@Before\n\tpublic void setUp() throws Exception {\n\t\ttry {\n\t\t\temf = Persistence.createEntityManagerFactory(\"DistribSubastaCoreEM\");\n\t\t dao.setEm(emf.createEntityManager());\n\t\t dao.getEm().setFlushMode(FlushModeType.COMMIT);\n\t\t dao.getEm().getEntityManagerFactory().getCache().evictAll();\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\tfail();\n\t\t}\n\t}", "javax.management.ObjectName getPersistenceManager();", "public static Prestamo createEntity(EntityManager em) {\n Prestamo prestamo = new Prestamo().observaciones(DEFAULT_OBSERVACIONES).fechaFin(DEFAULT_FECHA_FIN);\n // Add required entity\n Libro libro;\n if (TestUtil.findAll(em, Libro.class).isEmpty()) {\n libro = LibroResourceIT.createEntity(em);\n em.persist(libro);\n em.flush();\n } else {\n libro = TestUtil.findAll(em, Libro.class).get(0);\n }\n prestamo.setLibro(libro);\n // Add required entity\n Persona persona;\n if (TestUtil.findAll(em, Persona.class).isEmpty()) {\n persona = PersonaResourceIT.createEntity(em);\n em.persist(persona);\n em.flush();\n } else {\n persona = TestUtil.findAll(em, Persona.class).get(0);\n }\n prestamo.setPersona(persona);\n // Add required entity\n User user = UserResourceIT.createEntity(em);\n em.persist(user);\n em.flush();\n prestamo.setUser(user);\n return prestamo;\n }", "@PersistenceContext\r\n\tpublic void setEntityManager(EntityManager em) {\r\n\t\tthis.em = em;\r\n\t}", "public void setEntityManager(EntityManager em) {\n this.em = em;\n }", "public static void main(String[] args) {\n\n\t\tEntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory(\"banque\");\n\t\tEntityManager em = entityManagerFactory.createEntityManager();\n\t\t\n\t\tEntityTransaction et = em.getTransaction();\n\t\tet.begin();\n\t\t\n\t\tAssuranceVie av = new AssuranceVie();\n\t\t\n\t\tem.persist(av);\n\t\t\n\t\tet.commit();\n\t\tem.close();\n\t}", "public static void main(String[] args) {\n\t\tUser user = new User(); \n//\t\tuser.setId(900);//Ä~©ÓUserÃþ§O«á·sŒWžê®Æ\n\t\tuser.setName(\"abf\");//Ä~©ÓUserÃþ§O«á·sŒWžê®Æ\n\n\t\tEntityManagerFactory emf = Persistence.createEntityManagerFactory(\"jpa.test\");\n\t\tEntityManager em = emf.createEntityManager();\n\t\tEntityTransaction tx = em.getTransaction();\n\t\ttx.begin();\t\n\t\tem.persist(user);\t\t\n\t\ttx.commit();\n//\t\tuser = em.find(table_test.class, 15); //³z¹LId·jŽMSQLžê®Æ\n\t\tem.close();\n\t\n//\t\tSystem.out.println(user.getId());\n//\t\tSystem.out.println(user.getName());\n\t}", "public static PersistenceUnit createPersistenceUnit(Project project, DatabaseConnection connection) throws IOException, InvalidPersistenceXmlException {\n FileObject persistenceXML = ProviderUtil.getDDFile(project);\n Persistence persistence = PersistenceMetadata.getDefault().getRoot(persistenceXML);\n String dbURL = connection.getDatabaseURL();\n \n // Determine name of the PU\n String dbName = dbURL.substring(dbURL.lastIndexOf('/')+1);\n String puName = dbName + \"PU\"; // NOI18N\n PersistenceUnit unit = findPersistenceUnit(persistence, puName);\n int count = 0;\n while (unit != null) {\n count++;\n puName = dbName + \"PU\" + count; // NOI18N\n unit = findPersistenceUnit(persistence, puName);\n }\n\n // Determine the provider\n Provider provider;\n if (persistence.getPersistenceUnit().length > 0) {\n // Use the same provider as the existing persistence unit\n provider = ProviderUtil.getProvider(persistence.getPersistenceUnit(0));\n } else {\n // The first persistence unit - use EclipseLink provider\n // (it is delivered as a part of NetBeans J2EE support)\n provider = ProviderUtil.ECLIPSELINK_PROVIDER3_1;\n }\n\n unit = ProviderUtil.buildPersistenceUnit(puName, provider, connection, persistence.getVersion());\n unit.setTransactionType(\"RESOURCE_LOCAL\"); // NOI18N\n\n // TopLink(Eclipselink may too, TODO: verify)/Derby combination doesn't like empty username and password,\n // but we can use dummy (app/app) values in this case, see issue 121427.\n if ((nullOrEmpty(connection.getUser()) || nullOrEmpty(connection.getPassword()))\n && (ProviderUtil.TOPLINK_PROVIDER1_0.equals(provider)\n || ProviderUtil.ECLIPSELINK_PROVIDER3_1.equals(provider)\n || ProviderUtil.ECLIPSELINK_PROVIDER3_0.equals(provider)\n || ProviderUtil.ECLIPSELINK_PROVIDER2_2.equals(provider)\n || ProviderUtil.ECLIPSELINK_PROVIDER2_1.equals(provider)\n || ProviderUtil.ECLIPSELINK_PROVIDER2_0.equals(provider))\n && connection.getDriverClass().startsWith(\"org.apache.derby.jdbc.\")) { // NOI18N\n String userPropName = provider.getJdbcUsername();\n String passwdPropName = provider.getJdbcPassword();\n for (Property prop : unit.getProperties().getProperty2()) {\n String propName = prop.getName();\n if ((userPropName.equals(propName) || passwdPropName.equals(propName)) && nullOrEmpty(prop.getValue())) {\n prop.setValue(\"app\"); // NOI18N\n }\n }\n }\n\n // Java Embedded DB, see issue 121391\n if (\"org.apache.derby.jdbc.EmbeddedDriver\".equals(connection.getDriverClass())) { // NOI18N\n // Make sure tables are created if they do not exist\n ProviderUtil.setTableGeneration(unit, Provider.TABLE_GENERATION_CREATE, provider);\n // Make sure the DB is created if it does not exist\n if (!dbURL.contains(\";create=true\")) { // NOI18N\n if (!dbURL.endsWith(\";\")) { // NOI18N\n dbURL += \";\"; // NOI18N\n }\n dbURL += \"create=true\"; // NOI18N\n Property prop = ProviderUtil.getProperty(unit, provider.getJdbcUrl());\n if (prop != null) {\n prop.setValue(dbURL);\n }\n }\n }\n ProviderUtil.addPersistenceUnit(unit, project);\n\n return unit;\n }", "public RequisicaoDAO() {\n em = JPAUtil.initConnection();\n }", "public static Emprunt createEntity(EntityManager em) {\n Emprunt emprunt = new Emprunt()\n .dateEmprunt(DEFAULT_DATE_EMPRUNT)\n .dateRetour(DEFAULT_DATE_RETOUR);\n // Add required entity\n Usager usager = UsagerResourceIntTest.createEntity(em);\n em.persist(usager);\n em.flush();\n emprunt.setUsager(usager);\n // Add required entity\n Exemplaire exemplaire = ExemplaireResourceIntTest.createEntity(em);\n em.persist(exemplaire);\n em.flush();\n emprunt.setExemplaire(exemplaire);\n return emprunt;\n }", "public static void main(String[] args)\r\n\t{\n\t\tEntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory(\"Test\");\r\n\t\tEntityManager entityManager =entityManagerFactory.createEntityManager();\r\n\t \r\n\r\n\t\t//Movie m = entityManager.find(Movie.class, 100);\r\n\t\tMovie m = entityManager.getReference(Movie.class, 100);\r\n\t\t\r\n\t\t//Movie m1 = entityManager.getReference(Movie.class, 99);\r\n\t\tSystem.out.println(m.getClass());\r\n\t\t\r\n\t\tSystem.out.println(m.getMid());\r\n\t\tSystem.out.println(m.getMname());\r\n\t\tSystem.out.println(m.getRating());\r\n\t\t\r\n\t\tentityManager.close();\r\n\t}", "@Override\n\tprotected EntityManager getEntityManager() {\n\t\treturn null;\n\t}", "public static void main(String[] args) {\n\t\t\n\t\tUserDetail userDetail = new UserDetail();\n\t\tuserDetail.setName(\"Priyanka\");\n\t\tuserDetail.setContact(\"8827611875\");\n\t\t\n\t\tEntityManagerFactory entityManagerFactory = Persistence.createEntityManagerFactory(\"JPA-PU\");\n\t\tEntityManager entityManager = entityManagerFactory.createEntityManager();\n\t\tentityManager.getTransaction().begin();\n\t\tentityManager.persist(userDetail);\n\t\tentityManager.getTransaction().commit();\n\t\tentityManager.close();\n\t\tentityManagerFactory.close();\n\t\t\t\t\n\t}", "@Bean\n @Autowired\n public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource datasource) {\n\n LocalContainerEntityManagerFactoryBean entityManagerFactory = new LocalContainerEntityManagerFactoryBean();\n\n entityManagerFactory.setDataSource(dataSource());\n entityManagerFactory.setPackagesToScan(\"com.emergya.sss3E.persistence.model\");\n\n HibernateJpaVendorAdapter jpaVendorAdapter = new HibernateJpaVendorAdapter();\n\n jpaVendorAdapter.setGenerateDdl(true);\n\n entityManagerFactory.setJpaVendorAdapter(jpaVendorAdapter);\n\n entityManagerFactory.setJpaProperties(jpaProperties());\n\n return entityManagerFactory;\n }", "@Bean\n\tpublic LocalContainerEntityManagerFactoryBean entityManagerFactory() {\n\t\tProperties jpaProperties = new Properties();\n\t\tjpaProperties.put(org.hibernate.cfg.AvailableSettings.HBM2DDL_AUTO, this.env.getProperty(\"hibernate.hbm2ddl.auto\"));\n\t\tjpaProperties.put(org.hibernate.cfg.AvailableSettings.CACHE_REGION_FACTORY, SingletonEhCacheRegionFactory.class.getCanonicalName());\n\t\tjpaProperties.put(\"hibernate.cache.use_structured_entries\", Boolean.TRUE);\n\t\tjpaProperties.put(\"hibernate.cache.use_second_level_cache\", Boolean.TRUE);\n\n\t\tHibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();\n\t\tvendorAdapter.setGenerateDdl(Boolean.valueOf(this.env.getProperty(\"hibernate.ddl_create\")).booleanValue());\n\t\tvendorAdapter.setShowSql(Boolean.valueOf(this.env.getProperty(\"hibernate.show_sql\")).booleanValue());\n\t\tvendorAdapter.getJpaPropertyMap().put(\"databasePlatform\", this.env.getProperty(\"hibernate.dialect\"));\n\n\t\tLocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();\n\t\tfactory.setDataSource(this.dataSource());\n\t\tfactory.setJpaVendorAdapter(vendorAdapter);\n\t\tfactory.setPackagesToScan(PersistenceConfiguration.ENTITIES_PACKAGE);\n\t\tfactory.setJpaProperties(jpaProperties);\n\t\tfactory.afterPropertiesSet();\n\t\tfactory.setLoadTimeWeaver(new InstrumentationLoadTimeWeaver());\n\t\tfactory.setPersistenceProvider(new HibernatePersistenceProvider());\n\n\t\treturn factory;\n\t}", "@Override\n public void deletar(Object pacienteParametro) {\n Paciente paciente;\n paciente = (Paciente) pacienteParametro;\n EntityManagerFactory factory = Persistence.createEntityManagerFactory(\"vesaliusPU\"); \n EntityManager em = factory.createEntityManager();\n em.getTransaction().begin();\n em.remove(em.merge(paciente));\n em.getTransaction().commit();\n em.close();\n factory.close();\n }", "public void initPersistence (){\n\t\tif (!this._onAppInit){\n\t\t\t/*\n\t\t\t * Evita stackoverflow\n\t\t\t */\n\t\t\tcloseActiveStoreData ();\n\t\t}\n\t\tsetDatastoreProperties ();\n\t\tfinal Properties properties = this._dataStoreEnvironment.getDataStoreProperties ();\n\t\tfinal PersistenceManagerFactory pmf =\n\t\t\t\t\t JDOHelper.getPersistenceManagerFactory(properties);\n\t\t\n//\t\tSystem.out.println (\"Setting persistent manager from \"+properties);\n\t\t\n\t\tthis.pm = pmf.getPersistenceManager();\n\t\t\n\t\tif (this.pm.currentTransaction().isActive ()){\n\t\t\tthis.pm.currentTransaction().commit();\n\t\t}\n\t\tthis.pm.currentTransaction().setOptimistic (false);\n//\t\tthis.pm.currentTransaction().begin();\n\t}", "public String crearProducto(String id, String nombre, String precio, String idCategoria, \n String estado, String descripcion) {\n \n String validacion = \"\";\n if (verificarCamposVacios(id, nombre, precio, idCategoria, estado, descripcion) == false) {\n //Se crea en EntityManagerFactory con el nombre de nuestra unidad de persistencia\n EntityManagerFactory emf = Persistence.createEntityManagerFactory(\"SG-RESTPU\");\n //se crea un objeto producto y se le asignan sus atributos\n if (verificarValoresNum(id,precio,idCategoria)) {\n //Se crea el controlador de la categoria del producto\n CategoriaProductoJpaController daoCategoriaProducto = new CategoriaProductoJpaController(emf);\n CategoriaProducto categoriaProducto = daoCategoriaProducto.findCategoriaProducto(Integer.parseInt(idCategoria));\n //se crea el controlador del producto \n ProductoJpaController daoProducto = new ProductoJpaController(emf);\n Producto producto = new Producto(Integer.parseInt(id), nombre);\n producto.setPrecio(Long.parseLong(precio));\n producto.setIdCategoria(categoriaProducto);\n producto.setDescripcion(descripcion);\n producto.setFotografia(copiarImagen());\n if (estado.equalsIgnoreCase(\"Activo\")) {\n producto.setEstado(true);\n } else {\n producto.setEstado(false);\n }\n try {\n if (ExisteProducto(nombre) == false) {\n daoProducto.create(producto);\n deshabilitar();\n limpiar();\n validacion = \"El producto se agrego exitosamente\";\n } else {\n validacion = \"El producto ya existe\";\n }\n } catch (NullPointerException ex) {\n limpiar();\n } catch (Exception ex) {\n Logger.getLogger(Gui_empleado.class.getName()).log(Level.SEVERE, null, ex);\n }\n } else {\n validacion = \"El campo id, precio, idCategoria deben ser numéricos\";\n }\n } else {\n validacion = \"Llene los datos obligatorios\";\n }\n return validacion;\n }", "@Bean(name = \"serviceEntityManagerFactory\")\n public LocalContainerEntityManagerFactoryBean serviceEntityManagerFactory() {\n final LocalContainerEntityManagerFactoryBean bean = new LocalContainerEntityManagerFactoryBean();\n\n bean.setJpaVendorAdapter(jpaServiceVendorAdapter());\n bean.setPersistenceUnitName(\"jpaServiceRegistryContext\");\n bean.setPackagesToScan(jpaServicePackagesToScan());\n bean.setDataSource(dataSourceService());\n\n final Properties properties = new Properties();\n properties.put(\"hibernate.dialect\", this.hibernateDialect);\n properties.put(\"hibernate.hbm2ddl.auto\", this.hibernateHbm2DdlAuto);\n properties.put(\"hibernate.jdbc.batch_size\", this.hibernateBatchSize);\n bean.setJpaProperties(properties);\n return bean;\n }", "protected abstract void createDatabaseData(EntityManager entityManager);", "protected EntityManager getEntityManager() {\n return em;\n }", "public void setEntityManager(EntityManager em) {\n\t\tthis.em = em;\n\t}" ]
[ "0.778156", "0.7299347", "0.718167", "0.689175", "0.6785555", "0.67158735", "0.6715575", "0.6668984", "0.6625837", "0.658827", "0.6578557", "0.65609664", "0.6461624", "0.6447879", "0.6391606", "0.6388376", "0.6329028", "0.6308923", "0.6295238", "0.6278684", "0.62422305", "0.62339616", "0.6233533", "0.62314135", "0.62241143", "0.61964417", "0.618366", "0.6175506", "0.6168837", "0.6161679", "0.6153227", "0.61433625", "0.6142717", "0.6127771", "0.61216885", "0.6114027", "0.60999525", "0.6093842", "0.6089315", "0.60860693", "0.60851985", "0.6061603", "0.6051146", "0.6049652", "0.6046369", "0.6035699", "0.6029022", "0.600967", "0.60082966", "0.60082966", "0.5989485", "0.59812295", "0.5978418", "0.5975452", "0.5971279", "0.5971205", "0.59679127", "0.595394", "0.59524375", "0.5931778", "0.59210056", "0.5883918", "0.58753425", "0.5874545", "0.58742154", "0.5870246", "0.58653444", "0.58592474", "0.58592474", "0.58592474", "0.5855147", "0.5849566", "0.5830993", "0.58280265", "0.5827043", "0.58197165", "0.5809965", "0.5786377", "0.5785503", "0.5773542", "0.57674205", "0.5733399", "0.5730262", "0.57275474", "0.5725577", "0.57203597", "0.5718101", "0.570444", "0.5696698", "0.5684491", "0.56774676", "0.5667528", "0.56662697", "0.56453854", "0.564363", "0.5642925", "0.56320834", "0.56300944", "0.56293035", "0.56191015" ]
0.56985146
88
creates a new parser object for the given file
public SqlFileParser(File sqlScript) { try { this.reader = new BufferedReader(new FileReader(sqlScript)); } catch (FileNotFoundException e) { throw new IllegalArgumentException("file not found " + sqlScript); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public JsonParser createParser(File f)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 755 */ IOContext ctxt = _createContext(f, true);\n/* 756 */ InputStream in = new FileInputStream(f);\n/* 757 */ return _createParser(_decorate(in, ctxt), ctxt);\n/* */ }", "public Parser(File file) {\n \t\t\ttry {\n \t\t\t\tload(new FileInputStream(file));\n \t\t\t} catch (Exception e) {\n \t\t\t\t// continue ... actual parsing will report errors\n \t\t\t}\n \t\t}", "Object create(File file) throws IOException, SAXException, ParserConfigurationException;", "public void initParser(String file) {\n if (checkFileExists(file)) {\n parseXml(file);\n }\n }", "Parse createParse();", "public void parse(String filename);", "public PragyanXmlParser(InputStream file) {\r\n\t\tfileToParse = file;\r\n\t\tcharWriter = new CharArrayWriter();\r\n\t\tdateWriter = new CharArrayWriter();\r\n\t\tformat = new SimpleDateFormat(\"dd-MM-yyyy HH:mm\"); \r\n\t\t\r\n\t}", "public Parser( File inFile ) throws FileNotFoundException\r\n {\r\n if( inFile.isDirectory() )\r\n throw new FileNotFoundException( \"Excepted a file but found a directory\" );\r\n \r\n feed = new Scanner( inFile );\r\n lineNum = 1;\r\n }", "private static Parser<Grammar> makeParser(final File grammar) {\n try {\n\n return Parser.compile(grammar, Grammar.ROOT);\n\n // translate these checked exceptions into unchecked\n // RuntimeExceptions,\n // because these failures indicate internal bugs rather than client\n // errors\n } catch (IOException e) {\n throw new RuntimeException(\"can't read the grammar file\", e);\n } catch (UnableToParseException e) {\n throw new IllegalArgumentException(\"the grammar has a syntax error\", e);\n }\n }", "public FitnessParser getParser(UploadedFile file ) throws IOException {\n\t\tInputStream stream = file.getInputstream();\n\t\tStringWriter sw = new StringWriter();\n\t\tIOUtils.copy(stream, sw);\n\t\tStringReader sr = new StringReader(sw.toString());\n\t\tBufferedReader br = new BufferedReader(sr);\n\t\t\n\t\tString firstLine = br.readLine();\n\t\tif(firstLine == null) {\n\t\t\tFacesMessage msg = new FacesMessage( FacesMessage.SEVERITY_ERROR, \"Error\", \"Invalid File\" );\n\t\t\tFacesContext.getCurrentInstance().addMessage( null, msg );\n\t\t\treturn null;\n\t\t} \n\t\tFitnessParser ret = null;\n\t\tif(checkFitbitFile(firstLine)) {\n\t\t\tret = new FitbitParser(file);\n\t\t} else if (checkMicrosoftFile(firstLine)) {\n\t\t\tret = new MicrosoftParser(file);\n\t\t} \n\t\t\n\t\tbr.close();\n\t\treturn ret;\n\t}", "public ClassParser(final String file_name) {\n this.file_name = file_name;\n fileOwned = true;\n }", "public Parser() {}", "public CommandParser(String filename) {\r\n try {\r\n sc = new Scanner(new File(filename));\r\n }\r\n catch (FileNotFoundException e) {\r\n e.printStackTrace();\r\n System.out.println(\"File not found.\");\r\n }\r\n }", "public String parse(File file);", "public Parser(String fileHandle) {\n\t\tmainFile = fileHandle;\n\t}", "@Deprecated\n/* */ public JsonParser createJsonParser(File f)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 951 */ return createParser(f);\n/* */ }", "public JsonParser createParser(InputStream in)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 809 */ IOContext ctxt = _createContext(in, false);\n/* 810 */ return _createParser(_decorate(in, ctxt), ctxt);\n/* */ }", "public GongDomObject(File file) throws ParserConfigurationException, InvalidTagException, SAXException, IOException {\r\n super(file);\r\n }", "public Parser(String inputFile, PrintWriter newFile)\n\t{\n\t\ttry\n\t\t{\n\t\t\tthis.scanner = new Scanner(inputFile);\n\t\t\tthis.newFile = newFile;\n\t\t\tvariableCount = functionCount = statementCount = labelCount = startLabel = endLabel = condLabel = globalCount = localCount = 0;\n\t\t\tglobalFlag = true;\n\t\t\tdeclareFlag = true;\n\t\t\tinFunction = true; \n\t\t\tglobalMap = new HashMap<String, Integer>();\n\t\t\tstatus = false;\n\t\t\tUpdateToken();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\t\n\t\t}\n\t}", "public void parse(String fileName) throws Exception;", "private static SimpleNode parse(String filename) throws ParseException {\n\t\tParser parser;\n\t\t// open file as input stream\n\t\ttry {\n\t\t\tparser = new Parser(new java.io.FileInputStream(filename));\n\t\t}\n\t\tcatch (java.io.FileNotFoundException e) {\n\t\t\tSystem.out.println(\"ERROR: file \" + filename + \" not found.\");\n\t\t\treturn null;\n\t\t}\n\t\t// parse and return root node\n\t\treturn parser.parse();\n\t}", "private Parser () { }", "private Parser makeParser(String input) throws LexicalException {\r\n\t\tshow(input); //Display the input \r\n\t\tScanner scanner = new Scanner(input).scan(); //Create a Scanner and initialize it\r\n\t\tshow(scanner); //Display the Scanner\r\n\t\tParser parser = new Parser(scanner);\r\n\t\treturn parser;\r\n\t}", "public RuleParser() {\n this.fileName = \"\";\n }", "public static final Document parse(final File f) {\r\n String uri = \"file:\" + f.getAbsolutePath();\r\n\r\n if (File.separatorChar == '\\\\') {\r\n uri = uri.replace('\\\\', '/');\r\n }\r\n\r\n return parse(new InputSource(uri));\r\n }", "@Override\n public Class<? extends FileParser> resolveFileParser(Path file) {\n // getting file extension\n String filename = file.getFileName().toString();\n String[] filenameParts = filename.split(\"\\\\.\");\n String extension = filenameParts[filenameParts.length - 1];\n\n // get the class of the file parser\n return parsers.get(extension);\n }", "public XMLHandler(File file) {\n this.file = file;\n }", "protected ASTParser createASTParser() {\n ASTParser parser = ASTParser.newParser(this.testLevel);\n return parser;\n }", "public JsnParser(String filename) {\n this.filename = filename;\n }", "public static Document parse(final File file) {\r\n\t\tDocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n\t\tDocumentBuilder db;\r\n\t\tDocument dom = null;\r\n\t\ttry {\r\n\t\t\tdb = dbf.newDocumentBuilder();\r\n\t\t\tdom = db.parse(file);\r\n\t\t} catch (ParserConfigurationException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (SAXException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn dom;\r\n\t}", "public Parser()\n {\n //nothing to do\n }", "public JsonParser createParser(DataInput in)\n/* */ throws IOException\n/* */ {\n/* 920 */ IOContext ctxt = _createContext(in, false);\n/* 921 */ return _createParser(_decorate(in, ctxt), ctxt);\n/* */ }", "public Parser(Scanner fileStream) {\n // Save fileStream for later\n this.fileStream = fileStream;\n // Set the delimiter so that actual instructions are read, instead of the whitespace\n this.fileStream.useDelimiter(Pattern.compile(whitespace, Pattern.MULTILINE));\n }", "public FitnessParser getParser(UploadedFile file, DataSource ds) throws IOException, DBException {\n\t\tInputStream stream = file.getInputstream();\n\t\tStringWriter sw = new StringWriter();\n\t\tIOUtils.copy(stream, sw);\n\t\tStringReader sr = new StringReader(sw.toString());\n\t\tBufferedReader br = new BufferedReader(sr);\n\t\t\n\t\tString firstLine = br.readLine();\n\t\tif(firstLine == null) {\n\t\t\tFacesMessage msg = new FacesMessage( FacesMessage.SEVERITY_ERROR, \"Error\", \"Invalid File\" );\n\t\t\tFacesContext.getCurrentInstance().addMessage( null, msg );\n\t\t\treturn null;\n\t\t} \n\t\tFitnessParser ret = null;\n\t\tif(checkFitbitFile(firstLine)) {\n\t\t\tret = new FitbitParser(file, ds);\n\t\t} else if (checkMicrosoftFile(firstLine)) {\n\t\t\tret = new MicrosoftParser(file, ds);\n\t\t} \n\t\t\n\t\tbr.close();\n\t\treturn ret;\n\t}", "public SqlFileParser(String filename) {\n try {\n this.reader = new BufferedReader(new FileReader(filename));\n } catch (FileNotFoundException e) {\n throw new IllegalArgumentException(\"file not found \" + filename);\n }\n }", "public InputReader(File file){\n try {\n inputStream = new Scanner(file);\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n instantiate();\n assert(invariant());\n }", "public Parser(String parserFilename, String dataFilename)\n/* */ {\n/* 57 */ initComponents();\n/* */ \n/* 59 */ this.parserPanel = new ParserPanel();\n/* 60 */ getContentPane().add(\"Center\", this.parserPanel);\n/* 61 */ if (parserFilename != null) {\n/* 62 */ this.parserPanel.loadParser(parserFilename);\n/* */ }\n/* 64 */ if (dataFilename != null) {\n/* 65 */ this.parserPanel.loadFile(dataFilename);\n/* */ }\n/* 67 */ pack();\n/* */ }", "public parser(Scanner s) {super(s);}", "public JsonParser createParser(char[] content)\n/* */ throws IOException\n/* */ {\n/* 899 */ return createParser(content, 0, content.length);\n/* */ }", "CParser getParser();", "public interface Parser {\n\t\n\t/**\n\t * A method to parse the file\n\t * @param file the file\n\t * @return the content\n\t */\n\tpublic String parse(File file);\n\t\n}", "public ImportCommand parseFile(File file) throws ParseException {\n\n FileReader fr;\n\n try {\n fr = new FileReader(file);\n } catch (FileNotFoundException fnfe) {\n throw new ParseException(\"File not found\");\n }\n\n BufferedReader br = new BufferedReader(fr);\n return parseLinesFromFile(br);\n }", "public Document parse(File aFile)\n\t\t\t\t throws org.xml.sax.SAXException, java.io.IOException {\n\t\t/**\n\t\t * @todo Fix/implement this later\n\t\t */\n\t\tthrow new SAXException(\"Not supported\");\n\t}", "public ObjReader(String filename){\n file = filename;\n }", "public abstract ArgumentParser makeParser();", "public Parser() {\n\t\tpopulateMaps();\n\t}", "static RobotProgramNode parseFile(File code){\r\n\tScanner scan = null;\r\n\ttry {\r\n\t scan = new Scanner(code);\r\n\r\n\t // the only time tokens can be next to each other is\r\n\t // when one of them is one of (){},;\r\n\t scan.useDelimiter(\"\\\\s+|(?=[{}(),;])|(?<=[{}(),;])\");\r\n\r\n\t RobotProgramNode n = parseProgram(scan); // You need to implement this!!!\r\n\r\n\t scan.close();\r\n\t return n;\r\n\t} catch (FileNotFoundException e) {\r\n\t System.out.println(\"Robot program source file not found\");\r\n\t} catch (ParserFailureException e) {\r\n\t System.out.println(\"Parser error:\");\r\n\t System.out.println(e.getMessage());\r\n\t scan.close();\r\n\t}\r\n\treturn null;\r\n }", "public SYEParser(InputStream input, String name) throws FileNotFoundException {\n super(input);\n this.filename = name;\n }", "public JsonParser createParser(URL url)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 782 */ IOContext ctxt = _createContext(url, true);\n/* 783 */ InputStream in = _optimizedStreamFromURL(url);\n/* 784 */ return _createParser(_decorate(in, ctxt), ctxt);\n/* */ }", "public Parser()\n{\n //nothing to do\n}", "abstract protected Parser createSACParser();", "public TestNGParser(String fileName) {\n super(fileName);\n m_fileName = fileName;\n m_inputStream = null;\n m_postProcessor = null;\n }", "private SourceFile _parseString(String txt) throws ParseException {\n ACParser p = new ACParser(txt);\n return p.SourceFile();\n }", "private void parseFile(Project p, File f, ImportSettings settings, int pass)\n throws ImportException {\n\n\n try {\n BufferedInputStream bs = new BufferedInputStream(new FileInputStream(f));\n Lexer l = new Lexer(bs, f.getAbsolutePath());\n TokenCollection toks = l.lex();\n Parser px = new Parser();\n CompilationUnitNode cu = px.parse(toks, l.StringLiterals);\n parsedElements.add(cu);\n } catch (FeatureNotSupportedException e) {\n //throw new ImportException(\"Error parsing file: \" + f.getAbsolutePath() + \" due to: \"+e.getMessage());\n System.out.println(\"Error parsing file: \" + f.getAbsolutePath() + \" due to: \"+e.getMessage());\n } catch (Exception e) {\n// e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n// throw new ImportException(\"Error parsing file: \" + f.getAbsolutePath());\n System.out.println(\"Error parsing file: \" + f.getAbsolutePath());\n }\n\n }", "ValueResourceParser2(@NonNull File file) {\n mFile = file;\n }", "public TokenScanner(final File f) throws FileNotFoundException {\n\t\tfileScanner = new Scanner(file = f);\n\t}", "Object create(InputStream in) throws IOException, SAXException, ParserConfigurationException;", "public Editor(String file) {\n\t\tinit();\n\t\tloadFile(file);\n\t}", "protected abstract void parseFile(File f) throws IOException;", "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 }", "Object create(InputSource is) throws IOException, SAXException, ParserConfigurationException;", "public static PackerFileParser get() {\r\n\t\tif(parser==null) {\r\n\t\t\tIterator<PackerFileParser> packerFileParseIterator = \r\n\t\t\t\t\tServiceLoader.load(PackerFileParser.class).iterator();\r\n\t\t\t\r\n\t\t\tif(packerFileParseIterator.hasNext()) {\r\n\t\t\t\tparser = packerFileParseIterator.next();\r\n\t\t\t} else {\r\n\t\t\t\tparser = new PackerFileParserImpl();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn parser;\r\n\t}", "public Parser(URL url) {\n \t\t\ttry {\n \t\t\t\tload(url.openStream());\n \t\t\t} catch (Exception e) {\n \t\t\t\t// continue ... actual parsing will report errors\n \t\t\t}\n \t\t}", "public Cmdline(String file) {\n \n try {\n File selectedFile = new File(file);\n Model m = loadModel( selectedFile );\n if( m != null )\n models.add( m );\n } catch (FileNotFoundException fnfe) {\n System.out.println(\"File not found\");\n } catch( ParseException pe ) {\n System.out.println(\"Parse Error: \" + pe.getMessage());\n } catch( LemException le ) {\n System.out.println(\"Parse Error: \" + le.getMessage());\n } catch( IOException ioe ) {\n System.out.println(\"I/OO Error: \" + ioe.getMessage());\n }\n \n/* metamodel.Procedure p = m.getDomain( \"Publications\" ).getClass( \"Manuscript\" ).getStateMachine().getState(\"Adding\").getProcedure();\n runtime.ModelInstance i = new runtime.ModelInstance();\n \n p.execute(i); */\n }", "public JsonParser createParser(Reader r)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 829 */ IOContext ctxt = _createContext(r, false);\n/* 830 */ return _createParser(_decorate(r, ctxt), ctxt);\n/* */ }", "@Override\n public ConfigurationMetaData parse(String configFile) {\n ParsingMethod parsingMethod = ParsingMethod.REGEX;\n FlexGrammarParser parser = null;\n if (!StringUtils.isEmpty(configFile)) {\n try {\n CharStream input = new ANTLRInputStream(new StringReader(configFile));\n FlexGrammarLexer lex = new FlexGrammarLexer(input);\n CommonTokenStream tokens = new CommonTokenStream(lex);\n parser = new FlexGrammarParser(tokens);\n parser.removeErrorListeners();\n ErrorListener errorListener = new ErrorListener();\n parser.addErrorListener(errorListener);\n ConfigurationMetaData configMetaData = resolve(parser);\n configMetaData.setParsingMethod(parsingMethod);\n validator.validateTokenCount(configMetaData);\n return configMetaData;\n } catch (IllegalArgumentException | FlexEngineParseException e) {\n throw e;\n } catch (Exception e) {\n logger.error(\"unable to parse config file, error: {}\", e.getMessage(), e);\n throw new FlexEngineParseException(\"unable to parse config file\", e);\n }\n } else {\n logger.error(\"config file is null or empty\");\n throw new IllegalArgumentException(\"config file is null or empty\");\n }\n\n }", "private ReoFile<T> parse(CharStream c) throws IOException {\n\t\tReoLexer lexer = new ReoLexer(c); \n\t\tCommonTokenStream tokens = new CommonTokenStream(lexer);\n\t\t\n\t\tReoParser parser = new ReoParser(tokens);\n\t\tMyErrorListener errListener = new MyErrorListener();\n\t\tparser.removeErrorListeners();\n\t\tparser.addErrorListener(errListener);\n\t\t\n\t\tParseTree tree = parser.file();\n\t\tif (errListener.hasError)\n\t\t\treturn null;\n\t\t\n\t\tParseTreeWalker walker = new ParseTreeWalker();\n\t\twalker.walk(listener, tree);\n\t\treturn listener.getMain();\n\t}", "public SmartScriptParser(String text) {\n lexer = new SmartScriptLexer(text);\n documentNode = new DocumentNode();\n stack = new ObjectStack();\n parse();\n\n}", "public static ArrayList<String> parseFile(String f) throws Exception {\n\t\tArrayList<CommandNode> cmdNode = new ArrayList<CommandNode>();\n\t\tArrayList<MemoryNode> memNode = new ArrayList<MemoryNode>();\n\t\tparseFile(f,cmdNode,memNode);\n\t\treturn preCompile(cmdNode, memNode);\n\t}", "private PLPParser makeParser(String input) throws LexicalException {\n\t\t\tshow(input); //Display the input \n\t\t\tPLPScanner scanner = new PLPScanner(input).scan(); //Create a Scanner and initialize it\n\t\t\tshow(scanner); //Display the Scanner\n\t\t\tPLPParser parser = new PLPParser(scanner);\n\t\t\treturn parser;\n\t\t}", "@Override\n public void parse() throws ParseException {\n\n /* parse file */\n try {\n\n Scanner scanner = new Scanner(file, CHARSET_UTF_8);\n\n MowerConfig mowerConfig = null;\n\n int lineNumber = 1;\n\n do {\n\n boolean even = lineNumber % 2 == 0;\n String line = scanner.nextLine();\n\n /* if nothing in the file */\n if ((line == null || line.isEmpty()) && lineNumber == 1) {\n\n throw new ParseException(\"Nothing found in the file: \" + file);\n\n /* first line: lawn top right position */\n } else if(lineNumber == 1) {\n\n Position lawnTopRight = Position.parsePosition(line);\n config.setLawnTopRightCorner(lawnTopRight);\n\n /* even line: mower init */\n } else if (even) {\n\n int lastWhitespace = line.lastIndexOf(' ');\n Position p = Position.parsePosition(line.substring(0, lastWhitespace));\n Orientation o = Orientation.parseOrientation(line.substring(lastWhitespace).trim());\n\n mowerConfig = new MowerConfig();\n mowerConfig.setInitialPosition(p);\n mowerConfig.setInitialOrientation(o);\n\n /* odd line: mower commands */\n } else {\n\n mowerConfig.setCommands(MowerCommand.parseCommands(line));\n config.addMowerConfig(mowerConfig);\n }\n\n lineNumber++;\n\n } while(scanner.hasNextLine());\n\n\n } catch (Exception e) {\n throw new ParseException(\"Exception: \" + e.getMessage());\n }\n\n }", "public JsonReader(String file) {\n this.file = file;\n }", "public OnionooParser() {\n\n\t}", "public void parseFile(String fileLocation) {\n\t\tString sourceCode = null;\n\t\ttry {\n\t\t\tsourceCode = FileUtils.readFileToString(new File(fileLocation), \"ISO-8859-1\");\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\t// just in case somehow things escape the try-catch statement\n\t\tif(sourceCode == null) {\n\t\t\tthrow new IllegalStateException(\"[ERROR]: source code is null!\");\n\t\t}\n\n\t\t// create parser and set properties\n\t\tASTParser parser = ASTParser.newParser(AST.JLS8);\n\t\tparser.setUnitName(fileLocation);\n\t\tparser.setEnvironment(null, null, null, true);\n\t\tparser.setSource(sourceCode.toCharArray());\n\t\tparser.setKind(ASTParser.K_COMPILATION_UNIT);\n\t\tparser.setResolveBindings(true);\n\t\tparser.setBindingsRecovery(true);\n\t\tparser.setStatementsRecovery(true);\n\n\t\tfinal CompilationUnit cu = (CompilationUnit) parser.createAST(null);\n\n//\t\tfor (Comment comment : (List<Comment>) cu.getCommentList()) {\n//\t\t\tcomment.accept(new ASTRefactor.CommentVisitor(cu, sourceCode));\n//\t\t}\n\n\t\tcu.accept(new ASTVisitor() {\n\t\t\tpublic boolean visit(AnonymousClassDeclaration node) {\n\t\t\t\tJavaClass co = new JavaClass();\n\n\t\t\t\tif(configProperties.get(\"AnonymousClassDeclaration\")) {\n\t\t\t\t\tITypeBinding binding = node.resolveBinding();\n\n\t\t\t\t\tint startLine = cu.getLineNumber(node.getStartPosition());\n\t\t\t\t\tint endLine = cu.getLineNumber(node.getStartPosition() + node.getLength() - 1);\n\n\t\t\t\t\tco.setIsAnonymous(binding.isAnonymous());\n\t\t\t\t\tco.setColumnNumber(cu.getColumnNumber(node.getStartPosition()));\n\t\t\t\t\tco.setEndLine(endLine);\n\t\t\t\t\tco.setLineNumber(startLine);\n\n\t\t\t\t\tSystem.out.println(startLine);\n\n\t\t\t\t\tco.setNumberOfCharacters(node.getLength());\n\t\t\t\t\tco.setFileName(fileLocation);\n\n\t\t\t\t\tList<String> genericParametersList = new ArrayList<>();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif(binding.isGenericType()) {\n\t\t\t\t\t\t\tco.setIsGenericType(binding.isGenericType());\n\t\t\t\t\t\t\tfor(Object o : binding.getTypeParameters()) {\n\t\t\t\t\t\t\t\tgenericParametersList.add(o.toString());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tco.setIsGenericType(false);\n\t\t\t\t\t}\n\t\t\t\t\tco.setGenericParametersList(genericParametersList);\n\n\t\t\t\t\tco.setHasComments(hasComments);\n\t\t\t\t\tco.setSourceCode(getClassSourceCode(fileLocation, startLine, endLine));\n\t\t\t\t\tco.setStartCharacter(node.getStartPosition());\n\t\t\t\t\tco.setEndCharacter(node.getStartPosition() + node.getLength() - 1);\n\t\t\t\t\tco.setImportList(importList);\n\t\t\t\t\tco.setPackage(packageObject);\n\t\t\t\t\tco.setIsAnonymous(true);\n\t\t\t\t}\n\n\t\t\t\tentityStack.push(co);\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic void endVisit(AnonymousClassDeclaration node) {\n\t\t\t\tif(configProperties.get(\"AnonymousClassDeclaration\")) {\n\t\t\t\t\tJavaClass temp = (JavaClass) entityStack.pop();\n\n\t\t\t\t\ttemp.setIsInnerClass(true);\n\n\t\t\t\t\ttemp.setComplexities();\n\t\t\t\t\ttemp.setMethodDeclarationNames();\n\t\t\t\t\ttemp.setMethodInvocationNames();\n\n\t\t\t\t\tif(!containingClass.isEmpty()) {\n\t\t\t\t\t\ttemp.setContainingClass(containingClass);\n\t\t\t\t\t}\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tentityStack.peek().addEntity(temp, Entity.EntityType.CLASS);\n\t\t\t\t\t} catch (EmptyStackException e) {\n\t\t\t\t\t\t// should not be possible\n\t\t\t\t\t}\n\n\t\t\t\t\tfileModel.addJavaClass(temp);\n\n\t\t\t\t\thasComments = false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tpublic boolean visit(CatchClause node) {\n\t\t\t\tif(inMethod && configProperties.get(\"CatchClause\")) {\n\t\t\t\t\tSimpleName name = node.getException().getName();\n\n\t\t\t\t\tSuperEntityClass cco = new SuperEntityClass(\n\t\t\t\t\t\t\t\t\tname.toString(),\n\t\t\t\t\t\t\t\t\tcu.getLineNumber(name.getStartPosition()),\n\t\t\t\t\t\t\t\t\tcu.getColumnNumber(name.getStartPosition())\n\t\t\t\t\t);\n\t\t\t\t\tcco.setType(node.getException().getType());\n\t\t\t\t\tentityStack.peek().addEntity(cco, Entity.EntityType.CATCH_CLAUSE);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(ConditionalExpression node){\n\t\t\t\tif(inMethod && configProperties.get(\"ConditionalExpression\")) {\n\t\t\t\t\tString name;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tname = node.getExpression().toString();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tname = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tentityStack.peek().addEntity(\n\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(node.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(node.getStartPosition())\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tEntity.EntityType.CONDITIONAL_EXPRESSION\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(DoStatement node) {\n\t\t\t\tif(inMethod && configProperties.get(\"DoStatement\")) {\n\t\t\t\t\tString name;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tname = node.getExpression().toString();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tname = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tentityStack.peek().addEntity(\n\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(node.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(node.getStartPosition())\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tEntity.EntityType.DO_STATEMENT\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(EnhancedForStatement node) {\n\t\t\t\tif(inMethod && configProperties.get(\"EnhancedForStatement\")) {\n\t\t\t\t\tString name;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tname = node.getExpression().toString();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tname = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tentityStack.peek().addEntity(\n\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(node.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(node.getStartPosition())\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tEntity.EntityType.FOR_STATEMENT\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(FieldDeclaration node) {\n\t\t\t\tif(configProperties.get(\"FieldDeclaration\")) {\n\t\t\t\t\tType nodeType = node.getType();\n\n\t\t\t\t\tfor(Object v : node.fragments()) {\n\t\t\t\t\t\tSimpleName name = ((VariableDeclarationFragment) v).getName();\n\n\t\t\t\t\t\t// get fully qualified name\n\t\t\t\t\t\tITypeBinding binding = node.getType().resolveBinding();\n\t\t\t\t\t\tString fullyQualifiedName;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tfullyQualifiedName = binding.getQualifiedName();\n\t\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\t\tfullyQualifiedName = name.toString();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tSuperEntityClass fdEntity = new SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\tname.toString(),\n\t\t\t\t\t\t\t\t\t\tfullyQualifiedName,\n\t\t\t\t\t\t\t\t\t\tnodeType,\n\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(name.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(name.getStartPosition())\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif(nodeType.isArrayType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(fdEntity, Entity.EntityType.ARRAY);\n\t\t\t\t\t\t\tentityStack.peek().addEntity(fdEntity, Entity.EntityType.GLOBAL);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(nodeType.isParameterizedType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(fdEntity, Entity.EntityType.GENERICS);\n\t\t\t\t\t\t\tentityStack.peek().addEntity(fdEntity, Entity.EntityType.GLOBAL);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(nodeType.isPrimitiveType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(fdEntity, Entity.EntityType.PRIMITIVE);\n\t\t\t\t\t\t\tentityStack.peek().addEntity(fdEntity, Entity.EntityType.GLOBAL);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(nodeType.isSimpleType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(fdEntity, Entity.EntityType.SIMPLE);\n\t\t\t\t\t\t\tentityStack.peek().addEntity(fdEntity, Entity.EntityType.GLOBAL);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tSystem.out.println(\"Something is missing \" + nodeType);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(ForStatement node) {\n\t\t\t\tif(inMethod && configProperties.get(\"ForStatement\")) {\n\t\t\t\t\tString name;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tname = node.getExpression().toString();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tname = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tentityStack.peek().addEntity(\n\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(node.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(node.getStartPosition())\n\t\t\t\t\t\t\t\t\t), Entity.EntityType.FOR_STATEMENT\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(IfStatement node) {\n\t\t\t\tif(inMethod && configProperties.get(\"IfStatement\")) {\n\t\t\t\t\tString name;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tname = node.getExpression().toString();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tname = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tentityStack.peek().addEntity(\n\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(node.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(node.getStartPosition())\n\t\t\t\t\t\t\t\t\t), Entity.EntityType.IF_STATEMENT\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(ImportDeclaration node) {\n\t\t\t\tif(configProperties.get(\"ImportDeclaration\")) {\n\t\t\t\t\tName name = node.getName();\n\n\t\t\t\t\tString fullyQualifiedName;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfullyQualifiedName = name.getFullyQualifiedName();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tfullyQualifiedName = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\timportList.add(\n\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tname.toString(),\n\t\t\t\t\t\t\t\t\t\t\t\t\tfullyQualifiedName,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(name.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(name.getStartPosition())\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(InfixExpression node){\n\t\t\t\tif(inMethod && configProperties.get(\"InfixExpression\")) {\n\t\t\t\t\tentityStack.peek().addEntity(\n\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tnode.getOperator().toString(),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(node.getLeftOperand().getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(node.getLeftOperand().getStartPosition())\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tEntity.EntityType.INFIX_EXPRESSION\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(MethodDeclaration node) {\n\t\t\t\tinMethod = true;\n\t\t\t\tMethodDeclarationObject md = new MethodDeclarationObject();\n\n\t\t\t\tif(configProperties.get(\"MethodDeclaration\")) {\n\t\t\t\t\tSimpleName name = node.getName();\n\t\t\t\t\tboolean isStatic = false;\n\t\t\t\t\tboolean isAbstract = false;\n\n\t\t\t\t\t// get fully qualified name\n\t\t\t\t\tString fullyQualifiedName;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfullyQualifiedName = name.getFullyQualifiedName();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tfullyQualifiedName = name.toString();\n\t\t\t\t\t}\n\n\t\t\t\t\t// is method declaration abstract?\n\t\t\t\t\tint mod = node.getModifiers();\n\t\t\t\t\tif(Modifier.isAbstract(mod)) {\n\t\t\t\t\t\tisAbstract = true;\n\t\t\t\t\t}\n\n\t\t\t\t\t// is method declaration static?\n\t\t\t\t\tif(Modifier.isStatic(mod)) {\n\t\t\t\t\t\tisStatic = true;\n\t\t\t\t\t}\n\n\t\t\t\t\tIMethodBinding binding = node.resolveBinding();\n\n\t\t\t\t\t// get type of each parameter\n\t\t\t\t\tList<String> parameterTypes = new ArrayList<>();\n\t\t\t\t\tfor(Object obj : node.parameters()) {\n\t\t\t\t\t\tITypeBinding tb = ((SingleVariableDeclaration) obj).getType().resolveBinding();\n\t\t\t\t\t\tString fqn;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tfqn = tb.getQualifiedName();\n\t\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\t\tfqn = name.toString();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tparameterTypes.add(fqn);\n\t\t\t\t\t}\n\n\t\t\t\t\tmd.setColumnNumber(cu.getColumnNumber(name.getStartPosition()));\n\t\t\t\t\ttry {\n\t\t\t\t\t\tmd.setDeclaringClass(binding.getDeclaringClass().getQualifiedName());\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tmd.setDeclaringClass(null);\n\t\t\t\t\t}\n\t\t\t\t\tmd.setEndCharacter(node.getStartPosition() + node.getLength() - 1);\n\t\t\t\t\tmd.setEndLine(cu.getLineNumber(node.getStartPosition() + node.getLength() - 1));\n\t\t\t\t\tmd.setFullyQualifiedName(fullyQualifiedName);\n\n\t\t\t\t\tmd.setIsAbstract(isAbstract);\n\t\t\t\t\tmd.setIsConstructor(node.isConstructor());\n\n\t\t\t\t\t// to avoid API from setting constructor return type to void\n\t\t\t\t\tif(node.isConstructor()) {\n\t\t\t\t\t\tmd.setReturnType(null);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tmd.setReturnType(binding.getReturnType().getQualifiedName());\n\t\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\t\tmd.setReturnType(null);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t// get generic parameters\n\t\t\t\t\tList<String> genericParametersList = new ArrayList<>();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif(binding.isGenericMethod()) {\n\t\t\t\t\t\t\tmd.setIsGenericType(binding.isGenericMethod());\n\t\t\t\t\t\t\tfor(Object o : binding.getTypeParameters()) {\n\t\t\t\t\t\t\t\tgenericParametersList.add(o.toString());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tmd.setIsGenericType(false);\n\t\t\t\t\t}\n\n\t\t\t\t\tmd.setGenericParametersList(genericParametersList);\n\t\t\t\t\tmd.setIsStatic(isStatic);\n\t\t\t\t\tmd.setIsVarargs(node.isVarargs());\n\t\t\t\t\tmd.setLineNumber(cu.getLineNumber(name.getStartPosition()));\n\t\t\t\t\tmd.setName(name.toString());\n\t\t\t\t\tmd.setNumberOfCharacters(node.getLength());\n\t\t\t\t\tmd.setParametersList(node.parameters());\n\t\t\t\t\tmd.setParameterTypesList(parameterTypes);\n\t\t\t\t\tmd.setStartCharacter(name.getStartPosition());\n\n\t\t\t\t\tif(node.thrownExceptionTypes().size() > 0) {\n\t\t\t\t\t\tfor(Object o : node.thrownExceptionTypes()) {\n\t\t\t\t\t\t\tmd.addThrowsException(o.toString());\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tentityStack.push(md);\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic void endVisit(MethodDeclaration node) {\n\t\t\t\tMethodDeclarationObject temp = (MethodDeclarationObject) entityStack.pop();\n\n\t\t\t\tif(configProperties.get(\"MethodDeclaration\")) {\n\t\t\t\t\ttemp.setComplexities();\n\t\t\t\t\ttemp.setMethodDeclarationNames();\n\t\t\t\t\ttemp.setMethodInvocationNames();\n\t\t\t\t\tentityStack.peek().addEntity(temp, Entity.EntityType.METHOD_DECLARATION);\n\t\t\t\t}\n\n\t\t\t\tinMethod = false;\n\t\t\t}\n\n\t\t\tpublic boolean visit(MethodInvocation node) {\n\t\t\t\tif(configProperties.get(\"MethodInvocation\")) {\n\t\t\t\t\tSimpleName name = node.getName();\n\n\t\t\t\t\t// get fully qualified name\n\t\t\t\t\tString fullyQualifiedName;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfullyQualifiedName = name.getFullyQualifiedName();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tfullyQualifiedName = name.toString();\n\t\t\t\t\t}\n\n\t\t\t\t\t// get declaring class\n\t\t\t\t\tIMethodBinding binding = node.resolveMethodBinding();\n\t\t\t\t\tString declaringClass;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tdeclaringClass = binding.getDeclaringClass().getQualifiedName();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tdeclaringClass = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\t// get calling class\n\t\t\t\t\tString callingClass;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tcallingClass = node.getExpression().resolveTypeBinding().getQualifiedName();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tcallingClass = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\t// get argument types\n\t\t\t\t\tList<String> argumentTypes = new ArrayList<>();\n\t\t\t\t\tfor(Object t : node.arguments()) {\n\t\t\t\t\t\tITypeBinding tb = ((Expression)t).resolveTypeBinding();\n\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\targumentTypes.add(tb.getQualifiedName());\n\t\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\t\targumentTypes.add(\"\");\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tMethodInvocationObject mio = new MethodInvocationObject();\n\t\t\t\t\tmio.setName(name.toString());\n\t\t\t\t\tmio.setFullyQualifiedName(fullyQualifiedName);\n\t\t\t\t\tmio.setDeclaringClass(declaringClass);\n\t\t\t\t\tmio.setCallingClass(callingClass);\n\t\t\t\t\tmio.setArguments(node.arguments());\n\t\t\t\t\tmio.setArgumentTypes(argumentTypes);\n\t\t\t\t\tmio.setLineNumber(cu.getLineNumber(name.getStartPosition()));\n\t\t\t\t\tmio.setEndLine(cu.getLineNumber(node.getStartPosition() + node.getLength() - 1));\n\t\t\t\t\tmio.setStartCharacter(name.getStartPosition());\n\t\t\t\t\tmio.setEndCharacter(node.getStartPosition() + node.getLength() - 1);\n\t\t\t\t\tmio.setColumnNumber(cu.getColumnNumber(name.getStartPosition()));\n\t\t\t\t\tentityStack.peek().addEntity(mio, Entity.EntityType.METHOD_INVOCATION);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(PackageDeclaration node){\n\t\t\t\tif(configProperties.get(\"PackageDeclaration\")) {\n\t\t\t\t\tName name = node.getName();\n\n\t\t\t\t\t// get fully qualified name\n\t\t\t\t\tString fullyQualifiedName;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfullyQualifiedName = name.getFullyQualifiedName();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tfullyQualifiedName = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tpackageObject = new SuperEntityClass(\n\t\t\t\t\t\t\t\t\tnode.getName().toString(),\n\t\t\t\t\t\t\t\t\tfullyQualifiedName,\n\t\t\t\t\t\t\t\t\tcu.getLineNumber(name.getStartPosition()),\n\t\t\t\t\t\t\t\t\tcu.getColumnNumber(name.getStartPosition())\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(SingleVariableDeclaration node) {\n\t\t\t\tif(configProperties.get(\"SingleVariableDeclaration\")) {\n\t\t\t\t\tSimpleName name = node.getName();\n\n\t\t\t\t\t// get fully qualified name\n\t\t\t\t\tITypeBinding binding = node.getType().resolveBinding();\n\t\t\t\t\tString fullyQualifiedName;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tfullyQualifiedName = binding.getQualifiedName();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tfullyQualifiedName = name.toString();\n\t\t\t\t\t}\n\n\t\t\t\t\tSuperEntityClass svdEntity = new SuperEntityClass(\n\t\t\t\t\t\t\t\t\tname.toString(),\n\t\t\t\t\t\t\t\t\tfullyQualifiedName,\n\t\t\t\t\t\t\t\t\tnode.getType(),\n\t\t\t\t\t\t\t\t\tcu.getLineNumber(name.getStartPosition()),\n\t\t\t\t\t\t\t\t\tcu.getColumnNumber(name.getStartPosition())\n\t\t\t\t\t);\n\n\t\t\t\t\tif(node.getType().isArrayType()) {\n\t\t\t\t\t\tentityStack.peek().addEntity(svdEntity, Entity.EntityType.ARRAY);\n\t\t\t\t\t}\n\t\t\t\t\telse if(node.getType().isParameterizedType()) {\n\t\t\t\t\t\tentityStack.peek().addEntity(svdEntity, Entity.EntityType.GENERICS);\n\t\t\t\t\t}\n\t\t\t\t\telse if(node.getType().isPrimitiveType()) {\n\t\t\t\t\t\tentityStack.peek().addEntity(svdEntity, Entity.EntityType.PRIMITIVE);\n\t\t\t\t\t}\n\t\t\t\t\telse if(node.getType().isSimpleType()) {\n\t\t\t\t\t\tentityStack.peek().addEntity(svdEntity, Entity.EntityType.SIMPLE);\n\t\t\t\t\t}\n\t\t\t\t\telse if(node.getType().isUnionType()) {\n\t\t\t\t\t\tentityStack.peek().addEntity(svdEntity, Entity.EntityType.UNION);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tSystem.out.println(\"Something is missing \" + node.getType());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(SwitchStatement node) {\n\t\t\t\tif(inMethod && configProperties.get(\"SwitchStatement\")) {\n\t\t\t\t\tString name;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tname = node.getExpression().toString();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tname = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tSuperEntityClass sso = new SuperEntityClass(\n\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\tcu.getLineNumber(node.getStartPosition()),\n\t\t\t\t\t\t\t\t\tcu.getColumnNumber(node.getStartPosition())\n\t\t\t\t\t);\n\n\t\t\t\t\tList<SuperEntityClass> switchCaseList = new ArrayList<>();\n\n\t\t\t\t\tfor(Object s : node.statements()) {\n\t\t\t\t\t\tif(s instanceof SwitchCase) {\n\t\t\t\t\t\t\tString expression;\n\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\texpression = ((SwitchCase) s).getExpression().toString();\n\t\t\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\t\t\texpression = \"Default\";\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tswitchCaseList.add(\n\t\t\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\texpression,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(((SwitchCase) s).getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(((SwitchCase)s).getStartPosition())\n\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tsso.addEntities(switchCaseList, Entity.EntityType.SWITCH_CASE);\n\t\t\t\t\tentityStack.peek().addEntity(sso, Entity.EntityType.SWITCH_STATEMENT);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(ThrowStatement node) {\n\t\t\t\tif(inMethod && configProperties.get(\"ThrowStatement\")) {\n\t\t\t\t\tString name;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tname = node.getExpression().toString();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tname = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tentityStack.peek().addEntity(\n\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(node.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(node.getStartPosition())\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tEntity.EntityType.THROW_STATEMENT\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(TryStatement node) {\n\t\t\t\tif(inMethod && configProperties.get(\"TryStatement\")) {\n\t\t\t\t\tentityStack.peek().addEntity(\n\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"Try Statement\",\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(node.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(node.getStartPosition())\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tEntity.EntityType.TRY_STATEMENT\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(TypeDeclaration node) {\n\t\t\t\tJavaClass co = new JavaClass();\n\n\t\t\t\tif(configProperties.get(\"TypeDeclaration\")) {\n\t\t\t\t\tif(node.isInterface()) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\tint startLine = cu.getLineNumber(node.getStartPosition());\n\t\t\t\t\t\tint endLine = cu.getLineNumber(node.getStartPosition() + node.getLength() - 1);\n\n\t\t\t\t\t\tITypeBinding binding = node.resolveBinding();\n\n\t\t\t\t\t\t// get fully qualified name\n\t\t\t\t\t\tString fullyQualifiedName;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tfullyQualifiedName = node.getName().getFullyQualifiedName();\n\t\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\t\tfullyQualifiedName = node.getName().toString();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(containingClass.isEmpty()) {\n\t\t\t\t\t\t\tcontainingClass = node.getName().toString();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tco.setIsAnonymous(binding.isAnonymous());\n\t\t\t\t\t\tco.setColumnNumber(cu.getColumnNumber(node.getStartPosition()));\n\t\t\t\t\t\tco.setEndLine(endLine);\n\t\t\t\t\t\tco.setLineNumber(startLine);\n\t\t\t\t\t\tco.setName(node.getName().toString());\n\t\t\t\t\t\tco.setNumberOfCharacters(node.getLength());\n\t\t\t\t\t\tco.setFileName(fileLocation);\n\t\t\t\t\t\tco.setFullyQualifiedName(fullyQualifiedName);\n\n\t\t\t\t\t\t// get generic parameters\n\t\t\t\t\t\tList<String> genericParametersList = new ArrayList<>();\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tif(binding.isGenericType()) {\n\t\t\t\t\t\t\t\tco.setIsGenericType(binding.isGenericType());\n\t\t\t\t\t\t\t\tfor(Object o : binding.getTypeParameters()) {\n\t\t\t\t\t\t\t\t\tgenericParametersList.add(o.toString());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\t\tco.setIsGenericType(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tco.setGenericParametersList(genericParametersList);\n\n\t\t\t\t\t\tco.setHasComments(hasComments);\n\t\t\t\t\t\tco.setImportList(importList);\n\t\t\t\t\t\tco.setPackage(packageObject);\n\t\t\t\t\t\tco.setSourceCode(getClassSourceCode(fileLocation, startLine, endLine));\n\t\t\t\t\t\tco.setStartCharacter(node.getStartPosition());\n\t\t\t\t\t\tco.setEndCharacter(node.getStartPosition() + node.getLength() - 1);\n\n\t\t\t\t\t\tif(node.getSuperclassType() != null) {\n\t\t\t\t\t\t\tco.setSuperClass(node.getSuperclassType().toString());\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif(node.superInterfaceTypes().size() > 0) {\n\t\t\t\t\t\t\tfor(Object o : node.superInterfaceTypes()) {\n\t\t\t\t\t\t\t\tco.addImplementsInterface(o.toString());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tint mod = node.getModifiers();\n\t\t\t\t\t\tif(Modifier.isAbstract(mod)) {\n\t\t\t\t\t\t\tco.setIsAbstract(true);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tco.setIsAbstract(false);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tentityStack.push(co);\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic void endVisit(TypeDeclaration node) {\n\t\t\t\tJavaClass temp = (JavaClass) entityStack.pop();\n\n\t\t\t\tif(!node.isInterface() && configProperties.get(\"TypeDeclaration\")) {\n\t\t\t\t\t// check if current class is an inner class\n\t\t\t\t\tboolean isInnerClass = true;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tentityStack.peek();\n\t\t\t\t\t} catch (EmptyStackException e) {\n\t\t\t\t\t\tisInnerClass = false;\n\t\t\t\t\t}\n\t\t\t\t\ttemp.setIsInnerClass(isInnerClass);\n\n\t\t\t\t\ttemp.setComplexities();\n\t\t\t\t\ttemp.setMethodDeclarationNames();\n\t\t\t\t\ttemp.setMethodInvocationNames();\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tif(!containingClass.isEmpty()) {\n\t\t\t\t\t\t\ttemp.setContainingClass(containingClass);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tentityStack.peek().addEntity(temp, Entity.EntityType.CLASS);\n\n\t\t\t\t\t} catch (EmptyStackException e) {\n\t\t\t\t\t\tcontainingClass = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tfileModel.addJavaClass(temp);\n\t\t\t\t}\n\n\t\t\t\thasComments = false;\n\t\t\t}\n\n\t\t\tpublic boolean visit(VariableDeclarationStatement node) {\n\t\t\t\tif(configProperties.get(\"VariableDeclarationStatement\")) {\n\t\t\t\t\tType nodeType = node.getType();\n\n\t\t\t\t\tfor(Object v : node.fragments()) {\n\t\t\t\t\t\tSimpleName name = ((VariableDeclarationFragment) v).getName();\n\n\t\t\t\t\t\t// get fully qualified name\n\t\t\t\t\t\tITypeBinding binding = node.getType().resolveBinding();\n\t\t\t\t\t\tString fullyQualifiedName;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tfullyQualifiedName = binding.getQualifiedName();\n\t\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\t\tfullyQualifiedName = name.toString();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tSuperEntityClass vdsEntity = new SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\tname.toString(),\n\t\t\t\t\t\t\t\t\t\tfullyQualifiedName,\n\t\t\t\t\t\t\t\t\t\tnodeType,\n\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(name.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(name.getStartPosition())\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif(nodeType.isArrayType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(vdsEntity, Entity.EntityType.ARRAY);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(nodeType.isParameterizedType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(vdsEntity, Entity.EntityType.GENERICS);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(nodeType.isPrimitiveType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(vdsEntity, Entity.EntityType.PRIMITIVE);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(nodeType.isSimpleType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(vdsEntity, Entity.EntityType.SIMPLE);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tSystem.out.println(\"Something is missing \" + nodeType);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(VariableDeclarationExpression node) {\n\t\t\t\tif(configProperties.get(\"VariableDeclarationExpression\")) {\n\t\t\t\t\tType nodeType = node.getType();\n\n\t\t\t\t\tfor(Object v : node.fragments()) {\n\t\t\t\t\t\tSimpleName name = ((VariableDeclarationFragment) v).getName();\n\n\t\t\t\t\t\t// get fully qualified name\n\t\t\t\t\t\tITypeBinding binding = node.getType().resolveBinding();\n\t\t\t\t\t\tString fullyQualifiedName;\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tfullyQualifiedName = binding.getQualifiedName();\n\t\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\t\tfullyQualifiedName = name.toString();\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tSuperEntityClass vdeEntity = new SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\tname.toString(),\n\t\t\t\t\t\t\t\t\t\tfullyQualifiedName,\n\t\t\t\t\t\t\t\t\t\tnodeType,\n\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(name.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(name.getStartPosition())\n\t\t\t\t\t\t);\n\n\t\t\t\t\t\tif(nodeType.isArrayType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(vdeEntity, Entity.EntityType.ARRAY);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(nodeType.isParameterizedType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(vdeEntity, Entity.EntityType.GENERICS);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(nodeType.isPrimitiveType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(vdeEntity, Entity.EntityType.PRIMITIVE);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse if(nodeType.isSimpleType()) {\n\t\t\t\t\t\t\tentityStack.peek().addEntity(vdeEntity, Entity.EntityType.SIMPLE);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tSystem.out.println(\"Something is missing \" + nodeType);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(WhileStatement node){\n\t\t\t\tif(inMethod && configProperties.get(\"WhileStatement\")) {\n\t\t\t\t\tString name;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tname = node.getExpression().toString();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tname = \"\";\n\t\t\t\t\t}\n\n\t\t\t\t\tentityStack.peek().addEntity(\n\t\t\t\t\t\t\t\t\tnew SuperEntityClass(\n\t\t\t\t\t\t\t\t\t\t\t\t\tname,\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getLineNumber(node.getStartPosition()),\n\t\t\t\t\t\t\t\t\t\t\t\t\tcu.getColumnNumber(node.getStartPosition())\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\tEntity.EntityType.WHILE_STATEMENT\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tpublic boolean visit(WildcardType node) {\n\t\t\t\tif(inMethod && configProperties.get(\"WildcardType\")) {\n\t\t\t\t\tSuperEntityClass wo = new SuperEntityClass();\n\t\t\t\t\two.setName(\"Wildcard\");\n\n\t\t\t\t\tString bound;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tbound = node.getBound().toString();\n\t\t\t\t\t} catch (NullPointerException e) {\n\t\t\t\t\t\tbound = \"none\";\n\t\t\t\t\t}\n\n\t\t\t\t\two.setBound(bound);\n\t\t\t\t\two.setType(((ParameterizedType) node.getParent()).getType());\n\t\t\t\t\two.setLineNumber(cu.getLineNumber(node.getStartPosition()));\n\t\t\t\t\two.setColumnNumber(cu.getColumnNumber(node.getStartPosition()));\n\t\t\t\t\tentityStack.peek().addEntity(wo, Entity.EntityType.WILDCARD);\n\t\t\t\t}\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t});\n\t}", "public Project(File file)\n {\n super(file);\n this.open();\n }", "public static Document parse(String filename) throws ParserException {\n\t\t// TODO YOU MUST IMPLEMENT THIS\n\t\t// girish - All the code below is mine\n\t\t\t\n\t\t// Creating the object for the new Document\n\t\t\n\t\t\n\t\tif (filename == null){\n\t\t\tthrow new ParserException();\n\t\t}\n\t\t\n\t\t// Variable indexPos to track the current pointer location in the String Array\n\t\tint indexPos = 0;\n\t\t\n\t\t// Creating an instance of the document class to store the parsed content\n\t\tDocument d = new Document();\n\t\t\n\t\t// to store the result sent from the regexAuthor method and regexPlaceDate method\n\t\tObject[] resultAuthor = {null, null, null};\n\t\tObject[] resultPlaceDate = {null, null, null};\n\t\tStringBuilder news = new StringBuilder();\n\t\t\n\t\t// Next 4 lines contains the code to get the fileID and Category metadata\n\t\tString[] fileCat = new String[2];\n\t\t\n\t\tfileCat = regexFileIDCat(\"/((?:[a-z]|-)+)/([0-9]{7})\", filename);\n\t\t// System.out.println(filename);\n\t\t// throw an exception if the file is blank, junk or null\n\t\tif (fileCat[0] == null){\n\t\t\tthrow new ParserException();\n\t\t}\n\t\td.setField(FieldNames.CATEGORY, fileCat[0]);\n\t\td.setField(FieldNames.FILEID, fileCat[1]);\n\t\t\n\t\t\n\t\t// Now , parsing the file\n\t\tFile fileConnection = new File(filename);\n\t\t\n\t\t// newscollated - it will store the parsed file content on a line by line basis\n\t\tArrayList<String> newscollated = new ArrayList<String>();\n\t\t\n\t\t// String that stores the content obtained from the . readline() operation\n\t\tString temp = null;\n\t\t\n\t\ttry\n\t\t{\n\t\t\t\n\t\t\tBufferedReader getInfo = new BufferedReader(new FileReader(fileConnection));\n\t\t\twhile ((temp = getInfo.readLine()) != null)\n\t\t\t{\n\t\t\t\tif(temp.equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\ttemp = temp + \" \";\n\t\t\t\t\tnewscollated.add(temp);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\tgetInfo.close();\n\t\t\t\n\t\t\t//-- deprecated (REMOVE THIS IF OTHER WORKS)\n\t\t\t// setting the title using the arraylist's 0th index element\n\t\t\t//d.setField(FieldNames.TITLE, newscollated.get(0));\n\t\t\t\n\t\t\t// Appending the lines into one big string using StringBuilder\n\t\t\t\n\t\t\tfor (String n: newscollated)\n\t\t\t{\n\t\t\t\tnews.append(n);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// Obtaining the TITLE of the file\n\t\t\tObject[] titleInfo = new Object[2];\n\t\t\t\n\t\t\ttitleInfo = regexTITLE(\"([^a-z]+)\\\\s{2,}\", news.toString());\n\t\t\td.setField(FieldNames.TITLE, titleInfo[0].toString().trim());\n\t\t\tindexPos = (Integer) titleInfo[1];\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// Getting the Author and Author Org\n\t\t\tresultAuthor = regexAuthor(\"<AUTHOR>(.*)</AUTHOR>\", news.toString());\n\t\t\t\n\t\t\tif (resultAuthor[0] != null)\n\t\t\t{\n\t\t\t\td.setField(FieldNames.AUTHOR, resultAuthor[0].toString());\n\t\t\t}\n\t\t\t\n\t\t\tif (resultAuthor[1] != null)\n\t\t\t{\n\t\t\t\td.setField(FieldNames.AUTHORORG, resultAuthor[1].toString());\n\t\t\t}\n\t\t \n\t\t \n\t\t \n\t\t if ((Integer) resultAuthor[2] != 0)\n\t\t {\n\t\t \tindexPos = (Integer) resultAuthor[2];\n\t\t }\n\t\t\t\n\t\t \n\t\t \n\t\t // Getting the Place and Date\n \t\t\tresultPlaceDate = regexPlaceDate(\"\\\\s{2,}(.+),\\\\s(?:([A-Z][a-z]+\\\\s[0-9]{1,})\\\\s{1,}-)\", news.toString());\n \t\t\t\n \t\t\tif (resultPlaceDate[0] != null)\n \t\t\t{\n \t\t\t\td.setField(FieldNames.PLACE, resultPlaceDate[0].toString().trim());\n \t\t\t}\n \t\t \n \t\t\tif (resultPlaceDate[1] != null)\n \t\t\t{\n \t\t\t\td.setField(FieldNames.NEWSDATE, resultPlaceDate[1].toString().trim());\n \t\t\t}\n \t\t\t\n \t\t // getting the content\n \t\t \n \t\t if ((Integer) resultPlaceDate[2] != 0)\n\t\t {\n\t\t \tindexPos = (Integer) resultPlaceDate[2];\n\t\t }\n \t\t \n \t\t \n \t\t d.setField(FieldNames.CONTENT, news.substring(indexPos + 1));\n \t\t \n \t\t return d;\n \t\t \n\t\t \n\t\t \n\t\t\t\n\t\t\t\n\t\t}\n\t\tcatch(FileNotFoundException e){\n\t\t\tthrow new ParserException();\n\t\t\t\n\t\t}\n\n\t\tcatch(IOException e){\n\t\t\tthrow new ParserException();\n\t\t}\n\t\t\n\t\tcatch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\t\n\t\t}\n\t\treturn d;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "public FastaReader(File file)\n throws FileNotFoundException, IOException {\n try {\n in = new BufferedReader(new FileReader(file));\n System.out.println(\"Start parsing fasta file ......\");\n parseFile();\n }\n catch (FileNotFoundException ex) {\n System.out.println(\"Error: \" + ex.getMessage());\n throw new FileNotFoundException(\"Can't not find the input file \".concat(file.getName()).concat(\".\"));\n }\n\n }", "public DocReader(File f)\n\t{\n\t\tthis.inputFile = f;\n\t}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public JsonParser createParser(String content)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 879 */ int strLen = content.length();\n/* */ \n/* 881 */ if ((this._inputDecorator != null) || (strLen > 32768) || (!canUseCharArrays()))\n/* */ {\n/* */ \n/* 884 */ return createParser(new StringReader(content));\n/* */ }\n/* 886 */ IOContext ctxt = _createContext(content, true);\n/* 887 */ char[] buf = ctxt.allocTokenBuffer(strLen);\n/* 888 */ content.getChars(0, strLen, buf, 0);\n/* 889 */ return _createParser(buf, 0, strLen, ctxt, true);\n/* */ }", "protected JsonParser _createParser(InputStream in, IOContext ctxt)\n/* */ throws IOException\n/* */ {\n/* 1271 */ return new ByteSourceJsonBootstrapper(ctxt, in).constructParser(this._parserFeatures, this._objectCodec, this._byteSymbolCanonicalizer, this._rootCharSymbols, this._factoryFeatures);\n/* */ }", "void setParser(CParser parser);", "ReleaseFile parse( InputStream is ) throws IOException;", "private HashMap<ASTNode, NodeInfo> parseFile(String file) {\n ASTParser parser = ASTParser.newParser(AST.JLS3);\n parser.setSource(file.toCharArray());\n parser.setKind(ASTParser.K_COMPILATION_UNIT);\n final CompilationUnit cu = (CompilationUnit) parser.createAST(null);\n ASTStatsCollector astStatsCollector = new ASTStatsCollector(cu);\n cu.accept(astStatsCollector);\n\n\n return astStatsCollector.nodeSubNodeMap;\n }", "void open(String fileName) throws IOException, ParserConfigurationException, SAXException;", "public JPClass getParsedClass(File f) throws Exception;", "public static Document parse(String filename) throws ParserException {\n\n\t\tString FileID, Category, Title = null, Author = null, AuthorOrg = null, Place = null, NewsDate = null, Content = null, FileN;\n\t\tDocument d = new Document();\n\t\tif (filename == null || filename == \"\")\n\t\t\tthrow new ParserException();\n\t\tFileN = filename;\n\t\tHashMap<Integer, String> map = new HashMap<Integer, String>();\n\t\tBufferedReader r = null;\n\t\tFile file = new File(FileN);\n\t\tif (!file.exists())\n\t\t\tthrow new ParserException();\n\t\tFileID = file.getName();\n\t\tCategory = file.getParentFile().getName();\n\t\ttry {\n\t\t\tr = new BufferedReader(new FileReader(file));\n\t\t\tint i = 1, j = 3;\n\t\t\tBoolean isTitle = true, hasAuthor = false;\n\t\t\tString line;\n\t\t\twhile ((line = r.readLine()) != null) {\n\t\t\t\tline = line.trim();\n\t\t\t\tif (!line.equals(\"\")) {\n\t\t\t\t\tmap.put(i, line);\n\t\t\t\t\tif (isTitle) {\n\t\t\t\t\t\tTitle = line;\n\t\t\t\t\t\tisTitle = false;\n\t\t\t\t\t}\n\t\t\t\t\tif (hasAuthor == false && i == 2) {\n\t\t\t\t\t\tPattern pattern = Pattern\n\t\t\t\t\t\t\t\t.compile(\"<AUTHOR>(.+?)</AUTHOR>\");\n\t\t\t\t\t\tMatcher matcher = pattern.matcher(line);\n\t\t\t\t\t\tif (matcher.find()) {\n\t\t\t\t\t\t\tAuthor = matcher.group(1).replace(\"BY\", \"\");\n\t\t\t\t\t\t\tAuthorOrg = Author.substring(\n\t\t\t\t\t\t\t\t\tAuthor.lastIndexOf(\",\") + 1).trim();\n\t\t\t\t\t\t\tAuthor = Author.split(\",\")[0].trim();\n\t\t\t\t\t\t\thasAuthor = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!hasAuthor && i == 2) {\n\t\t\t\t\t\tString[] str = checkPlace(line);\n\t\t\t\t\t\tContent = str[0];\n\t\t\t\t\t\tPlace = str[1];\n\t\t\t\t\t\tNewsDate = str[2];\n\t\t\t\t\t} else if (hasAuthor && i == 3) {\n\t\t\t\t\t\tString[] str = checkPlace(line);\n\t\t\t\t\t\tContent = str[0];\n\t\t\t\t\t\tPlace = str[1];\n\t\t\t\t\t\tNewsDate = str[2];\n\t\t\t\t\t\tj = 4;\n\t\t\t\t\t}\n\t\t\t\t\tif (i >= j) {\n\t\t\t\t\t\tContent = Content + map.get(i) + \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tr.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tif (Author != null) {\n\t\t\tAuthor = Author.replace(\"By\", \"\").trim();\n\t\t\td.setField(FieldNames.AUTHOR, Author);\n\t\t\td.setField(FieldNames.AUTHORORG, AuthorOrg);\n\t\t} \n\t\td.setField(FieldNames.FILEID, FileID);\n\t\td.setField(FieldNames.CATEGORY, Category);\n\t\td.setField(FieldNames.TITLE, Title);\n\t\td.setField(FieldNames.PLACE, Place);\n\t\td.setField(FieldNames.NEWSDATE, NewsDate);\n\t\td.setField(FieldNames.CONTENT, Content);\n\n\t\treturn d;\n\t}", "public Parser(java_cup.runtime.Scanner s) {super(s);}", "public Parser(java_cup.runtime.Scanner s) {super(s);}", "public Parser(java_cup.runtime.Scanner s) {super(s);}", "public Parser(java_cup.runtime.Scanner s) {super(s);}", "public Parser(java_cup.runtime.Scanner s) {super(s);}", "public Parser(java_cup.runtime.Scanner s) {super(s);}" ]
[ "0.78862715", "0.73792875", "0.7141527", "0.6868034", "0.6716605", "0.6709968", "0.66685486", "0.66608083", "0.66329825", "0.66045976", "0.6573198", "0.65517956", "0.6533502", "0.6506598", "0.6484793", "0.6457127", "0.6431254", "0.6383456", "0.62541354", "0.6239772", "0.6231958", "0.61733663", "0.6147479", "0.6103381", "0.6096603", "0.6068106", "0.6027301", "0.60256755", "0.60228986", "0.6019566", "0.600864", "0.60025775", "0.60024124", "0.59933317", "0.5989019", "0.59346193", "0.59154606", "0.59099555", "0.59082913", "0.5902914", "0.58954316", "0.58840674", "0.5882542", "0.58803344", "0.58749497", "0.5873878", "0.5848136", "0.5843758", "0.5834177", "0.58194405", "0.5808581", "0.5808355", "0.58074296", "0.5794667", "0.5774926", "0.5768318", "0.57643306", "0.57624763", "0.5760042", "0.5730656", "0.5717433", "0.57097554", "0.570687", "0.57050514", "0.568069", "0.56742233", "0.56624645", "0.5648645", "0.5648432", "0.5645909", "0.5641232", "0.56395644", "0.56363314", "0.56321037", "0.5607426", "0.56072587", "0.5600308", "0.5580019", "0.5577122", "0.5577122", "0.5577122", "0.5577122", "0.5577122", "0.5577122", "0.5577122", "0.5577122", "0.5572599", "0.5560462", "0.555288", "0.55526704", "0.5550682", "0.55415064", "0.5540697", "0.5540372", "0.55402136", "0.55402136", "0.55402136", "0.55402136", "0.55402136", "0.55402136" ]
0.5648518
68
creates a new parser object for the given filename
public SqlFileParser(String filename) { try { this.reader = new BufferedReader(new FileReader(filename)); } catch (FileNotFoundException e) { throw new IllegalArgumentException("file not found " + filename); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public JsonParser createParser(File f)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 755 */ IOContext ctxt = _createContext(f, true);\n/* 756 */ InputStream in = new FileInputStream(f);\n/* 757 */ return _createParser(_decorate(in, ctxt), ctxt);\n/* */ }", "public void parse(String filename);", "public CommandParser(String filename) {\r\n try {\r\n sc = new Scanner(new File(filename));\r\n }\r\n catch (FileNotFoundException e) {\r\n e.printStackTrace();\r\n System.out.println(\"File not found.\");\r\n }\r\n }", "public JsnParser(String filename) {\n this.filename = filename;\n }", "public ClassParser(final String file_name) {\n this.file_name = file_name;\n fileOwned = true;\n }", "public Parser(String fileHandle) {\n\t\tmainFile = fileHandle;\n\t}", "Object create(File file) throws IOException, SAXException, ParserConfigurationException;", "public void parse(String fileName) throws Exception;", "private static SimpleNode parse(String filename) throws ParseException {\n\t\tParser parser;\n\t\t// open file as input stream\n\t\ttry {\n\t\t\tparser = new Parser(new java.io.FileInputStream(filename));\n\t\t}\n\t\tcatch (java.io.FileNotFoundException e) {\n\t\t\tSystem.out.println(\"ERROR: file \" + filename + \" not found.\");\n\t\t\treturn null;\n\t\t}\n\t\t// parse and return root node\n\t\treturn parser.parse();\n\t}", "Parse createParse();", "public Parser(File file) {\n \t\t\ttry {\n \t\t\t\tload(new FileInputStream(file));\n \t\t\t} catch (Exception e) {\n \t\t\t\t// continue ... actual parsing will report errors\n \t\t\t}\n \t\t}", "public ObjReader(String filename){\n file = filename;\n }", "public Parser() {}", "public RuleParser() {\n this.fileName = \"\";\n }", "public void initParser(String file) {\n if (checkFileExists(file)) {\n parseXml(file);\n }\n }", "@Deprecated\n/* */ public JsonParser createJsonParser(File f)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 951 */ return createParser(f);\n/* */ }", "public SYEParser(InputStream input, String name) throws FileNotFoundException {\n super(input);\n this.filename = name;\n }", "private static Parser<Grammar> makeParser(final File grammar) {\n try {\n\n return Parser.compile(grammar, Grammar.ROOT);\n\n // translate these checked exceptions into unchecked\n // RuntimeExceptions,\n // because these failures indicate internal bugs rather than client\n // errors\n } catch (IOException e) {\n throw new RuntimeException(\"can't read the grammar file\", e);\n } catch (UnableToParseException e) {\n throw new IllegalArgumentException(\"the grammar has a syntax error\", e);\n }\n }", "public Parser( File inFile ) throws FileNotFoundException\r\n {\r\n if( inFile.isDirectory() )\r\n throw new FileNotFoundException( \"Excepted a file but found a directory\" );\r\n \r\n feed = new Scanner( inFile );\r\n lineNum = 1;\r\n }", "public JsonParser createParser(URL url)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 782 */ IOContext ctxt = _createContext(url, true);\n/* 783 */ InputStream in = _optimizedStreamFromURL(url);\n/* 784 */ return _createParser(_decorate(in, ctxt), ctxt);\n/* */ }", "public Parser(String parserFilename, String dataFilename)\n/* */ {\n/* 57 */ initComponents();\n/* */ \n/* 59 */ this.parserPanel = new ParserPanel();\n/* 60 */ getContentPane().add(\"Center\", this.parserPanel);\n/* 61 */ if (parserFilename != null) {\n/* 62 */ this.parserPanel.loadParser(parserFilename);\n/* */ }\n/* 64 */ if (dataFilename != null) {\n/* 65 */ this.parserPanel.loadFile(dataFilename);\n/* */ }\n/* 67 */ pack();\n/* */ }", "public TestNGParser(String fileName) {\n super(fileName);\n m_fileName = fileName;\n m_inputStream = null;\n m_postProcessor = null;\n }", "private Parser () { }", "public String parse(File file);", "public XPathParser(String xmlFileName) {\n this(new InputSource(xmlFileName), defaultContextNode);\n }", "public FitnessParser getParser(UploadedFile file ) throws IOException {\n\t\tInputStream stream = file.getInputstream();\n\t\tStringWriter sw = new StringWriter();\n\t\tIOUtils.copy(stream, sw);\n\t\tStringReader sr = new StringReader(sw.toString());\n\t\tBufferedReader br = new BufferedReader(sr);\n\t\t\n\t\tString firstLine = br.readLine();\n\t\tif(firstLine == null) {\n\t\t\tFacesMessage msg = new FacesMessage( FacesMessage.SEVERITY_ERROR, \"Error\", \"Invalid File\" );\n\t\t\tFacesContext.getCurrentInstance().addMessage( null, msg );\n\t\t\treturn null;\n\t\t} \n\t\tFitnessParser ret = null;\n\t\tif(checkFitbitFile(firstLine)) {\n\t\t\tret = new FitbitParser(file);\n\t\t} else if (checkMicrosoftFile(firstLine)) {\n\t\t\tret = new MicrosoftParser(file);\n\t\t} \n\t\t\n\t\tbr.close();\n\t\treturn ret;\n\t}", "public JsonParser createParser(InputStream in)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 809 */ IOContext ctxt = _createContext(in, false);\n/* 810 */ return _createParser(_decorate(in, ctxt), ctxt);\n/* */ }", "public PragyanXmlParser(InputStream file) {\r\n\t\tfileToParse = file;\r\n\t\tcharWriter = new CharArrayWriter();\r\n\t\tdateWriter = new CharArrayWriter();\r\n\t\tformat = new SimpleDateFormat(\"dd-MM-yyyy HH:mm\"); \r\n\t\t\r\n\t}", "private Parser makeParser(String input) throws LexicalException {\r\n\t\tshow(input); //Display the input \r\n\t\tScanner scanner = new Scanner(input).scan(); //Create a Scanner and initialize it\r\n\t\tshow(scanner); //Display the Scanner\r\n\t\tParser parser = new Parser(scanner);\r\n\t\treturn parser;\r\n\t}", "public static Document parse(String filename) throws ParserException {\n\t\t// TODO YOU MUST IMPLEMENT THIS\n\t\t// girish - All the code below is mine\n\t\t\t\n\t\t// Creating the object for the new Document\n\t\t\n\t\t\n\t\tif (filename == null){\n\t\t\tthrow new ParserException();\n\t\t}\n\t\t\n\t\t// Variable indexPos to track the current pointer location in the String Array\n\t\tint indexPos = 0;\n\t\t\n\t\t// Creating an instance of the document class to store the parsed content\n\t\tDocument d = new Document();\n\t\t\n\t\t// to store the result sent from the regexAuthor method and regexPlaceDate method\n\t\tObject[] resultAuthor = {null, null, null};\n\t\tObject[] resultPlaceDate = {null, null, null};\n\t\tStringBuilder news = new StringBuilder();\n\t\t\n\t\t// Next 4 lines contains the code to get the fileID and Category metadata\n\t\tString[] fileCat = new String[2];\n\t\t\n\t\tfileCat = regexFileIDCat(\"/((?:[a-z]|-)+)/([0-9]{7})\", filename);\n\t\t// System.out.println(filename);\n\t\t// throw an exception if the file is blank, junk or null\n\t\tif (fileCat[0] == null){\n\t\t\tthrow new ParserException();\n\t\t}\n\t\td.setField(FieldNames.CATEGORY, fileCat[0]);\n\t\td.setField(FieldNames.FILEID, fileCat[1]);\n\t\t\n\t\t\n\t\t// Now , parsing the file\n\t\tFile fileConnection = new File(filename);\n\t\t\n\t\t// newscollated - it will store the parsed file content on a line by line basis\n\t\tArrayList<String> newscollated = new ArrayList<String>();\n\t\t\n\t\t// String that stores the content obtained from the . readline() operation\n\t\tString temp = null;\n\t\t\n\t\ttry\n\t\t{\n\t\t\t\n\t\t\tBufferedReader getInfo = new BufferedReader(new FileReader(fileConnection));\n\t\t\twhile ((temp = getInfo.readLine()) != null)\n\t\t\t{\n\t\t\t\tif(temp.equals(\"\"))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\t\n\t\t\t\t\ttemp = temp + \" \";\n\t\t\t\t\tnewscollated.add(temp);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\tgetInfo.close();\n\t\t\t\n\t\t\t//-- deprecated (REMOVE THIS IF OTHER WORKS)\n\t\t\t// setting the title using the arraylist's 0th index element\n\t\t\t//d.setField(FieldNames.TITLE, newscollated.get(0));\n\t\t\t\n\t\t\t// Appending the lines into one big string using StringBuilder\n\t\t\t\n\t\t\tfor (String n: newscollated)\n\t\t\t{\n\t\t\t\tnews.append(n);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// Obtaining the TITLE of the file\n\t\t\tObject[] titleInfo = new Object[2];\n\t\t\t\n\t\t\ttitleInfo = regexTITLE(\"([^a-z]+)\\\\s{2,}\", news.toString());\n\t\t\td.setField(FieldNames.TITLE, titleInfo[0].toString().trim());\n\t\t\tindexPos = (Integer) titleInfo[1];\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t// Getting the Author and Author Org\n\t\t\tresultAuthor = regexAuthor(\"<AUTHOR>(.*)</AUTHOR>\", news.toString());\n\t\t\t\n\t\t\tif (resultAuthor[0] != null)\n\t\t\t{\n\t\t\t\td.setField(FieldNames.AUTHOR, resultAuthor[0].toString());\n\t\t\t}\n\t\t\t\n\t\t\tif (resultAuthor[1] != null)\n\t\t\t{\n\t\t\t\td.setField(FieldNames.AUTHORORG, resultAuthor[1].toString());\n\t\t\t}\n\t\t \n\t\t \n\t\t \n\t\t if ((Integer) resultAuthor[2] != 0)\n\t\t {\n\t\t \tindexPos = (Integer) resultAuthor[2];\n\t\t }\n\t\t\t\n\t\t \n\t\t \n\t\t // Getting the Place and Date\n \t\t\tresultPlaceDate = regexPlaceDate(\"\\\\s{2,}(.+),\\\\s(?:([A-Z][a-z]+\\\\s[0-9]{1,})\\\\s{1,}-)\", news.toString());\n \t\t\t\n \t\t\tif (resultPlaceDate[0] != null)\n \t\t\t{\n \t\t\t\td.setField(FieldNames.PLACE, resultPlaceDate[0].toString().trim());\n \t\t\t}\n \t\t \n \t\t\tif (resultPlaceDate[1] != null)\n \t\t\t{\n \t\t\t\td.setField(FieldNames.NEWSDATE, resultPlaceDate[1].toString().trim());\n \t\t\t}\n \t\t\t\n \t\t // getting the content\n \t\t \n \t\t if ((Integer) resultPlaceDate[2] != 0)\n\t\t {\n\t\t \tindexPos = (Integer) resultPlaceDate[2];\n\t\t }\n \t\t \n \t\t \n \t\t d.setField(FieldNames.CONTENT, news.substring(indexPos + 1));\n \t\t \n \t\t return d;\n \t\t \n\t\t \n\t\t \n\t\t\t\n\t\t\t\n\t\t}\n\t\tcatch(FileNotFoundException e){\n\t\t\tthrow new ParserException();\n\t\t\t\n\t\t}\n\n\t\tcatch(IOException e){\n\t\t\tthrow new ParserException();\n\t\t}\n\t\t\n\t\tcatch(Exception e){\n\t\t\te.printStackTrace();\n\t\t\t\n\t\t}\n\t\treturn d;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "void open(String fileName) throws IOException, ParserConfigurationException, SAXException;", "public Parser()\n {\n //nothing to do\n }", "public Parser(URL url) {\n \t\t\ttry {\n \t\t\t\tload(url.openStream());\n \t\t\t} catch (Exception e) {\n \t\t\t\t// continue ... actual parsing will report errors\n \t\t\t}\n \t\t}", "public static FileSource fromPath(String filename) {\n return fromPath(filename, new SmarterMap());\n }", "public static Object loadObject(String filename) throws XmlParseException, IOException\n {\n return loadObject(new File(filename));\n }", "Program( String filename ) throws IOException, ParserException, EvaluationException\n\t\t{\n\t\t\tmParser = new Parser();\n\t\t\t\n\t\t\tFileReader r = new FileReader( filename );\n\t\t\t\n\t\t\tStringBuilder builder = new StringBuilder();\n\t\t\t\n\t\t\tint ch = -1;\n\t\t\twhile( ( ch = r.read() ) >= 0 )\n\t\t\t{\n\t\t\t\tbuilder.append( (char) ch );\n\t\t\t}\n\t\t\tmProgram = builder.toString();\n\t\t\t\n\t\t\tmParser.parse( mProgram );\n\t\t}", "public static Document parse(String filename) throws ParserException {\n\n\t\tString FileID, Category, Title = null, Author = null, AuthorOrg = null, Place = null, NewsDate = null, Content = null, FileN;\n\t\tDocument d = new Document();\n\t\tif (filename == null || filename == \"\")\n\t\t\tthrow new ParserException();\n\t\tFileN = filename;\n\t\tHashMap<Integer, String> map = new HashMap<Integer, String>();\n\t\tBufferedReader r = null;\n\t\tFile file = new File(FileN);\n\t\tif (!file.exists())\n\t\t\tthrow new ParserException();\n\t\tFileID = file.getName();\n\t\tCategory = file.getParentFile().getName();\n\t\ttry {\n\t\t\tr = new BufferedReader(new FileReader(file));\n\t\t\tint i = 1, j = 3;\n\t\t\tBoolean isTitle = true, hasAuthor = false;\n\t\t\tString line;\n\t\t\twhile ((line = r.readLine()) != null) {\n\t\t\t\tline = line.trim();\n\t\t\t\tif (!line.equals(\"\")) {\n\t\t\t\t\tmap.put(i, line);\n\t\t\t\t\tif (isTitle) {\n\t\t\t\t\t\tTitle = line;\n\t\t\t\t\t\tisTitle = false;\n\t\t\t\t\t}\n\t\t\t\t\tif (hasAuthor == false && i == 2) {\n\t\t\t\t\t\tPattern pattern = Pattern\n\t\t\t\t\t\t\t\t.compile(\"<AUTHOR>(.+?)</AUTHOR>\");\n\t\t\t\t\t\tMatcher matcher = pattern.matcher(line);\n\t\t\t\t\t\tif (matcher.find()) {\n\t\t\t\t\t\t\tAuthor = matcher.group(1).replace(\"BY\", \"\");\n\t\t\t\t\t\t\tAuthorOrg = Author.substring(\n\t\t\t\t\t\t\t\t\tAuthor.lastIndexOf(\",\") + 1).trim();\n\t\t\t\t\t\t\tAuthor = Author.split(\",\")[0].trim();\n\t\t\t\t\t\t\thasAuthor = true;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif (!hasAuthor && i == 2) {\n\t\t\t\t\t\tString[] str = checkPlace(line);\n\t\t\t\t\t\tContent = str[0];\n\t\t\t\t\t\tPlace = str[1];\n\t\t\t\t\t\tNewsDate = str[2];\n\t\t\t\t\t} else if (hasAuthor && i == 3) {\n\t\t\t\t\t\tString[] str = checkPlace(line);\n\t\t\t\t\t\tContent = str[0];\n\t\t\t\t\t\tPlace = str[1];\n\t\t\t\t\t\tNewsDate = str[2];\n\t\t\t\t\t\tj = 4;\n\t\t\t\t\t}\n\t\t\t\t\tif (i >= j) {\n\t\t\t\t\t\tContent = Content + map.get(i) + \"\\n\";\n\t\t\t\t\t}\n\t\t\t\t\ti++;\n\t\t\t\t}\n\t\t\t}\n\t\t\tr.close();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tif (Author != null) {\n\t\t\tAuthor = Author.replace(\"By\", \"\").trim();\n\t\t\td.setField(FieldNames.AUTHOR, Author);\n\t\t\td.setField(FieldNames.AUTHORORG, AuthorOrg);\n\t\t} \n\t\td.setField(FieldNames.FILEID, FileID);\n\t\td.setField(FieldNames.CATEGORY, Category);\n\t\td.setField(FieldNames.TITLE, Title);\n\t\td.setField(FieldNames.PLACE, Place);\n\t\td.setField(FieldNames.NEWSDATE, NewsDate);\n\t\td.setField(FieldNames.CONTENT, Content);\n\n\t\treturn d;\n\t}", "public Decoder(String filename) throws FileNotFoundException { \n this.i = 0;\n this.position = 0;\n this.px = 0;\n this.py = 0;\n this.alkuposition = 0;\n this.j = 0;\n this.filename = filename;\n }", "protected ASTParser createASTParser() {\n ASTParser parser = ASTParser.newParser(this.testLevel);\n return parser;\n }", "public abstract ArgumentParser makeParser();", "public static Document parse(String filename) throws ParserException {\n\t\tif (filename == null) {\n\t\t\tthrow new ParserException();\n\t\t}\n\t\tFile file = new File(filename);\n\t\tif (!file.exists() || !file.isFile()) {\n\t\t\tthrow new ParserException();\n\t\t}\n\t\tFile subDir = file.getParentFile();\n\t\tif (!subDir.exists() || !subDir.isDirectory()) {\n\t\t\tthrow new ParserException();\n\t\t}\n\t\t// Document should be valid by here\n\t\tDocument doc = new Document();\n\t\tFieldNames field = FieldNames.TITLE;\n\t\tList<String> authors = new LinkedList<String>();\n\t\tString content = new String();\n\t\tboolean startContent = false;\n\n\t\tdoc.setField(FieldNames.FILEID, file.getName());\n\t\tdoc.setField(FieldNames.CATEGORY, subDir.getName());\n\n\t\ttry {\n\t\t\tBufferedReader reader = new BufferedReader(new FileReader(file));\n\t\t\tString line = reader.readLine();\n\n\t\t\twhile (line != null) {\n\t\t\t\tif (!line.isEmpty()) {\n\t\t\t\t\tswitch (field) {\n\t\t\t\t\tcase TITLE:\n\t\t\t\t\t\tdoc.setField(field, line);\n\t\t\t\t\t\tfield = FieldNames.AUTHOR;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase AUTHOR:\n\t\t\t\t\tcase AUTHORORG:\n\t\t\t\t\t\tif (line.startsWith(\"<AUTHOR>\") || !authors.isEmpty()) {\n\t\t\t\t\t\t\tString[] seg = null;\n\t\t\t\t\t\t\tString[] author = null;\n\n\t\t\t\t\t\t\tline = line.replace(\"<AUTHOR>\", \"\");\n\t\t\t\t\t\t\tseg = line.split(\",\");\n\t\t\t\t\t\t\tauthor = seg[0].split(\"and\");\n\t\t\t\t\t\t\tauthor[0] = author[0].replaceAll(\"BY|By|by\", \"\");\n\t\t\t\t\t\t\t// Refines author names\n\t\t\t\t\t\t\tfor (int i = 0; i < author.length; ++i) {\n\t\t\t\t\t\t\t\tauthor[i] = author[i].trim();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tauthor[author.length - 1] = author[author.length - 1]\n\t\t\t\t\t\t\t\t\t.replace(\"</AUTHOR>\", \"\").trim();\n\t\t\t\t\t\t\tauthors.addAll(Arrays.asList(author));\n\n\t\t\t\t\t\t\t// Saves author organization\n\t\t\t\t\t\t\tif (seg.length > 1) {\n\t\t\t\t\t\t\t\tdoc.setField(FieldNames.AUTHORORG, seg[1]\n\t\t\t\t\t\t\t\t\t\t.replace(\"</AUTHOR>\", \"\").trim());\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (line.endsWith(\"</AUTHOR>\")) {\n\t\t\t\t\t\t\t\t// Saves author\n\t\t\t\t\t\t\t\tdoc.setField(FieldNames.AUTHOR, authors\n\t\t\t\t\t\t\t\t\t\t.toArray(new String[authors.size()]));\n\t\t\t\t\t\t\t\tfield = FieldNames.PLACE;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t// This should be a PLACE\n\t\t\t\t\t\t\tfield = FieldNames.PLACE;\n\t\t\t\t\t\t}\n\t\t\t\t\tcase PLACE:\n\t\t\t\t\t\tif (!line.contains(\"-\")) {\n\t\t\t\t\t\t\tfield = FieldNames.CONTENT;\n\t\t\t\t\t\t\tstartContent = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tString[] seg = line.split(\"-\");\n\t\t\t\t\t\t\tString[] meta = seg[0].split(\",\");\n\t\t\t\t\t\t\tif (seg.length != 0 && !seg[0].isEmpty()) {\n\n\t\t\t\t\t\t\t\tif (meta.length > 1) {\n\t\t\t\t\t\t\t\t\tdoc.setField(\n\t\t\t\t\t\t\t\t\t\t\tFieldNames.PLACE,\n\t\t\t\t\t\t\t\t\t\t\tseg[0].substring(0,\n\t\t\t\t\t\t\t\t\t\t\t\t\tseg[0].lastIndexOf(\",\"))\n\t\t\t\t\t\t\t\t\t\t\t\t\t.trim());\n\t\t\t\t\t\t\t\t\tdoc.setField(FieldNames.NEWSDATE,\n\t\t\t\t\t\t\t\t\t\t\tmeta[meta.length - 1].trim());\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tmeta[0] = meta[0].trim();\n\t\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\t\tnew SimpleDateFormat(\"MMM d\",\n\t\t\t\t\t\t\t\t\t\t\t\tLocale.ENGLISH).parse(meta[0]);\n\t\t\t\t\t\t\t\t\t\t// This is a news date\n\t\t\t\t\t\t\t\t\t\tdoc.setField(FieldNames.NEWSDATE,\n\t\t\t\t\t\t\t\t\t\t\t\tmeta[0]);\n\t\t\t\t\t\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\t\t\t\t\t\t// This is a place\n\t\t\t\t\t\t\t\t\t\tdoc.setField(FieldNames.PLACE, meta[0]);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfield = FieldNames.CONTENT;\n\t\t\t\t\tcase CONTENT:\n\t\t\t\t\t\tif (!startContent) {\n\t\t\t\t\t\t\t// First line of content\n\t\t\t\t\t\t\tString[] cont = line.split(\"-\");\n\t\t\t\t\t\t\tif (cont.length > 1) {\n\t\t\t\t\t\t\t\tfor (int i = 1; i < cont.length; ++i) {\n\t\t\t\t\t\t\t\t\tcontent += cont[i];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstartContent = true;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tcontent += \" \" + line;\n\t\t\t\t\t\t}\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tline = reader.readLine();\n\t\t\t}\n\t\t\tdoc.setField(FieldNames.CONTENT, content);\n\t\t\tdoc.setField(FieldNames.LENGTH, Integer.toString(content.trim().split(\"\\\\s+\").length));\n\t\t\treader.close();\n\t\t} catch (IOException e) {\n\t\t\tthrow new ParserException();\n\t\t}\n\n\t\treturn doc;\n\t}", "private SourceFile _parseString(String txt) throws ParseException {\n ACParser p = new ACParser(txt);\n return p.SourceFile();\n }", "public static final Document parse(final File f) {\r\n String uri = \"file:\" + f.getAbsolutePath();\r\n\r\n if (File.separatorChar == '\\\\') {\r\n uri = uri.replace('\\\\', '/');\r\n }\r\n\r\n return parse(new InputSource(uri));\r\n }", "public void load(String filename) {\n\t\tsetup();\n\t\tparseOBJ(getBufferedReader(filename));\n\t}", "public Document load(final String filename) throws IOException, SAXException {\n final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();\n factory.setNamespaceAware(true);\n final DocumentBuilder builder;\n try {\n builder = factory.newDocumentBuilder();\n } catch (final ParserConfigurationException pce) {\n pce.printStackTrace();\n return null;\n }\n final InputStream inputStream = getClass().getResourceAsStream(filename);\n if (inputStream != null) {\n // for files found in JARs\n return builder.parse(inputStream);\n } else {\n // for files directly on the file system\n return builder.parse(new File(filename));\n }\n }", "public Parser(String inputFile, PrintWriter newFile)\n\t{\n\t\ttry\n\t\t{\n\t\t\tthis.scanner = new Scanner(inputFile);\n\t\t\tthis.newFile = newFile;\n\t\t\tvariableCount = functionCount = statementCount = labelCount = startLabel = endLabel = condLabel = globalCount = localCount = 0;\n\t\t\tglobalFlag = true;\n\t\t\tdeclareFlag = true;\n\t\t\tinFunction = true; \n\t\t\tglobalMap = new HashMap<String, Integer>();\n\t\t\tstatus = false;\n\t\t\tUpdateToken();\n\t\t}\n\t\tcatch(Exception e)\n\t\t{\n\t\t\t\n\t\t}\n\t}", "public Parser() {\n\t\tpopulateMaps();\n\t}", "public static PackerFileParser get() {\r\n\t\tif(parser==null) {\r\n\t\t\tIterator<PackerFileParser> packerFileParseIterator = \r\n\t\t\t\t\tServiceLoader.load(PackerFileParser.class).iterator();\r\n\t\t\t\r\n\t\t\tif(packerFileParseIterator.hasNext()) {\r\n\t\t\t\tparser = packerFileParseIterator.next();\r\n\t\t\t} else {\r\n\t\t\t\tparser = new PackerFileParserImpl();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn parser;\r\n\t}", "CParser getParser();", "public Parser()\n{\n //nothing to do\n}", "public XmlResourceParser openXmlResourceParser(int cookie, String fileName) throws IOException {\n XmlBlock block = openXmlBlockAsset(cookie, fileName);\n XmlResourceParser parser = block.newParser();\n if (parser != null) {\n if (block != null) {\n $closeResource(null, block);\n }\n return parser;\n }\n throw new AssertionError(\"block.newParser() returned a null parser\");\n }", "@Override\n public Class<? extends FileParser> resolveFileParser(Path file) {\n // getting file extension\n String filename = file.getFileName().toString();\n String[] filenameParts = filename.split(\"\\\\.\");\n String extension = filenameParts[filenameParts.length - 1];\n\n // get the class of the file parser\n return parsers.get(extension);\n }", "Object create(InputSource is) throws IOException, SAXException, ParserConfigurationException;", "public InstanceReader(String filename) throws FileNotFoundException{\n this.reader = new FileReader(filename);\n }", "public Node parseFromMain(InputStream inputStream, String filename) {\n if (config.isInlineScript()) {\n return parseInline(inputStream, filename, getCurrentContext().getCurrentScope());\n } else {\n return parseFileFromMain(inputStream, filename, getCurrentContext().getCurrentScope());\n }\n }", "public Config createConfig(String filename);", "public NameParser()\n {\n this(null);\n }", "public static LevelPack fromFile(String filename) {\n\t\tString json = Serializer.readStringFromFile(filename);\n\t\tLevelPack lp = fromJson(json);\n\t\tstandardize(lp);\n\t\treturn lp;\n\t}", "public Document getDocFromFile(String filename)\r\n throws ParserConfigurationException{\r\n {\r\n DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();\r\n DocumentBuilder db = dbf.newDocumentBuilder();\r\n Document doc = null;\r\n try{\r\n doc = db.parse(filename);\r\n }\r\n catch (Exception ex){\r\n System.out.println(\"XML parse failure\");\r\n ex.printStackTrace();\r\n }\r\n return doc;\r\n } \r\n }", "public Scanner( String filename ) throws IOException\n {\n sourceFile = new PushbackInputStream(new FileInputStream(filename));\n \n nextToken = null;\n }", "Object create(String uri) throws IOException, SAXException, ParserConfigurationException;", "public JsonParser createParser(char[] content)\n/* */ throws IOException\n/* */ {\n/* 899 */ return createParser(content, 0, content.length);\n/* */ }", "public FieldParser(String f) throws Exception {\n\t\tthis.fixFileName = f;\n\t}", "public HTMLFile (String inFileName) {\n inFile = new File(inFileName);\n inName = inFileName;\n inURL = null;\n commonConstruction();\n }", "public JsonParser createParser(DataInput in)\n/* */ throws IOException\n/* */ {\n/* 920 */ IOContext ctxt = _createContext(in, false);\n/* 921 */ return _createParser(_decorate(in, ctxt), ctxt);\n/* */ }", "Object create(Reader reader) throws IOException, SAXException, ParserConfigurationException;", "public FitnessParser getParser(UploadedFile file, DataSource ds) throws IOException, DBException {\n\t\tInputStream stream = file.getInputstream();\n\t\tStringWriter sw = new StringWriter();\n\t\tIOUtils.copy(stream, sw);\n\t\tStringReader sr = new StringReader(sw.toString());\n\t\tBufferedReader br = new BufferedReader(sr);\n\t\t\n\t\tString firstLine = br.readLine();\n\t\tif(firstLine == null) {\n\t\t\tFacesMessage msg = new FacesMessage( FacesMessage.SEVERITY_ERROR, \"Error\", \"Invalid File\" );\n\t\t\tFacesContext.getCurrentInstance().addMessage( null, msg );\n\t\t\treturn null;\n\t\t} \n\t\tFitnessParser ret = null;\n\t\tif(checkFitbitFile(firstLine)) {\n\t\t\tret = new FitbitParser(file, ds);\n\t\t} else if (checkMicrosoftFile(firstLine)) {\n\t\t\tret = new MicrosoftParser(file, ds);\n\t\t} \n\t\t\n\t\tbr.close();\n\t\treturn ret;\n\t}", "public parser(Scanner s) {super(s);}", "public ArrayList<Operation> parse(String filename) {\n\tint ref, op, arg;\n\tArrayList<Operation> retVal;\n\tBufferedReader br;\n\tString line;\n\tString[] lineContent;\n\tFile file = new File(filename);\n\tretVal = new ArrayList<Operation>();\n\ttry {\n\t br = new BufferedReader(new FileReader(file));\n\t while ((line = br.readLine()) != null) {\n\t\tlineContent = line.split(\" \");\n\t\tref = Integer.parseInt(lineContent[0]);\n\t\top = Integer.parseInt(lineContent[1]);\n\t\targ = Integer.parseInt(lineContent[2]);\n\n\t\tretVal.add(new Operation(ref, op, arg));\n\t }\n\t br.close();\n\t return retVal;\n\t} catch (Exception e) {\n\t return null;\n\t}\n }", "public PropFileReader(String filename, String jsonFileName){\n this.ruleJsonFile=jsonFileName;\n this.filename=filename;\n this.propertyBuilder();\n }", "public SqlFileParser(File sqlScript) {\n try {\n this.reader = new BufferedReader(new FileReader(sqlScript));\n } catch (FileNotFoundException e) {\n throw new IllegalArgumentException(\"file not found \" + sqlScript);\n }\n }", "void createNewInstance(String filename)\n {\n iIncomingLobsFactory = new incomingLobsFactory();\n iIncomingLobsFactory.setPackageName(\"com.loadSample\");\n \n // include schemaLocation hint for validation\n iIncomingLobsFactory.setXSDFileName(\"LoadSample.xsd\");\n \n // encoding for output document\n iIncomingLobsFactory.setEncoding(\"UTF8\");\n \n // encoding tag for xml declaration\n iIncomingLobsFactory.setEncodingTag(\"UTF-8\");\n \n // Create the root element in the document using the specified root element name\n iIncomingLobs = (incomingLobs) iIncomingLobsFactory.createRoot(\"incomingLobs\");\n createincomingLobs();\n \n iIncomingLobsFactory.save(filename);\n }", "private PLPParser makeParser(String input) throws LexicalException {\n\t\t\tshow(input); //Display the input \n\t\t\tPLPScanner scanner = new PLPScanner(input).scan(); //Create a Scanner and initialize it\n\t\t\tshow(scanner); //Display the Scanner\n\t\t\tPLPParser parser = new PLPParser(scanner);\n\t\t\treturn parser;\n\t\t}", "public static FileItem fromFilename(String filename) {\n String[] splitted = filename.split(SEPARATOR_FIELDS);\n\n String name = splitted[0];\n String date = cleanDate(splitted[1]);\n String time = cleanTime(splitted[2]);\n String sensor = splitted[3];\n\n return new FileItem(filename, name, date, time, sensor);\n }", "Object create(InputStream in) throws IOException, SAXException, ParserConfigurationException;", "abstract protected Parser createSACParser();", "ReleaseFile parse( InputStream is ) throws IOException;", "public OptionParser() {\n\n\t}", "public TagManager(String filePath) throws ClassNotFoundException, IOException {\n\t\ttagList = new HashMap<String, Integer>();\n\t\tselectedTags = new ArrayList<String>();\n\t\t// Reads serializable objects from file.\n\t\t// Populates the record list using stored data, if it exists.\n\t\tFile file = new File(filePath);\n\t\tif (file.exists()) {\n\t\t\treadFromFile(filePath);\n\t\t} else {\n\t\t\tfile.createNewFile();\n\t\t}\n\t}", "public GongDomObject(File file) throws ParserConfigurationException, InvalidTagException, SAXException, IOException {\r\n super(file);\r\n }", "public Parser(Scanner fileStream) {\n // Save fileStream for later\n this.fileStream = fileStream;\n // Set the delimiter so that actual instructions are read, instead of the whitespace\n this.fileStream.useDelimiter(Pattern.compile(whitespace, Pattern.MULTILINE));\n }", "public AnalysisMetadata parseFileToAnalysisMetadata(String filename) {\n\t\t\n\t\tAnalysisMetadata am = new AnalysisMetadata();\n\t\t\n\t\tRubyScript rs = new RubyScript(filename);\n\t\t\n\t\tam.setScript(rs);\n\t\t\t\t\n\t\tParameterDictionary pd = ParameterDictionary.emptyDictionary();\n\t\t\n\t\tParameter p = new Parameter(SCRIPT_FILENAME_PARAM, SCRIPT_FILENAME_PARAM, ParameterType.STRING_T, filename, null);\n\t\tpd.addParameter(p);\n\t\t\n\t\t\n\t\tam.setInputParameters(pd);\n\t\t\n\t\tScriptingContainer sc = new ScriptingContainer(org.jruby.embed.LocalContextScope.SINGLETHREAD, org.jruby.embed.LocalVariableBehavior.PERSISTENT);\n\t\tsc.setClassLoader(ij.IJ.getClassLoader());\n\t\tsc.put(\"parameters\", pd);\n\t\t\t\t\n\t\tsc.setCompatVersion(org.jruby.CompatVersion.RUBY1_9);\n\t\t\n\t\tsc.runScriptlet(this.getClass().getClassLoader().getResourceAsStream(SCRIPT_FUNCTIONS_FILE), SCRIPT_FUNCTIONS_FILE);\n\t\tsc.runScriptlet(rs.getScriptString());\n\t\t\n\t\tp = new Parameter(\"method_name\", \"method_name\", ParameterType.STRING_T, \"ScriptMethod\", null);\n\t\tpd.addIfNotSet(\"method_name\", p);\n\t\t\n\t\tam.setOutputParameters(new ParameterDictionary(pd));\n\t\t\n\t\treturn am;\n\t}", "private void parseFile(Project p, File f, ImportSettings settings, int pass)\n throws ImportException {\n\n\n try {\n BufferedInputStream bs = new BufferedInputStream(new FileInputStream(f));\n Lexer l = new Lexer(bs, f.getAbsolutePath());\n TokenCollection toks = l.lex();\n Parser px = new Parser();\n CompilationUnitNode cu = px.parse(toks, l.StringLiterals);\n parsedElements.add(cu);\n } catch (FeatureNotSupportedException e) {\n //throw new ImportException(\"Error parsing file: \" + f.getAbsolutePath() + \" due to: \"+e.getMessage());\n System.out.println(\"Error parsing file: \" + f.getAbsolutePath() + \" due to: \"+e.getMessage());\n } catch (Exception e) {\n// e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n// throw new ImportException(\"Error parsing file: \" + f.getAbsolutePath());\n System.out.println(\"Error parsing file: \" + f.getAbsolutePath());\n }\n\n }", "public static ArrayList<String> parseFile(String f) throws Exception {\n\t\tArrayList<CommandNode> cmdNode = new ArrayList<CommandNode>();\n\t\tArrayList<MemoryNode> memNode = new ArrayList<MemoryNode>();\n\t\tparseFile(f,cmdNode,memNode);\n\t\treturn preCompile(cmdNode, memNode);\n\t}", "public ClassParser(final InputStream inputStream, final String file_name) {\n this.file_name = file_name;\n fileOwned = false;\n\n if (inputStream instanceof DataInputStream) {\n this.dataInputStream = (DataInputStream) inputStream;\n } else {\n this.dataInputStream = new DataInputStream(new BufferedInputStream(inputStream, BUF_SIZE));\n }\n }", "public JPClass getParsedClass(File f) throws Exception;", "public interface Parser {\n\t\n\t/**\n\t * A method to parse the file\n\t * @param file the file\n\t * @return the content\n\t */\n\tpublic String parse(File file);\n\t\n}", "public JsonParser createParser(Reader r)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 829 */ IOContext ctxt = _createContext(r, false);\n/* 830 */ return _createParser(_decorate(r, ctxt), ctxt);\n/* */ }", "public FastaReader(String fileName) throws IOException{\n\t\tthis(new FileInputStream(fileName));\n\t}", "public JsonParser createParser(String content)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 879 */ int strLen = content.length();\n/* */ \n/* 881 */ if ((this._inputDecorator != null) || (strLen > 32768) || (!canUseCharArrays()))\n/* */ {\n/* */ \n/* 884 */ return createParser(new StringReader(content));\n/* */ }\n/* 886 */ IOContext ctxt = _createContext(content, true);\n/* 887 */ char[] buf = ctxt.allocTokenBuffer(strLen);\n/* 888 */ content.getChars(0, strLen, buf, 0);\n/* 889 */ return _createParser(buf, 0, strLen, ctxt, true);\n/* */ }", "protected abstract void parseFile(File f) throws IOException;", "public FileDatabase(String filename) throws IOException {\n\t\tdatabase = new File(filename);\n\t\tread();\n\t}", "public static Parser getInstance(Context ctx){\n if(instance == null){\n instance = new Parser(ctx);\n }\n return instance;\n }", "public GeneSplicerParser(String filepath) throws FileNotFoundException, IOException {\n // initialize the lists\n this();\n\n // read in the file\n BufferedReader br = new BufferedReader(new FileReader(filepath));\n for(String line = br.readLine(); line != null; line = br.readLine()) {\n // parse the line\n GeneSplicerEntry entry = new GeneSplicerEntry(line);\n\n // add the entry to the appropriate list\n if(entry.type == GeneSplicerEntry.Type.Acceptor) {\n acceptors.add(entry.start);\n } else {\n donors.add(entry.start);\n }\n }\n }", "public XMLHandler(File file) {\n this.file = file;\n }", "public static DecaLexer createLexerFromArgs(String[] args)\n throws IOException {\n Validate.isTrue(args.length <= 1, \"0 or 1 argument expected.\");\n DecaLexer lex;\n if (args.length == 1) {\n lex = new DecaLexer(CharStreams.fromFileName(args[0]));\n lex.setSource(new File(args[0]));\n } else {\n System.err.println(\"Reading from stdin ...\");\n lex = new DecaLexer(CharStreams.fromStream(System.in));\n }\n return lex;\n }", "public IniFile(String name) {\r\n this.filename = name;\r\n isavailable = parse(name);\r\n }", "public XmlPullParser getLocalXML(String filename) throws IOException {\r\n\t\ttry {\r\n\t\t\tin = mContext.getAssets().open(filename);\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\ttry {\r\n\t\t\tXmlPullParser parser = Xml.newPullParser();\r\n\t\t\tparser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, false);\r\n\t\t\tparser.setInput(in, null);\r\n\t\t\tparser.nextTag();\r\n\t\t\treturn parser;\r\n\t\t} catch (XmlPullParserException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}", "public JavaCodeGenerator(String filename)\n throws IOException {\n this(filename, new CodeStyle());\n }", "@Override\n public ConfigurationMetaData parse(String configFile) {\n ParsingMethod parsingMethod = ParsingMethod.REGEX;\n FlexGrammarParser parser = null;\n if (!StringUtils.isEmpty(configFile)) {\n try {\n CharStream input = new ANTLRInputStream(new StringReader(configFile));\n FlexGrammarLexer lex = new FlexGrammarLexer(input);\n CommonTokenStream tokens = new CommonTokenStream(lex);\n parser = new FlexGrammarParser(tokens);\n parser.removeErrorListeners();\n ErrorListener errorListener = new ErrorListener();\n parser.addErrorListener(errorListener);\n ConfigurationMetaData configMetaData = resolve(parser);\n configMetaData.setParsingMethod(parsingMethod);\n validator.validateTokenCount(configMetaData);\n return configMetaData;\n } catch (IllegalArgumentException | FlexEngineParseException e) {\n throw e;\n } catch (Exception e) {\n logger.error(\"unable to parse config file, error: {}\", e.getMessage(), e);\n throw new FlexEngineParseException(\"unable to parse config file\", e);\n }\n } else {\n logger.error(\"config file is null or empty\");\n throw new IllegalArgumentException(\"config file is null or empty\");\n }\n\n }" ]
[ "0.7380303", "0.7276484", "0.70246154", "0.6977238", "0.6818986", "0.674782", "0.67348456", "0.66068304", "0.6565904", "0.6489775", "0.6470226", "0.63538665", "0.63276625", "0.6228586", "0.62029725", "0.61422044", "0.6123134", "0.61224633", "0.61120254", "0.6060136", "0.6048817", "0.602634", "0.59923255", "0.5982005", "0.59730834", "0.59374464", "0.593253", "0.58651376", "0.5859613", "0.5822202", "0.57740146", "0.5748518", "0.5737364", "0.573647", "0.57346904", "0.5732523", "0.5721158", "0.5718673", "0.5684402", "0.56561923", "0.5646368", "0.5643028", "0.5632115", "0.5620767", "0.5619956", "0.5614962", "0.561473", "0.5608862", "0.55918175", "0.55819386", "0.5573197", "0.556988", "0.5569768", "0.55671465", "0.55668956", "0.55564326", "0.55428433", "0.55419207", "0.55238515", "0.5507195", "0.55028325", "0.5481414", "0.5474537", "0.54710966", "0.54709154", "0.54647577", "0.54643047", "0.5458726", "0.54513425", "0.5446919", "0.54254574", "0.54181796", "0.5417027", "0.54141563", "0.54135174", "0.5409719", "0.54093117", "0.5401153", "0.53997564", "0.5388091", "0.53848547", "0.5383831", "0.5382006", "0.53648245", "0.5348645", "0.53457606", "0.53438944", "0.5341702", "0.5325025", "0.5318885", "0.53160024", "0.5311602", "0.5299742", "0.52897394", "0.5289641", "0.5289571", "0.52875245", "0.5278095", "0.52724236", "0.52633965" ]
0.6593031
8
creates a new parser object for the given input steam
public SqlFileParser(InputStream stream) { this.reader = new BufferedReader(new InputStreamReader(stream)); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Parser makeParser(String input) throws LexicalException {\r\n\t\tshow(input); //Display the input \r\n\t\tScanner scanner = new Scanner(input).scan(); //Create a Scanner and initialize it\r\n\t\tshow(scanner); //Display the Scanner\r\n\t\tParser parser = new Parser(scanner);\r\n\t\treturn parser;\r\n\t}", "private PLPParser makeParser(String input) throws LexicalException {\n\t\t\tshow(input); //Display the input \n\t\t\tPLPScanner scanner = new PLPScanner(input).scan(); //Create a Scanner and initialize it\n\t\t\tshow(scanner); //Display the Scanner\n\t\t\tPLPParser parser = new PLPParser(scanner);\n\t\t\treturn parser;\n\t\t}", "public JsonParser createParser(InputStream in)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 809 */ IOContext ctxt = _createContext(in, false);\n/* 810 */ return _createParser(_decorate(in, ctxt), ctxt);\n/* */ }", "public JsonParser createParser(DataInput in)\n/* */ throws IOException\n/* */ {\n/* 920 */ IOContext ctxt = _createContext(in, false);\n/* 921 */ return _createParser(_decorate(in, ctxt), ctxt);\n/* */ }", "Parse createParse();", "Object create(InputSource is) throws IOException, SAXException, ParserConfigurationException;", "public parser(Scanner s) {super(s);}", "abstract protected Parser createSACParser();", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public parser(java_cup.runtime.Scanner s) {super(s);}", "public Parser() {}", "public ProgramParser(String prog, String input) {\n ProgramParser.programCode = new java.io.StringReader(prog);\n ProgramParser.stringInput = input;\n //System.out.println(\"Program: \" + prog + \" - input: \" + programInput);\n }", "public Parser(java_cup.runtime.Scanner s) {super(s);}", "public Parser(java_cup.runtime.Scanner s) {super(s);}", "public Parser(java_cup.runtime.Scanner s) {super(s);}", "public Parser(java_cup.runtime.Scanner s) {super(s);}", "public Parser(java_cup.runtime.Scanner s) {super(s);}", "public Parser(java_cup.runtime.Scanner s) {super(s);}", "protected ASTParser createASTParser() {\n ASTParser parser = ASTParser.newParser(this.testLevel);\n return parser;\n }", "public parser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);}", "public parser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);}", "public parser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);}", "public parser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);}", "public parser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);}", "public parser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);}", "public parser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);}", "public parser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);}", "public parser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);}", "public parser(Scanner s, SymbolFactory sf) {super(s,sf);}", "public Parser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);}", "public Parser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);}", "public Parser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);}", "public Parser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);}", "public Parser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);}", "public Parser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);}", "public Parser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);}", "public abstract ArgumentParser makeParser();", "public JsonParser createParser(URL url)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 782 */ IOContext ctxt = _createContext(url, true);\n/* 783 */ InputStream in = _optimizedStreamFromURL(url);\n/* 784 */ return _createParser(_decorate(in, ctxt), ctxt);\n/* */ }", "private Parser () { }", "public JsonParser createParser(String content)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 879 */ int strLen = content.length();\n/* */ \n/* 881 */ if ((this._inputDecorator != null) || (strLen > 32768) || (!canUseCharArrays()))\n/* */ {\n/* */ \n/* 884 */ return createParser(new StringReader(content));\n/* */ }\n/* 886 */ IOContext ctxt = _createContext(content, true);\n/* 887 */ char[] buf = ctxt.allocTokenBuffer(strLen);\n/* 888 */ content.getChars(0, strLen, buf, 0);\n/* 889 */ return _createParser(buf, 0, strLen, ctxt, true);\n/* */ }", "public SmartScriptParser(String text) {\n lexer = new SmartScriptLexer(text);\n documentNode = new DocumentNode();\n stack = new ObjectStack();\n parse();\n\n}", "public ProgramParser(java.io.InputStream stream, String encoding) {\n try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\n token_source = new ProgramParserTokenManager(jj_input_stream);\n token = new Token();\n jj_ntk = -1;\n jj_gen = 0;\n for (int i = 0; i < 14; i++) jj_la1[i] = -1;\n for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\n }", "Object create(InputStream in) throws IOException, SAXException, ParserConfigurationException;", "public CoolParser(java_cup.runtime.Scanner s) {super(s);}", "public StringParseable getParser(String input) {\n\t\treturn new XMLStringParser(input);\n\t}", "public SimpleHtmlParser createNewParserFromHereToText(String text) throws ParseException {\n return new SimpleHtmlParser(getStringToTextAndSkip(text));\n }", "public Programa(java.io.InputStream stream, String encoding) {\n if (jj_initialized_once) {\n System.out.println(\"ERROR: Second call to constructor of static parser. \");\n System.out.println(\" You must either use ReInit() or set the JavaCC option STATIC to false\");\n System.out.println(\" during parser generation.\");\n throw new Error();\n }\n jj_initialized_once = true;\n try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\n token_source = new ProgramaTokenManager(jj_input_stream);\n token = new Token();\n jj_ntk = -1;\n jj_gen = 0;\n for (int i = 0; i < 2; i++) jj_la1[i] = -1;\n }", "private TraceParser genParser() throws ParseException {\n TraceParser parser = new TraceParser();\n parser.addRegex(\"^(?<VTIME>)(?<TYPE>)$\");\n parser.addPartitionsSeparator(\"^--$\");\n return parser;\n }", "public void setupParser(InputStream is) {\r\n inputSource = new InputSource(is);\r\n }", "public AstParser(java.io.InputStream stream, String encoding) {\n try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\n token_source = new AstParserTokenManager(jj_input_stream);\n token = new Token();\n jj_ntk = -1;\n jj_gen = 0;\n for (int i = 0; i < 9; i++) jj_la1[i] = -1;\n }", "protected StreamParser()\n {\n }", "public CoolParser(java_cup.runtime.Scanner s, java_cup.runtime.SymbolFactory sf) {super(s,sf);}", "public Parser(String[] userInput) {\n this.command = userInput[0];\n if (userInput.length > 1) {\n this.description = userInput[1];\n }\n }", "public A4Parser(java_cup.runtime.Scanner s) {super(s);}", "public A4Parser(java_cup.runtime.Scanner s) {super(s);}", "private Module parse(InputStream input)\r\n\t\t\t\t\tthrows ModuleParseException\r\n\t{\n\t\treturn null;\r\n\t}", "public JsonParser createParser(char[] content)\n/* */ throws IOException\n/* */ {\n/* 899 */ return createParser(content, 0, content.length);\n/* */ }", "public static JavaParser getParser(final CharStream stream) {\n final JavaLexer lexer = new JavaLexer(stream);\n final CommonTokenStream in = new CommonTokenStream(lexer);\n return new JavaParser(in);\n }", "protected JsonParser _createParser(InputStream in, IOContext ctxt)\n/* */ throws IOException\n/* */ {\n/* 1271 */ return new ByteSourceJsonBootstrapper(ctxt, in).constructParser(this._parserFeatures, this._objectCodec, this._byteSymbolCanonicalizer, this._rootCharSymbols, this._factoryFeatures);\n/* */ }", "public FractalParser(java_cup.runtime.Scanner s) {super(s);}", "public CalculatorTokenStream(String input) {\n\t\tscanner = new CalculatorScanner(input);\n\t\t// prime the first token.\n\t\tadvance();\n\t}", "public JsonParser createParser(char[] content, int offset, int len)\n/* */ throws IOException\n/* */ {\n/* 908 */ if (this._inputDecorator != null) {\n/* 909 */ return createParser(new CharArrayReader(content, offset, len));\n/* */ }\n/* 911 */ return _createParser(content, offset, len, _createContext(content, true), false);\n/* */ }", "public JsonParser createParser(byte[] data)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 840 */ IOContext ctxt = _createContext(data, true);\n/* 841 */ if (this._inputDecorator != null) {\n/* 842 */ InputStream in = this._inputDecorator.decorate(ctxt, data, 0, data.length);\n/* 843 */ if (in != null) {\n/* 844 */ return _createParser(in, ctxt);\n/* */ }\n/* */ }\n/* 847 */ return _createParser(data, 0, data.length, ctxt);\n/* */ }", "public Parser() {\n\t\tpopulateMaps();\n\t}", "public Parser()\n {\n //nothing to do\n }", "public JsonParser createParser(File f)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 755 */ IOContext ctxt = _createContext(f, true);\n/* 756 */ InputStream in = new FileInputStream(f);\n/* 757 */ return _createParser(_decorate(in, ctxt), ctxt);\n/* */ }", "public Program parse() throws SyntaxException {\n\t\tProgram p = program();\n\t\tmatchEOF();\n\t\treturn p;\n\t}", "public MJParser(java_cup.runtime.Scanner s) {super(s);}", "public CompParser(java_cup.runtime.Scanner s) {super(s);}", "public synchronized void init() throws IOException\n {\n parserIn = new PipedOutputStream();\n PipedInputStream in = new PipedInputStream();\n parserIn.connect( in );\n antlrSchemaConverterLexer lexer = new antlrSchemaConverterLexer( in );\n parser = new antlrSchemaConverterParser( lexer );\n }", "public Parser(java.io.InputStream stream, String encoding) {\r\n try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\r\n token_source = new ParserTokenManager(jj_input_stream);\r\n token = new Token();\r\n jj_ntk = -1;\r\n }", "Program parse() throws SyntaxException {\n\t\tProgram p = null;\n\t\tp = program();\n\t\tmatchEOF();\n\t\treturn p;\n\t}", "public Parser()\n{\n //nothing to do\n}", "public Parser(URL url) {\n \t\t\ttry {\n \t\t\t\tload(url.openStream());\n \t\t\t} catch (Exception e) {\n \t\t\t\t// continue ... actual parsing will report errors\n \t\t\t}\n \t\t}", "SAPL parse(InputStream saplInputStream);", "public SYEParser(InputStream input, String name) throws FileNotFoundException {\n super(input);\n this.filename = name;\n }", "public TallerLP(java.io.InputStream stream, String encoding) {\n if (jj_initialized_once) {\n System.out.println(\"ERROR: Second call to constructor of static parser. \");\n System.out.println(\" You must either use ReInit() or set the JavaCC option STATIC to false\");\n System.out.println(\" during parser generation.\");\n throw new Error();\n }\n jj_initialized_once = true;\n try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\n token_source = new TallerLPTokenManager(jj_input_stream);\n token = new Token();\n jj_ntk = -1;\n jj_gen = 0;\n for (int i = 0; i < 2; i++) jj_la1[i] = -1;\n }", "public BasicParser(java.io.InputStream stream, String encoding) {\n\t try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\n\t token_source = new BasicParserTokenManager(jj_input_stream);\n\t token = new Token();\n\t jj_ntk = -1;\n\t jj_gen = 0;\n\t for (int i = 0; i < 13; i++) jj_la1[i] = -1;\n }", "public JsonParser createParser(Reader r)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 829 */ IOContext ctxt = _createContext(r, false);\n/* 830 */ return _createParser(_decorate(r, ctxt), ctxt);\n/* */ }", "public SparrowParser(java.io.InputStream stream, String encoding) {\n if (jj_initialized_once) {\n System.out.println(\"ERROR: Second call to constructor of static parser. \");\n System.out.println(\" You must either use ReInit() or set the JavaCC option STATIC to false\");\n System.out.println(\" during parser generation.\");\n throw new Error();\n }\n jj_initialized_once = true;\n try { jj_input_stream = new JavaCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\n token_source = new SparrowParserTokenManager(jj_input_stream);\n token = new Token();\n jj_ntk = -1;\n jj_gen = 0;\n for (int i = 0; i < 3; i++) jj_la1[i] = -1;\n for (int i = 0; i < jj_2_rtns.length; i++) jj_2_rtns[i] = new JJCalls();\n }", "public SyntaxParser(final String input, @NotNull final InstructionSet instructionSet) {\n this(input, instructionSet, 0, CharInputStream.END_OF_FILE);\n }", "protected JsonParser _createParser(DataInput input, IOContext ctxt)\n/* */ throws IOException\n/* */ {\n/* 1329 */ String format = getFormatName();\n/* 1330 */ if (format != \"JSON\") {\n/* 1331 */ throw new UnsupportedOperationException(String.format(\"InputData source not (yet?) support for this format (%s)\", new Object[] { format }));\n/* */ }\n/* */ \n/* */ \n/* */ \n/* 1336 */ int firstByte = ByteSourceJsonBootstrapper.skipUTF8BOM(input);\n/* 1337 */ ByteQuadsCanonicalizer can = this._byteSymbolCanonicalizer.makeChild(this._factoryFeatures);\n/* 1338 */ return new UTF8DataInputJsonParser(ctxt, this._parserFeatures, input, this._objectCodec, can, firstByte);\n/* */ }", "@Deprecated\n/* */ public JsonParser createJsonParser(InputStream in)\n/* */ throws IOException, JsonParseException\n/* */ {\n/* 1002 */ return createParser(in);\n/* */ }", "public void parse(Lexer lex);", "public CalculatorParser(java.io.InputStream stream, String encoding) {\n try { jj_input_stream = new SimpleCharStream(stream, encoding, 1, 1); } catch(java.io.UnsupportedEncodingException e) { throw new RuntimeException(e); }\n token_source = new CalculatorParserTokenManager(jj_input_stream);\n token = new Token();\n jj_ntk = -1;\n }", "public parser(CharStream arg0){\r\n\t\tsuper(arg0);\r\n\t\t//create a list to hold the employee objects\r\n\t\tmySms = new ArrayList();\r\n\t\tmyFaq = new ArrayList();\r\n\t\tfor (int i = 0 ; i< MAX_RANKS; i++){\r\n\t\t\t Ranks[i] = new rank();\r\n\t\t\t Ranks[i].setHits(0);\r\n\t\t\t Ranks[i].setId(\"\");\r\n\t\t\t Ranks[i].setQuestion(\"\");\r\n\t\t\t Ranks[i].setDomain(\"\");\r\n\t\t}\r\n\t\tfor (int i = 0 ; i< MAX_RANKS; i++){\r\n\t\t\t topRank[i] = new rank();\r\n\t\t\t topRank[i].setHits(0);\r\n\t\t\t topRank[i].setId(\"\");\r\n\t\t\t topRank[i].setQuestion(\"\");\r\n\t\t\t topRank[i].setDomain(\"\");\r\n\t\t}\r\n\t\t\r\n\t}", "public Parser(Scanner fileStream) {\n // Save fileStream for later\n this.fileStream = fileStream;\n // Set the delimiter so that actual instructions are read, instead of the whitespace\n this.fileStream.useDelimiter(Pattern.compile(whitespace, Pattern.MULTILINE));\n }", "CParser getParser();", "public Parser() throws IOException {\n\t\tlookahead = System.in.read();\n\t\terrorNum = 0;\n\t\tinput = \"\";\n\t\toutput = \"\";\n\t\terrorPos = \"\";\n\t\terrorList = new ArrayList<String>();\n\t\twrongState = false;\n\t}", "public OnionooParser() {\n\n\t}", "public TemplexTokenMaker(java.io.InputStream in) {\r\n this(new java.io.InputStreamReader(in));\r\n }", "PTB2TextLexer(java.io.InputStream in) {\n this(new java.io.InputStreamReader(in));\n }", "void Parse(Source source);", "public AstParser(AstParserTokenManager tm) {\n token_source = tm;\n token = new Token();\n jj_ntk = -1;\n jj_gen = 0;\n for (int i = 0; i < 9; i++) jj_la1[i] = -1;\n }", "public abstract T parseLine(String inputLine);" ]
[ "0.74408096", "0.71443796", "0.69569933", "0.69278055", "0.674166", "0.65531695", "0.6546578", "0.64104706", "0.640272", "0.640272", "0.640272", "0.640272", "0.640272", "0.640272", "0.640272", "0.640272", "0.63854283", "0.63594365", "0.63443387", "0.63443387", "0.63443387", "0.63443387", "0.63443387", "0.63443387", "0.6277903", "0.6277447", "0.6277447", "0.6277447", "0.6277447", "0.6277447", "0.6277447", "0.6277447", "0.6277447", "0.6277447", "0.6247164", "0.62168026", "0.62168026", "0.62168026", "0.62168026", "0.62168026", "0.62168026", "0.62168026", "0.6203016", "0.62015283", "0.6140753", "0.61352086", "0.6085923", "0.6072854", "0.6043681", "0.6033528", "0.6022033", "0.59908426", "0.5981537", "0.5950498", "0.5932053", "0.5910887", "0.5905575", "0.588983", "0.58519405", "0.58428", "0.58428", "0.5837858", "0.5827876", "0.5824621", "0.5817041", "0.58168715", "0.5815139", "0.58147013", "0.5806511", "0.57894665", "0.5765095", "0.5764881", "0.57392514", "0.573329", "0.57028407", "0.5687892", "0.5679818", "0.5676859", "0.56741536", "0.56688106", "0.5657727", "0.5655332", "0.5655048", "0.5651545", "0.5650473", "0.56347644", "0.5628368", "0.5627173", "0.56213915", "0.5620321", "0.5620034", "0.5605957", "0.5589698", "0.5583537", "0.55741894", "0.55507314", "0.5534967", "0.55340123", "0.5522123", "0.551402", "0.5511544" ]
0.0
-1
read the file line per line: strip comments split on ';' concatenate multipleline statements
public List<String> parse() { String line = null; int lineCounter = 0; StringBuilder statement = new StringBuilder(); List<String> statements = new LinkedList<String>(); Pattern commentPattern = Pattern.compile("(//|#|--)+.*$"); try { while ((line = reader.readLine()) != null) { lineCounter++; //strip comment up to the first non-comment Matcher m = commentPattern.matcher(line); if (m.find()) { line = line.substring(0, m.start()); } //remove leading and trailing whitespace statement.append(" "); line = statement.append(line).toString(); line = line.replaceAll("\\s+", " "); line = line.trim(); //split by ; //Note: possible problems with ; in '' String[] tokens = line.split(";"); //trim the tokens (no leading or trailing whitespace for (int i = 0; i < tokens.length; i++) { tokens[i] = tokens[i].trim(); } boolean containsSemicolon = line.contains(";"); boolean endsWithSemicolon = line.endsWith(";"); if (!containsSemicolon) { //statement is still open, do nothing continue; } if (tokens.length == 1 && endsWithSemicolon) { //statement is complete, semicolon at the end. statements.add(tokens[0]); statement = new StringBuilder(); continue; } // other cases must have more than 1 token //iterate over tokens (but the last one) for (int i = 0; i < tokens.length - 1; i++) { statements.add(tokens[0]); statement = new StringBuilder(); } //last statement may remain open: if (endsWithSemicolon) { statements.add(tokens[0]); statement = new StringBuilder(); } else { statement = new StringBuilder(); statement.append(tokens[tokens.length - 1]); } } if (statement != null && statement.toString().trim().length() > 0) throw new UnclosedStatementException("Statement is not closed until the end of the file."); } catch (IOException e) { logger.warn("An error occurred!", e); } finally { try { reader.close(); } catch (IOException e) { logger.warn("An error occurred!", e); } } return statements; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private void cleanComments() throws IOException {\n boolean parsingComment = false;\n PrintWriter writer = new PrintWriter(\"clean.txt\", \"UTF-8\");\n ArrayList<String> symbols = new ArrayList<String>();\n String c = String.valueOf((char) _br.read());\n symbols.add(c);\n while (!c.equals(String.valueOf((char) -1))) {\n if (parsingComment) {\n String scan = \"\";\n while (!scan.endsWith(\"*/\")) {\n c = String.valueOf((char) _br.read());\n if (c.equals(\"\\n\"))\n symbols.add(c);\n scan += c;\n }\n parsingComment = false;\n }\n c = String.valueOf((char) _br.read());\n if (c.equals(\"*\") && symbols.get(symbols.size() - 1).equals(\"/\")) {\n symbols.remove(symbols.size() - 1);\n parsingComment = true;\n continue;\n }\n if (!c.equals(String.valueOf((char) -1)))\n symbols.add(c);\n }\n for (String s : symbols) {\n writer.print(s);\n }\n writer.close();\n _br.close();\n _br = new BufferedReader(new FileReader(\"clean.txt\"));\n }", "private void handleFile(File file) {\n try {\n Scanner reader = new Scanner(file);\n while (reader.hasNextLine()) {\n // Get the next line\n String line = reader.nextLine();\n\n // Clean any lines from unwanted statements\n line = cleanLine(line);\n\n // Filter out the imports and save\n if (line.length() >= 7 && line.substring(0, 7).equals(\"import \")) {\n if (! (line.length() >= 12 && line.substring(0, 12).equals(\"import main.\"))) {\n imports.add(line);\n }\n } else if (! (line.length() >= 7 && line.substring(0, 7).equals(\"package\"))){\n lines.add(line);\n }\n }\n lines.add(\"\"); // Add an empty line between files\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "private boolean readLines(final File file) throws IOException {\n\t\t_lastCommentStart = -1;\n\t\t_lastCommentEnd = -1;\n\t\t_lastCommentLine = -1;\n\t\t_firstCommentStart = -1;\n\t\t_firstCommentEnd = -1;\n\t\t_linePos = -1;\n\t\tBufferedReader in = _charset == null\n\t\t\t? new BufferedReader(new InputStreamReader(\n\t\t\t\tnew FileInputStream(file)))\n\t\t\t: new BufferedReader(new InputStreamReader(\n\t\t\t\tnew FileInputStream(file), _charset));\n\t\tString line;\n\t\tboolean modified = false;\n\t\twhile ((line = in.readLine()) != null) {\n\t\t\t_lines++;\n\t\t\t//cut final white spaces\n\t\t\tint len = line.length();\n\t\t\tint i = len;\n\t\t\tint k;\n\t\t\twhile((len > 0)\n\t\t\t\t&& line.charAt(len - 1) <= ' ') {\n\t\t\t\tlen--;\n\t\t\t}\n\t\t\t_linePos = _sb.length();\n\t\t\tif (len == 0) {\n\t\t\t\tif (_linePos == 0) { //ignore leading empty lines\n\t\t\t\t\tmodified = true;\n\t\t\t\t} else {\n\t\t\t\t\tmodified |= i != len;\n\t\t\t\t\tif (_genCR) {\n\t\t\t\t\t\t_sb.append('\\r'); //add CR\n\t\t\t\t\t}\n\t\t\t\t\t_sb.append('\\n'); //add LF\n\t\t\t\t}\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (_spacesToTab) { //makeTabsFromSpaces\n\t\t\t\t//replace leading spaces by tabs\n\t\t\t\tfor (i = 0, k = 0; i < len; i++ ) {\n\t\t\t\t\tchar ch = line.charAt(i);\n\t\t\t\t\tif (ch == '\\t') {\n\t\t\t\t\t\tk = (((k + _indentSize - 1)/_indentSize) + 1)\n\t\t\t\t\t\t\t*_indentSize;\n\t\t\t\t\t} else if (ch == ' ') {\n\t\t\t\t\t\tk++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (i < len) { //not empty line\n\t\t\t\t\tfor (int j = 0; j < (k / _indentSize); j++) {\n\t\t\t\t\t\t_sb.append('\\t');\n\t\t\t\t\t}\n\t\t\t\t\tif ((k = k % _indentSize) > 0) {\n\t\t\t\t\t\t_sb.append(_indentSpaces.substring(0, k));\n\t\t\t\t\t}\n\t\t\t\t\t_sb.append(line.substring(i,len));\n\t\t\t\t}\n\t\t\t} else { //makeSpacesFromTabs\n\t\t\t\t//replace leading tabs by spaces\n\t\t\t\tfor (i = 0, k = 0; i < len; i++ ) {\n\t\t\t\t\tchar ch = line.charAt(i);\n\t\t\t\t\tif (ch == '\\t') {\n\t\t\t\t\t\tk = (((k+_oldIndent-1)/_oldIndent)+1)*_oldIndent;\n\t\t\t\t\t } else if (ch == ' ') {\n\t\t\t\t\t\tk++;\n\t\t\t\t\t } else {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t }\n\t\t\t\t}\n\t\t\t\tif (i < len) { //not empty line\n\t\t\t\t\tfor (int j = 0; j < (k / _oldIndent); j++) {\n\t\t\t\t\t\t_sb.append(_indentSpaces);\n\t\t\t\t\t}\n\t\t\t\t\tif ((k = k % _oldIndent) > 0) {\n\t\t\t\t\t\t_sb.append(_indentSpaces.substring(0, k));\n\t\t\t\t\t}\n\t\t\t\t\t_sb.append(line.substring(i,len));\n\t\t\t\t}\n\t\t\t}\n\t\t\tmodified |= !line.equals(_sb.substring(_linePos));\n\t\t\tif (_lastCommentStart >= 0) {\n\t\t\t\tif (line.indexOf(\"*/\") >= 0) {\n\t\t\t\t\tif (line.endsWith(\"*/\")) { //only comment lines blocks\n\t\t\t\t\t\t_lastCommentLine = _linePos;\n\t\t\t\t\t\t_lastCommentEnd = _sb.length();\n\t\t\t\t\t\tif (_firstCommentEnd == -1) {\n\t\t\t\t\t\t\t_firstCommentEnd = _lastCommentEnd;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (_firstCommentStart == _lastCommentStart) {\n\t\t\t\t\t\t\t_firstCommentStart = -1;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t_lastCommentStart = -1;\n\t\t\t\t\t\t_lastCommentEnd = -1;\n\t\t\t\t\t\t_lastCommentLine = -1;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (line.trim().startsWith(\"/*\")) {\n\t\t\t\tif (line.indexOf(\"*/\") < 0) { //only more lines blocks\n\t\t\t\t\t_lastCommentStart = _linePos;\n\t\t\t\t\t_lastCommentLine = -1;\n\t\t\t\t\t_lastCommentEnd = -1;\n\t\t\t\t\tif (_firstCommentStart == -1) {\n\t\t\t\t\t\t_firstCommentStart = _linePos;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (_genCR) {\n\t\t\t\t_sb.append('\\r'); //add CR\n\t\t\t}\n\t\t\t_sb.append('\\n'); //add LF\n\t\t}\n\t\tin.close();\n\t\treturn modified;\n\t}", "private void skipCommentLine() {\n while (position < length) {\n int c = data.charAt(position);\n if (c == '\\r' || c == '\\n') {\n return;\n }\n position++;\n }\n }", "private void interpretComments() throws IOException {\n trimLines( comments );\n \n /* Try to interpret the last remaining comment line as a set of\n * column headings. */\n if ( comments.size() > 0 ) {\n String hline = (String) comments.get( comments.size() - 1 );\n List headings = readHeadings( new PushbackInputStream( \n new ByteArrayInputStream( hline.getBytes() ) ) );\n \n /* If this line looks like a set of headings (there are the\n * right number of fields) modify the colinfos accordingly and\n * remove it from the set of comments. */\n if ( headings.size() == ncol ) {\n comments.remove( comments.size() - 1 );\n for ( int i = 0; i < ncol; i++ ) {\n colinfos[ i ].setName( (String) headings.get( i ) );\n }\n trimLines( comments );\n }\n }\n \n /* If there are any other comment lines, concatenate them and bung\n * them into a description parameter. */\n if ( comments.size() > 0 ) {\n StringBuffer dbuf = new StringBuffer();\n for ( Iterator it = comments.iterator(); it.hasNext(); ) {\n dbuf.append( (String) it.next() );\n if ( it.hasNext() ) {\n dbuf.append( '\\n' );\n }\n }\n ValueInfo descriptionInfo =\n new DefaultValueInfo( \"Description\", String.class,\n \"Comments included in text file\" );\n parameters.add( new DescribedValue( descriptionInfo, \n dbuf.toString() ) );\n }\n }", "private void ReadFile(String filePath) throws IOException{\n File file = new File(filePath);\n BufferedReader b = new BufferedReader(new FileReader(file));\n int lineNumber = 1;\n String line = \"\";\n line = b.readLine();\n while (line != null) {\n // analyze the line only when it is not empty and it is not a comment\n String trimLine = line.toString().trim();\n if(trimLine.length() != 0 && !trimLine.substring(0, 1).equals(\"/\") && !trimLine.substring(0, 1).equals(\"#\")){\n // line.toString().trim(): eliminate heading and tailing whitespaces\n // but add one whitespace to the end of the string to facilitate token manipulation\n // under the circumstances that there is only one token on one line, e.g. main\n AnalyzeByLine(line.toString().trim() + \" \", lineNumber);\n }\n lineNumber++;\n line = b.readLine();\n }\n arrL.add(new Token(\"end of file\", 255, lineNumber));\n// for(int i = 0; i < arrL.size(); i++){\n// System.out.println(arrL.get(i).getCharacters() + \" \" + arrL.get(i).getValue() + \" \" + arrL.get(i).getLineNum());\n// }\n }", "public static void main(String[] args) throws FileNotFoundException\n\t{\n\t\tFile inputfile = new File(\"Test4.java\"); //output for Test2.java: \"Unbalanced! Symbol } is mismatched\"; \n\t\t//File inputfile = new File(args[0]);\n\t\tScanner in = new Scanner(inputfile);\n\t\t//System.out.println(inputfile.exists());\n\t\tString lines = \"\"; \n\t\t\n\t\tint j=0; \n\t\twhile(in.hasNextLine()) //reading in the whole file and put them into the string. \n\t\t{\n\t\t\tString tempString = in.nextLine(); \n\t\t\t\n\t\t\t//HANDLGING COMMENT BLOCKS: \n\t\t\tif(tempString.contains(\"/*\")) //if the line read contains beginning of comment, discard this line. move on. \n\t\t\t{\n\t\t\t\tcontinue; //go to the next iteration of the loop. \n\t\t\t}\n\t\t\telse if (tempString.contains(\"*\\\\\")) //the line is the end of a comment \n\t\t\t{\n\t\t\t\tcontinue; //don't add this line to the \"lines\" string because it is a comment \n\t\t\t}\n\t\t\telse if(tempString.contains(\"//\")) //same reason as above \n\t\t\t{\n\t\t\t\t//splitting string from http://stackoverflow.com/questions/3481828/how-to-split-a-string-in-java\n\t\t\t\tString[] parts = tempString.split(\"//\"); //splits the string to BEFORE // and AFTER // \n\t\t\t\t//only using the BEFORE part because the rest is just comment --> index 0 in parts[] array \n\t\t\t\tlines=lines.concat(parts[0]);\n\t\t\t\tcontinue; \n\t\t\t}\n\t\t\t\n\t\t\t//HANDING QUOTATION MARKS:\n\t\t\telse if(tempString.contains(\"\\\"\")) //beginning of a quotation \n\t\t\t{\n\t\t\t\tint start = tempString.indexOf(\"\\\"\"); //returns the index of the first occurrence of \" \n\t\t\t\t//System.out.println(\"start is \"+start);\n\t\t\t\tint end = tempString.lastIndexOf(\"\\\"\"); //returns the index of the LAST occurrence of the \"\n\t\t\t\t//System.out.println(\"end is \"+end);\n\t\t\t\tif(start == end) //this means there's only 1 \" in the string-->mismatched\n\t\t\t\t{\n\t\t\t\t\t//lastIndexOf counts from the end of the string. if the end index is the same as the begin index of \" occurance\n\t\t\t\t\t//that means that there's only 1 \" in this line, which usually means that it is mismatched.. \n\t\t\t\t\tSystem.out.println(\"Unbalanced! Symbol \\\" is mismatched\");\n\t\t\t\t\tSystem.exit(0); \n\t\t\t\t}\n\t\t\t\telse \n\t\t\t\t{\n\t\t\t\t\t//By replacing the quotations, we ignore the literal string.\n\t\t\t\t\tSystem.out.println(\"This is before trimming: \" + tempString);\n\t\t\t\t\tString newstring = tempString.substring(start, end+1); //returns a new string that is a substring of tempString\n\t\t\t\t\ttempString = tempString.replace(newstring, \"IGNORE\"); //replaces each substring with a replacement string \n\t\t\t\t\tSystem.out.println(\"This is after trimming: \" + tempString); \n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t//If the line is not a comment line, then concatenate the line to the whole string\n\t\t\tlines = lines.concat(tempString);\n\t\t\t\n\t\t}\n\t\t//System.out.print(lines);\n\t\t//////////////////////////////////////////////////////////////////////////\n\t\tint i=0; //counter as we traverse through the string \n\t\tchar temp = ' '; \n\t\t\n\t\tMyStack<Character> tempstack = new MyStack<Character>(); //NEED TO DECLARE A STACK HERER!!!!!!!! \n\t\t//System.out.println(lines);\n\t\twhile(i!=lines.length())\n\t\t{\n\t\t\t//READING in one character at a time from the string lines -->handle each char one at a time. \n\t\t\ttemp = lines.charAt(i); \n\t\t\t//System.out.print(temp); \n\t\t\tif(temp == '(' || temp=='[' || temp =='{')\n\t\t\t{\n\t\t\t\ttempstack.push(temp); //if the char is an opening symbol, then push onto the stack \n\t\t\t}\n\t\t\telse if ((temp == ')' || temp==']' || temp =='}')&& tempstack.isEmpty()) \n\t\t\t{\n\t\t\t\t//if the character is a closing symbol AND the stack is empty -->ERROR \n\t\t\t\tSystem.out.println(\"Unbalanced! Symbol \" + temp + \" is mismatched.\"); \n\t\t\t\tSystem.exit(0); \n\t\t\t}\n\t\t\telse if((temp == ')' || temp==']' || temp =='}')&& !tempstack.isEmpty()) \n\t\t\t{\n\t\t\t\t//if the character is a closing symbol BUT the stack is NOT empty, then pop the top \n\t\t\t\tchar c = tempstack.pop();\n\t\t\t\t\n\t\t\t\t//compare the top (c) to the temp (current character being read from the string) to see if matched. \n\t\t\t\tif(temp==')'&&(c!='('))\n\t\t\t\t{\n\t\t\t\t\t//unexpected pairing --> ERROR is reported \n\t\t\t\t\tSystem.out.println(\"Unbalanced! Symbol \" + temp + \" is mismatched.\"); \n\t\t\t\t\tSystem.exit(0); \n\t\t\t\t}\n\t\t\t\telse if(temp==']'&&(c!='['))\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Unbalanced! Symbol \" + temp + \" is mismatched.\"); \n\t\t\t\t\tSystem.exit(0); \n\t\t\t\t}\n\t\t\t\telse if(temp=='}'&&(c!='{'))\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Unbalanced! Symbol \" + temp + \" is mismatched.\"); \n\t\t\t\t\tSystem.exit(0); \n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\ti++; \n\t\t}\n\t\t\n\t\t//End of file (everything in lines string is read) \n\t\t//it needs to ignore the comment!!! System.out.println(\"Hey! --> \" + tempstack.pop()); \n\t\tif(tempstack.isEmpty()) // if the stack is NOT empty\n\t\t{\n\t\t\tSystem.out.println(\"This file is balanced!\"); \n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\tSystem.out.println(\"Leftover \" + tempstack.pop() + \" in the stack\");\n\t\t\tSystem.out.println(\"File not balanced!\"); \n\t\t}\n\t\t\n\t\t\n\t}", "private void parseFile(IFile file) throws CoreException, IOException {\r\n \t\tBufferedReader reader = new BufferedReader(new InputStreamReader(file.getContents()));\r\n \t\tString nxt = \"\";\r\n \t\tStringBuilder builder = new StringBuilder();\r\n \t\tbuilder.append(reader.readLine());\r\n \t\twhile (nxt!=null) {\r\n \t\t\tnxt = reader.readLine();\r\n \t\t\tif (nxt!=null) {\r\n \t\t\t\tbuilder.append(\"\\n\");\r\n \t\t\t\tbuilder.append(nxt);\r\n \t\t\t}\r\n \t\t}\r\n \t\t// QUESTION: does this trigger the reconcilers?\r\n \t\tset(builder.toString());\r\n \t}", "public static void checkSingleLineStatements(File file){\n Scanner scanner = getScanner(file);\n String currentLine = scanner.nextLine();\n int lineCounter = 1;\n\n if(currentLine.startsWith(\"/*\")) {\n while (!currentLine.trim().startsWith(\"*/\")) {\n currentLine = scanner.nextLine();\n lineCounter++;\n }\n }\n\n while (scanner.hasNext()) {\n currentLine = scanner.nextLine();\n lineCounter++;\n if(currentLine.contains(\";\")) {\n int i = currentLine.indexOf(\";\");\n if (currentLine.substring(i + 1).contains(\";\") && !currentLine.trim().startsWith(\"for\")) {\n singleLineStatementErrors.add(lineCounter);\n }\n }\n }\n scanner.close();\n }", "public void stripComments() {\r\n if (command.contains(\"//\")) {\r\n command = command.substring(0, command.indexOf(\"//\"));\r\n }\r\n command = command.replace(\"\\n\", \"\");\r\n command = command.replace(\"\\t\", \"\");\r\n }", "private String handleLine(String line) {\n if (line == null)\n throw new WrongCommentFormatException(\"\\nNULL line was found\");\n\n // bracketsState shows if the line already begins as a comment (for multiple line comments)\n int bracketsState = isLongComment ? 1 : 0;\n\n // if not a long comment and no long comment open separator found, check if there is any single line comment\n if (!isLongComment && !line.contains(Character.toString(AssemblyConstants.LONG_COMMENT_OPEN))) {\n // if there is a single line comment as well, it must be removed. Remove whitespaces afterwards\n if (!line.contains(Character.toString(AssemblyConstants.LONG_COMMENT_CLOSE)))\n return removeWhitespace(line.contains(Character.toString(AssemblyConstants.SINGLE_LINE_COMMENT))\n ? line.substring(0, line.indexOf(AssemblyConstants.SINGLE_LINE_COMMENT))\n : line);\n else\n return handleMixedLine(line, bracketsState);\n }\n\n // if a long comment and no long comment close separator found, return null (the whole line is a comment)\n if (isLongComment && !line.contains(Character.toString(AssemblyConstants.LONG_COMMENT_CLOSE)))\n return null;\n\n // handle special mixed lines with multiple comments possible\n return handleMixedLine(line, bracketsState);\n }", "private void parse(Reader reader) throws IOException {\n/* 260 */ BufferedReader buf_reader = new BufferedReader(reader);\n/* 261 */ String line = null;\n/* 262 */ String continued = null;\n/* */ \n/* 264 */ while ((line = buf_reader.readLine()) != null) {\n/* */ \n/* */ \n/* 267 */ line = line.trim();\n/* */ \n/* */ try {\n/* 270 */ if (line.charAt(0) == '#')\n/* */ continue; \n/* 272 */ if (line.charAt(line.length() - 1) == '\\\\') {\n/* 273 */ if (continued != null) {\n/* 274 */ continued = continued + line.substring(0, line.length() - 1); continue;\n/* */ } \n/* 276 */ continued = line.substring(0, line.length() - 1); continue;\n/* 277 */ } if (continued != null) {\n/* */ \n/* 279 */ continued = continued + line;\n/* */ \n/* */ try {\n/* 282 */ parseLine(continued);\n/* 283 */ } catch (MailcapParseException e) {}\n/* */ \n/* */ \n/* 286 */ continued = null;\n/* */ \n/* */ continue;\n/* */ } \n/* */ try {\n/* 291 */ parseLine(line);\n/* */ }\n/* 293 */ catch (MailcapParseException e) {}\n/* */ \n/* */ \n/* */ }\n/* 297 */ catch (StringIndexOutOfBoundsException e) {}\n/* */ } \n/* */ }", "public void parse(){\n\t\t//Read next line in content; timestamp++\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(instructionfile))) {\n\t\t String line;\n\t\t while ((line = br.readLine()) != null) {\n\t\t \t//divide the line by semicolons\n\t\t \tString[] lineParts = line.split(\";\");\n\t\t \tfor(String aPart: lineParts){\n\t\t\t \tSystem.out.println(\"Parser:\"+aPart);\n\n\t\t\t \t// process the partial line.\n\t\t\t \tString[] commands = parseNextInstruction(aPart);\n\t\t\t \tif(commands!=null){\n\t\t\t\t\t\t\n\t\t\t \t\t//For each instruction in line: TransactionManager.processOperation()\n\t\t\t \t\ttm.processOperation(commands, currentTimestamp);\n\t\t\t \t}\n\t\t \t}\n\t\t \t//Every new line, time stamp increases\n\t \t\tcurrentTimestamp++;\n\t\t }\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}", "@NotNull\n private List<UMLComment> extractInternalComments(@NotNull PsiFile file,\n @NotNull String sourceFile) {\n Collection<PsiComment> psiComments = PsiTreeUtil.findChildrenOfType(file, PsiComment.class);\n List<UMLComment> umlComments = new ArrayList<>();\n for (PsiComment comment : psiComments) {\n LocationInfo locationInfo = null;\n if (comment.getTokenType() == JavaTokenType.END_OF_LINE_COMMENT) {\n locationInfo = new LocationInfo(file, sourceFile, comment, LocationInfo.CodeElementType.LINE_COMMENT);\n } else if (comment.getTokenType() == JavaTokenType.C_STYLE_COMMENT) {\n locationInfo = new LocationInfo(file, sourceFile, comment, LocationInfo.CodeElementType.BLOCK_COMMENT);\n }\n if (locationInfo != null) {\n String text = Formatter.format(comment);\n UMLComment umlComment = new UMLComment(text, locationInfo);\n umlComments.add(umlComment);\n }\n }\n return umlComments;\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}", "private String removeComments(String line) {\n\t\tint commentIndex = line.indexOf(\"//\");\n\t\tif (commentIndex >= 0) {\n\t\t\tline = line.substring(0, commentIndex);\n\t\t}\n\t\tline = line.trim();\n\n\t\t// clear line if entire line is comment\n\t\tif (line.startsWith(\"#\")) {\n\t\t\treturn \"\";\n\t\t}\n\t\treturn line;\n\t}", "private String handleMixedLine(String line, int bracketsState) {\n // instructions to extract between comments\n StringBuilder nonCommentLines = new StringBuilder();\n char prevChar = '\\0';\n boolean isString = false;\n\n for (int i = 0; i < line.length(); i++) {\n // if long comment open bracket found, change the current state\n // if no escape sequence found and not a String\n if (line.charAt(i) == AssemblyConstants.LONG_COMMENT_OPEN\n && prevChar != AssemblyConstants.ESCAPE_SEQUENCE && !isString) {\n bracketsState = 1;\n\n // if long comment close bracket found, change the current state\n // if no escape sequence found and not a String\n } else if (line.charAt(i) == AssemblyConstants.LONG_COMMENT_CLOSE\n && prevChar != AssemblyConstants.ESCAPE_SEQUENCE && !isString) {\n bracketsState--;\n\n // make sure there is not too many long comment close brackets\n if (bracketsState < 0)\n throw new WrongCommentFormatException(\"\\nInvalid long comment found: \" +\n \"Too many long comment close brackets found in line: '\" + line + \"'\");\n\n // if state equals zero, extract all instructions found\n } else if (bracketsState == 0)\n // if single line comment found, break the loop (everything else is definitely a part of the comment)\n // if no escape sequence found and not a String\n if (line.charAt(i) == AssemblyConstants.SINGLE_LINE_COMMENT\n && prevChar != AssemblyConstants.ESCAPE_SEQUENCE && !isString)\n break;\n else\n // add the instruction part found\n nonCommentLines.append(line.charAt(i));\n\n // check if the string separator found and is not with an escape sequence\n if (line.charAt(i) == AssemblyConstants.STRING_SEPARATOR\n && prevChar != AssemblyConstants.ESCAPE_SEQUENCE)\n isString = !isString;\n // save the previous char\n prevChar = line.charAt(i);\n }\n\n // update the brackets' state\n isLongComment = bracketsState != 0;\n\n // remove all unnecessary whitespaces found in lines in-between\n return removeWhitespace(nonCommentLines.toString());\n\n }", "void createSingleFileComment(ChangedFile file, Integer line, String comment);", "public List<String> codeAnalyse(List<String> srcLines) {\n\t\t// Initializes the return List\n\t\tList<String> listForCsv = new ArrayList<String>();\n\t\t\n\t\t// Declares main comment pattern\n\t\tPattern patComments = Pattern.compile(\"^\\\\*.*|//.*|/\\\\*.*\");\n\t\t\n\t\t/*\n\t\t * Initializes our metrics loc(Lines of code),\n\t\t * noc(Number of classes), nom(Number of methods)\n\t\t */\n\t\tint loc = 0;\n\t\tint noc = 0;\n\t\tint nom = 0;\n\t\t\n\t\t// Variable to check if the loop is inside a multiple line comment\n\t\tboolean multLine = false;\n\t\t\n\t\t// Looping through the lines of code\n\t\tfor (String line: srcLines) {\n\t\t\tMatcher matcher = patComments.matcher(line);\n\t\t\t// If line is not a comment\n\t\t\tif (!matcher.matches()) {\n\t\t\t\tif (multLine == false) {\n\t\t\t\t\t// Regex for checking if line represents the beginning of a class\n\t\t\t\t\tif (line.matches(\"(?:\\\\s*(public|private|native|abstract|strictfp|abstract\"\n\t\t\t\t\t\t\t+ \"|protected|final)\\\\s+)?(?:static\\\\s+)?class.*\")) {\n\t\t\t\t\t\t// If true then increases noc by 1\n\t\t\t\t\t\tnoc ++;\n\t\t\t\t\t}\n\t\t\t\t\t// Regex for checking if line represents the beginning of a method\n\t\t\t\t\tif (line.matches(\"((public|private|native|static|final|protected\"\n\t\t\t\t\t\t\t+ \"|abstract|transient)+\\\\s)+[\\\\$_\\\\w\\\\<\\\\>\\\\[\\\\]]*\\\\s+[\\\\$_\\\\w]+\\\\([^\"\n\t\t\t\t\t\t\t+ \"\\\\)]*\\\\)?\\\\s*\\\\{?[^\\\\}]*\\\\}?\")) {\n\t\t\t\t\t\t// If true then increases nom by 1\n\t\t\t\t\t\tnom ++;\n\t\t\t\t\t}\n\t\t\t\t\t/*\n\t\t\t\t\t * Line is not a comment neither a blank line(insured while\n\t\t\t\t\t * reading the file) so we add 1 to the loc variable\n\t\t\t\t\t */ \n\t\t\t\t\tloc ++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t// Potential multiple line comment starter\n\t\t\tif (line.matches(\"/\\\\*.*\")) {\n\t\t\t\tmultLine = true;\n\t\t\t}\n\t\t\t// Potential multiple line comment ender\n\t\t\tif (line.matches(\".*\\\\*/.*$\")) {\n\t\t\t\tmultLine = false;\n\t\t\t}\n\t\t}\n\t\t// Adds metrics to the return list\n\t\tlistForCsv.add(String.valueOf(loc));\n\t\tlistForCsv.add(String.valueOf(noc));\n\t\tlistForCsv.add(String.valueOf(nom));\n\t\t\n\t\t// Returns the list\n\t\treturn listForCsv;\n\t}", "@Override\n public String readLine() throws IOException {\n\n String line = null;\n\n while (true) {\n\n line = super.readLine();\n\n if (line == null) {\n\n return null;\n }\n\n // Get rid of comments\n\n // VT: FIXME: not handling the escaped comments\n\n int hash = line.indexOf(\"#\");\n\n if (hash != -1) {\n\n // Check if the '#' is escaped\n\n if (hash > 0 && line.indexOf(\"\\\\#\") == hash - 1) {\n\n // Yes, it is\n\n // System.err.println( \"Raw: '\"+line+\"'\" );\n line = line.substring(0, hash - 1) + line.substring(hash, line.length());\n // System.err.println( \"Unescaped: '\"+line+\"'\" );\n\n } else {\n\n line = line.substring(0, hash);\n }\n }\n\n // Trim it\n\n line = line.trim();\n\n if (line.length() != 0) {\n\n return line;\n }\n }\n }", "private void readFile() {\r\n\t\tcsvEntrys = new ArrayList<>();\r\n\t\tString line = \"\";\r\n\t\ttry (BufferedReader br = new BufferedReader(new FileReader(new File(filepath)))) {\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\tif (!line.contains(\"id\")) {\r\n\t\t\t\t\tcsvEntrys.add(line);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public static void reformat(BufferedReader input) throws IOException {\n String line = input.readLine();\n\n while (line != null) {\n String[] parts = line.split(\";\", 2);\n for (String part : parts) {\n System.out.println(part);\n }\n line = input.readLine();\n }\n }", "private void eatMultiline() {\n int prev = ';';\n int pos = position + 1;\n\n while (pos < length) {\n int c = data.charAt(pos);\n if (c == ';' && (prev == '\\n' || prev == '\\r')) {\n position = pos + 1;\n // get rid of the ;\n tokenStart++;\n\n // remove trailing newlines\n pos--;\n c = data.charAt(pos);\n while (c == '\\n' || c == '\\r') {\n pos--;\n c = data.charAt(pos);\n }\n tokenEnd = pos + 1;\n\n isEscaped = true;\n return;\n } else {\n // handle line numbers\n if (c == '\\r') {\n lineNumber++;\n } else if (c == '\\n' && prev != '\\r') {\n lineNumber++;\n }\n\n prev = c;\n pos++;\n }\n }\n\n position = pos;\n }", "private void extractFile() {\n try (BufferedReader buffered_reader = new BufferedReader(new FileReader(source_file))) {\n String line;\n while((line = buffered_reader.readLine()) != null) {\n String spaceEscaped = line.replace(\" \", \"\");\n //file was read, each line is one of the elements of the file_read_lines list\n //line 0 is keyword \"TELL\"\n //line 1 is the knowledge base\n //line 2 is the keyword \"ASK\"\n //line 3 is the query\n file_read_lines.add(spaceEscaped);\n }\n\n //generate list of Horn clauses (raw) from the KB raw sentence\n //replace \\/ by |\n String kbLine = file_read_lines.get(1).replace(\"\\\\/\", \"|\");\n rawClauses = Arrays.asList(kbLine.split(\";\"));\n //query - a propositional symbol\n query = file_read_lines.get(3);\n } catch (IOException e) {\n //Return error if file cannot be opened\n error = true;\n System.out.println(source_file.toString() + \" is not found!\");\n }\n }", "void createCommentWithAllSingleFileComments(String string);", "@Override\n public String readFile(BufferedReader reader)\n {\n try\n {\n StringBuffer strLine = new StringBuffer();\n String line;\n\n while ((line = reader.readLine()) != null)\n {\n if (!line.startsWith(\"--\", 0))\n {\n strLine.append(line);\n\n // use ; as the command delimiter and execute the query on the database.\n if (line.endsWith(\";\"))\n {\n super.exeQuery(strLine.toString());\n strLine = new StringBuffer();\n }\n }\n }\n\n return strLine.toString();\n }\n catch (IOException ioex)\n {\n logger.error(\"Error reading contents from file.\");\n return null;\n }\n }", "private String removeComments(String str) {\n boolean inDQ = false;\n boolean inSQ = false;\n \n String result = str;\n \n for(int i = 0; i < result.length()-1; i++) {\n char c = result.charAt(i);\n \n if(inDQ) {\n if(c == '\\\"' && result.charAt(i-1) != '\\\\') {\n inDQ = false;\n }\n }\n else if(inSQ) {\n if(c == '\\'' && result.charAt(i-1) != '\\\\') {\n inSQ = false;\n }\n }\n else {\n \n // Line comment\n if(c == '/' && result.charAt(i+1) == '/') {\n int newLineIndex = result.indexOf(\"\\n\", i);\n \n result = result.substring(0, i) + result.substring(newLineIndex);\n i--;\n }\n \n // Block comment\n else if(c == '/' && result.charAt(i+1) == '*') {\n int endBlockIndex = result.indexOf(\"*/\", i) + 2;\n \n result = result.substring(0, i) + result.substring(endBlockIndex);\n i--;\n }\n \n // Python comment\n else if(c == '#' && (i == 0 || result.charAt(i-1) == '\\n')) {\n int newLineIndex = result.indexOf(\"\\n\", i);\n \n result = result.substring(0, i) + result.substring(newLineIndex+1); \n i--;\n }\n else if(c == '\\\"') {\n inDQ = true;\n }\n else if(c == '\\'') {\n inSQ = true;\n }\n }\n }\n \n return result;\n }", "public void refreshMultilineComments(String text) {\n\t\tcommentOffsets.clear();\r\n\r\n\t\t// Go through all the instances of COMMENT_START\r\n\t\tfor (int pos = text.indexOf(COMMENT_START); pos > -1; pos = text.indexOf(COMMENT_START, pos)) {\r\n\t\t\t// offsets[0] holds the COMMENT_START offset\r\n\t\t\t// and COMMENT_END holds the ending offset\r\n\t\t\tint[] offsets = new int[2];\r\n\t\t\toffsets[0] = pos;\r\n\r\n\t\t\t// Find the corresponding end comment.\r\n\t\t\tpos = text.indexOf(COMMENT_END, pos);\r\n\r\n\t\t\t// If no corresponding end comment, use the end of the text\r\n\t\t\toffsets[1] = pos == -1 ? text.length() - 1 : pos + COMMENT_END.length() - 1;\r\n\t\t\tpos = offsets[1];\r\n\r\n\t\t\t// Add the offsets to the collection\r\n\t\t\tcommentOffsets.add(offsets);\r\n\t\t}\r\n\t}", "private void skipEmptyLines() throws IOException {\n for (;;) {\n if (nextChar != ';') {\n do {\n readNextChar();\n } while (isWhitespace(nextChar));\n if (nextChar != ';') return;\n }\n do {\n readNextChar();\n if (nextChar == -1) return;\n } while (nextChar != '\\n');\n }\n }", "public void Parse()\n {\n String prepend = \"urn:cerner:mid:core.personnel:c232:\";\n try{\n\n BufferedReader br = new BufferedReader(new FileReader(new File(path)));\n\n String line;\n\n while ((line = br.readLine()) != null)\n {\n line = line.trim();\n String[] lines = line.split(\",\");\n for (String entry : lines)\n {\n entry = entry.trim();\n entry = entry.replace(prepend, replace);\n System.out.println(entry+\",\");\n }\n\n }\n \n br.close();\n }catch(IOException IO)\n {\n System.out.println(IO.getStackTrace());\n } \n \n }", "public static void read8() {\n List<String> list = new ArrayList<>();\n\n try (Stream<String> stream = Files.lines(Paths.get(filePath))) {\n\n //1. filter line 3\n //2. convert all content to upper case\n //3. convert it into a List\n list = stream\n .filter(line -> !line.startsWith(\"line3\"))\n .map(String::toUpperCase)\n .collect(Collectors.toList());\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n list.forEach(System.out::println);\n }", "public void parseFile() {\n File file = new File(inputFile);\n try {\n Scanner scan = new Scanner(file);\n\n while (scan.hasNextLine()) {\n String line = scan.nextLine();\n line = line.replaceAll(\"\\\\s+\", \" \").trim();\n\n if (line.isEmpty()) {\n continue;\n }\n // System.out.println(line);\n String cmd = line.split(\" \")[0];\n String lineWithoutCmd = line.replaceFirst(cmd, \"\").trim();\n // System.out.println(lineWithoutCmd);\n\n // The fields following each command\n String[] fields;\n\n switch (cmd) {\n case (\"add\"):\n fields = lineWithoutCmd.split(\"<SEP>\");\n fields[0] = fields[0].trim();\n fields[1] = fields[1].trim();\n fields[2] = fields[2].trim();\n add(fields);\n break;\n case (\"delete\"):\n\n fields = split(lineWithoutCmd);\n delete(fields[0], fields[1]);\n break;\n case (\"print\"):\n if (lineWithoutCmd.equals(\"ratings\")) {\n printRatings();\n break;\n }\n fields = split(lineWithoutCmd);\n\n print(fields[0], fields[1]);\n\n break;\n case (\"list\"):\n // need to check if it is the movie or reviewer\n fields = split(lineWithoutCmd);\n list(fields[0], fields[1]);\n break;\n case (\"similar\"):\n // need to check if it is the movie or reviewer\n fields = split(lineWithoutCmd);\n similar(fields[0], fields[1]);\n break;\n default:\n break;\n }\n\n }\n\n }\n catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "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 static List<String> processFileLineByLine(MultipartFile file) throws IOException {\n try(BufferedReader fileBufferReader = new BufferedReader(new InputStreamReader(file.getInputStream()))) {\n return fileBufferReader.lines().collect(Collectors.toList());\n }\n }", "private String removeTailComment(String line) {\n //remove any comment from this line\n int commentPos = line.indexOf(\",#\");\n if (commentPos != -1) {\n line = line.substring(0, commentPos);\n }\n return line;\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 void main(String[] args) {\n String file = System.getProperty(\"user.dir\") + \"\\\\src\\\\\" + TaskB.class.getName().replace(\".\", File.separator);\n String fileIn = file + \".java\";\n String fileOut = file + \".txt\";\n StringBuilder convert = new StringBuilder();\n try (BufferedReader reader = new BufferedReader(\n new FileReader(fileIn))) {\n Boolean commentOne = false;\n Boolean commentTwo = false;\n String chars = \"\";\n\n // text\n\n while (reader.ready()) {\n if (reader.ready()) {\n char currchar = (char) reader.read();\n chars = chars + currchar;\n\n if (chars.equals(\"/\" + \"*\")) {\n commentOne = true;\n commentTwo = true;\n convert.deleteCharAt(convert.length() - 1);\n }\n\n if (chars.equals(\"/\" + \"/\")) {\n commentOne = true;\n commentTwo = false;\n convert.deleteCharAt(convert.length() - 1);\n }\n\n // text\n\n if (!commentOne) {\n convert.append(chars.substring(chars.length() - 1));\n }\n\n if (chars.equals(\"\\r\\n\") && commentOne && !commentTwo) {\n commentOne = false;\n commentTwo = false;\n convert.append(chars);\n }\n\n if (chars.equals(\"*\" + \"/\") && commentOne && commentTwo) {\n commentOne = false;\n commentTwo = false;\n }\n chars = Character.toString(currchar);\n }\n\n /*\nmay be the end\n */\n }\n PrintWriter out = new PrintWriter(new FileWriter(fileOut));\n System.out.print(convert);\n out.print(convert);\n out.close();\n\n } catch (IOException e) {\n e.printStackTrace();\n // the end!\n }\n }", "private static void testComments() throws IOException {\n\t// say what output is expected\n\tSystem.err.println(\"\\nTESTING COMMENTS -- NO OUTPUT EXPECTED\");\n\n\t// open input file\n\tFileReader inFile = null;\n\ttry {\n\t inFile = new FileReader(\"inComments\");\n\t} catch (FileNotFoundException ex) {\n\t System.err.println(\"File inUntermComment not found.\");\n\t System.exit(-1);\n\t}\n\n\t// create and call the scanner\n\tYylex scanner = new Yylex(inFile);\n\tSymbol token = scanner.next_token();\n\tif (token.sym != sym.EOF) {\n\t System.err.println(\"ERROR TESTING COMMENTS: not at EOF\");\n\t System.err.println(\"sym: \" + token.sym);\n\t}\n }", "private String[] splitLine (String fileLine){\n String[] ans = new String[5];\n ans[0] = fileLine.substring(0, fileLine.indexOf(\"!\"));\n ans[1] = fileLine.substring(fileLine.indexOf(\"[\") + 1, fileLine.indexOf(\"]\"));\n String dfTf = fileLine.substring(fileLine.indexOf(\"]!\") + 2);\n ans[3] = dfTf;\n ans[2] = dfTf.substring(0, dfTf.indexOf(\"!\"));\n if (dfTf.contains(\"^\")) {\n ans[4] = dfTf.substring(dfTf.length() - 1);\n ans[3] = ans[3].substring(ans[3].indexOf(\"!\") + 1, ans[3].length() - 2);\n } else\n ans[3] = ans[3].substring(dfTf.indexOf(\"!\") + 1);\n\n return ans;\n }", "public void skipComments() {\r\n this.ignoreLinesStartWith(this.charComment);\r\n }", "private boolean reformatMultilineComments() {\n \n \t\tString curLine = line.trim();\n \n \t\t// abort the operation?\n \t\tboolean bAbort = false;\n \t\t// the level of nested comments\n \t\tint nestedCommentsLevel = 0;\n \t\t// a comment until the end of the line\n \t\tMatcher matcherCommentEOL = patternCommentEOL.matcher(curLine);\n \t\tif (matcherCommentEOL.find()) {\n \n \t\t\tif (matcherCommentEOL.start() + 2 < curLine.length()) {\n \t\t\t\tchar firstChar = curLine.charAt(matcherCommentEOL.start() + 2);\n \t\t\t\t// this character means \"do not reformat this comment\"\n \t\t\t\tif (firstChar == '*' || firstChar == '|') {\n \t\t\t\t\tbDoNotFormatComment = true;\n \t\t\t\t\tbAbort = true;\n \t\t\t\t}\n \t\t\t}\n \n \t\t\t// check that this comment is not closed (or else, we would loop\n \t\t\t// indefinitely)\n \t\t\tMatcher matcherComment = patternComment.matcher(curLine);\n \t\t\twhile (matcherComment.find())\n \t\t\t\tif (matcherComment.start() == matcherCommentEOL.start())\n \t\t\t\t\tbAbort = true;\n \n \t\t\t// if we are inside a string, do nothing\n \t\t\tMatcher matcherString = patternString.matcher(curLine);\n \t\t\twhile (matcherString.find()) {\n \t\t\t\tif ((matcherString.start() < matcherCommentEOL.start())\n \t\t\t\t\t\t&& (matcherCommentEOL.start() < matcherString.end()))\n \t\t\t\t\tbAbort = true;\n \t\t\t}\n \n \t\t\tif (!bAbort && preferenceFormatComments) {\n \n \t\t\t\tnestedCommentsLevel = 1;\n \n \t\t\t\t// look for the end of the comment\n \t\t\t\tPattern patternCommentBeginEnd = Pattern.compile(\"(\\\\(\\\\*)|(\\\\*\\\\))\");\n \n \t\t\t\t// all the lines of the comment, concatenated\n \t\t\t\tString commentLines = curLine.substring(matcherCommentEOL.start() + 2);\n \n \t\t\t\t// what's before the comment on its first line\n \t\t\t\tString beforeComment = curLine.substring(0, matcherCommentEOL.start());\n \n \t\t\t\t// what's left after the comment on its last line\n \t\t\t\tString afterComment = \"\";\n \n \t\t\t\t// the index of the current line\n \t\t\t\tint l;\n \t\t\t\tgetWholeComment: for (l = currentLine; l < lines.length; l++) {\n \n \t\t\t\t\tString commentLine;\n \t\t\t\t\t// first line\n \t\t\t\t\tif (l == currentLine) {\n \t\t\t\t\t\tcommentLine = commentLines;\n \t\t\t\t\t\tcommentLines = \"\";\n \t\t\t\t\t} else\n \t\t\t\t\t\tcommentLine = lines[l].trim();\n \n \t\t\t\t\tMatcher matcherCommentBeginEnd = patternCommentBeginEnd.matcher(commentLine);\n \n \t\t\t\t\t/*\n \t\t\t\t\t * parse all the delimiters, and delete the nested ones, while keeping the body of the\n \t\t\t\t\t * comment\n \t\t\t\t\t */\n \t\t\t\t\twhile (matcherCommentBeginEnd.find()) {\n \n \t\t\t\t\t\t// check that we are not inside a string\n \t\t\t\t\t\tMatcher matcherString2 = patternString.matcher(commentLine);\n \t\t\t\t\t\tboolean bInString = false;\n \n \t\t\t\t\t\twhile (matcherString2.find()) {\n \n \t\t\t\t\t\t\tif (matcherString2.start() <= matcherCommentBeginEnd.start()\n \t\t\t\t\t\t\t\t\t&& matcherCommentBeginEnd.start() < matcherString2.end()) {\n \t\t\t\t\t\t\t\tbInString = true;\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\tif (!bInString) {\n \n \t\t\t\t\t\t\tif (matcherCommentBeginEnd.group().equals(\"(*\"))\n \t\t\t\t\t\t\t\tnestedCommentsLevel++;\n \t\t\t\t\t\t\telse\n \t\t\t\t\t\t\t\tnestedCommentsLevel--;\n \n \t\t\t\t\t\t\t// delete the comment delimiter from the body of the\n \t\t\t\t\t\t\t// comment\n \t\t\t\t\t\t\tif (nestedCommentsLevel != 0) {\n \t\t\t\t\t\t\t\tString before = commentLine.substring(0, matcherCommentBeginEnd.start());\n \t\t\t\t\t\t\t\tString after = commentLine.substring(matcherCommentBeginEnd.start() + 2);\n \t\t\t\t\t\t\t\tcommentLine = before + after;\n \t\t\t\t\t\t\t}\n \n \t\t\t\t\t\t\tif (nestedCommentsLevel == 0) {\n \n \t\t\t\t\t\t\t\tcommentLines = commentLines + \" \"\n \t\t\t\t\t\t\t\t\t\t+ commentLine.substring(0, matcherCommentBeginEnd.start());\n \t\t\t\t\t\t\t\tafterComment = commentLine.substring(matcherCommentBeginEnd.start() + 2);\n \n \t\t\t\t\t\t\t\tbreak getWholeComment;\n \t\t\t\t\t\t\t}\n \n \t\t\t\t\t\t\t// we modified the string: we have to restart the\n \t\t\t\t\t\t\t// matcher\n \t\t\t\t\t\t\tmatcherCommentBeginEnd = patternCommentBeginEnd.matcher(commentLine);\n \t\t\t\t\t\t}\n \t\t\t\t\t}\n \t\t\t\t\tcommentLines = commentLines + \" \" + commentLine;\n \t\t\t\t}\n \n \t\t\t\t// if we are at the beginning, we must insert blank lines (or\n \t\t\t\t// else we would access\n \t\t\t\t// out of\n \t\t\t\t// bounds)\n \t\t\t\tif (l < 3) {\n \t\t\t\t\tString[] lines2 = new String[lines.length + 2];\n \t\t\t\t\tfor (int k = 0; k < lines.length; k++)\n \t\t\t\t\t\tlines2[k + 2] = lines[k];\n \t\t\t\t\tlines = lines2;\n \t\t\t\t\tl += 2;\n \t\t\t\t}\n \n \t\t\t\t// if we didn't go through at least one iteration of the loop\n \t\t\t\tif (l >= lines.length)\n \t\t\t\t\tl--;\n \n \t\t\t\t/*\n \t\t\t\t * Now, we put all the modified lines in the table, and we modify the current line so that the\n \t\t\t\t * formatter will take the modifications into account.\n \t\t\t\t */\n \n \t\t\t\t// Do not put blank lines\n \t\t\t\tif (beforeComment.trim().equals(\"\") && afterComment.trim().equals(\"\")) {\n \t\t\t\t\tlines[l] = \"(*\" + commentLines + \"*)\";\n \t\t\t\t\tcurrentLine = l;\n \t\t\t\t\treturn true;\n \t\t\t\t} else if (beforeComment.trim().equals(\"\")) {\n \t\t\t\t\tlines[l - 1] = \"(*\" + commentLines + \"*)\";\n \t\t\t\t\tlines[l] = afterComment;\n \t\t\t\t\tcurrentLine = l - 1;\n \t\t\t\t\treturn true;\n \t\t\t\t} else if (afterComment.trim().equals(\"\")) {\n \t\t\t\t\tlines[l - 1] = beforeComment;\n \t\t\t\t\tlines[l] = \"(*\" + commentLines + \"*)\";\n \t\t\t\t\tcurrentLine = l - 1;\n \t\t\t\t\treturn true;\n \t\t\t\t} else {\n \t\t\t\t\t// the source code before the comment\n \t\t\t\t\tlines[l - 2] = beforeComment;\n \t\t\t\t\t// the body of the comment\n \t\t\t\t\tlines[l - 1] = \"(*\" + commentLines + \"*)\";\n \t\t\t\t\t// the source code after the comment\n \t\t\t\t\tlines[l] = afterComment;\n \t\t\t\t\t// the line on which we will continue formatting\n \t\t\t\t\tcurrentLine = l - 2;\n \t\t\t\t\treturn true;\n \t\t\t\t}\n \t\t\t}\n \t\t}\n \n \t\treturn false;\n \t}", "public void tokenizeFile (String filePath) throws IOException {\r\n tokenList.clear();\r\n\r\n FileInputStream fInStream = new FileInputStream(filePath);\r\n Scanner inFS = new Scanner(fInStream);\r\n\r\n while (inFS.hasNextLine()) {\r\n String nextStr = inFS.nextLine();\r\n\r\n if (!nextStr.isEmpty()) {\r\n tokenList.add(theBuilder.build(nextStr));\r\n }\r\n }\r\n\r\n fInStream.close();\r\n inFS.close();\r\n }", "public void read(){\n assert(inputStream.hasNext());\n\n while(inputStream.hasNextLine()){\n String line = inputStream.nextLine();\n String[] fields = line.split(\";\");\n\n //If Line is address line\n if(fields.length >= 4){\n Address adr = new Address(fields[0], fields[1], fields[2], fields[3]);\n if(fields.length == 5){\n parseGroups(fields[4], adr);\n }\n inputAddressList.add(adr);\n }\n\n //If Line is Group Line\n else if(fields.length <=3){\n Group group = new Group(fields[0], Integer.parseInt(fields[1]));\n if(fields.length == 3){\n parseGroups(fields[2], group);\n }\n inputGroupList.add(group);\n }\n }\n compose();\n assert(invariant());\n }", "public String[] parseLine() throws IOException, FHIRException {\n\t\tList<String> res = new ArrayList<String>();\n\t\tStringBuilder b = new StringBuilder();\n\t\tboolean inQuote = false;\n\n\t\twhile (more() && !finished(inQuote, res.size())) {\n\t\t\tchar c = peek();\n\t\t\tnext();\n\t\t\tif (c == '\"' && doingQuotes) {\n\t\t\t\tif (ready() && peek() == '\"') {\n\t b.append(c);\n next();\n\t\t\t\t} else {\n\t\t\t inQuote = !inQuote;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse if (!inQuote && c == delimiter ) {\n\t\t\t\tres.add(b.toString().trim());\n\t\t\t\tb = new StringBuilder();\n\t\t\t}\n\t\t\telse \n\t\t\t\tb.append(c);\n\t\t}\n\t\tres.add(b.toString().trim());\n\t\twhile (ready() && (peek() == '\\r' || peek() == '\\n')) {\n\t\t\tnext();\n\t\t}\n\t\t\n\t\tString[] r = new String[] {};\n\t\tr = res.toArray(r);\n\t\treturn r;\n\t}", "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}", "private void process(String file, LinkedList<String> ll) {\r\n \ttry {\r\n \t\tFile currFile = openFile(file);\r\n \t\tStringBuilder sb;\r\n\r\n \t\tif (currFile == null) {\r\n \t\t\treturn;\r\n \t\t}\r\n\r\n \t\tBufferedReader br = new BufferedReader(new FileReader(currFile));\r\n \t\tString line = null;\r\n \t\twhile ((line = br.readLine()) != null) {\r\n \t\t\tint length = line.length();\r\n \t\t\tif (length == 0) {\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t\tint index = 0;\r\n \t\t\tLinkedList<String> newLL;\r\n \t\t\twhile (index < length && line.charAt(index) == ' ') {\r\n \t\t\t\t++index;\r\n \t\t\t}\r\n \t\t\tif (index > length-8 || line.substring(index, index+8).compareTo(\"#include\") != 0) {\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t\tindex += 8;\r\n \t\t\twhile (line.charAt(index) == ' ') {\r\n \t\t\t\t++index;\r\n \t\t\t}\r\n \t\t\tif (line.charAt(index) != '\"') {\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t\tindex++;\r\n \t\t\tint len = line.length();\r\n \t\t\tsb = new StringBuilder();\r\n \t\t\twhile (index < len) {\r\n \t\t\t\tif (line.charAt(index) == '\"') {\r\n \t\t\t\t\tbreak;\r\n \t\t\t\t}\r\n \t\t\t\tsb.append(line.charAt(index));\r\n \t\t\t\t++index;\r\n \t\t\t}\r\n \t\t\tString currName = sb.toString();\r\n \t\t\tll.add(currName);\r\n \t\t\tif (hashM.containsKey(currName)) {\r\n \t\t\t\tcontinue;\r\n \t\t\t}\r\n \t\t\tnewLL = new LinkedList<String>();\r\n \t\t\thashM.put(currName, newLL);\r\n \t\t\tworkQueue.add(currName);\r\n \t\t}\r\n \t}\r\n \tcatch (Exception x) {\r\n \t\tx.printStackTrace();\r\n \t}\r\n }", "List<ThingPackage> parseLines(List<String> line);", "public void parseFile() throws IOException {\r\n\t\tFileInputStream inputStream = new FileInputStream(FILE_PATH);\r\n\t\tScanner sc = new Scanner(inputStream, \"UTF-8\");\r\n\r\n\t\tString line = \"\";\r\n\t\t\r\n\t\twhile (sc.hasNextLine()) {\r\n\t\t\ttry{line = sc.nextLine();} catch(Exception e){System.out.println(e);}\r\n\t\t\tif(line.indexOf(comment_char)==0) {\r\n\t\t\t\tcontinue;\r\n\t\t\t} else {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tif(header == true) {\r\n//\t\t\tline = sc.nextLine();\r\n\t\t\tString[] linee = line.split(delimiter);\r\n\t\t\tthis.fieldNames = linee;\r\n\t\t\tfor(int i = 0; i < linee.length; i++) {\r\n\t\t\t\tcolumnMapping.put(linee[i], i);\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\twhile (sc.hasNextLine()) {\r\n\t\t\ttry{line = sc.nextLine();} catch(Exception e){System.out.println(e);}\r\n\t\t\tdf.add(line.split(delimiter, -1));\r\n//\t\t\tif(df.get(df.size()-1).length != this.fieldNames.length) {\r\n//\t\t\t\tSystem.out.println(this.FILE_PATH);\r\n//\t\t\t\tSystem.out.println(String.join(\" \", df.get(df.size()-1)));\r\n//\t\t\t}\r\n\t\t\tfor(int i = 0; i < df.get(df.size()-1).length; i++) {\r\n\t\t\t\tif(df.get(df.size()-1)[i].equals(\"\")) {\r\n\t\t\t\t\tdf.get(df.size()-1)[i] = \"0\";\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tinputStream.close();\r\n\t\tsc.close();\t\r\n\t}", "private static List<String> split(final String source) throws IOException {\n List<String> result = new ArrayList<>();\n int last_split = -1;\n boolean opened_quotes = false;\n for (int i = 0; i < source.length(); i++) {\n char value = source.charAt(i);\n if (i == source.length() - 1 || source.charAt(i + 1) == '\\n') {\n if (value != ';') {\n throw new IOException(\"Invalid end of statement\");\n }\n String split = source.substring(last_split + 1, i);\n last_split = i;\n if (split.length() != 0) {\n result.add(split);\n }\n result.add(\";\");\n }\n\n if (opened_quotes) {\n if (value == '\\\"') {\n opened_quotes = false;\n String split = source.substring(last_split + 1, i + 1);\n last_split = i;\n if (split.length() == 0) continue;\n result.add(split);\n }\n if (value == '\\n') {\n throw new IOException(\"Invalid input.\");\n }\n } else {\n if (value == '\\\"') {\n opened_quotes = true;\n } else if (Character.isWhitespace(value)) {\n String split = source.substring(last_split + 1, i);\n last_split = i;\n if (split.length() == 0) continue;\n result.add(split);\n } else if (isSymbol(value) && value != ';') {\n String split = source.substring(last_split + 1, i);\n last_split = i;\n if (split.length() != 0) {\n result.add(split);\n }\n result.add(Character.toString(value));\n }\n }\n }\n if (opened_quotes) {\n throw new IOException(\"Invalid input.\");\n }\n\n return result;\n }", "public void readFile() {\r\n\t\tBufferedReader br = null;\r\n\r\n\t\ttry {\r\n\r\n\t\t\tString currentLine;\r\n\r\n\t\t\tbr = new BufferedReader(new FileReader(fileName));\r\n\r\n\t\t\twhile ((currentLine = br.readLine()) != null) {\r\n\r\n\t\t\t\tif (!currentLine.equals(\"\")) {\r\n\t\t\t\t\tString[] paragraphs = currentLine.split(\"\\\\n\\\\n\");\r\n\r\n\t\t\t\t\tfor (String paragraphEntry : paragraphs) {\r\n\t\t\t\t\t\t//process(paragraphEntry);\r\n\t\t\t\t\t\t//System.out.println(\"Para:\"+paragraphEntry);\r\n\t\t\t\t\t\tParagraph paragraph = new Paragraph();\r\n\t\t\t\t\t\tparagraph.process(paragraphEntry);\r\n\t\t\t\t\t\tthis.paragraphs.add(paragraph);\r\n\t\t\t\t\t}\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\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tif (br != null)br.close();\r\n\t\t\t} catch (IOException ex) {\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public static void processDataFile() {\n final String INPUT_FILENAME = \"input/assn6input1.txt\";\n File inputFile = null;\n Scanner inputScanner = null;\n System.out.println(\"Reading data from file: \" + INPUT_FILENAME);\n System.out.println();\n try {\n inputFile = new File(INPUT_FILENAME);\n inputScanner = new Scanner(inputFile);\n } catch(FileNotFoundException e) {\n System.err.println(\"Error opening file \" + INPUT_FILENAME);\n }\n while(inputScanner.hasNext()) {\n String[] dataLine = inputScanner.nextLine().split(\",\");\n // Is the first token \"REALTOR\"?\n if(dataLine[0].toUpperCase().equals(\"REALTOR\")) {\n if(dataLine[1].toUpperCase().equals(\"ADD\")) {\n addRealtor(dataLine);\n }\n else if(dataLine[1].toUpperCase().equals(\"DEL\")) {\n //deleteRealtor(dataLine[2]);\n }\n else {\n \n }\n }\n // Is the first token \"PROPERTY\"?\n else if(dataLine[0].toUpperCase().equals(\"PROPERTY\")) {\n if(dataLine[1].toUpperCase().equals(\"ADD\")) {\n addProperty(dataLine);\n }\n else if(dataLine[1].toUpperCase().equals(\"DEL\")) {\n //deleteProperty(Integer.parseInt(dataLine[2]));\n }\n else {\n \n }\n } else {\n // not realtor or property in the first token\n System.out.println(\"\\tNeither realtor, nor property in first\"\n + \" token\");\n }\n }\n inputScanner.close();\n }", "private String[] parseLine(final String nextLine, final boolean readLine)\n throws IOException {\n String line = nextLine;\n if (line.length() == 0) {\n return new String[0];\n } else {\n\n final List<String> fields = new ArrayList<String>();\n StringBuilder sb = new StringBuilder();\n boolean inQuotes = false;\n boolean hadQuotes = false;\n do {\n if (inQuotes && readLine) {\n sb.append(\"\\n\");\n line = getNextLine();\n if (line == null) {\n break;\n }\n }\n for (int i = 0; i < line.length(); i++) {\n final char c = line.charAt(i);\n if (c == CsvConstants.QUOTE_CHARACTER) {\n hadQuotes = true;\n if (inQuotes && line.length() > i + 1\n && line.charAt(i + 1) == CsvConstants.QUOTE_CHARACTER) {\n sb.append(line.charAt(i + 1));\n i++;\n } else {\n inQuotes = !inQuotes;\n if (i > 2 && line.charAt(i - 1) != this.fieldSeparator\n && line.length() > i + 1\n && line.charAt(i + 1) != this.fieldSeparator) {\n sb.append(c);\n }\n }\n } else if (c == this.fieldSeparator && !inQuotes) {\n hadQuotes = false;\n if (hadQuotes || sb.length() > 0) {\n fields.add(sb.toString());\n } else {\n fields.add(null);\n }\n sb = new StringBuilder();\n } else {\n sb.append(c);\n }\n }\n } while (inQuotes);\n if (sb.length() > 0 || fields.size() > 0) {\n if (hadQuotes || sb.length() > 0) {\n fields.add(sb.toString());\n } else {\n fields.add(null);\n }\n }\n return fields.toArray(new String[0]);\n }\n }", "public void read(File file, String sep, boolean bQuoted) throws Exception {\n BufferedReader reader = new BufferedReader(new FileReader(file));\n for (int i=1;;i++) {\n String line = reader.readLine();\n if (line == null) break;\n String[] ss = parse(line, sep, bQuoted, i);\n if (ss != null) process(ss, i);\n }\n reader.close();\n }", "public Collection<FastqSequence> parse(File file)throws IOException{\n\t\tCollection<FastqSequence> rtrn=new ArrayList<FastqSequence>();\n\t\tString nextLine;\n while ((nextLine = reader.readLine()) != null && (nextLine.trim().length() > 0)) {\n \tif(nextLine.startsWith(\"@\")){\n \t\tString firstLine=nextLine;\n \t\tString secondLine=reader.readLine();\n \t\tString thirdLine=reader.readLine();\n \t\tString fourthLine=reader.readLine();\n \t\t\n \t\tFastqSequence seq=new FastqSequence(firstLine, secondLine,thirdLine, fourthLine);\n \t\t\t\n \t\trtrn.add(seq);\n \t}\n \t\n \t\n }\n return rtrn;\n\t}", "private String removeCommentsFromSourceCode(String codeString, char[] code, CompilationUnit ast) {\n String commentLessCodeString = codeString;\n for (Object commentObj : ast.getCommentList()) {\n Comment comment = (Comment) commentObj;\n String commentString = \"\";\n int start = comment.getStartPosition();\n int length = comment.getLength();\n if (comment.isLineComment() == Boolean.TRUE) {\n for (int i = start; i < code.length; i++) {\n commentString += code[i];\n if (code[i] == '\\n') {\n break;\n }\n }\n } else {\n for (int i = start; i < start + length; i++) {\n commentString += code[i];\n }\n }\n commentLessCodeString = commentLessCodeString.replace(commentString, \"\");\n }\n return commentLessCodeString;\n }", "private int ignoreComment(int nextVal) throws java.io.IOException {\n\t\tint c = nextVal;\n\t\twhile (!isNewLine(c) && c != EOF) {\n\t\t\tc = reader.read();\n\t\t}\n\t\treturn c;\n\t}", "public static String stripComments(String s, ParseResult result) {\n\t\tint commentStart = s.indexOf(\";\");\n\t\tif (commentStart != -1) {\n\t\t\ts = s.substring(0, commentStart);\n\t\t\tresult.commentStartPos = commentStart;\n\t\t\t// undo the effect escape() has had on commas\n\t\t\tint index = s.indexOf(\" , \");\n\t\t\twhile (index > -1) {\n\t\t\t\tresult.commentStartPos -= 2;\n\t\t\t\tindex = s.indexOf(\" , \", index + 3);\n\t\t\t}\n\t\t}\n\t\treturn s.trim();\n\t}", "private String filterComments(String[] initial) {\n\t\tStringBuilder answer = new StringBuilder();\n\t\tfor (int a = 0; a < initial.length; a++) {\n\t\t\tString potential = initial[a];\n\t\t\tint index = potential.indexOf(START_COMMENT);\n\t\t\tif(index != -1)\n\t\t\t\tpotential = potential.substring(0,index);\n\t\t\tif (!potential.trim().isEmpty())\n\t\t\t\tanswer.append(potential + \" \");\n\t\t}\n\t\treturn answer.toString();\n\t}", "public void method() // trailing comment here\n {\n int a; /* non-trailing comment */ int b; /* trailing comment */\n // continuation trailing comment\n int c1; /* non-trailing comment */ int d2; /* trailing comment */\n // non-continuation comment\n }", "static void writeEndOfLineComment(String s) {\n String line = s.trim();\n for (int j = 0; j < level; j++) {\n line = \" \" + line; // 4 spaces\n }\n outputBuffer.append(line).append(ls);\n }", "List<String[]> readCsv(String inputFilePath,int skipLine)throws IOException;", "List<String[]> readCsv(String inputFilePath,int skipLine,char separator)throws IOException;", "@Test(timeout = 4000)\n public void test118() throws Throwable {\n StringReader stringReader0 = new StringReader(\"<SINGLE_LINE_COMMENT>\");\n stringReader0.read();\n JavaCharStream javaCharStream0 = new JavaCharStream(stringReader0, 47, 32);\n JavaParserTokenManager javaParserTokenManager0 = new JavaParserTokenManager(javaCharStream0);\n javaParserTokenManager0.getNextToken();\n assertEquals(18, javaCharStream0.bufpos);\n assertEquals(50, javaCharStream0.getEndColumn());\n }", "private ImportCommand parseLinesFromFile(BufferedReader br) {\n boolean hasContactWithInvalidField = false;\n boolean hasContactWithoutName = false;\n try {\n String line = br.readLine();\n while (line != null) {\n String[] attributes = line.split(\",\", -1);\n int numAttributes = attributes.length;\n\n if (attributes[NAME_FIELD].equalsIgnoreCase(\"Name\")\n || attributes[NAME_FIELD].equalsIgnoreCase(\"Name:\")) { // ignore headers\n line = br.readLine();\n continue;\n }\n\n if (contactHasNoName(attributes, numAttributes)) {\n hasContactWithoutName = true;\n line = br.readLine();\n continue;\n }\n\n Name name = null;\n Optional<Phone> phone = Optional.empty();\n Optional<Email> email = Optional.empty();\n Optional<Address> address = Optional.empty();\n Meeting meeting = null;\n\n try {\n name = ParserUtil.parseName(attributes[NAME_FIELD]);\n if (!attributes[PHONE_FIELD].matches(\"\")) {\n phone = Optional.of(ParserUtil.parsePhone(attributes[PHONE_FIELD]));\n }\n if (!attributes[EMAIL_FIELD].matches(\"\")) {\n email = Optional.of(ParserUtil.parseEmail(attributes[EMAIL_FIELD]));\n }\n if (!attributes[ADDRESS_FIELD].matches(\"\")) {\n address = Optional.of(ParserUtil.parseAddress(attributes[ADDRESS_FIELD]));\n }\n if (!attributes[MEETING_FIELD].matches(\"\")) {\n meeting = ParserUtil.parseMeeting(attributes[MEETING_FIELD]);\n }\n } catch (ParseException pe) {\n hasContactWithInvalidField = true;\n line = br.readLine();\n continue;\n }\n\n ArrayList<String> tags = new ArrayList<>();\n //Check for tags\n if (numAttributes > TAG_FIELD_START) {\n for (int i = TAG_FIELD_START; i < numAttributes; i++) {\n if (!attributes[i].matches(\"\")) {\n tags.add(attributes[i]);\n }\n }\n }\n\n Set<Tag> tagList = null;\n try {\n tagList = ParserUtil.parseTags(tags);\n } catch (ParseException e) {\n line = br.readLine();\n continue;\n }\n if (meeting == null) {\n persons.add(new Person(name, phone, email, address, tagList));\n } else {\n persons.add(new Person(name, phone, email, address, tagList, meeting));\n }\n line = br.readLine();\n }\n br.close();\n } catch (IOException ioe) {\n ioe.printStackTrace();\n }\n return new ImportCommand(persons, hasContactWithInvalidField, hasContactWithoutName);\n }", "private void readFile (String file, Visitor visitor) throws Exception {\n\t\tFileReader fr = new FileReader (file);\n\t\tBufferedReader reader = new BufferedReader (fr);\n\n\t\tSystem.out.println (\"Reading file \" + file);\n\n\t\tint count = 0;\n\t\tfor (String line; (line = reader.readLine()) != null;) {\n\t\t\tif (count++ % 10000 == 0) System.out.println (line);\n\t\t\tvisitor.visit (line);\n\n\t\t\tif (count >= LIMIT) break;\n\t\t}\n\n\t\tSystem.out.println (\"Done\");\n\n\t\treader.close();\n\t\tfr.close();\n\t}", "private Comment handleComment(String line) {\n\t\tComment c = new Comment();\n\t\tc.setText(\"\");\n\t\treturn (Comment) c;\n\t}", "protected void processLine(String line){}", "public static List<String> readLineFromFile(File file) {\r\n List<String> result = new ArrayList<String>();\r\n LineNumberReader lnr = null;\r\n try {\r\n lnr = new LineNumberReader(new BufferedReader(\r\n new InputStreamReader(new FileInputStream(file), Charset\r\n .defaultCharset().name())));\r\n for (String line = lnr.readLine(); line != null; line = lnr\r\n .readLine()) {\r\n result.add(line);\r\n }\r\n } catch (Exception e) {\r\n throw new RuntimeException(e);\r\n } finally {\r\n if (lnr != null) {\r\n try {\r\n lnr.close();\r\n } catch (IOException e) {\r\n throw new RuntimeException(e);\r\n }\r\n }\r\n }\r\n return result;\r\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 }", "private void addLine()\n{\n BaleElement first = null;\n BaleElement last = null;\n BaleElement eol = null;\n boolean havecmmt = false;\n for (BaleElement ce : line_elements) {\n eol = ce;\n if (!ce.isEmpty() && !ce.isComment()) {\n\t if (first == null) first = ce;\n\t last = ce;\n }\n else if (ce.isComment()) havecmmt = true;\n }\n\n if (first != null && cur_parent.isComment()) cur_parent = cur_parent.getBaleParent();\n if (first == null && !cur_parent.isComment() && !havecmmt) ++num_blank;\n else if (first != null || cur_parent.isComment()) num_blank = 0;\n\n // fix outer parent to ensure it includes this line\n fixOuterParent(first,last,eol);\n\n // Create nodes for block comments\n BaleElement.Branch cpar = null;\n if (first == null) {\n if (!cur_parent.isComment() && (havecmmt || num_blank >= 2)) {\n\t cpar = new BaleElement.BlockCommentNode(for_document,cur_parent);\n\t addElementNode(cpar,num_blank);\n\t cpar.setAstNode(cur_ast);\n\t cpar.setStartTokenState(token_state);\n\t cur_parent = cpar;\n }\n }\n\n if (cpar != null && cur_parent != cpar) {\n BoardLog.logE(\"BALE\",\"UNUSED COMMENT\");\n }\n\n // Add the current line\n BaleElement.Branch lastpar = cur_parent;\n cur_line = new BaleElement.LineNode(for_document,cur_parent);\n cur_line.setAstNode(cur_ast);\n cur_line.setStartTokenState(token_state);\n addElementNode(cur_line,0);\n cur_parent = cur_line;\n\n boolean haveindent = true;\n for (BaleElement ce : line_elements) {\n fixInnerParent(ce);\n ce = fixLeafElement(ce,haveindent);\n haveindent = false;\n addElementNode(ce,0);\n token_state = ce.getEndTokenState();\n }\n\n cur_line.setEndTokenState(token_state);\n cur_parent = lastpar;\n cur_line = null;\n}", "private ArrayList<Constant> importConstants(File f) throws FileNotFoundException, IOException\r\n\t{\r\n\t\tArrayList<Constant> constants = new ArrayList<>();\r\n\t\tPattern equPattern = Pattern.compile(\"\\\\s+EQU\\\\s+\");\r\n\t\tPattern constdefPattern = Pattern.compile(\"^\\\\tconst_def\\\\s*\");\r\n\t\tPattern constPattern = Pattern.compile(\"^\\\\tconst\\\\s+\");\r\n\t\tPattern constskipPattern = Pattern.compile(\"^\\\\tconst_skip\\\\s*\");\r\n\t\tPattern constnextPattern = Pattern.compile(\"^\\\\tconst_next\\\\s+\");\r\n\t\t\r\n\t\tint count = -1;\r\n\t\tint step = 1;\r\n\t\ttry (BufferedReader reader = new BufferedReader(new FileReader(f)))\r\n\t\t{\r\n\t\t\twhile (reader.ready())\r\n\t\t\t{\r\n\t\t\t\tString line = reader.readLine();\r\n\t\t\t\tString backup = line;\r\n\t\t\t\tline = this.commentPattern.matcher(line).replaceFirst(\"\");\r\n\t\t\t\tline = this.trailingWhitespacePattern.matcher(line).replaceFirst(\"\");\r\n\t\t\t\t\r\n\t\t\t\tif (equPattern.matcher(line).find())\r\n\t\t\t\t{\r\n\t\t\t\t\tString[] args = equPattern.split(line, 2);\r\n\t\t\t\t\tif (args.length != 2) continue; //throw new IllegalArgumentException(\"The line \\\"\" + line + \"\\\" does not compile\");\r\n\t\t\t\t\t\r\n\t\t\t\t\tint value;\r\n\t\t\t\t\tif (args[1].startsWith(\"$\")) value = Integer.parseInt(args[1].substring(1), 16);\r\n\t\t\t\t\telse if (args[1].equals(\"const_value\")) value = count;\r\n\t\t\t\t\telse value = Integer.parseInt(args[1]);\r\n\t\t\t\t\t\r\n\t\t\t\t\tconstants.add(new Constant(args[0], value));\r\n\t\t\t\t}\r\n\t\t\t\telse if (constdefPattern.matcher(line).find())\r\n\t\t\t\t{\r\n\t\t\t\t\tline = constdefPattern.matcher(line).replaceFirst(\"\");\r\n\t\t\t\t\tif (line.equals(\"\")) count = 0;\r\n\t\t\t\t\telse if (this.commaSeparatorPattern.matcher(line).find())\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tString[] args = this.commaSeparatorPattern.split(line);\r\n\t\t\t\t\t\tif (args.length > 2) throw new IOException(\"Too many arguments provided to const_def: \" + backup);\r\n\t\t\t\t\t\tcount = Integer.parseInt(args[0]);\r\n\t\t\t\t\t\tstep = Integer.parseInt(args[1]);\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse count = Integer.parseInt(line);\r\n\t\t\t\t}\r\n\t\t\t\telse if (constPattern.matcher(line).find())\r\n\t\t\t\t{\r\n\t\t\t\t\tif (count == -1) throw new IllegalStateException();\r\n\t\t\t\t\tline = constPattern.matcher(line).replaceFirst(\"\");\r\n\t\t\t\t\tconstants.add(new Constant(line, count));\r\n\t\t\t\t\tcount += step;\r\n\t\t\t\t}\r\n\t\t\t\telse if (constskipPattern.matcher(line).find()) count += step;\r\n\t\t\t\telse if (constnextPattern.matcher(line).find())\r\n\t\t\t\t{\r\n\t\t\t\t\tline = constnextPattern.matcher(line).replaceFirst(\"\");\r\n\t\t\t\t\tint newCount = Integer.parseInt(line);\r\n\t\t\t\t\tif (newCount < count) throw new IOException(\"const value cannot decrease: \" + backup);\r\n\t\t\t\t\tcount = newCount;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn constants;\r\n\t}", "@Test\n\tpublic void simpleComment() throws ParseException {\n\t\t// -->\n\t\tILineMatcher startMatcher = JavaSourceLineMatcher.startMatcher();\n\t\tILineMatcher endMatcher = JavaSourceLineMatcher.endMatcher();\n\t\tBlockToBlockListConverter converter = new BlockToBlockListConverter(startMatcher, endMatcher);\n\n\t\tList<String> lines = Lists.newArrayList();\n\n\t\tlines.add(\" // -->\");\n\t\tlines.add(\" // shift one left\");\n\t\tlines.add(\" // this line too\");\n\t\tlines.add(\" // <--\");\n\n\t\tList<Block> blocks = converter.convert(new Block(lines));\n\n\t\tassertEquals(1, blocks.size());\n\t\tBlock block = blocks.get(0);\n\t\tassertNotNull(block);\n\t\tassertEquals(\"// shift one left\", block.lines().get(0));\n\t\tassertEquals(\"// this line too\", block.lines().get(1));\n\t\t// <--\n\t}", "public final void mMULTILINE_COMMENT() throws RecognitionException {\n try {\n int _type = MULTILINE_COMMENT;\n int _channel = DEFAULT_TOKEN_CHANNEL;\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:623:5: ( '/*' ( . )* '*/' )\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:623:7: '/*' ( . )* '*/'\n {\n match(\"/*\"); \n\n // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:623:12: ( . )*\n loop13:\n do {\n int alt13=2;\n int LA13_0 = input.LA(1);\n\n if ( (LA13_0=='*') ) {\n int LA13_1 = input.LA(2);\n\n if ( (LA13_1=='/') ) {\n alt13=2;\n }\n else if ( ((LA13_1>='\\u0000' && LA13_1<='.')||(LA13_1>='0' && LA13_1<='\\uFFFF')) ) {\n alt13=1;\n }\n\n\n }\n else if ( ((LA13_0>='\\u0000' && LA13_0<=')')||(LA13_0>='+' && LA13_0<='\\uFFFF')) ) {\n alt13=1;\n }\n\n\n switch (alt13) {\n \tcase 1 :\n \t // /Users/devdatta.kulkarni/Documents/Cassandra/apache-cassandra-0.8.6-src/src/java/org/apache/cassandra/cql/Cql.g:623:12: .\n \t {\n \t matchAny(); \n\n \t }\n \t break;\n\n \tdefault :\n \t break loop13;\n }\n } while (true);\n\n match(\"*/\"); \n\n _channel = HIDDEN; \n\n }\n\n state.type = _type;\n state.channel = _channel;\n }\n finally {\n }\n }", "private void skipComment() {\r\n int length = sourceCode.length();\r\n if (++index < length) {\r\n char character = sourceCode.charAt(index);\r\n if (character == '/') {\r\n // If it's a line comment (//) then skip to the next line.\r\n // Find the next line.\r\n index = sourceCode.indexOf('\\n', index);\r\n // Skip to after it if it's found, or the end of the source code\r\n // otherwise.\r\n index = index == -1 ? length : index + 1;\r\n } else if (character == '*') {\r\n // If it's a long comment (/* ... */) then skip to after the\r\n // occurrence of \"*/\".\r\n // Find \"*/\".\r\n index = sourceCode.indexOf(\"*/\", index);\r\n // Skip to after it if it's found, or the end of the source code\r\n // otherwise.\r\n index = index == -1 ? length : index + 2;\r\n }\r\n }\r\n }", "private ArrayList<String> parseFile(String file_name){ // extract each line from file AS string (stopList)\r\n ArrayList<String> list = new ArrayList<>();\r\n Scanner scanner = null;\r\n try{\r\n scanner = new Scanner(new BufferedReader(new FileReader(file_name)));\r\n while (scanner.hasNextLine())\r\n {\r\n list.add(scanner.nextLine());\r\n }\r\n }\r\n catch (Exception e ){ System.out.println(\"Error reading file -> \"+e.getMessage()); }\r\n finally {\r\n if(scanner != null ){scanner.close();} // close the file\r\n }\r\n return list;\r\n }", "private Stream<String> processLines(Stream<String> lines) {\n System.out.println(\"processlines\" + Thread.currentThread().getName());\n Pattern pattern = Pattern.compile(\"<a href=\\\"([^\\\\/]*\\\\/)\\\".*\");\n\n return lines\n .map(s -> pattern.matcher(s))\n .filter(m -> m.matches())\n .map(m -> m.group(1))\n .filter(s -> !\"../\".equals(s));\n }", "private void exercise5() throws IOException {\n final Path resourcePath = retrieveResourcePath();\n List<String> nonDuplicateList;\n try (BufferedReader reader = newBufferedReader(resourcePath)) {\n nonDuplicateList = reader.lines()\n .flatMap(line -> of(line.split(WORD_REGEXP)))\n .distinct()\n .collect(toList());\n }\n\n nonDuplicateList.forEach(System.out::println);\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 void commentStates() throws SAXException, IOException {\n CommentState state = CommentState.COMMENT_START_STATE;\n for (;;) {\n char c = read();\n switch (state) {\n case COMMENT_START_STATE:\n /*\n * Comment start state\n * \n * \n * Consume the next input character:\n */\n switch (c) {\n case '-':\n /*\n * U+002D HYPHEN-MINUS (-) Switch to the comment\n * start dash state.\n */\n state = CommentState.COMMENT_START_DASH_STATE;\n continue;\n case '>':\n /*\n * U+003E GREATER-THAN SIGN (>) Parse error.\n */\n err(\"Premature end of comment.\");\n /* Emit the comment token. */\n emitComment();\n /*\n * Switch to the data state.\n */\n return;\n case '\\u0000':\n /*\n * EOF Parse error.\n */\n err(\"End of file inside comment.\");\n /* Emit the comment token. */\n emitComment();\n /*\n * Reconsume the EOF character in the data state.\n */\n unread(c);\n return;\n default:\n /*\n * Anything else Append the input character to the\n * comment token's data.\n */\n appendToComment(c);\n /*\n * Switch to the comment state.\n */\n state = CommentState.COMMENT_STATE;\n continue;\n }\n case COMMENT_START_DASH_STATE:\n /*\n * Comment start dash state\n * \n * Consume the next input character:\n */\n switch (c) {\n case '-':\n /*\n * U+002D HYPHEN-MINUS (-) Switch to the comment end\n * state\n */\n state = CommentState.COMMENT_END_STATE;\n continue;\n case '>':\n /*\n * U+003E GREATER-THAN SIGN (>) Parse error.\n */\n err(\"Premature end of comment.\");\n /* Emit the comment token. */\n emitComment();\n /*\n * Switch to the data state.\n */\n return;\n case '\\u0000':\n /*\n * EOF Parse error.\n */\n err(\"End of file inside comment.\");\n /* Emit the comment token. */\n emitComment();\n /*\n * Reconsume the EOF character in the data state.\n */\n unread(c);\n return;\n default:\n /*\n * Anything else Append a U+002D HYPHEN-MINUS (-)\n * character and the input character to the comment\n * token's data.\n */\n appendToComment('-');\n appendToComment(c);\n /*\n * Switch to the comment state.\n */\n state = CommentState.COMMENT_STATE;\n continue;\n }\n case COMMENT_STATE:\n /*\n * Comment state Consume the next input character:\n */\n switch (c) {\n case '-':\n /*\n * U+002D HYPHEN-MINUS (-) Switch to the comment end\n * dash state\n */\n state = CommentState.COMMENT_END_DASH_STATE;\n continue;\n case '\\u0000':\n /*\n * EOF Parse error.\n */\n err(\"End of file inside comment.\");\n /* Emit the comment token. */\n emitComment();\n /*\n * Reconsume the EOF character in the data state.\n */\n unread(c);\n return;\n default:\n /*\n * Anything else Append the input character to the\n * comment token's data.\n */\n appendToComment(c);\n /*\n * Stay in the comment state.\n */\n continue;\n }\n case COMMENT_END_DASH_STATE:\n /*\n * Comment end dash state Consume the next input character:\n */\n switch (c) {\n case '-':\n /*\n * U+002D HYPHEN-MINUS (-) Switch to the comment end\n * state\n */\n state = CommentState.COMMENT_END_STATE;\n continue;\n case '\\u0000':\n /*\n * EOF Parse error.\n */\n err(\"End of file inside comment.\");\n /* Emit the comment token. */\n emitComment();\n /*\n * Reconsume the EOF character in the data state.\n */\n unread(c);\n return;\n default:\n /*\n * Anything else Append a U+002D HYPHEN-MINUS (-)\n * character and the input character to the comment\n * token's data.\n */\n appendToComment('-');\n appendToComment(c);\n /*\n * Switch to the comment state.\n */\n state = CommentState.COMMENT_STATE;\n continue;\n }\n case COMMENT_END_STATE:\n /*\n * Comment end dash state Consume the next input character:\n */\n switch (c) {\n case '>':\n /*\n * U+003E GREATER-THAN SIGN (>) Emit the comment\n * token.\n */\n emitComment();\n /*\n * Switch to the data state.\n */\n return;\n case '-':\n /* U+002D HYPHEN-MINUS (-) Parse error. */\n err(\"Consecutive hyphens did not terminate a comment.\");\n /*\n * Append a U+002D HYPHEN-MINUS (-) character to the\n * comment token's data.\n */\n appendToComment('-');\n /*\n * Stay in the comment end state.\n */\n continue;\n case '\\u0000':\n /*\n * EOF Parse error.\n */\n err(\"End of file inside comment.\");\n /* Emit the comment token. */\n emitComment();\n /*\n * Reconsume the EOF character in the data state.\n */\n unread(c);\n return;\n default:\n /*\n * Anything else Parse error.\n */\n err(\"Consecutive hyphens did not terminate a comment.\");\n /*\n * Append two U+002D HYPHEN-MINUS (-) characters and\n * the input character to the comment token's data.\n */\n appendToComment('-');\n appendToComment('-');\n appendToComment(c);\n /*\n * Switch to the comment state.\n */\n state = CommentState.COMMENT_STATE;\n continue;\n }\n }\n }\n }", "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 }", "public final void mSINGLE_COMMENT() throws RecognitionException {\r\n try {\r\n int _type = SINGLE_COMMENT;\r\n int _channel = DEFAULT_TOKEN_CHANNEL;\r\n // C:\\\\sandbox\\\\objc2j\\\\src\\\\ru\\\\andremoniy\\\\objctojavacnv\\\\antlr\\\\Preprocessor.g:256:2: ( '//' (~ ( '\\\\n' | '\\\\r' ) )* )\r\n // C:\\\\sandbox\\\\objc2j\\\\src\\\\ru\\\\andremoniy\\\\objctojavacnv\\\\antlr\\\\Preprocessor.g:256:4: '//' (~ ( '\\\\n' | '\\\\r' ) )*\r\n {\r\n match(\"//\"); \r\n\r\n\r\n\r\n // C:\\\\sandbox\\\\objc2j\\\\src\\\\ru\\\\andremoniy\\\\objctojavacnv\\\\antlr\\\\Preprocessor.g:256:9: (~ ( '\\\\n' | '\\\\r' ) )*\r\n loop2:\r\n do {\r\n int alt2=2;\r\n int LA2_0 = input.LA(1);\r\n\r\n if ( ((LA2_0 >= '\\u0000' && LA2_0 <= '\\t')||(LA2_0 >= '\\u000B' && LA2_0 <= '\\f')||(LA2_0 >= '\\u000E' && LA2_0 <= '\\uFFFF')) ) {\r\n alt2=1;\r\n }\r\n\r\n\r\n switch (alt2) {\r\n \tcase 1 :\r\n \t // C:\\\\sandbox\\\\objc2j\\\\src\\\\ru\\\\andremoniy\\\\objctojavacnv\\\\antlr\\\\Preprocessor.g:\r\n \t {\r\n \t if ( (input.LA(1) >= '\\u0000' && input.LA(1) <= '\\t')||(input.LA(1) >= '\\u000B' && input.LA(1) <= '\\f')||(input.LA(1) >= '\\u000E' && input.LA(1) <= '\\uFFFF') ) {\r\n \t input.consume();\r\n \t }\r\n \t else {\r\n \t MismatchedSetException mse = new MismatchedSetException(null,input);\r\n \t recover(mse);\r\n \t throw mse;\r\n \t }\r\n\r\n\r\n \t }\r\n \t break;\r\n\r\n \tdefault :\r\n \t break loop2;\r\n }\r\n } while (true);\r\n\r\n\r\n _channel = HIDDEN; \r\n\r\n }\r\n\r\n state.type = _type;\r\n state.channel = _channel;\r\n }\r\n finally {\r\n \t// do for sure before leaving\r\n }\r\n }", "static TreeSet<Insertion> parseFile(String fn) throws IOException\n{\n\tTreeSet<Insertion> res = new TreeSet<>();\n\t@SuppressWarnings(\"resource\")\n\tScanner input = new Scanner(new FileInputStream(new File(fn)));\n\twhile(input.hasNext())\n\t{\n\t\tString line = input.nextLine();\n\t\tif(line.length() == 0 || line.charAt(0) == '#') continue;\n\t\tif(filter && svType == DELETE && !line.contains(\"SVTYPE=DEL\")) continue;\n\t\tif(filter && svType == INSERT && !line.contains(\"SVTYPE=INS\")) continue;\n\t\tInsertion cur = new Insertion(line);\n\t\tif(cur.length == 0) continue;\n\t\tres.add(new Insertion(line));\n\t}\n\treturn res;\n}", "private void formatCode() {\n isLongComment = false;\n\n for (int i = 0; i < formattedCode.size(); i++) {\n String line = formattedCode.get(i);\n // format each line\n String handledLine = handleLine(line);\n\n // if not empty, replace given line with its formatted version\n if (handledLine != null && !handledLine.equals(\"\"))\n formattedCode.set(i, handledLine);\n else\n // else remove the line without any instructions\n formattedCode.remove(i--);\n }\n }", "public void readInput(String fileName){\n\n BufferedReader reader;\n try {\n reader = new BufferedReader(new FileReader(fileName));\n String line = reader.readLine(); //read first line\n int numLine =1; //keep track the number of line\n while (line != null) {\n String[] tokens = line.trim().split(\"\\\\s+\"); //split line into token\n if(numLine==1){ //for the first line\n intersection = Integer.parseInt(tokens[0]); //set the number of intersection\n roadways = Integer.parseInt(tokens[1]); // set the number of roadways\n coor = new Coordinates[intersection];\n g = new Graph(intersection);//create a graph\n line = reader.readLine();\n numLine++;\n }\n else if(numLine>1&&numLine<intersection+2){ //for all intersection\n while(numLine>1&&numLine<intersection+2){\n tokens = line.trim().split(\"\\\\s+\");\n coor[Integer.parseInt(tokens[0])] = new Coordinates(Integer.parseInt(tokens[1]),Integer.parseInt(tokens[2])); //add into coor array to keep track the coor of intersection\n line = reader.readLine();\n numLine++;\n }\n }\n else if(numLine ==intersection+2){ //skip the space line\n line = reader.readLine();\n numLine++;\n while(numLine<roadways+intersection+3){ // for all the roadways, only include the number of roadways mention in the first line\n tokens = line.trim().split(\"\\\\s+\");\n int fst = Integer.parseInt(tokens[0]);\n int snd = Integer.parseInt(tokens[1]);\n g.addEgde(fst,snd,coor[fst].distTo(coor[snd]));\n line = reader.readLine();\n numLine++;\n }\n }\n else if(numLine >= roadways+intersection+3)\n break;\n }\n reader.close();\n } catch (FileNotFoundException e){\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "public void analyze(File sourceFile) throws CompilerException,IOException\r\n\t{\r\n\t\tthis.stream = new BufferedReader(new FileReader(sourceFile));\r\n\t\tif (!this.stream.markSupported())\r\n\t\t\tthrow new CompilerException(\"Mark method is not available,updating java should solve this.\");\r\n\t\t\r\n\t\tfor (;;)\r\n\t\t{\t\r\n\t\t\t/**\r\n\t\t\t * Info is read char by char until end of stream is reached.\r\n\t\t\t */\r\n\t\t\tint c = this.stream.read();\r\n\t\t\tif (c == -1)\r\n\t\t\t\tbreak;\r\n\t\t\tchar rchar = (char)c;\r\n\t\t\t\r\n\t\t\t/**\r\n\t\t\t * If current char is '\"' it starts reading string constant\r\n\t\t\t * it reads it until it is terminated by another '\"'\r\n\t\t\t */\r\n\t\t\tif (rchar == '\"') // string token.\r\n\t\t\t{\r\n\t\t\t\tStringBuilder builder = new StringBuilder();\r\n\t\t\t\tfor (;;)\r\n\t\t\t\t{\r\n\t\t\t\t\tint ca = this.stream.read();\r\n\t\t\t\t\tif (ca == -1)\r\n\t\t\t\t\t\tthrow new CompilerException(\"Unterminated string - \" + builder.toString());\r\n\t\t\t\t\tchar caa = (char)ca;\r\n\t\t\t\t\tif (caa == '\"')\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tbuilder.append(caa);\r\n\t\t\t\t}\r\n\t\t\t\tthis.tokens.Put(new StringToken(builder.toString()));\r\n\t\t\t}\r\n\t\t\t/**\r\n\t\t\t * If current char is \"'\" it starts reading char constant\r\n\t\t\t * it reads it until it is terminated by another \"'\"\r\n\t\t\t */\r\n\t\t\telse if (rchar == new String(\"'\").charAt(0)) // char token\r\n\t\t\t{\r\n\t\t\t\tStringBuilder builder = new StringBuilder();\r\n\t\t\t\tfor (;;)\r\n\t\t\t\t{\r\n\t\t\t\t\tint ca = this.stream.read();\r\n\t\t\t\t\tif (ca == -1)\r\n\t\t\t\t\t\tthrow new CompilerException(\"Unterminated character - \" + builder.toString());\r\n\t\t\t\t\tchar caa = (char)ca;\r\n\t\t\t\t\tif (caa == new String(\"'\").charAt(0))\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\tbuilder.append(caa);\r\n\t\t\t\t}\r\n\t\t\t\tthis.tokens.Put(new CharToken(builder.toString()));\r\n\t\t\t}\r\n\t\t\t/**\r\n\t\t\t * If current char starts with number\r\n\t\t\t * it reads it until it encounters char which is not letter\r\n\t\t\t * and not number.\r\n\t\t\t */\r\n\t\t\telse if (isNumber(rchar))\r\n\t\t\t{\r\n\t\t\t\tStringBuilder builder = new StringBuilder();\r\n\t\t\t\tbuilder.append(rchar);\r\n\t\t\t\tfor (;;)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.stream.mark(1);\r\n\t\t\t\t\tint ca = this.stream.read();\r\n\t\t\t\t\tif (ca == -1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthis.stream.reset();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tchar caa = (char)ca;\r\n\t\t\t\t\tif (!isLetterOrNumber(caa))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthis.stream.reset();\r\n\t\t\t\t\t\tbreak;\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\tbuilder.append(caa);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.tokens.Put(new NumericToken(builder.toString()));\r\n\t\t\t}\r\n\t\t\t/**\r\n\t\t\t * If current char is symbol it reads it and converts to SymbolToken.\r\n\t\t\t */\r\n\t\t\telse if (isSymbol(rchar))\r\n\t\t\t{\r\n\t\t\t\t/**\r\n\t\t\t\t * We have exceptional check for /\r\n\t\t\t\t * because if next char is / or * , it means it's comment\r\n\t\t\t\t */\r\n\t\t\t\tboolean isComment = false;\r\n\t\t\t\tif (rchar == '/')\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.stream.mark(1);\r\n\t\t\t\t\tint data = this.stream.read();\r\n\t\t\t\t\tif (data == -1) {\r\n\t\t\t\t\t\tthis.stream.reset();\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\tchar second = (char)data;\r\n\t\t\t\t\t\tif (second == '/') {\r\n\t\t\t\t\t\t\tisComment = true;\r\n\t\t\t\t\t\t\tfor (;;) {\r\n\t\t\t\t\t\t\t\tdata = this.stream.read();\r\n\t\t\t\t\t\t\t\tif (data == -1)\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\tsecond = (char)data;\r\n\t\t\t\t\t\t\t\tif (second == '\\n')\r\n\t\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}\r\n\t\t\t\t\t\telse if (second == '*') {\r\n\t\t\t\t\t\t\tisComment = true;\r\n\t\t\t\t\t\t\tfor (;;) {\r\n\t\t\t\t\t\t\t\tdata = this.stream.read();\r\n\t\t\t\t\t\t\t\tif (data == -1)\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\tsecond = (char)data;\r\n\t\t\t\t\t\t\t\tint thirdData = this.stream.read();\r\n\t\t\t\t\t\t\t\tif (thirdData == -1)\r\n\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\tchar third = (char)thirdData;\r\n\t\t\t\t\t\t\t\tif (second == '*' && third == '/') {\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}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tthis.stream.reset();\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif (!isComment) {\r\n\t\t\t\t\tthis.tokens.Put(new SymbolToken(new StringBuilder().append(rchar).toString()));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t/**\r\n\t\t\t * If current char is letter then it reads it until it encounters char\r\n\t\t\t * which is not number or letter or symbol\r\n\t\t\t * When done reading letter it checks if it's keyword \r\n\t\t\t * If it is , it writes KeywordToken , else - NameToken\r\n\t\t\t */\r\n\t\t\telse if (isLetter(rchar))\r\n\t\t\t{\r\n\t\t\t\tStringBuilder builder = new StringBuilder();\r\n\t\t\t\tbuilder.append(rchar);\r\n\t\t\t\tfor (;;)\r\n\t\t\t\t{\r\n\t\t\t\t\tthis.stream.mark(1);\r\n\t\t\t\t\tint ca = this.stream.read();\r\n\t\t\t\t\tif (ca == -1)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthis.stream.reset();\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t\tchar caa = (char)ca;\r\n\t\t\t\t\tif (!isLetterOrNumber(caa))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tthis.stream.reset();\r\n\t\t\t\t\t\tbreak;\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\tbuilder.append(caa);\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tthis.tokens.Put(isKeyword(builder.toString()) ? new KeywordToken(builder.toString()) : \r\n\t\t\t\t\t(isExpressionKeyword(builder.toString()) ? new ExpressionKeywordToken(builder.toString()) : new NameToken(builder.toString())));\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tthis.stream.close();\r\n\t\t/**\r\n\t\t * Once we are done with reading and analyzing, flip the tokens bag\r\n\t\t * so it's prepared for reading.\r\n\t\t */\r\n\t\tthis.tokens.Flip();\r\n\t}", "protected abstract Operation parseLine(File baseDir, String line, int lineNum) throws IOException;", "List<CountryEntity> parseLines(List<String> line);", "private List<LineStatement> createCommentList(List<Comment> commentList) {\n List<LineStatement> resultList = new ArrayList<>(commentList.size());\n\n for (Comment comment : commentList) {\n resultList.add(new LineStatement(comment.getLine(), comment.getValue()));\n }\n\n return resultList;\n }", "private boolean isComment(String line) {\n\t\tif (line.equals(\"\")) return true;\n\t\t\n\t\t// If the line starts with \"//\".\n\t\tif (line.substring(0, 2).equals(\"//\")) return true;\n\t\t\n\t\treturn false;\n\t}", "private StringBuilder stripWhitespace(String description)\n/* */ {\n/* 1650 */ StringBuilder result = new StringBuilder();\n/* */ \n/* */ \n/* 1653 */ int start = 0;\n/* 1654 */ while ((start != -1) && (start < description.length()))\n/* */ {\n/* */ \n/* 1657 */ while ((start < description.length()) && (PatternProps.isWhiteSpace(description.charAt(start)))) {\n/* 1658 */ start++;\n/* */ }\n/* */ \n/* */ \n/* 1662 */ if ((start < description.length()) && (description.charAt(start) == ';')) {\n/* 1663 */ start++;\n/* */ \n/* */ \n/* */ }\n/* */ else\n/* */ {\n/* */ \n/* 1670 */ int p = description.indexOf(';', start);\n/* 1671 */ if (p == -1)\n/* */ {\n/* */ \n/* 1674 */ result.append(description.substring(start));\n/* 1675 */ start = -1;\n/* */ }\n/* 1677 */ else if (p < description.length()) {\n/* 1678 */ result.append(description.substring(start, p + 1));\n/* 1679 */ start = p + 1;\n/* */ \n/* */ \n/* */ }\n/* */ else\n/* */ {\n/* */ \n/* */ \n/* 1687 */ start = -1;\n/* */ }\n/* */ } }\n/* 1690 */ return result;\n/* */ }", "private Status processComment(final String line, final CVSChangeLogSet.File file, final CVSChangeLog change,\n final Status currentStatus, final Map<String, String> branches,\n final String previousLine, final List<CVSChangeLog> changes, final Map<String, CvsFile> files,\n final CvsRepositoryLocation location, final String prePreviousLine, final EnvVars envVars) {\n if (line != null && line.startsWith(FILE_DIVIDER)) {\n if (previousLine.equals(CHANGE_DIVIDER)) {\n updateChangeMessage(change, previousLine);\n }\n return currentStatus;\n } else if (previousLine != null && previousLine.startsWith(FILE_DIVIDER)) {\n if (line != null && line.isEmpty()) {\n //we could be on a line between files\n return currentStatus;\n } else {\n updateChangeMessage(change, previousLine);\n }\n } else if (prePreviousLine != null && prePreviousLine.startsWith(FILE_DIVIDER)) {\n // we've reached the end of the changes for the current file. Save the current change\n // and start processing the next file\n if ((previousLine == null || previousLine.isEmpty())\n && (line == null || line.startsWith(\"RCS file:\"))) {\n saveChange(file, change, branches, changes, files, location, envVars);\n return Status.FILE_NAME_PREVIOUS_LINE;\n } else {\n updateChangeMessage(change, prePreviousLine);\n updateChangeMessage(change, previousLine);\n return currentStatus;\n }\n } else if (previousLine != null && previousLine.startsWith(CHANGE_DIVIDER)) {\n if (line != null && line.startsWith(\"revision\")) {\n // the previous commit line has ended and we're now in a new commit.\n // Add the current change to our changeset and start processing the next commit\n parsePreviousChangeVersion(line, file, change, branches, changes, files, location, envVars);\n return Status.CHANGE_HEADER;\n } else {\n // see next else if line - we may have skipped a line that contains '-------'.\n // if we don't now have a 'revision' line then the line we skipped was actually\n // part of a comment so we need to include it in the current change\n updateChangeMessage(change, previousLine);\n updateChangeMessage(change, line);\n }\n } else if (line != null && line.startsWith(CHANGE_DIVIDER)) {\n // don't do anything yet, this could be either a part of the current comment\n // or a dividing line\n return currentStatus;\n } else {\n // nothing special on this line, add it to the current change comment\n updateChangeMessage(change, line);\n }\n return currentStatus;\n }", "public static void processCSS(File file) throws Exception {\n BufferedReader in = new BufferedReader(new FileReader(file));\n Vector<String> vLines = new Vector<String>();\n String line;\n int init, end;\n\n while ((line = in.readLine()) != null) {\n if ((init = line.indexOf(\"/*~RTL \")) != -1) {\n end = line.indexOf(\"*/\");\n if (end == -1)\n end = line.length();\n vLines.add(line.substring(init + 7, end) + \"\\n\");\n } else {\n vLines.add(line + \"\\n\");\n }\n }\n in.close();\n\n BufferedWriter out = new BufferedWriter(new FileWriter(file));\n for (String lineToWrite : vLines) {\n out.write(lineToWrite);\n }\n out.close();\n }", "private String trimLine(String line) {\n int idx = line.indexOf(\"//\");\n if (idx != -1) {\n line = line.substring(0, idx);\n }\n return line.trim();\n }", "private static boolean isComment(String line) {\n String trimLine = line.trim();\n return trimLine.startsWith(\"#\") || trimLine.isEmpty();\n }", "private void readFileByLines(String inputName){\n File file = new File(inputName);\n BufferedReader reader = null;\n\n try {\n reader = new BufferedReader(new FileReader(file));\n\n String tempString = null;\n this.inputContent = new StringBuilder();\n\n while((tempString = reader.readLine()) != null){\n this.inputContent.append(tempString);\n this.inputContent.append(\" \");\n }\n\n reader.close();\n } catch (IOException e) {\n e.printStackTrace();\n } finally {\n if (reader != null) {\n try {\n reader.close();\n } catch (IOException e1) {\n e1.printStackTrace();\n }\n }\n }\n }", "private String[] readLine( String line ) throws IOException {\n if ( StringUtils.isBlank( line ) ) {\n return null;\n }\n if ( line.startsWith( \"#\" ) ) {\n return null;\n }\n\n String[] fields = StringUtils.splitPreserveAllTokens( line, '\\t' );\n if ( fields.length < 2 ) {\n throw new IOException( \"Illegal format, expected at least 2 columns, got \" + fields.length );\n }\n return fields;\n\n }", "private void removeComments(Node node) {\n for (int i = 0; i < node.childNodeSize();) {\n Node child = node.childNode(i);\n if (child.nodeName().equals(\"#comment\")) {\n child.remove();\n } else {\n removeComments(child);\n i++;\n }\n }\n }", "@Test\n\tpublic void embeddedComment() throws ParseException {\n\t\t// -->\n\t\tILineMatcher startMatcher = JavaSourceLineMatcher.startMatcher();\n\t\tILineMatcher endMatcher = JavaSourceLineMatcher.endMatcher();\n\t\tBlockToBlockListConverter converter = new BlockToBlockListConverter(startMatcher, endMatcher);\n\n\t\tList<String> lines = Lists.newArrayList();\n\n\t\tlines.add(\" // -->\");\n\t\tlines.add(\" // shift one left\");\n\t\tlines.add(\" \t// <--\");\n\t\tlines.add(\" \t// -->\");\n\t\tlines.add(\" \t// shift one left (embedded)\");\n\t\tlines.add(\" \t// this line too (embedded)\");\n\t\tlines.add(\" \t// <--\");\n\t\tlines.add(\" \t// -->\");\n\t\tlines.add(\" // this line too\");\n\t\tlines.add(\" // <--\");\n\n\t\tList<Block> blocks = converter.convert(new Block(lines));\n\n\t\tassertEquals(1, blocks.size());\n\t\tBlock block = blocks.get(0);\n\t\tassertNotNull(block);\n\t\tassertEquals(\"// shift one left\", block.lines().get(0));\n\t\tassertEquals(\"\t// shift one left (embedded)\", block.lines().get(1));\n\t\tassertEquals(\"\t// this line too (embedded)\", block.lines().get(2));\n\t\tassertEquals(\"// this line too\", block.lines().get(3));\n\t\t// <--\n\t}", "String[] getLegalLineDelimiters();", "public Set<String> readFile(File file)throws IOException{\n Scanner scanner = new Scanner(file);\n StringBuilder stringBuilder = new StringBuilder();\n Set<String> data = new HashSet<>();\n\n while(scanner.hasNextLine()){\n data.add(scanner.nextLine());\n }\n return data;\n }" ]
[ "0.59679884", "0.5964931", "0.5956872", "0.58128816", "0.58127356", "0.5773285", "0.5708144", "0.5655276", "0.56383777", "0.55492306", "0.5537363", "0.5533021", "0.5520777", "0.54695797", "0.5455733", "0.54406357", "0.5417821", "0.54162425", "0.54084224", "0.5383615", "0.5373605", "0.5366284", "0.53334", "0.5261956", "0.52335805", "0.5218043", "0.52126694", "0.51971805", "0.51968044", "0.5150218", "0.51250213", "0.5120784", "0.5113662", "0.5097918", "0.50901115", "0.50566816", "0.5041267", "0.5027552", "0.50186", "0.5014395", "0.4991893", "0.49915144", "0.498634", "0.49643713", "0.4935224", "0.49346486", "0.49328503", "0.49252427", "0.4922706", "0.49184024", "0.4906624", "0.48994058", "0.48982635", "0.48979545", "0.4870847", "0.4861579", "0.48611733", "0.48574403", "0.4857345", "0.48536828", "0.48494738", "0.48466638", "0.48415413", "0.48311234", "0.48288873", "0.48258427", "0.4823127", "0.48179933", "0.48154113", "0.48121756", "0.4810185", "0.47993064", "0.47850576", "0.4759317", "0.47559145", "0.475496", "0.47544488", "0.4743993", "0.4740983", "0.4735774", "0.47355452", "0.47353494", "0.4723735", "0.4722894", "0.47217253", "0.47136462", "0.4711907", "0.47117612", "0.47115812", "0.47029305", "0.4684406", "0.468266", "0.46773028", "0.4674952", "0.46602532", "0.46601766", "0.4659706", "0.46576828", "0.46567014", "0.46555084" ]
0.6325452
0
TODO Autogenerated method stub
public static String sendEmail(String fromId,String toId, String subject, String emailBody) { System.out.println("Test"); CloseableHttpClient httpClient=null; Base64.Encoder encoder = Base64.getEncoder(); String attachmentStr = encoder.encodeToString(subject.getBytes()); try{ httpClient = HttpClients.createDefault(); HttpPost httpPost = new HttpPost("https://api.sendgrid.com/v3/mail/send"); httpPost.setHeader("content-type", "application/json"); //httpPost.setHeader("accept", "application/json"); httpPost.setHeader("YOUR_API_KEY", "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"); httpPost.setHeader("Authorization", "Bearer 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"); String jsonStr="{\r\n" + " \"personalizations\": [\r\n" + " {\r\n" + " \"to\": [\r\n" + " {\r\n" + " \"email\": \""+toId+"\"\r\n" + " }\r\n" + " ],\r\n" + " \"subject\": \""+subject+"\"\r\n" + " }\r\n" + " ],\r\n" + " \"from\": {\r\n" + " \"email\": \""+fromId+"\"\r\n" + " },\r\n" + " \"content\": [\r\n" + " {\r\n" + " \"type\": \"text/plain\",\r\n" + " \"value\": \""+emailBody+"\"\r\n" + " }\r\n" + " ],\r\n" + "\"attachments\":[ {\"content\":\""+attachmentStr+"\", \"filename\":\"attachment.txt\", \"disposition\":\"attachment\"} ]"+ "}"; StringEntity jsonString =new StringEntity(jsonStr); httpPost.setEntity(jsonString); StringBuilder sb = new StringBuilder(); HttpResponse response = httpClient.execute(httpPost); BufferedReader br = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); String inputLine = null; while ((inputLine = br.readLine()) != null) { sb.append(inputLine); } httpClient.close(); System.out.println(sb.toString()); //return sb.toString(); }catch(Exception e){ e.printStackTrace(); } return "1"; }
{ "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 protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); DumpLog.Init(this); setContentView(R.layout.activity_main); Button btnStartup = (Button)findViewById(R.id.btnStartup); btnStartup.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub DumpLog.LOGD("btnStartup onClick"); PackageManager packageManager = getPackageManager(); Intent intent = new Intent(); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent = packageManager.getLaunchIntentForPackage("com.tencent.tmgp.hhw"); startActivity(intent); } }); Spinner spinner = (Spinner) findViewById(R.id.spinner); //数据 List<String> data_list = new ArrayList<String>(); data_list.add("com.tencent.tmgp.hhw"); //适配器 ArrayAdapter<String> arr_adapter= new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, data_list); //设置样式 arr_adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); //加载适配器 spinner.setAdapter(arr_adapter); }
{ "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 onClick(View v) { DumpLog.LOGD("btnStartup onClick"); PackageManager packageManager = getPackageManager(); Intent intent = new Intent(); intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent = packageManager.getLaunchIntentForPackage("com.tencent.tmgp.hhw"); startActivity(intent); }
{ "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 qiuyd on 2020/2/16.
public interface IFlyAminal { void fly(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void perish() {\n \n }", "private stendhal() {\n\t}", "@Override\n\tpublic void comer() {\n\t\t\n\t}", "@Override\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 init() {\n\n }", "@Override\r\n\tpublic void tires() {\n\t\t\r\n\t}", "@Override\n protected void initialize() {\n\n \n }", "@Override\n\tpublic void grabar() {\n\t\t\n\t}", "@Override\n void init() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n protected void initialize() {\n }", "@Override\n public void init() {\n }", "private static void cajas() {\n\t\t\n\t}", "@Override\n protected void initialize() \n {\n \n }", "@Override\n public void func_104112_b() {\n \n }", "@Override\r\n\t\t\tpublic void ayuda() {\n\r\n\t\t\t}", "public final void mo51373a() {\n }", "@Override\n\tprotected void getExras() {\n\n\t}", "@Override\r\n\tpublic void comer() \r\n\t{\n\t\t\r\n\t}", "@Override\r\n\tpublic void rozmnozovat() {\n\t}", "@Override\n\tpublic void anular() {\n\n\t}", "@Override\n\tpublic void entrenar() {\n\t\t\n\t}", "@Override\n public void memoria() {\n \n }", "@Override\r\n\tpublic void dormir() {\n\t\t\r\n\t}", "@Override\n\tpublic void nadar() {\n\t\t\n\t}", "@Override\n public void init() {}", "@Override\n public int describeContents() { return 0; }", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void dibujar() {\n\t\t\r\n\t}", "Petunia() {\r\n\t\t}", "@Override\r\n\t\tpublic void init() {\n\t\t\t\r\n\t\t}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n public void initialize() {}", "@Override\n\tpublic void gravarBd() {\n\t\t\n\t}", "@Override\n public void inizializza() {\n\n super.inizializza();\n }", "private void init() {\n\n\t}", "@Override\n public void init() {\n\n }", "@Override\n public void init() {\n\n }", "@Override\n public void initialize() { \n }", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "@Override\n\tpublic void init() {\n\t\t\n\t}", "private Rekenhulp()\n\t{\n\t}", "@Override\r\n\t\t\tpublic void annadir() {\n\r\n\t\t\t}", "@Override\n protected void getExras() {\n }", "public void mo38117a() {\n }", "@Override\n public void initialize() {\n \n }", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\n\tpublic void init() {\n\n\t}", "@Override\r\n\tpublic void init() {}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "@Override\n\tprotected void initialize() {\n\t\t\n\t}", "public Pitonyak_09_02() {\r\n }", "@Override\n protected void init() {\n }", "@Override\n\tprotected void initialize() {\n\n\t}", "@Override\n\tpublic void sacrifier() {\n\t\t\n\t}", "private void poetries() {\n\n\t}", "@Override\n\tprotected void interr() {\n\t}", "@Override\r\n\tpublic void anularFact() {\n\t\t\r\n\t}", "public void mo6081a() {\n }", "@Override\n\tpublic void nghe() {\n\n\t}", "public void mo4359a() {\n }", "private UsineJoueur() {}", "private MetallicityUtils() {\n\t\t\n\t}", "private MApi() {}", "private TMCourse() {\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}", "protected MetadataUGWD() {/* intentionally empty block */}", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "public void mo55254a() {\n }", "private Singletion3() {}", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\n public void initialize() {\n }", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\r\n\tpublic void init() {\n\r\n\t}", "@Override\n\tpublic void one() {\n\t\t\n\t}" ]
[ "0.5961039", "0.5897514", "0.5516217", "0.55090535", "0.55090535", "0.54945564", "0.54922366", "0.54875195", "0.54690987", "0.54647654", "0.54572266", "0.54572266", "0.54572266", "0.54572266", "0.54572266", "0.54572266", "0.54185855", "0.54023945", "0.5394271", "0.53909385", "0.5369925", "0.53697044", "0.53488094", "0.53468835", "0.5345208", "0.5339825", "0.5337113", "0.5336647", "0.53246003", "0.53203183", "0.5303056", "0.5302123", "0.53010607", "0.53010607", "0.5290778", "0.52719283", "0.5269748", "0.5269748", "0.5269748", "0.52650696", "0.52622503", "0.52582985", "0.5252246", "0.5252246", "0.52512586", "0.52501005", "0.52501005", "0.52501005", "0.52501005", "0.52501005", "0.5249154", "0.52483064", "0.5238418", "0.5236441", "0.52283204", "0.5215918", "0.5215918", "0.5215918", "0.52157235", "0.5215224", "0.5215224", "0.52144676", "0.52090514", "0.52087945", "0.5200048", "0.51987845", "0.5193116", "0.51900595", "0.5186669", "0.5185675", "0.518165", "0.51777846", "0.51768917", "0.51746196", "0.5155419", "0.5154714", "0.5154714", "0.5154714", "0.51505256", "0.5141693", "0.5141693", "0.5141693", "0.5141693", "0.5141693", "0.5141693", "0.5141693", "0.51329243", "0.5130973", "0.5130973", "0.5130973", "0.5130973", "0.5130973", "0.5130973", "0.5130973", "0.5130973", "0.5130973", "0.5130973", "0.512102", "0.512102", "0.512102", "0.5118299" ]
0.0
-1
AudioClip audioClip = new AudioClip(String.valueOf(Main.class.getResource(musicFile))); audioClip.setCycleCount(Integer.MAX_VALUE); audioClip.play();
private static void playAudio(String musicFile) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void music (String fileName)\r\n {\r\n\tAudioPlayer MGP = AudioPlayer.player;\r\n\tAudioStream BGM;\r\n\tAudioData MD;\r\n\r\n\tContinuousAudioDataStream loop = null;\r\n\r\n\ttry\r\n\t{\r\n\t InputStream test = new FileInputStream (\"lamarBackgroundMusic.wav\");\r\n\t BGM = new AudioStream (test);\r\n\t AudioPlayer.player.start (BGM);\r\n\r\n\t}\r\n\tcatch (FileNotFoundException e)\r\n\t{\r\n\t System.out.print (e.toString ());\r\n\t}\r\n\tcatch (IOException error)\r\n\t{\r\n\t System.out.print (error.toString ());\r\n\t}\r\n\tMGP.start (loop);\r\n }", "public void playLooped()\n {\n audioClip.loop(Clip.LOOP_CONTINUOUSLY);\n play();\n }", "public void playMusic() {\r\n try {\r\n File mFile = new File(Filepath);\r\n if (mFile.exists()) {\r\n AudioInputStream audioInput = AudioSystem.getAudioInputStream(mFile);\r\n Clip clip = AudioSystem.getClip();\r\n clip.open(audioInput);\r\n FloatControl gainControl = (FloatControl) clip.getControl(FloatControl.Type.MASTER_GAIN);\r\n gainControl.setValue(-25.0f); //reduces the volume by 25 decibels\r\n clip.start();\r\n clip.loop(Clip.LOOP_CONTINUOUSLY);\r\n\r\n } else {\r\n System.out.println(\"Music File not found\"); // will be thrown if music file is not in the file\r\n }\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "public void play() {\n\t\ttry {\n\t\t\taudioInput = AudioSystem.getAudioInputStream(this.music);\n\t\t\tclip.open(audioInput);\n\t\t\tclip.start();\n\t\t} catch (UnsupportedAudioFileException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (LineUnavailableException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void playSoundtrack() {\n if(this.musicEnabled) {\n try {\n Clip soundtrackClip = AudioSystem.getClip();\n AudioInputStream inputStream = AudioSystem.getAudioInputStream(new BufferedInputStream(Assets.soundTrack));\n soundtrackClip.open(inputStream);\n soundtrackClip.start();\n soundtrackClip.loop(Clip.LOOP_CONTINUOUSLY);\n } catch (Exception e) {\n e.printStackTrace();\n System.err.println(e.getMessage());\n }\n }\n }", "public void backgroundMusic(String path) {\n if (Objects.equals(playingFile, path)) return;\n playingFile = path;\n\n\n // stop if playing\n stop();\n\n if (path == null) {\n // nothing to play\n playingClip = null;\n return;\n }\n\n try {\n\n // find file\n final AudioInputStream stream = AudioSystem.getAudioInputStream(new File(path));\n\n // create player\n playingClip = AudioSystem.getClip();\n playingClip.open(stream);\n playingClip.loop(playingClip.LOOP_CONTINUOUSLY);\n\n // play\n playingClip.start();\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public static void playSound(){\r\n try{\r\n Clip clip = AudioSystem.getClip();\r\n clip.open(AudioSystem.getAudioInputStream(new File(\"Cheering.wav\")));\r\n clip.start();\r\n }\r\n catch (Exception exc){\r\n exc.printStackTrace(System.out);\r\n } \r\n }", "public static void play(String filename) {\r\n javax.sound.sampled.Clip sonido;\r\n InputStream path=load(filename);\r\n \r\n try\r\n {\r\n sonido=AudioSystem.getClip();\r\n sonido.open(AudioSystem.getAudioInputStream(new BufferedInputStream(path)));\r\n sonido.start();\r\n\r\n }catch(Exception fallo)\r\n {\r\n \r\n }\r\n }", "public static void loop(String filename) {\r\n\r\n InputStream path=load(filename);\r\n\r\n \r\n try\r\n {\r\n stop();\r\n soundLoop=AudioSystem.getClip();\r\n soundLoop.open(AudioSystem.getAudioInputStream(new BufferedInputStream(path)));\r\n soundLoop.loop(javax.sound.sampled.Clip.LOOP_CONTINUOUSLY);\r\n\r\n }catch(Exception fallo)\r\n {\r\n \r\n\r\n }\r\n \r\n }", "public void pauseSong()\n {\n if(!mute)\n {\n try{ \n //bclip.stop();\n \n URL url = this.getClass().getClassLoader().getResource(\"Refreshing Elevator Music.wav\");\n \n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n // Get a sound clip resource.\n pclip = AudioSystem.getClip();\n \n // Open audio clip and load samples from the audio input stream.\n pclip.open(audioIn); \n pclip.start();\n pclip.loop(Clip.LOOP_CONTINUOUSLY);\n }catch(Exception e){}\n }\n }", "public void run() {\n\t\t try {\n\t\t Clip clip = AudioSystem.getClip();\n\t\t //AudioInputStream inputStream = AudioSystem.getAudioInputStream(\n\t\t //Main.class.getResourceAsStream(\"/path/to/sounds/\" + url));\n\t\t //clip.open(inputStream);\n\t\t clip.start(); \n\t\t } catch (Exception e) {\n\t\t System.err.println(e.getMessage());\n\t\t }\n\t\t }", "public void foodSound(){\n if (enableSound){\r\n\t clip.play();\r\n }\r\n\t\t\r\n\t}", "public void keepLooping() {\n\t\tif(!clip.isActive()) {\n\t\t\tstartSound();\n\t\t}\n\t}", "public void run() \n {\n try\n {\n Clip clip = AudioSystem.getClip();\n AudioInputStream inputStream = AudioSystem.getAudioInputStream(getClass().getResource(sound));\n clip = AudioSystem.getClip();\n clip.open(inputStream);\n clip.start(); \n } catch (UnsupportedAudioFileException e) {\n \t\t\te.printStackTrace();\n } catch (IOException e) {\n \t\t\te.printStackTrace();\n } catch (LineUnavailableException e) {\n \t\t\te.printStackTrace();\n }\n }", "public void play(String loopOption) {\n\t\ttry {\n\t\t\tthis.audioInput = AudioSystem.getAudioInputStream(this.music);\n\t\t\tclip.open(audioInput);\n\t\t\tclip.start();\n\t\t\tif (loopOption.equals(\"infinite\")) {\n\t\t\t\tthis.clip.loop(Clip.LOOP_CONTINUOUSLY);\n\t\t\t}\n\t\t} catch (UnsupportedAudioFileException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (LineUnavailableException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void playSound(String fileName) {\n\t\tAudioClip sound = JApplet.newAudioClip(getClass().getResource(fileName));\n\t\tsound.play();\n\t}", "public static void startMusic()\n\t{\n\t\tmusic.loop();\n\t}", "public void cenaSounds()\n {\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.setTitle(\"Test Sound Clip\");\n this.setSize(300, 200);\n this.setVisible(false);\n\n try {\n // Open an audio input stream.\n //URL url = this.getClass().getClassLoader().getResource(\"gameover.wav\");\n //AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n\n URL url= new URL(\"http://shortmp3.mobi/u/files/WAV/39603-John_Cena_Msg_Alert_(ShortMp3.com).wav\");\n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n \n //You can change this URL to be whatever .wav file you want\n\n // Get a sound clip resource.\n Clip clip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n clip.open(audioIn);\n clip.start();\n\n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n }\n\n }", "public void playWinSounds(){\r\n try {\r\n File mFile = new File(Filepath3);\r\n if (mFile.exists()) {\r\n AudioInputStream audioInput4 = AudioSystem.getAudioInputStream(mFile);\r\n Clip clip4 = AudioSystem.getClip();\r\n clip4.open(audioInput4);\r\n FloatControl gainControl4 = (FloatControl) clip4.getControl(FloatControl.Type.MASTER_GAIN);\r\n gainControl4.setValue(-10.0f); //reduces the volume by 10 decibels\r\n clip4.start();\r\n } else {\r\n System.out.println(\"Music File not found\"); // will be thrown if music file is not in the file\r\n }\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "public void startSound() {\n\t\ttry {\n\t\t\t// Open an audio input stream.\n\t\t\tURL url = this.getClass().getResource(\"/\"+wavMusicFile);\n\t\t\t//System.out.println(\"url: \" + url);\n\t\t\tAudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n\t\t\t// Get a sound clip resource.\n\t\t\tclip = AudioSystem.getClip();\n\t\t\t// Open audio clip and load samples from the audio input stream.\n\t\t\tclip.open(audioIn);\n\t\t\tclip.start();\n\t\t} catch (UnsupportedAudioFileException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (LineUnavailableException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void soundClipTest()\n {\n //this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n //this.setTitle(\"Test Sound Clip\");\n //this.setSize(300, 200);\n //this.setVisible(true);\n \n try {\n // Open an audio input stream.\n URL url = this.getClass().getClassLoader().getResource(\"Silence.wav\");\n if(difficult.equals(\"YOU WILL NOT SURVIVE\")) \n url = this.getClass().getClassLoader().getResource(\"Koopa Bros.wav\"); \n else if(difficult.equals(\"HARD\"))\n url = this.getClass().getClassLoader().getResource(\"Epic One Piece.wav\");//\"Stand Up Be Strong.wav\"); \"Halo.wav\" \n else if(difficult.equals(\"MEDIUM\"))\n url = this.getClass().getClassLoader().getResource(\"Epic One Piece.wav\");\n else if(difficult.equals(\"EASY\"))\n url = this.getClass().getClassLoader().getResource(\"Bowsers Castle.wav\");\n else if(difficult.equals(\"GHOST\"))\n url = this.getClass().getClassLoader().getResource(\"Paper Mario- Crystal Palace Crawl.wav\");\n else if(difficult.equals(\"TROLL\"))\n url = this.getClass().getClassLoader().getResource(\"Troll Song.wav\"); //\"Mario Kart 64.wav\"\n \n \n \n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n // Get a sound clip resource.\n bclip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n bclip.open(audioIn);\n \n \n //try{Thread.sleep(2000);} catch(InterruptedException e) {}\n if(!mute)\n {\n bclip.start();\n //clip.loop(Clip.LOOP_CONTINUOUSLY);\n bclip.loop(Clip.LOOP_CONTINUOUSLY);\n \n }\n if(pause)\n {\n try{bclip.wait();} catch(InterruptedException e) {}\n \n URL url2 = this.getClass().getClassLoader().getResource(\"Refreshing Elevator Music.wav\");\n \n AudioInputStream audioIn2 = AudioSystem.getAudioInputStream(url2);\n // Get a sound clip resource.\n Clip pclip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n pclip.open(audioIn2);\n \n if(!mute)\n pclip.start(); \n }\n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n }\n \n }", "@Override\r\n \tpublic void play() {\n \t\tFile file = new File(location);\r\n \t\tlong audioFileLength = file.length();\r\n \t\tAudioInputStream audioInputStream;\r\n \t\ttry {\r\n \t\t\taudioInputStream = AudioSystem.getAudioInputStream(file);\r\n \r\n \t\t\tAudioFormat format = audioInputStream.getFormat();\r\n \r\n \t\t\tint frameSize = format.getFrameSize();\r\n \t\t\tfloat frameRate = format.getFrameRate();\r\n \t\t\tdurationInSeconds = (audioFileLength / (frameSize * frameRate));\r\n \r\n \r\n \t\t\tLine.Info linfo = new Line.Info(Clip.class);\r\n \t\t\tLine line = AudioSystem.getLine(linfo);\r\n \t\t\tclip = (Clip) line;\r\n \t\t\t//clip.addLineListener(this);\r\n \t\t\tclip.open(audioInputStream);\r\n \t\t\tclip.start();\r\n \r\n \t\t} catch (UnsupportedAudioFileException e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\te.printStackTrace();\r\n \t\t} catch (IOException e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\te.printStackTrace();\r\n \t\t} catch (LineUnavailableException e) {\r\n \t\t\t// TODO Auto-generated catch block\r\n \t\t\te.printStackTrace();\r\n \t\t}\t\r\n \r\n \t}", "public void startSound()\n \n {try\n { \n URL url = this.getClass().getClassLoader().getResource(\"Mario Kart Start 2.wav\");\n \n \n \n \n \n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n // Get a sound clip resource.\n startClip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n startClip.open(audioIn); \n \n startClip.start();\n \n \n } \n catch (UnsupportedAudioFileException e)\n {\n e.printStackTrace();\n } \n catch (IOException e) \n {\n e.printStackTrace();\n } \n catch (LineUnavailableException e) \n {\n e.printStackTrace();\n } \n \n }", "public void playDonkeySounds(){\r\n try {\r\n File mFile = new File(Filepath2);\r\n if (mFile.exists()) {\r\n AudioInputStream audioInput3 = AudioSystem.getAudioInputStream(mFile);\r\n Clip clip3 = AudioSystem.getClip();\r\n clip3.open(audioInput3);\r\n FloatControl gainControl3 = (FloatControl) clip3.getControl(FloatControl.Type.MASTER_GAIN);\r\n gainControl3.setValue(-10.0f); //reduces the volume by 10 decibels\r\n clip3.start();\r\n\r\n } else {\r\n System.out.println(\"Music File not found\"); // will be thrown if music file is not in the file\r\n }\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "private void playSound(String sound) {\r\n try {\r\n BufferedInputStream soundFileStream = new BufferedInputStream(this\r\n .getClass().getResourceAsStream(sound));\r\n AudioInputStream audioInputStream = AudioSystem\r\n .getAudioInputStream(soundFileStream);\r\n AudioFormat audioFormat = audioInputStream.getFormat();\r\n DataLine.Info dataLineInfo = new DataLine.Info(Clip.class, audioFormat);\r\n Clip clip = (Clip) AudioSystem.getLine(dataLineInfo);\r\n clip.open(audioInputStream);\r\n clip.start();\r\n } catch (Exception e) {\r\n e.printStackTrace();\r\n }\r\n }", "public void playSound(String fileName){\n \n Random rand = new Random();\n if (fileName == null) {\n int nextSongNumber = rand.nextInt(soundList.size());\n while(nextSongNumber == currentSongNumber){\n nextSongNumber = rand.nextInt(soundList.size());\n }\n currentSongNumber = nextSongNumber;\n fileName = soundList.get(currentSongNumber);\n }\n \n try {\n \n \n soundSequencer = MidiSystem.getSequencer();\n soundSequencer.open();\n \n soundSequencer.setSequence(this.getClass().getResourceAsStream(fileName));\n soundSequencer.setLoopCount(Sequencer.LOOP_CONTINUOUSLY);\n soundSequencer.start();\n \n } catch (IOException | InvalidMidiDataException | MidiUnavailableException ex) {\n //Logger.getLogger(GUI.class.getName()).log(Level.SEVERE, null, ex);\n }\n }", "public static void clic_sound() {\n\t\tm_player_clic.start();\n\t\tm_player_clic.setMediaTime(new Time(0));\n\t}", "public static void musicFirstLevel(){\n\t\ttry {\r\n\t\t\tbgmusicLevel = new Music(\"res/sound/firstLevel.wav\");\r\n\t\t\tbgmusicLevel.loop(1f, 0.1f);\r\n\t\t} catch (SlickException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public void specialSong()\n {\n if(!mute)\n {\n try {\n \n bclip.stop();\n \n // Open an audio input stream.\n //URL url = this.getClass().getClassLoader().getResource(\"Glitzville.wav\"); \n //if(lastpowerUp.equals(\"RAINBOW\"))\n URL url = this.getClass().getClassLoader().getResource(\"Mario Kart Starman.wav\");\n \n \n \n \n \n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n // Get a sound clip resource.\n sclip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n sclip.open(audioIn); \n \n sclip.start();\n \n \n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n } \n }\n }", "private void playAudio() {\r\n Play.au(audioFileName, false);\r\n }", "public SimpleAudioPlayer(String filePath) \r\n throws UnsupportedAudioFileException, \r\n IOException, LineUnavailableException \r\n { \r\n // create AudioInputStream object \r\n audioInputStream = \r\n AudioSystem.getAudioInputStream(new File(filePath).getAbsoluteFile()); \r\n \r\n // create clip reference \r\n clip = AudioSystem.getClip(); \r\n \r\n // open audioInputStream to the clip \r\n clip.open(audioInputStream); \r\n \r\n clip.loop(Clip.LOOP_CONTINUOUSLY); \r\n }", "public void loop(){\n\t\t\n\t\tclip.loop(Clip.LOOP_CONTINUOUSLY);\n\t\tplay();\n\t}", "private void playMusic(File filepath) {\r\n\t\ttry {\r\n\t\t AudioInputStream song = AudioSystem.getAudioInputStream(filepath);\r\n\t\t\tAudioFormat format = song.getFormat();\r\n\t\t DataLine.Info info = new DataLine.Info(Clip.class, format);\r\n\t\t Clip clip = (Clip) AudioSystem.getLine(info);\r\n\t\t clip.open(song);\r\n\t\t clip.start();\r\n\t\t}\r\n\t\tcatch (Exception ex) {\r\n\t\t\tthrow new ErrorException(ex);\r\n\t\t}\r\n\t}", "public void theRockSounds()\n {\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.setTitle(\"Test Sound Clip\");\n this.setSize(300, 200);\n this.setVisible(false);\n\n try {\n // Open an audio input stream.\n URL url= new URL(\"http://shortmp3.mobi/u/files/WAV/39627-The_Rock_(ShortMp3.com).wav\");\n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n\n // Get a sound clip resource.\n Clip clip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n clip.open(audioIn);\n clip.start();\n\n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n }\n\n }", "public void playMusic() {\n\t\tthis.music.start();\n\t}", "@Override\r\n protected void playGameStartAudio() {\n\taudio.playClip();\r\n }", "public synchronized void playAbruptLoop(String path){\r\n if(currentLoop0){\r\n if(backgroundMusicLoop0!=null) backgroundMusicLoop0.stopClip();\r\n currentLoop0 = false;\r\n backgroundMusicLoop1 = new MusicThread(path, currentLoop0);\r\n backgroundMusicLoop1.start();\r\n }else{\r\n if(backgroundMusicLoop1!=null) backgroundMusicLoop1.stopClip();\r\n currentLoop0 = true;\r\n backgroundMusicLoop0 = new MusicThread(path, currentLoop0);\r\n backgroundMusicLoop0.start();\r\n }\r\n }", "static void PlaySound(File Sound)\n {\n try{\n Clip clip = AudioSystem.getClip();\n clip.open(AudioSystem.getAudioInputStream(Sound));\n clip.start();\n //BGM = new AudioStream(new FileInputStream(\"OST.WAV\"));\n //MD = BGM.getData();\n //loop = new ContinuousAudioDataStream(MD);\n }catch(Exception e) {}\n //MGP.start(loop); \n }", "public void playAudio() {\n\t\tmusic[currentSong].stop();\n\t\tcurrentSong++;\n\t\tcurrentSong %= music.length;\n\t\tmusic[currentSong].play();\n\t}", "public void continueSound() {\n\t\tclip.start();\n\t}", "private void reproducirAudio() {\n try{\n audioInputStream = AudioSystem.getAudioInputStream(new File(\"Sonidos/Inicio.wav\").getAbsoluteFile());\n clip = AudioSystem.getClip();\n clip.open(audioInputStream);\n clip.start();\n }\n catch (UnsupportedAudioFileException | IOException | LineUnavailableException ex){\n ex.printStackTrace();\n }\n }", "public static void loadAudio()\n\t{\n\t\ttry\n\t\t{\n\t\t\tmusic = Applet.newAudioClip(new URL(\"file:\" + System.getProperty(\"user.dir\") + \"/sound/Pamgaea.wav\"));\n\t\t\tlaser = Applet.newAudioClip(new URL(\"file:\" + System.getProperty(\"user.dir\") + \"/sound/laser.wav\"));\n\t\t\tlaserContinuous = Applet.newAudioClip(new URL(\"file:\" + System.getProperty(\"user.dir\") + \"/sound/laser_continuous.wav\"));\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void playYouWinSound()\n {\n try\n {\n java.io.File soundFile = new java.io.File(\n \"C:\\\\Windows\\\\Media\\\\tada.wav\");\n javax.sound.sampled.AudioInputStream audioIn =\n javax.sound.sampled.AudioSystem.getAudioInputStream(\n soundFile);\n javax.sound.sampled.Clip clip =\n javax.sound.sampled.AudioSystem.getClip();\n\n clip.open(audioIn);\n clip.start();\n }\n catch (Exception ex)\n {\n System.out.println(ex);\n }\n }", "public static void play(String filename) {\n\t\ttry {\n\t\t\tClip clip = AudioSystem.getClip();\n\t\t\tclip.open(AudioSystem.getAudioInputStream(new File(filename)));\n\t\t\tclip.start();\n\t\t} catch (Exception exc) {\n\t\t\texc.printStackTrace(System.out);\n\t\t}\n\t}", "public static void playSoundOOSrc(String path, boolean loop) {\r\n\t\t\r\n\t\tif (debugMode) {\r\n\t\t\tSystem.out.println(\"Try to play sound...\");\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tif (!debugMode) {\r\n\t\t\t AudioInputStream audioInput = AudioSystem.getAudioInputStream(new File(path));\r\n\t\t\t\tClip clip = AudioSystem.getClip();\r\n\t\t\t\t\r\n\t\t\t\t//stopAllClips();\r\n\t\t\t\tclips.add(clip);\r\n\t\t\t\tclip.open(audioInput);\r\n\t\t\t\tif (loop) {\r\n\t\t\t\t\tclip.loop(Clip.LOOP_CONTINUOUSLY);\r\n\t\t\t\t}\r\n\t\t\t\tclip.start();\r\n\t\t\t\tif (debugMode) {\r\n\t\t\t\t\tSystem.out.println(\"Successfully played sound!\");\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\tif (debugMode) {\r\n\t\t\t\t\tSystem.out.println(\"Can't find sound file.\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (Exception e) {\r\n\t\t\tif (debugMode) {\r\n\t\t\t\tSystem.out.println(\"Can't play sound.\");\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public void playLoseSounds(){\r\n try {\r\n File mFile = new File(Filepath4);\r\n if (mFile.exists()) {\r\n AudioInputStream audioInput5 = AudioSystem.getAudioInputStream(mFile);\r\n Clip clip5 = AudioSystem.getClip();\r\n clip5.open(audioInput5);\r\n FloatControl gainControl5 = (FloatControl) clip5.getControl(FloatControl.Type.MASTER_GAIN);\r\n gainControl5.setValue(-8.0f); //reduces the volume by 8 decibels\r\n clip5.start();\r\n } else {\r\n System.out.println(\"Music File not found\"); // will be thrown if music file is not in the file\r\n }\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "@Override\n public void run() {\n // TODO Auto-generated method stub\n running = true;\n AudioFile song = musicFiles.get(currentSongIndex);\n song.play();\n while(running){\n if(!song.isPlaying()){\n currentSongIndex++;\n if(currentSongIndex >= musicFiles.size()){\n currentSongIndex = 0;\n }\n song = musicFiles.get(currentSongIndex);\n song.play();\n }\n try{\n Thread.sleep(1);\n }\n catch (InterruptedException e){\n e.printStackTrace();\n } \n }\n }", "public static void playSoundOnce(Clip clip)\n { \n if (clip == null || clip.isRunning())\n return;\n \n clip.setFramePosition(0);\n clip.start();\n }", "public void bigShowSounds()\n {\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.setTitle(\"Test Sound Clip\");\n this.setSize(300, 200);\n this.setVisible(false);\n\n try {\n // Open an audio input stream.\n URL url= new URL(\"http://shortmp3.mobi/u/files/WAV/39586-Big_Show_(ShortMp3.com).wav\");\n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n\n // Get a sound clip resource.\n Clip clip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n clip.open(audioIn);\n clip.start();\n\n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n }\n\n }", "private void play()\n {\n if(AudioDetector.getInstance().isNoAudio())\n {\n return;\n }\n\n stop();\n musicPlayer.play();\n }", "public static void musicMainMenu(){\n\t\ttry {\r\n\t\t\tbgmusic = new Music(\"res/otherSounds/Menu.wav\");\r\n\t\t\tbgmusic.loop(1f, 0.2f);\r\n\t\t\t//System.out.println(bgmusic.getVolume()); \t\r\n\t\t} catch (SlickException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private void initialMusic(){\n\n }", "public void playBackground(String path){\n\t stopBackground();\n\t\tloopingSound = new Sound(\"/res/sounds/\" + path,-1,true);\n\t\tactiveSounds++;\n\t}", "public void undertakerSounds()\n {\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.setTitle(\"Test Sound Clip\");\n this.setSize(300, 200);\n this.setVisible(false);\n\n try {\n // Open an audio input stream.\n URL url= new URL(\"http://shortmp3.mobi/u/files/WAV/39633-Undertaker_(ShortMp3.com).wav\");\n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n\n // Get a sound clip resource.\n Clip clip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n clip.open(audioIn);\n clip.start();\n\n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n }\n\n }", "private void makeNewMusic() {\n File f = music.getFile();\n boolean playing = music.isPlaying();\n music.stop();\n music = new MP3(f);\n if (playing) {\n music.play(nextStartTime);\n }\n }", "public void playLaneSounds(){\r\n try {\r\n File mFile = new File(Filepath5);\r\n if (mFile.exists()) {\r\n AudioInputStream audioInput6 = AudioSystem.getAudioInputStream(mFile);\r\n Clip clip6 = AudioSystem.getClip();\r\n clip6.open(audioInput6);\r\n FloatControl gainControl6 = (FloatControl) clip6.getControl(FloatControl.Type.MASTER_GAIN);\r\n gainControl6.setValue(-10.0f); //reduces the volume by 10 decibels\r\n clip6.start();\r\n } else {\r\n System.out.println(\"Music File not found\"); // will be thrown if music file is not in the file\r\n }\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }", "public void playSound(String filename) {\r\n\t\tif (debugLevel > 1)\r\n\t\t\tSystem.out.println(\" ... play audio file: \" + filename);\r\n\t\ttry {\r\n\t\t\tFile file = new File(filename);\r\n\t\t\tAudioInputStream in = AudioSystem.getAudioInputStream(file);\r\n\t\t\tclip = AudioSystem.getClip();\r\n\t\t\tclip.open(in);\r\n\t\t\tclip.start();\r\n\t\t} catch (Exception e) {\r\n\t\t\t\r\n\t\t}\r\n\t}", "public void ChangeMusic(int musicnum, boolean looping);", "public void playAudio() {\n\n }", "private void playGameOverSound()\n {\n try\n {\n java.io.File soundFile = new java.io.File(\n \"C:\\\\Windows\\\\Media\\\\ringout.wav\");\n javax.sound.sampled.AudioInputStream audioIn =\n javax.sound.sampled.AudioSystem.getAudioInputStream(\n soundFile);\n javax.sound.sampled.Clip clip =\n javax.sound.sampled.AudioSystem.getClip();\n\n clip.open(audioIn);\n clip.start();\n }\n catch (Exception ex)\n {\n System.out.println(ex);\n }\n }", "private void startMusic() {\r\n final Format input1 = new AudioFormat(AudioFormat.MPEGLAYER3);\r\n final Format input2 = new AudioFormat(AudioFormat.MPEG);\r\n final Format output = new AudioFormat(AudioFormat.LINEAR);\r\n PlugInManager.addPlugIn(\r\n \"com.sun.media.codec.audio.mp3.JavaDecoder\",\r\n new Format[]{input1, input2},\r\n new Format[]{output},\r\n PlugInManager.CODEC\r\n );\r\n try {\r\n final File f = new File(\"support_files//tetris.mp3\");\r\n myPlayer = Manager.createPlayer(new MediaLocator(f.toURI().toURL()));\r\n } catch (final NoPlayerException | IOException e) {\r\n e.printStackTrace();\r\n }\r\n if (myPlayer != null) {\r\n myPlayer.start();\r\n }\r\n }", "private void playSound(String soundFile){\n try {\n AudioInputStream audioInputStream = AudioSystem.getAudioInputStream(new File(soundFile).getAbsoluteFile());\n Clip clip = AudioSystem.getClip();\n clip.open(audioInputStream);\n clip.start();\n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "SoundEffect(String n) {\n\t\ttry{\n\t\t\tURL url = this.getClass().getClassLoader().getResource(n); //Create url with filename\n\t\t\tAudioInputStream audioInputStream = AudioSystem.getAudioInputStream(url); //Create AudioInputStream with url\n\t\t\tclip = AudioSystem.getClip(); //Assign the wav to clip\n\t\t\tclip.open(audioInputStream); //Open the clip\n\t\t}\n\t\tcatch (UnsupportedAudioFileException e) {\n\t\t\te.printStackTrace(); //Print stack trace for debugging\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\te.printStackTrace(); //Print stack trace for debugging\n\t\t}\n\t\tcatch (LineUnavailableException e) {\n\t\t\te.printStackTrace(); //Print stack trace for debugging\n\t\t}\n\t}", "public void play() { \r\n if (midi) \r\n sequencer.start(); \r\n else \r\n clip.start(); \r\n timer.start(); \r\n play.setText(\"Stop\"); \r\n playing = true; \r\n }", "public void play() {\n\t\tif(hasAudioLoaded()) {\n\t\t\tcurrentClip.start();\n\t\t\tisPlaying = true;\n\t\t}\n\t}", "public static void playShootingSound(){\n String musicFile = \"Sounds\\\\Shoot.mp3\";\n Media sound = new Media(new File(musicFile).toURI().toString());\n MediaPlayer mediaPlayer = new MediaPlayer(sound);\n mediaPlayer.setVolume(App.getVolume());\n mediaPlayer.play();\n }", "private static void loadMusic()\n\t{\n\t\t// TODO: update this with the correct file names.\n\t\tmusic = new ArrayList<Music>();\n\t\t\n\t\ttry\n\t\t{\n\t\t\tmusic.add(Gdx.audio.newMusic(new FileHandle(new File(MUSIC_PATH + \"Lessons-8bit.mp3\"))));\n\t\t\tmusic.add(Gdx.audio.newMusic(new FileHandle(new File(MUSIC_PATH + \"bolo_menu.mp3\"))));\n\t\t\t//music.add(Gdx.audio.newMusic(new FileHandle(new File(MUSIC_PATH + \"song2.ogg\"))));\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\t\n\t\t\tSystem.out.println(e);\n\t\t\te.printStackTrace();\n\t\t\tthrow e;\n\t\t}\n\t}", "public static void playSoundEffect(String path) {\n Thread thread = new Thread(() -> {\n Player soundEffectPlayer = new Player();\n soundEffectPlayer.setSourceLocation(path);\n soundEffectPlayer.play();\n });\n thread.setDaemon(true);\n thread.start();\n }", "public void playMusic() {\n\t\ttry {\n\t\t\tsoundManager.playMusic(\"bgroundmusic\");\n\t\t} catch (Exception e) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void pauseSound() {\n\t\tclip.stop();\n\t}", "public static void playSound(Activity a, int index) {\n MediaPlayer mp = new MediaPlayer();\n mp.setOnCompletionListener(new MediaPlayer.OnCompletionListener() {\n @Override\n public void onCompletion(MediaPlayer mp) {\n mp.reset(); // fix bug app show warning \"W/MediaPlayer: mediaplayer went away with unhandled events\"\n mp.release();\n mp = null;\n }\n });\n try {\n String []listMusic = a.getAssets().list(AppConstant.ASSETSMUSIC);\n AssetFileDescriptor afd = a.getAssets().openFd(\"music\"\n + System.getProperty(\"file.separator\") + listMusic[index]);\n mp.setDataSource(afd.getFileDescriptor(), afd.getStartOffset(), afd.getLength());\n afd.close();\n mp.prepare();\n } catch (IOException e) {\n e.printStackTrace();\n }\n mp.start();\n }", "public void play() {\n\t\t\r\n\t}", "public void tripleHSounds()\n {\n this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n this.setTitle(\"Test Sound Clip\");\n this.setSize(300, 200);\n this.setVisible(false);\n\n try {\n // Open an audio input stream.\n URL url= new URL(\"http://shortmp3.mobi/u/files/WAV/39629-Triple_H_(ShortMp3.com).wav\");\n AudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n\n // Get a sound clip resource.\n Clip clip = AudioSystem.getClip();\n // Open audio clip and load samples from the audio input stream.\n clip.open(audioIn);\n clip.start();\n\n } catch (UnsupportedAudioFileException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n } catch (LineUnavailableException e) {\n e.printStackTrace();\n }\n\n }", "public Music loadMusic(String fileName, boolean isLoop, float volumn);", "public static void playLazySong(){\n\n\t\tint channel = 0; // 0 is a piano, 9 is percussion, other channels are for other instruments\n\n\t\ttry {\n\t\t\tSynthesizer synth = MidiSystem.getSynthesizer();\n\t\t\tsynth.open();\n\t\t\tchannels = synth.getChannels();\n\t\t\t\n\t\t\tplayChorus();\n\t\t\t\n\t\t\tchannels[channel].allNotesOff();\n\t\t\tThread.sleep( 500 );\n\n\t\t\tsynth.close();\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public static void playBackGroundMusic(String path) {\n if (musicPlayer != null && musicPlayer.getSourceLocation() != null) {\n if (musicPlayer.getSourceLocation().equals(path)) {\n if (musicPlayer.isEndOfMediaReached()) {\n musicPlayer.seek(0);\n musicPlayer.play();\n }\n return;\n }\n musicPlayer.stop();\n }\n musicPlayer = new Player();\n musicPlayer.setSourceLocation(path);\n musicPlayer.play();\n }", "public void play(boolean music) {\n\t\tplay(1.0f, 1.0f, music);\n\t}", "public CoreJavaSound() throws Exception{\n\t\tInputStream wav = CoreJavaSound.class.getResourceAsStream(\"res/dun_dun_1.wav\");\n\t\tInputStream bufferedIn = new BufferedInputStream(wav);\n\t\t\n\t\tLine.Info linfo = new Line.Info(Clip.class);\n\t\tLine line = AudioSystem.getLine(linfo);\n\t\tclip = (Clip)line;\n\t\tclip.addLineListener(this);\n\t\tAudioInputStream ais = AudioSystem.getAudioInputStream(bufferedIn);\n\t\tclip.open(ais);\n\t\t\t\t\n\t}", "public void ascoltaAula()\n { \n try\n {\n String strFileAudio = \"audio/\" + this.myAula.getNome()+ \".wav\";\n System.out.println(\"leggo il file \"+ strFileAudio);\n \n ClassLoader classloader = Thread.currentThread().getContextClassLoader(); \n \n InputStream is = classloader.getResourceAsStream(strFileAudio);\n // File audioFile = new File (getClass().getClassLoader().getResource (strFileAudio).getFile()); \n // File audioFile = new File(strFileAudio);\n AudioInputStream audioIn = AudioSystem.getAudioInputStream(is);\n Clip suono = null;\n suono = AudioSystem.getClip();\n suono.open(audioIn);\n suono.start();\n }\n catch (Exception ex)\n {\n System.out.println(\"il suono non può essere caricato\");\n }\n }", "public void play(final Clip clip) {\n\t\tclip.stop();\n\t\tclip.setFramePosition(0);\n\t\tclip.start();\n\t\t//not sure if this makes sense without the 'multiple variations' system that he used.\n\t}", "public static void playMusic(String fileName, float volume) {\n\t\t\n\t\tif (Launcher.cHandler.musicToggle) {\n\t\t\t\n\t\t\ttry {\n\t\t\t\t// Load the audio file\n\t\t\t\tFile file = new File(\"./audio/\" + fileName + \".wav\");\n\t\t\t\t\n\t\t\t\tAudioInputStream audioIn = AudioSystem.getAudioInputStream(file);\n\t\t\t\t\n\t\t\t\t// Generate the sound clip\n\t\t\t\tcurrentMusic = AudioSystem.getClip();\n\t\t\t\tcurrentMusic.open(audioIn);\n\t\t\t\t\n\t\t\t\t// Set volume\n\t\t\t\tif (volume < 0f || volume > 1f) {\n\t\t\t\t\tthrow new IllegalArgumentException(\"'\" + volume + \"' is not a valid volume.\");\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tFloatControl gain = (FloatControl) currentMusic.getControl(FloatControl.Type.MASTER_GAIN); \n\t\t\t gain.setValue(20f * (float) Math.log10(volume));\n\t\t\t \n\t\t\t\t// Play the clip\n\t\t\t currentMusic.start();\n\t\t\t\t\n\t\t\t} catch (UnsupportedAudioFileException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (IOException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t} catch (LineUnavailableException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}", "@Override\n public void makeSound() {\n\n }", "@Override\n public void makeSound() {\n\n }", "public static synchronized void playSound(final String url) {\n\t\t new Thread(new Runnable() {\n\t\t public void run() {\n\t\t try {\n\t\t Clip clip = AudioSystem.getClip();\n\t\t AudioInputStream inputStream = AudioSystem.getAudioInputStream(\n\t\t Main.class.getResourceAsStream(\"/res/\" + url));\n\t\t clip.open(inputStream);\n\t\t clip.start(); \n\t\t } catch (Exception e) {\n\t\t System.err.println(e.getMessage());\n\t\t }\n\t\t }\n\t\t }).start();\n\t\t}", "public void playSound(String fileName, float gain)\n\t{\n\t\ttry\n\t\t{\n\t\t\t// Open an audio input stream.\n\t\t\tURL url = GamePanel.class.getResource(\"/me/aaron/sounds/\" + fileName);\n\t\t\tAudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n\n\t\t\t// Get a sound clip resource.\n\t\t\tClip clip = AudioSystem.getClip();\n\n\t\t\t// Open audio clip and load samples from the audio input stream.\n\t\t\tclip.open(audioIn);\n\n\t\t audioClips.add(clip);\n\t\t\t\n\t\t\t//System.out.println(\"Adding audio clip: \" + fileName + \" with length \" + clip.getMicrosecondLength() / (Math.pow(10, 6)));\n\n\t\t\tFloatControl gainControl = (FloatControl) clip.getControl(FloatControl.Type.MASTER_GAIN);\n\t\t\tgainControl.setValue(gain);\n\n\t\t\tclip.start();\n\t\t}\n\t\tcatch (UnsupportedAudioFileException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch (IOException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch (LineUnavailableException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t\tcatch (NullPointerException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void play() {\n if (audio != null) {\n audio.play(sfxVolume);\n }\n }", "public synchronized void playSmoothLoop(String path){\r\n if(currentLoop0){\r\n if(backgroundMusicLoop0!=null) backgroundMusicLoop0.fadeOut();\r\n currentLoop0 = false;\r\n if(backgroundMusicLoop1==null){\r\n backgroundMusicLoop1 = new MusicThread(path, currentLoop0);\r\n backgroundMusicLoop1.startOnFadeIn();\r\n }else backgroundMusicLoop1.fadeIn();\r\n }else{\r\n if(backgroundMusicLoop1!=null) backgroundMusicLoop1.fadeOut();\r\n currentLoop0 = true;\r\n if(backgroundMusicLoop0==null){\r\n backgroundMusicLoop0 = new MusicThread(path, currentLoop0);\r\n backgroundMusicLoop0.startOnFadeIn();\r\n }else backgroundMusicLoop0.fadeIn();\r\n }\r\n }", "@Override\r\n public void show()\r\n {\r\n // De inmediato, ponemos en marcha una melodia\r\n if (!juego.getAdminComponentes().get(\"Audios/bgmusic06.ogg\", Music.class).isPlaying())\r\n {\r\n juego.getAdminComponentes().get(\"Audios/bgmusic06.ogg\", Music.class).play();\r\n juego.getAdminComponentes().get(\"Audios/bgmusic06.ogg\", Music.class).setLooping(true);\r\n }\r\n }", "public static void startMusic()\r\n\t{\r\n\t\tif ( musicPlayer == null )\r\n\t\t\tmusicPlayer = new MusicPlayer( \"Music2.mid\" );\r\n\t\telse\r\n\t\t\tmusicPlayer.play();\r\n\t}", "public void play() {\n\t\tplay(true, true);\n\t}", "public static void play(String w) {\n\n\t\ttry {\n\t\t\t// Open an audio input stream.\n\t\t\t//URL url = this.getClass().getClassLoader().getResource(wavMusicFile);\n\t\t\tURL url = new File(w).toURI().toURL();\n\t\t\tAudioInputStream audioIn = AudioSystem.getAudioInputStream(url);\n\t\t\t// Get a sound clip resource.\n\t\t\tClip c = AudioSystem.getClip();\n\t\t\t// Open audio clip and load samples from the audio input stream.\n\t\t\tc.open(audioIn);\n\t\t\tc.start();\n\t\t} catch (UnsupportedAudioFileException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (LineUnavailableException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public void play() {\n\t\t//If volume is not muted\n\t\tif (volume != Volume.MUTE) {\n\t\t\t//If the clip is running\n\t\t\tif (clip.isRunning()) {\n\t\t\t\tclip.stop(); //Stop it\n\t\t\t}\n\t\t\tclip.setFramePosition(0); //Rewind\n\t\t\tclip.start(); //Play again\n\t\t}\n\t}", "public void playSound() {\n String path = \"Data\\\\\\\\Acceptance.wav\";\n InputStream success;\n try {\n success = new FileInputStream(new File(path));\n AudioStream audioStream = new AudioStream(success);\n AudioPlayer.player.start(audioStream);\n } catch (Exception e) {\n JOptionPane.showMessageDialog(null, \"Error playing sounds\");\n }\n }", "private void startPlay() {\n isPlaying = true;\n isPaused = false;\n playMusic();\n }", "public void loadMusic(File f) {\n music = new MP3(f);\n }", "public void play() {\n try {\n if (clip != null) {\n new Thread() {\n public void run() {\n synchronized (clip) {\n clip.stop();\n clip.setFramePosition(0);\n clip.start();\n }\n }\n }.start();\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "public static void resumeCurrentSoundtrack() {\n\t\tif (GameFrame.settingsPanel.musicOn() && soundtrack[GameBoardModel.getLevel()-1] != null)\n\t\t\tsoundtrack[GameBoardModel.getLevel()-1].loop(Clip.LOOP_CONTINUOUSLY);\n\t}", "public SoundLoader(String path)\n {\n //inputStream = SoundLoader.class.getResourceAsStream(\"/resources/\"+path);\n inputStream = getClass().getResourceAsStream(\"/resources/\" + path);\n// inputStream =\n// ClassLoader.getSystemResourceAsStream(\"/resources/\" + path);\n\n try\n {\n BufferedInputStream buffered = new BufferedInputStream(inputStream);\n AudioInputStream audioStream =\n AudioSystem.getAudioInputStream(buffered);\n AudioFormat format = audioStream.getFormat();\n DataLine.Info info = new DataLine.Info(Clip.class, format);\n audioClip = (Clip) AudioSystem.getLine(info);\n\n audioClip.addLineListener(SoundLoader.this);\n\n audioClip.open(audioStream);\n\n }\n catch (UnsupportedAudioFileException e)\n {\n e.printStackTrace();\n }\n catch (LineUnavailableException e)\n {\n e.printStackTrace();\n }\n catch (IOException e)\n {\n e.printStackTrace();\n }\n }", "public void StartMusic(int music_id);", "public void mp3(View view) {\n mp1 = MediaPlayer.create(this, R.raw.heyjude);\n mp1.setLooping(false);\n mp1.setVolume(100, 100);\n mp1.start();\n }" ]
[ "0.7364985", "0.7337618", "0.7271064", "0.7269717", "0.7229772", "0.71050924", "0.71040016", "0.70997304", "0.7016364", "0.69911385", "0.692494", "0.6915035", "0.69061357", "0.6903124", "0.6898342", "0.689202", "0.68827325", "0.68341696", "0.68326294", "0.6805048", "0.67943734", "0.6790333", "0.6781323", "0.6756902", "0.67438173", "0.67340434", "0.6728772", "0.67077965", "0.6693949", "0.665911", "0.6655662", "0.66308075", "0.6627468", "0.6625992", "0.6614663", "0.66000676", "0.6595411", "0.65916145", "0.65886205", "0.65664804", "0.65510535", "0.65112144", "0.64941025", "0.6489816", "0.64863354", "0.6478011", "0.6471401", "0.64585286", "0.6436412", "0.6419507", "0.63975644", "0.63934344", "0.6373597", "0.63531435", "0.63445663", "0.6332001", "0.6328797", "0.6328736", "0.632727", "0.6313246", "0.63120216", "0.63051313", "0.628186", "0.6261116", "0.62579453", "0.62418", "0.6241425", "0.623922", "0.62372345", "0.62285936", "0.62276757", "0.62244207", "0.6217599", "0.6210823", "0.6203706", "0.6191435", "0.61600584", "0.6158719", "0.6138746", "0.6135477", "0.6133601", "0.6128684", "0.6128684", "0.6124568", "0.61224693", "0.6120698", "0.61201936", "0.61125153", "0.61085206", "0.6101825", "0.60963404", "0.60920274", "0.60876715", "0.6081884", "0.6078841", "0.60784113", "0.60760415", "0.6071852", "0.60706955", "0.6064657" ]
0.68518144
17
Add the entity to the game universe
public UnmovableEntity(GameData data, Point position, String urlString) { this.data = data; this.canvas = data.getCanvas(); URL url = UnmovableEntity.class.getResource(urlString); this.image = new DrawableImage(url, this.canvas); this.position = position; this.data.getUniverse().addGameEntity(this); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void addEntity(org.bukkit.entity.Entity entity) {\n\t\tEntity nmsentity = CommonNMS.getNative(entity);\n\t\tnmsentity.world.getChunkAt(MathUtil.toChunk(nmsentity.locX), MathUtil.toChunk(nmsentity.locZ));\n\t\tnmsentity.dead = false;\n\t\t// Remove an entity tracker for this entity if it was present\n\t\tWorldUtil.getTracker(entity.getWorld()).stopTracking(entity);\n\t\t// Add the entity to the world\n\t\tnmsentity.world.addEntity(nmsentity);\n\t}", "public void addEntity(Entity e)\r\n\t{\r\n\t\tentities.add(e);\r\n\t}", "public void addEntity(Entity entity)\n\t{\n\t\t\n\t\tif (entity.getClass() == PlayerMP.class)\n\t\t{\n\t\t\t//System.out.println(\"ADDING PLAYER TO PLAYER LIST\");\n\t\t\tplayers.add((PlayerMP)entity);\n\t\t\t//System.out.println(\"World Player Count: \" + players.size());\n\t\t}\n\t\telse\n\t\t{\n\t\t\tentities.add(entity);\n\t\t}\n\t}", "public void add(E entity);", "public void addEntity(Entity entity)\n {\n if (this.withinBounds(entity.getPosition()))\n {\n this.setOccupancyCell(entity.getPosition(), entity);\n this.entities.add(entity);\n }\n }", "public void addEntity(Player player) {\n\t\tentities.add(player);\n\t}", "void addNode(Entity entity) {\n\t\tProcessing.nodeSet.add(entity);\n\t\tSystem.out.println(\"the entity was successfully added to the network.\");\n\t}", "public void addEntity(Entity entity)\n {\n if (withinBounds(entity.getPosition()))\n {\n setOccupancyCell(entity.getPosition(), entity);\n this.entities.add(entity);\n }\n }", "public void addEntity(Entity entity) {\n\t\tthis.entities.add(entity);\n\t}", "public void addToWorld(World world);", "public void add(E e) {\n\t\tentities.add(e);\n\t}", "void addEntity(IViewEntity entity);", "public void addNewEntity() {\n Random random = new Random();\n int bound = Aquarium.WIDTH / 10;\n int randX = bound + random.nextInt(Aquarium.WIDTH - (2 * bound));\n int randY = bound + random.nextInt(Aquarium.HEIGHT - (2 * bound));\n Piranha newPiranha = new Piranha(randX, randY);\n piranhas.add(newPiranha);\n }", "public static void addEntityToCurrentScene(Entity entity) {\n AbstractScene currentScene = instance().currentScene;\n if (currentScene != null) {\n currentScene.addEntity(entity);\n } else {\n logger.error(\"Couldn't add entity to the current scene, because there is no scene loaded!\", Thread.currentThread().getStackTrace());\n System.exit(-1);\n }\n }", "public void doAddEntity(TreePath path) {\n \t\tif(world == null) return;\n \t\tNode node = (Node) path.getLastPathComponent();\n \t\tString[] names = new String[EEntity.values().length];\n \t\tfor (int i = 0; i < names.length; i++) {\n \t\t\tnames[i] = EEntity.values()[i].name();\n \t\t}\n \t\tString selected = (String) JOptionPane.showInputDialog(\n \t\t\t\tWorldEditor.this, \"What kind of entity\", \"Create Entity\",\n \t\t\t\tJOptionPane.PLAIN_MESSAGE, null, names, names[0]);\n \t\tEEntity selectedEntity = EEntity.valueOf(selected);\n \t\tif (selectedEntity == null)\treturn;\n \t\tEditableEntity entity = (EditableEntity) EntityManager.getInstance().createEntity(selectedEntity);\n \t\tif (selectedEntity == EEntity.Terrain) {\n \t\t\tTerrainDialog dialog = new TerrainDialog(this);\n \t\t\tif (dialog.wasCanceled()) {\n \t\t\t\treturn;\n \t\t\t}\n \t\t\tDimension d = dialog.getTerrainSize();\n \t\t\tint tris = dialog.getTrisPerMesh();\n \t\t\t((TerrainEntity) entity).setWidth((int) d.getWidth());\n \t\t\t((TerrainEntity) entity).setDepth((int) d.getHeight());\n \t\t\t((TerrainEntity) entity).setTrianglesPerMesh(tris);\n \t\t}\n \t\tEditableView view = (EditableView) ViewManager.getInstance().createView(entity);\n \t\tif (selectedEntity == EEntity.Terrain) {\n \t\t\tthis.terrainView = (TerrainView)view;\n \t\t\tthis.terrainView.getTerrainCluster().setDetailTexture(1, 1);\n \t\t}\n \t\tthis.world.attachView(view);\n \t\ttreeModel.addChild(node, view);\n \t\trepaint();\n \t}", "@Override\n\tpublic void addEntity( final Entity _entity )\n\t{\n\t\tif( _entity == null )\n\t\t{\n\t\t\tLogger.println( \"Attempting to add null entity.\", Logger.Verbosity.MAJOR ) ;\n\t\t\treturn ;\n\t\t}\n\n\t\tentitiesToAdd.add( _entity ) ;\n\t}", "public WorldRegion(GameWorldEntity entity) {\n gameWorldEntities.add(entity);\n }", "public int addAsEntity(Entity e, int x, int y) {\n e.setMapRelation(new MapEntity_Relation(this, e, x, y));\n System.out.println(e.name_);\n int error_code = this.map_grid_[y][x].addEntity(e);\n System.out.println(e.name_ + \"2\");\n if (error_code == 0) {\n this.entity_list_.put(e.name_, e);\n } else {\n e.setMapRelation(null);\n System.err.println(\"Error in entity list\");\n }\n return error_code;\n }", "public void spawnEntity(Entity entity)\n\t{\n\t\tif(!entity.isLoadedResources() && !entity.loadResources())\n\t\t{\n\t\t\t//Don't add entity if an error occurs\n\t\t\treturn;\n\t\t}\n\t\tthis.newEntityBuffer.add(entity);\n\t\tLoggingHandler.logger.log(Level.FINE, \"Added entity to spawn queue: \" + entity);\n\t}", "public void add(IApsEntity entity) throws ApsSystemException;", "private void addEntity(Entity entity, ImageView view) {\n trackPosition(entity, view);\n entityImages.add(view);\n }", "public void addToWorld() {\n world().addObject(this, xPos, yPos);\n \n try{\n terrHex = MyWorld.theWorld.getObjectsAt(xPos, yPos, TerritoryHex.class).get(0);\n } catch(IndexOutOfBoundsException e){\n MessageDisplayer.showMessage(\"The new LinkIndic didn't find a TerritoryHex at this position.\");\n this.destroy();\n }\n \n }", "public void add(E entity)\r\n\t{\r\n\t\tpad( 1 );\r\n\r\n\t\tentities[size] = entity;\r\n\t\t\r\n\t\tonAdd( entity, size );\r\n\t\t\r\n\t\tsize++;\r\n\t}", "public void addEntity(final Entity aEntity)\r\n\t{\r\n\t\tif ( !aEntity.isParticle() && mEntities.containsKey(aEntity.getId()))\r\n\t\t{\r\n\t\t\taEntity.init(this, aEntity.getId());\r\n\t\t\treturn;\r\n\t\t}\r\n\t\taEntity.init(this, generateId());\r\n\t\tmAddEntities.put(aEntity.getId(), aEntity);\r\n\t}", "public void addEntity(T entity) {\n\t\t// Remove from needed\n\t\tidTracker.unset(entity.getId());\n\n\t\t// Add to entities\n\t\tentityMap.add(entity);\n\t}", "@Override\n\tpublic void entityAdded(Entity entity)\n\t{\n\t\t\n\t}", "@SuppressWarnings(\"unused\")\n void spawn(Entity entity);", "public void addToTile(GameEntity e) {\n\t\t\n\t\tGridTile tile = getTile(e.pos());\n\t\ttile.add(e);\n\t}", "@FXML\n public void addGym() {\n \tnew eMenuHandler().hideMenu();\n \tDisplayBuildingInstructions.showBuildingInstr();\n \tAddEntityOnMouseClick.setBuildMode(Boolean.TRUE);\n \tAddEntityOnMouseClick.entityList(new BuildingGym(0, 0));\n \t/*\n int xpos = (int) (Math.random() * 600) + 100;\n World.getInstance().addEntityToWorld(new BuildingGym(xpos, 30));\n */\n }", "private void toBeAddedEntities()\n\t{\n\t\tif( entitiesToAdd.isEmpty() )\n\t\t{\n\t\t\treturn ;\n\t\t}\n\n\t\tfinal List<Event<?>> events = MalletList.<Event<?>>newList() ;\n\n\t\tfinal int size = entitiesToAdd.size() ;\n\t\tfor( int i = 0; i < size; ++i )\n\t\t{\n\t\t\tfinal Entity entity = entitiesToAdd.get( i ) ;\n\t\t\thookEntity( eventSystem, events, entity ) ;\n\t\t\tentities.add( entity ) ;\n\t\t}\n\t\tentitiesToAdd.clear() ;\n\t\t\n\t\tif( size > capacity )\n\t\t{\n\t\t\t// If the size of entitiesToAdd exceeds our capacity then \n\t\t\t// we want to resize the array - it's easy for an \n\t\t\t// array to expand, it's much harder to shrink it!\n\t\t\tentitiesToAdd = MalletList.<Entity>newList( capacity ) ;\n\t\t}\n\t}", "public void addEntity(final Entity aEntity, final int aX, final int aY)\r\n\t{\r\n\t\tif ( !aEntity.isParticle() && mEntities.containsKey(aEntity.getId()))\r\n\t\t{\r\n\t\t\taEntity.init(this, aEntity.getId());\r\n\t\t\treturn;\r\n\t\t}\r\n\t\taEntity.init(this, generateId());\r\n\t\taEntity.setX(aX);\r\n\t\taEntity.setY(aY);\r\n\t\tmAddEntities.put(aEntity.getId(), aEntity);\r\n\t}", "void spawnEntityAt(String typeName, int x, int y);", "public void addUniverse(Universe uni){\n this.universe = uni;\n }", "@Override\n\tpublic void updateEntity() {\n\t\t\n\t\tif (this.mobID != null && !this.worldObj.isRemote) {\n\t\t\t\n\t\t\tif (this.delay > 0) {\n\t\t\t\tthis.delay--;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tEntity entity = EntityList.createEntityByName(this.mobID, this.worldObj);\n\t\t\t\n\t\t\t// L'entity n'existe pas\n\t\t\tif (entity == null) {\n\t\t\t\tModGollumCoreLib.log.warning(\"This mob \"+this.mobID+\" isn't register\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tthis.worldObj.setBlockToAir(this.xCoord , this.yCoord , this.zCoord);\n\t\t\t\n\t\t\tdouble x = (double)this.xCoord + 0.5D;\n\t\t\tdouble y = (double)(this.yCoord);// + this.worldObj.rand.nextInt(3) - 1);\n\t\t\tdouble z = (double)this.zCoord + 0.5D;\n\t\t\tEntityLiving entityLiving = entity instanceof EntityLiving ? (EntityLiving)entity : null;\n\t\t\tentity.setLocationAndAngles(x, y, z, this.worldObj.rand.nextFloat() * 360.0F, this.worldObj.rand.nextFloat() * 360.0F);\n\t\t\tthis.worldObj.spawnEntityInWorld(entity);\n\t\t\t\n\t\t\tif (entityLiving == null || entityLiving.getCanSpawnHere()) {\n\t\t\t\t\n\t\t\t\tthis.worldObj.playSoundEffect (this.xCoord, this.yCoord, this.zCoord, \"dig.stone\", 0.5F, this.worldObj.rand.nextFloat() * 0.25F + 0.6F);\n\t\t\t\t\n\t\t\t\tif (entityLiving != null) {\n\t\t\t\t\tentityLiving.spawnExplosionParticle();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public void addEntity(AnnexDetail entity) throws Exception {\n\t\t\n\t}", "public AddEntityCommand(SceneBase scene, Entity entity) {\n\t\tthis(scene, entity, null);\n\t}", "@Test\n @DisplayName(\"add queued entity on tick\")\n void TestQueueEntityForAdd() {\n world.removeEntity(ent);\n world.queueEntityForAdd(ent);\n world.onTick();\n assertEquals(1, world.getWorldEntities().size(), \"Expected one entity to be added from queue.\");\n assertEquals(ent, world.getWorldEntities().get(0), \"Expected the added entity to be our entity.\");\n }", "public void spawnEntity(AEntityB_Existing entity){\r\n\t\tBuilderEntityExisting builder = new BuilderEntityExisting(entity.world.world);\r\n\t\tbuilder.loadedFromSavedNBT = true;\r\n\t\tbuilder.setPositionAndRotation(entity.position.x, entity.position.y, entity.position.z, (float) -entity.angles.y, (float) entity.angles.x);\r\n\t\tbuilder.entity = entity;\r\n\t\tworld.spawnEntity(builder);\r\n }", "@Override\n public void init(Entity entity) {\n entity.add(AI_DATA, new BuildingSpawnerStratAIData());\n }", "@Override\n\tpublic void add(Game game) {\n\t\t\n\t}", "Builder addMainEntity(Thing value);", "public Tuple addEntity(Entity entity){\n\t\tsynchronized(m_viz){\n\t\t\treturn m_entities.addTuple(entity);\n\t\t}\n\t}", "private void addChild(Ent e){\n\t\tif(e.getParent() == this){\n\t\t\treturn;\n\t\t}else if(e.getParent() != null){\n\t\t\te.removeFromParent();\n\t\t}\n\t\tif(e instanceof PhysEnt){\n\t\t\tDbg.Error(\"Cannot make PhysEnt a child : PhysEnt must be root entities.\");\n\t\t\treturn;\n\t\t}\n\t\te.bound.setParent(this);\n\t\tif(childList == null){\n\t\t\tchildList = new ArrayList<Ent>();\n\t\t}\n\t\tchildList.add(e);\n\t\tfor(Scene s:sceneList){\n\t\t\ts.addEntity(e);\n\t\t}\n\t}", "@Override\n\tpublic void add(Entity entity) throws Exception {\n\t\tsuper.add(entity);\n\t\tProduct prod = (Product) entity;\n\n\t\tSQLiteStatement st = db\n\t\t\t\t.prepare(\"INSERT INTO products(sessionID, name, priceMin, priceMax, quantity, category)\"\n\t\t\t\t\t\t+\"VALUES (?, ?, ?, ?, ?, ?)\");\n\t\tst.bind(1, sessionId).bind(2, prod.getName()).bind(3, prod.getPriceMin())\n\t\t\t\t.bind(4, prod.getPriceMin()).bind(5, prod.getQuantity())\n\t\t\t\t.bind(6, prod.getCategory());\n\t\tst.step();\n\t\ttotalQuantity += prod.quantity;\n\t\tif (!categoryList.containsKey(prod.getCategory())) {\n\t\t\tcategoryList.put(prod.getCategory(), new ArrayList<Product>());\n\t\t}\n\t\tcategoryList.get(prod.getCategory()).add(prod);\n\t\tif (availableProducts.get(entity.getName())==null) {\n\t\t\tavailableProducts.put(entity.getName(), \" \");\n\t\t}\n\t}", "@Override\n public void add(Object o) {\n gameCollection.addElement(o);\n }", "public void add(IMobile mEntity) {\r\n\t\tthis.mEntity.add(mEntity);\r\n\t}", "protected void addedToWorld(World world) \n {\n createImages();\n }", "public int addAsKnight(Entity e, int x, int y) {\n e.setMapRelation(new MapKnight_Relation(this, e, x, y));\n System.out.println(e.name_);\n int error_code = this.map_grid_[y][x].addEntity(e);\n System.out.println(e.name_ + \"2\");\n if (error_code == 0) {\n this.entity_list_.put(e.name_, e);\n } else {\n e.setMapRelation(null);\n System.err.println(\"Error in entity list\");\n }\n return error_code;\n }", "public void add(GameEvent e);", "void add(Actor actor);", "public void registerDynamicEntity(DynamicEntity entity) {\n\t\tdynamicEntities.add(entity);\n\t\tputInVisLayerList(entity);\n\t}", "void addEntityToSystems(Entity e, RECSBits systemBits) {\n \t\tfor (int i = systemBits.nextSetBit(0); i >= 0; i = systemBits.nextSetBit(i + 1)) {\n \t\t\tsystemMap.get(i).addEntity(e.id);\n \t\t}\n \t}", "private void attachEntity(Usuario entity) {\n }", "public void insert(Entity entity){\n\n //Find the correct node for that object\n int index = this.getIndex(entity);\n if(index != -1){\n // Recursively insert\n this.getNodes().get(index).insert(entity);\n }\n\n //There is no subnode fit for this lets add it to the current node\n this.entities.add(entity);\n\n\n //Now that we have a new node, is the node ok with it?\n if(this.entities.size()> MAX_OBJECTS && this.level < MAX_LEVELS){\n // Nah... We need to split!\n this.split();\n\n // Let's reinsert all the objets in the current node into the right place\n int i = 0;\n while (i < this.entities.size()){\n Entity gObj = this.entities.get(i);\n index = this.getIndex(gObj);\n if(index != -1){\n //WE need to reinsert it in the correct place\n this.entities.remove(gObj);\n this.nodes.get(index).insert(gObj);\n }else{\n i += 1; //To the next gameObject\n }\n }\n }\n }", "public void addEnemy(Enemy enem)\r\n\t{\r\n\t\tenemy.add(new Enemy(enem));\r\n\t}", "public void AddItem( Standard_Transient anentity) {\n OCCwrapJavaJNI.Interface_EntityIterator_AddItem(swigCPtr, this, Standard_Transient.getCPtr(anentity) , anentity);\n }", "public void equip(Equipment e){\n equipment.add(e);\n }", "public void addedToWorld(World w) {\r\n\t\tupdate();\r\n\t}", "private void initializeEntities() {\n arrAttack = new ArrayList<>();\n arrCollidable = new ArrayList<>();\n entities = new ArrayList<>();\n\n arrAttack = scene.entityManager.getEntitiesWithComponents(attackComponent.getClass(), tool.getClass());\n\n arrCollidable = scene.entityManager.getEntitiesWithComponents(collidable.getClass(), Playable.class);\n\n for (int i = 0; i < arrAttack.size(); i++) {\n\n tool = scene.entityManager.getEntityComponentInstance(arrAttack.get(i), tool.getClass());\n\n //A -1 means that the entity is not attacking, at least with that weapon\n if (tool.currentActive != -1) {\n entities.add(arrAttack.get(i));\n }\n }\n\n //adding collidables to entities\n for (int i = 0; i < arrCollidable.size(); i++) {\n entities.add(arrCollidable.get(i));\n }\n }", "public void add(WorldObject obj) {\n\troomList.add(obj);\n}", "protected void onAdd( E entity, int index )\r\n\t{\r\n\t\t\r\n\t}", "@SuppressWarnings(\"unchecked\")\n \tvoid addSystem(EntitySystem system) {\n \t\tif (systems.contains(system))\n \t\t\tthrow new RuntimeException(\"System already added\");\n \t\tsystem.id = getNewSystemId();\n \t\tsystem.componentBits = world.getComponentBits(system.components);\n \n \t\tClass<? extends EntitySystem> class1 = system.getClass();\n \t\tdo {\n \t\t\tfor (Field field : class1.getDeclaredFields()) {\n \t\t\t\t// Check for ComponentManager declarations.\n \t\t\t\tif (field.getType() == ComponentMapper.class) {\n \t\t\t\t\tfield.setAccessible(true);\n \t\t\t\t\t// Read the type in the <> of componentmanager\n \t\t\t\t\tType type = ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[0];\n \t\t\t\t\ttry {\n \t\t\t\t\t\t// Set the component manager declaration with the right\n \t\t\t\t\t\t// component manager.\n \t\t\t\t\t\tfield.set(system, world.getComponentMapper((Class<? extends Component>) type));\n \t\t\t\t\t} catch (IllegalArgumentException e) {\n \t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t} catch (IllegalAccessException e) {\n \t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t}\n \t\t\t\t}\n \t\t\t\t// check for EventListener declarations.\n \t\t\t\tif (field.getType() == EventListener.class) {\n \t\t\t\t\tfield.setAccessible(true);\n \t\t\t\t\t// Read the type in the <> of eventListener.\n \t\t\t\t\tType type = ((ParameterizedType) field.getGenericType()).getActualTypeArguments()[0];\n \t\t\t\t\t@SuppressWarnings(\"rawtypes\")\n \t\t\t\t\tEventListener<? extends Event> eventListener = new EventListener();\n \t\t\t\t\tworld.registerEventListener(eventListener, (Class<? extends Event>) type);\n \n \t\t\t\t\ttry {\n \t\t\t\t\t\t// Set the event listener declaration with the right\n \t\t\t\t\t\t// field listener.\n \t\t\t\t\t\tfield.set(system, eventListener);\n \t\t\t\t\t} catch (IllegalArgumentException e) {\n \t\t\t\t\t\te.printStackTrace();\n \t\t\t\t\t} catch (IllegalAccessException 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\tclass1 = (Class<? extends EntitySystem>) class1.getSuperclass();\n \t\t} while (class1 != EntitySystem.class);\n \t\tsystems.add(system);\n \t\tsystemMap.put(system.id, system);\n\t\tsystem.world = world;\n \t}", "public EntityItemEmpowerable(World world) {\n super(world);\n }", "@Override\n\tpublic Result add(CurriculumVitae entity) {\n\t\treturn null;\n\t}", "public void addedToWorld(World w){\n PauseWorld world = (PauseWorld) w;\n world.addObject(nameLabel,this.getX(),this.getY()+itemSize/2+10);\n }", "private void addEvent() {\n String name = selectString(\"What is the name of this event?\");\n ReferenceFrame frame = selectFrame(\"Which frame would you like to define the event in?\");\n double time = selectDouble(\"When does the event occur (in seconds)?\");\n double x = selectDouble(\"Where does the event occur (in light-seconds)?\");\n world.addEvent(new Event(name, time, x, frame));\n System.out.println(\"Event added!\");\n }", "@Override\n\tpublic void onAdd() {\n\t\tsuper.onAdd();\n\n\t\tsetIdleAnimation(4527);\n\t\tsetNeverRandomWalks(true);\n\t\tsetWalkingHomeDisabled(true);\n\n\t\tthis.region = Stream.of(AbyssalSireRegion.values()).filter(r -> r.getSire().getX() == getSpawnPositionX()\n\t\t && r.getSire().getY() == getSpawnPositionY()).findAny().orElse(null);\n\n\t\tRegion region = Region.getRegion(getSpawnPositionX(), getSpawnPositionY());\n\n\t\tif (region != null) {\n\t\t\tregion.forEachNpc(npc -> {\n\t\t\t\tif (npc instanceof AbyssalSireTentacle) {\n\t\t\t\t\tif (!npc.isDead()) {\n\t\t\t\t\t\tnpc.setDead(true);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t\tList<Position> tentaclePositions = Arrays.asList(\n\t\t\t\tthis.region.getTentacleEast(),\n\t\t\t\tthis.region.getTentacleWest(),\n\t\t\t\tthis.region.getTentacleNorthEast(),\n\t\t\t\tthis.region.getTentacleNorthWest(),\n\t\t\t\tthis.region.getTentacleSouthEast(),\n\t\t\t\tthis.region.getTentacleSouthWest()\n\t\t );\n\n\t\ttentaclePositions.forEach(position -> {\n\t\t\ttentacles.add(NpcHandler.spawnNpc(5909, position.getX(), position.getY(), position.getZ()));\n\t\t});\n\n\t\tList<Position> respiratoryPositions = Arrays.asList(\n\t\t\t\tthis.region.getRespiratorySystemNorthEast(),\n\t\t\t\tthis.region.getRespiratorySystemNorthWest(),\n\t\t\t\tthis.region.getRespiratorySystemSouthEast(),\n\t\t\t\tthis.region.getRespiratorySystemSouthWest()\n\t\t );\n\n\t\trespiratoryPositions.forEach(position -> respiratorySystems.add(\n\t\t\t\tNpcHandler.spawnNpc(5914, position.getX(), position.getY(), position.getZ())));\n\t}", "public void addActor(Actor actor) { ActorSet.addElement(actor); }", "public void add(FavoriteEntity obj)\n {\n super.add(obj);\n }", "public abstract BossBar addPlayer(UUID player);", "void addConstraintEntity(IViewEntity entity);", "public void attach(final E entity) {\n if (entity.getId() != null) return;\n entity.setId(this.getNextId());\n this.entities.add(entity);\n this.id2entity.put(entity.getId(), entity);\n }", "public void create(GameSet entity) {\r\n\t\tgetDatabase().beginTransaction();\r\n\t\ttry {\r\n\t\t\tString sql = \"insert into GAME_SET (\" + GameSet.DbField.ID + \",\" + GameSet.DbField.GAME_ID + \",\" + GameSet.DbField.NAME + \",\" + GameSet.DbField.IMAGE\r\n\t\t\t\t\t+ \") values (?,?,?,?)\";\r\n\t\t\tObject[] params = new Object[4];\r\n\t\t\tparams[0] = entity.getId();\r\n\t\t\tparams[1] = entity.getGame().getId();\r\n\t\t\tparams[2] = entity.getName();\r\n\t\t\tparams[3] = entity.getImageName();\r\n\r\n\t\t\texecSQL(sql, params);\r\n\r\n\t\t\tgetDatabase().setTransactionSuccessful();\r\n\t\t\tentity.setState(DbState.LOADED);\r\n\r\n\t\t} finally {\r\n\t\t\tgetDatabase().endTransaction();\r\n\t\t}\r\n\t}", "public void save() {\r\n\t\tGame.getInstance().getInventory().add(id);\r\n\t}", "public void addNewLegalEntity(String string) {\n\t\t\r\n\t}", "private void initEntities() {\n\t\tship = new ShipEntity(this,\"ship.gif\",370,550);\n\t\tentities.add(ship);\n\t\tscore = 0;\n\t\t// create a block of aliens (5 rows, by 12 aliens, spaced evenly)\n\t\talienCount = 0;\n\t\tfor (int row=0;row<5;row++) {\n\t\t\tfor (int x=0;x<12;x++) {\n\t\t\t\tEntity alien = new AlienEntity(this,\"alien.gif\",100+(x*50),(50)+row*30);\n\t\t\t\tentities.add(alien);\n\t\t\t\talienCount++;\n\t\t\t}\n\t\t}\n\t}", "public void addEntityToTeam(LivingEntity livingEntity, String teamName) {\n getTeam(teamName).addEntry(livingEntity.getUniqueId().toString());\n }", "void create(E entity);", "public void addTile(Tile tile) {\n ownedTiles.add(tile);\n }", "public void addedToWorld (World w)\n {\n w.addObject (healthBar, this.getX(), this.getY()-60);\n world = (MyWorld) w;\n healthBar.update(health);\n }", "public void updateEntity();", "public void addObject(final PhysicalObject obj) {\n \t\tmyScene.addChild(obj.getGroup());\n \t\tmyObjects.add(obj);\n \t}", "public void add(Collection<T> entities) {\n\t\tnewEntities.addAll(entities);\n\t}", "public void add(GameObject go) {\r\n table[go.hashCode() % table.length].add(go);\r\n }", "public void addIsA(Entity ent)\n {\n if (ent == null || isAs.contains(ent))\n return;\n\n isAs.add(ent);\n }", "private void add(Tile t) {\n tileBag.add(t);\n shuffleBag();\n }", "void addObserver(EntityObserver observer);", "private void addObjectTo(Obstacle obj, int l) {\r\n\t\tassert inBounds(obj) : \"Object is not in bounds\";\r\n\t\tif (l == LevelCreator.allTag) {\r\n\t\t\tsharedObjects.add(obj);\r\n\t\t\t//obj.activatePhysics(world);\r\n\t\t}\r\n\t\telse if (l == LevelCreator.lightTag) {\r\n\t\t\tlightObjects.add(obj);\r\n\t\t\t//obj.activatePhysics(world);\r\n\t\t}else if (l == LevelCreator.darkTag) {\r\n\t\t\tdarkObjects.add(obj);\r\n\t\t\t//obj.activatePhysics(world);\r\n\t\t}\r\n\t}", "public void setBasicNewGameWorld()\r\n\t{\r\n\t\tlistCharacter = new ArrayList<Character>();\r\n\t\tlistRelationship = new ArrayList<Relationship>();\r\n\t\tlistLocation = new ArrayList<Location>();\r\n\t\t\r\n\t\t//Location;\r\n\t\t\r\n\t\tLocation newLocationCity = new Location();\r\n\t\tnewLocationCity.setToGenericCity();\r\n\t\tLocation newLocationDungeon = new Location();\r\n\t\tnewLocationDungeon.setToGenericDungeon();\r\n\t\tLocation newLocationForest = new Location();\r\n\t\tnewLocationForest.setToGenericForest();\r\n\t\tLocation newLocationJail = new Location();\r\n\t\tnewLocationJail.setToGenericJail();\r\n\t\tLocation newLocationPalace = new Location();\r\n\t\tnewLocationPalace.setToGenericPalace();\r\n\t\t\r\n\t\tlistLocation.add(newLocationCity);\r\n\t\tlistLocation.add(newLocationDungeon);\r\n\t\tlistLocation.add(newLocationForest);\r\n\t\tlistLocation.add(newLocationJail);\r\n\t\tlistLocation.add(newLocationPalace);\r\n\t\t\r\n\t\t\r\n\t\t//Item\r\n\t\tItem newItem = new Item();\r\n\t\t\r\n\t\tString[] type =\t\tnew String[]\t{\"luxury\"};\r\n\t\tString[] function = new String[]\t{\"object\"};\t\r\n\t\tString[] property = new String[]\t{\"\"};\r\n\t\tnewItem.setNewItem(900101,\"diamond\", type, function, \"null\", property, 2, true);\r\n\t\tnewLocationPalace.addOrUpdateItem(newItem);\r\n\t\t\r\n\t\ttype =\t \tnew String[]\t{\"weapon\"};\r\n\t\tfunction = new String[]\t{\"equipment\"};\t\r\n\t\tproperty = new String[]\t{\"weapon\"};\r\n\t\tnewItem = new Item();\r\n\t\tnewItem.setNewItem(500101,\"dagger\", type, function, \"null\", property, 1, false);\t\t\r\n\t\tnewLocationJail.addOrUpdateItem(newItem);\r\n\t\t\r\n\t\t\r\n\t\ttype =\t\tnew String[]\t{\"quest\"};\r\n\t\tfunction = new String[]\t{\"object\"};\t\r\n\t\tproperty = new String[]\t{\"\"};\r\n\t\tnewItem.setNewItem(900201,\"treasure_map\", type, function, \"null\", property, 2, true);\r\n\t\tnewLocationDungeon.addOrUpdateItem(newItem);\r\n\r\n\t\t\r\n\t\t////// Add very generic item (10+ items of same name)\r\n\t\t////// These item start ID at 100000\r\n\t\t\r\n\t\t//Add 1 berry\r\n\t\t//100000\r\n\t\tnewItem = new Item();\r\n\t\ttype =\t \tnew String[]\t{\"supply\"};\r\n\t\tfunction = new String[]\t{\"consumable\"};\t\r\n\t\tproperty = new String[]\t{\"berry\"};\r\n\t\tnewItem.setNewItem(100101,\"berry\", type, function, \"null\", property, 0, false);\r\n\t\tnewLocationForest.addOrUpdateItem(newItem);\r\n\t\t\r\n\t\t/* REMOVE 19-2-2019 to increase performance\r\n\t\t\r\n\t\tnewItem = new Item();\r\n\t\tnewItem.setNewItem(100102,\"berry\", type, function, \"null\", property, 0, false);\r\n\t\tnewLocationForest.addOrUpdateItem(newItem);\r\n\t\tnewItem = new Item();\r\n\t\tnewItem.setNewItem(100102,\"berry\", type, function, \"null\", property, 0, false);\r\n\t\tnewLocationForest.addOrUpdateItem(newItem);\r\n\t\tnewItem = new Item();\r\n\t\tnewItem.setNewItem(100103,\"berry\", type, function, \"null\", property, 0, false);\r\n\t\tnewLocationForest.addOrUpdateItem(newItem);\r\n\t\t\r\n\t\t*/\r\n\r\n\t\t\r\n\t\t//Add 2 poison_plant\r\n\t\t//101000\r\n\t\tnewItem = new Item();\r\n\t\ttype =\t \tnew String[]\t{\"supply\"};\r\n\t\tfunction = new String[]\t{\"consumable\"};\t\r\n\t\tproperty = new String[]\t{\"poison\"};\r\n\t\tnewItem.setNewItem(100201,\"poison_plant\", type, function, \"null\", property, 0, false);\r\n\t\tnewLocationForest.addOrUpdateItem(newItem);\r\n\t\tnewItem = new Item();\r\n\t\tnewItem.setNewItem(100202,\"poison_plant\", type, function, \"null\", property, 0, false);\r\n\t\tnewLocationForest.addOrUpdateItem(newItem);\r\n\t\tnewItem = new Item();\r\n\r\n\t\t//player\r\n\t\tCharacter newChar = new Character(\"player\", 1, true,\"city\", 0, false);\r\n\t\tnewChar.setIsPlayer(true);\r\n\t\tlistCharacter.add(newChar);\r\n\t\t\r\n\t\t//UNIQUE NPC\r\n\t\tnewChar = new Character(\"mob_NPC_1\", 15, true,\"city\", 0, false);\r\n\t\tlistCharacter.add(newChar);\r\n\r\n\t\t\r\n\t\tnewChar = new Character(\"king\", 20, true,\"palace\", 3, true);\r\n\t\tnewChar.addOccupation(\"king\");\r\n\t\tnewChar.addOccupation(\"noble\");\r\n\t\tnewChar.addStatus(\"rich\");\r\n\t\t\r\n\t\tlistCharacter.add(newChar);\r\n\r\n\r\n\t\t//Mob character\r\n\t\tnewChar = new Character(\"soldier1\", 20, true,\"city\", 2, true);\r\n\t\tnewChar.addOccupation(\"soldier\");\r\n\t\tlistCharacter.add(newChar);\r\n\t\t\r\n\t\t// REMOVE to improve performance\r\n\t\t/*\r\n\t\tnewChar = new Character(\"soldier2\", 20, true,\"jail\", 2, true);\r\n\t\tnewChar.addOccupation(\"soldier\");\r\n\t\tlistCharacter.add(newChar);\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t\tnewChar = new Character(\"soldier3\", 20, true,\"palace\", 2, true);\r\n\t\tnewChar.addOccupation(\"soldier\");\r\n\t\tlistCharacter.add(newChar);\r\n\t\t\r\n\t\t//listLocation.add(newLocationCity);\r\n\t\t//listLocation.add(newLocationDungeon);\r\n\t\t//listLocation.add(newLocationForest);\r\n\t\t//listLocation.add(newLocationJail);\r\n\t\t//listLocation.add(newLocationPalace);\r\n\t\t\r\n\t\tnewChar = new Character(\"doctor1\", 20, true,\"city\", 3, true);\r\n\t\tnewChar.addSkill(\"heal\");\r\n\t\tnewChar.addOccupation(\"doctor\");\r\n\t\tlistCharacter.add(newChar);\t\r\n\t\tnewChar = new Character(\"blacksmith1\", 20, true,\"city\", 2, true);\r\n\t\tnewChar.addOccupation(\"blacksmith\");\r\n\t\tlistCharacter.add(newChar);\r\n\t\t\r\n\t\t\r\n\t\tnewChar = new Character(\"thief1\", 20, true,\"jail\", 2, true);\r\n\t\tnewChar.addOccupation(\"thief\");\r\n\t\ttype =\t \tnew String[]\t{\"supply\"};\r\n\t\tfunction = new String[]\t{\"consumable\"};\t\r\n\t\tproperty = new String[]\t{\"unlock\"};\r\n\t\tnewItem = new Item();\r\n\t\tnewItem.setNewItem(300101,\"lockpick\", type, function, \"thief1\", property, 1, false);\r\n\t\tnewChar.addOrUpdateItem(newItem);\r\n\t\tlistCharacter.add(newChar);\r\n\t\t\r\n\t\t// Remove to improve performance\r\n\t\t/*\r\n\t\tnewChar = new Character(\"messenger1\", 20, true,\"city\", 2, true);\r\n\t\tnewChar.addOccupation(\"messenger\");\r\n\t\tlistCharacter.add(newChar);\r\n\t\t*/\r\n\t\t\r\n\t\tnewChar = new Character(\"miner1\", 20, true,\"dungeon\", 1, true);\r\n\t\tnewChar.addOccupation(\"miner\");\r\n\t\tlistCharacter.add(newChar);\r\n\t\tnewChar = new Character(\"lumberjack1\", 20, true,\"forest\", 1, true);\r\n\t\tnewChar.addOccupation(\"lumberjack\");\r\n\t\tlistCharacter.add(newChar);\r\n\t\t\r\n\t\t/* REMOVE 19-2-2019 to increase performance\r\n\t\t\r\n\t\tnewChar = new Character(\"scout1\", 20, true,\"forest\", 2, true);\r\n\t\tnewChar.addOccupation(\"scout\");\r\n\t\tlistCharacter.add(newChar);\r\n\t\tnewChar = new Character(\"farmer1\", 20, true,\"forest\", 1, true);\r\n\t\tnewChar.addOccupation(\"farmer\");\r\n\t\tlistCharacter.add(newChar);\r\n\t\t\r\n\t\t*/\r\n\t\t\r\n\t\t\r\n\t\tnewChar = new Character(\"merchant1\", 20, true,\"city\", 3, true);\r\n\t\tnewChar.addOccupation(\"merchant\");\r\n\t\tnewChar.addStatus(\"rich\");\r\n\t\t\r\n\t\t// Merchant Item\r\n\t\t//NPC item start at 50000\r\n\t\ttype =\t \tnew String[]\t{\"supply\"};\r\n\t\tfunction = new String[]\t{\"consumable\"};\t\r\n\t\tproperty = new String[]\t{\"poison\"};\r\n\t\tnewItem = new Item();\r\n\t\tnewItem.setNewItem(200101,\"potion_poison\", type, function, \"merchant1\", property, 1, false);\r\n\t\tnewChar.addOrUpdateItem(newItem);\r\n\t\t\r\n\t\ttype =\t \tnew String[]\t{\"supply\"};\r\n\t\tfunction = new String[]\t{\"consumable\"};\t\r\n\t\tproperty = new String[]\t{\"healing\"};\r\n\t\tnewItem = new Item();\r\n\t\tnewItem.setNewItem(200201,\"potion_heal\", type, function, \"merchant1\", property, 1, false);\r\n\t\tnewChar.addOrUpdateItem(newItem);\r\n\t\t\r\n\t\ttype =\t \tnew String[]\t{\"supply\"};\r\n\t\tfunction = new String[]\t{\"consumable\"};\t\r\n\t\tproperty = new String[]\t{\"cure_poison\"};\r\n\t\tnewItem = new Item();\r\n\t\tnewItem.setNewItem(200301,\"antidote\", type, function, \"merchant1\", property, 1, false);\t\r\n\t\tnewChar.addOrUpdateItem(newItem);\r\n\t\t\r\n\t\t\r\n\t\t//add merchant to List\r\n\t\tlistCharacter.add(newChar);\r\n\t\t\r\n\t\t\r\n\t\t\r\n\t\t//Relation\r\n\t\tRelationship newRelation = new Relationship();\r\n\t\tnewRelation.setRelationship(\"merchant1\", \"soldier1\", \"friend\");\r\n\t\tlistRelationship.add(newRelation);\r\n\t\t\r\n\t\t//\r\n\t\r\n\t}", "@Override\n\tpublic void onEnterNewTile(EntityTroop entity, World world, Player owner) {\n\t\tsuper.onEnterNewTile(entity, world, owner);\n\t\towner.addCredits(credidsPerTile);\n\t}", "public boolean add(Account entity) {\n\t\treturn false;\n\t}", "Builder addMainEntity(String value);", "@Override\r\n\tpublic void save(PartyType entity) {\n\t\t\r\n\t}", "@Override\r\n protected SimpleBody addObject(Entity e) {\n PhysicsShape ps = e.get(PhysicsShape.class);\r\n PhysicsMassType pmt = e.get(PhysicsMassType.class);\r\n Position pos = e.get(Position.class);\r\n\r\n // Right now only works for CoG-centered shapes \r\n SimpleBody newBody = createStatic(e.getId(), pmt.getTypeName(ed), ps.getFixture(), true);\r\n\r\n newBody.setPosition(pos); //ES position: Not used anymore, since Dyn4j controls movement\r\n\r\n newBody.getTransform().setTranslation(pos.getLocation().x, pos.getLocation().y); //Dyn4j position\r\n newBody.getTransform().setRotation(pos.getRotation());\r\n\r\n newBody.setUserData(e.getId());\r\n\r\n newBody.setLinearDamping(0.3);\r\n\r\n return newBody;\r\n }", "void addPiece(Piece piece);", "public void addEntity(ResourceLocation entity) throws BuildException {\n addDTD(entity);\n }", "public interface Entity {\n\n /**\n * Returns the position of this entity in the simulation system.\n *\n * @return the position of this entity.\n * @see Pasture\n * @see Point\n */\n public Point getPosition();\n\n /**\n * Sets the position of this entity.\n *\n * @param newPosition the new position of this entity.\n * @see Point\n */\n public void setPosition(Point newPosition);\n\n /**\n * Performs the relevant actions of this entity, depending on what kind of\n * entity it is.\n */\n public void tick();\n\n /**\n * Returns the icon of this entity, to be displayed by the pasture gui.\n *\n * @see PastureGUI\n */\n public ImageIcon getImage();\n\n /**\n * Returns the name of the entity\n */\n public String type();\n}", "@Override\n\tpublic Post add(Post entity) {\n\t\treturn null;\n\t}", "public void registerStaticEntity(StaticEntity entity) {\n\t\tputInVisLayerList(entity);\n\t}", "@Override\r\n protected SimpleBody addObject(Entity e) {\n PhysicsShape ps = e.get(PhysicsShape.class);\r\n PhysicsMassType pmt = e.get(PhysicsMassType.class);\r\n Position pos = e.get(Position.class);\r\n\r\n // Right now only works for CoG-centered shapes \r\n SimpleBody newBody = createBody(e.getId(), pmt.getTypeName(ed), ps.getFixture(), true);\r\n\r\n newBody.setPosition(pos); //ES position: Not used anymore, since Dyn4j controls movement\r\n\r\n newBody.getTransform().setTranslation(pos.getLocation().x, pos.getLocation().y); //Dyn4j position\r\n newBody.getTransform().setRotation(pos.getRotation());\r\n\r\n newBody.setUserData(e.getId());\r\n\r\n newBody.setLinearDamping(0.3);\r\n\r\n return newBody;\r\n }", "public void addProduct(Product item){\n inventory.add(item);\n }" ]
[ "0.73113304", "0.7177397", "0.7111769", "0.69543624", "0.6927326", "0.6863991", "0.684597", "0.6824073", "0.6818374", "0.6757948", "0.6707371", "0.6698065", "0.66913927", "0.6680635", "0.6646311", "0.6641719", "0.659184", "0.65660256", "0.65527666", "0.6514255", "0.6505742", "0.6439984", "0.64200145", "0.6417006", "0.6398413", "0.638261", "0.6262455", "0.6251206", "0.6197381", "0.61913663", "0.61882347", "0.6175767", "0.61418813", "0.6056487", "0.60390675", "0.60334134", "0.6012817", "0.6004968", "0.59474725", "0.59440047", "0.59000933", "0.58858514", "0.58712435", "0.58563185", "0.58454126", "0.58439857", "0.5833766", "0.58198506", "0.58097434", "0.58051914", "0.58043534", "0.58036506", "0.5797323", "0.57573754", "0.57508206", "0.5748751", "0.57374865", "0.57110965", "0.5709451", "0.5709208", "0.5696846", "0.56935", "0.5678415", "0.56654316", "0.5652416", "0.5643792", "0.5638299", "0.5637077", "0.5636387", "0.56325746", "0.56264853", "0.56199694", "0.5617777", "0.56174034", "0.55989265", "0.5584453", "0.5568763", "0.55666214", "0.5563602", "0.55592227", "0.5537345", "0.5531408", "0.5530037", "0.55284166", "0.55153567", "0.55094546", "0.5497852", "0.54976696", "0.5496479", "0.5492829", "0.549001", "0.54857445", "0.5484075", "0.5478477", "0.54775655", "0.54687166", "0.54683876", "0.54672605", "0.5462672", "0.54588753", "0.5457705" ]
0.0
-1
Draw the entity with the graphics, the image and the coordinates
@Override public void draw(Graphics g) { this.canvas.drawImage(g, this.image.getImage(), this.position.x, this.position.y); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void draw(){\n StdDraw.picture(this.xCoordinate,this.yCoordinate,this.img);\n }", "public void draw() {\t\t\n\t\ttexture.draw(x, y);\n\t\tstructure.getTexture().draw(x,y);\n\t}", "public void draw(){\n\t\tStdDraw.picture(this.xxPos,this.yyPos,\"images/\"+this.imgFileName);\n\t}", "public void render() { image.drawFromTopLeft(getX(), getY()); }", "public void draw(){\n\t\tString filename = \"images/\" + this.imgFileName;\n\t\tStdDraw.picture(this.xxPos, this.yyPos, filename);\n\t}", "public void draw(){\n\t\t/* Stamps a copy of the planet at the position. the file of the planet image is under folder of \"images\".\n\t\t * a mistake easily to be ignored here..*/\n\t\tString imageToDraw = \"images/\" + imgFileName;\n\t\tStdDraw.picture(xxPos, yyPos, imageToDraw);\n\n\t}", "private void draw() {\n Graphics2D g2 = (Graphics2D) image.getGraphics();\n\n g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n g2.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB);\n\n AffineTransform transform = AffineTransform.getTranslateInstance(0, height);\n transform.concatenate(AffineTransform.getScaleInstance(1, -1));\n g2.setTransform(transform);\n\n int width = this.width;\n int height = this.height;\n if (scale != 1) {\n g2.scale(scale, scale);\n width = (int) Math.round(width / scale);\n height = (int) Math.round(height / scale);\n }\n AbstractGraphics g = new GraphicsSWT(g2);\n\n g.setScale(scale);\n if (background != null) {\n g.drawImage(background, 0, 0, width, height);\n }\n\n synchronized (WFEventsLoader.GLOBAL_LOCK) {\n for (Widget widget : widgets) {\n if (widget != null) widget.paint(g, width, height);\n }\n }\n // draw semi-transparent pixel in top left corner to workaround famous OpenGL feature\n g.drawRect(0, 0, 1, 1, Color.WHITE, .5, PlateStyle.RectangleType.SOLID);\n\n g2.dispose();\n }", "public void draw(){\n\t\tif(selected){\n\t\t\timg.draw(xpos,ypos,scale,Color.blue);\n\t\t}else{\n\t\t\timg.draw(xpos, ypos, scale);\n\t\t}\n\t}", "void draw() {\n\t\t// display debug information\n\t\t// if (debugMode)\n\t\t// displayDebugInformation();\n\n\t\tupdate();\n\t\trender(); // display freetransform points, lines and colorings\n\n\t\t// display opposite objects\n\t\t// displayOppositeObject();\n\t}", "public void draw() {\n \n // TODO\n }", "public void draw() {\r\n\t\tif (active_)\r\n\t\t\tGlobals.getInstance().getCamera().drawImageOnHud(posx_, posy_, currentImage());\r\n\t}", "public void drawImage(float x, float y, float width, float height);", "private void drawEntity(Entity ent) {\n\t\tSprite entSprite = getSprite(ent.getName());\n\t\t\n\t\tglBindTexture(GL_TEXTURE_2D, entSprite.getTexture().getTextureID());\n\t\t\n\t\t// draw entity\n\t\tglBegin(GL_QUADS);\n\t\t{\n\t\t\tglTexCoord2f(0, 0);\n\t\t\tglVertex2d(ent.getX(), ent.getY());\n\t\t\tglTexCoord2f(1, 0);\n\t\t\tglVertex2d(ent.getX() + entSprite.getWidth(), ent.getY());\n\t\t\tglTexCoord2f(1, 1);\n\t\t\tglVertex2d(ent.getX() + entSprite.getWidth(), ent.getY() + entSprite.getHeight());\n\t\t\tglTexCoord2f(0, 1);\n\t\t\tglVertex2d(ent.getX(), ent.getY() + entSprite.getHeight());\n\t\t}\n\t\tglEnd();\n\t\t\n\t\tglBindTexture(GL_TEXTURE_2D, 0);\n\t}", "public void Draw() {\n \tapp.fill(this.r,this.g,this.b);\n\t\tapp.ellipse(posX, posY, 80, 80);\n\n\t}", "private void render(){\n planeImage.draw(currPos.x,currPos.y, drawOps);\n }", "public void draw(){\n\t\tcomponent.draw();\r\n\t}", "abstract void draw(Graphics g, int xoff, int yoff,\n int x, int y, int width, int height);", "public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }", "public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }", "public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }", "public void draw() {\n /* DO NOT MODIFY */\n StdDraw.point(x, y);\n }", "public void draw() {\r\n /* DO NOT MODIFY */\r\n StdDraw.point(x, y);\r\n }", "private void drawImage(){\n Integer resourceId = imageId.get(this.name);\n if (resourceId != null) {\n drawAbstract(resourceId);\n } else {\n drawNone();\n }\n }", "protected abstract void draw();", "public void render () {\n image (img, xC, yC, xLength * getPixelSize(), yLength * getPixelSize());\n }", "public void render () {\n\t\tcam.update();\n\t\tbatch.setProjectionMatrix(cam.combined);\n\t\trenderBackground();\n\t\t/*shapeRender.setProjectionMatrix(cam.combined);\n\t\tshapeRender.begin(ShapeRenderer.ShapeType.Line);\n\t\tshapeRender.ellipse(world.trout.hitBox.x, world.trout.hitBox.y, world.trout.hitBox.width, world.trout.hitBox.height);\n\t\tshapeRender.circle(world.hook.circleBounds.x, world.hook.circleBounds.y, world.hook.circleBounds.radius);\n\t\tshapeRender.point(world.trout.position.x, world.trout.position.y, 0f);*/\n\t\trenderObjects();\n\t\t\n\t}", "private void drawToScreen() {\n \n Graphics g2 = getGraphics();\n /*g2.drawImage(image, 0, 0, \n WIDTH * SCALE, HEIGHT * SCALE, \n 0, 0, WIDTH, HEIGHT, \n this);*/\n g2.drawImage(image,\n (int)gsm.getAttribute(\"CAMERA_X1\"),\n (int)gsm.getAttribute(\"CAMERA_Y1\"),\n (int)gsm.getAttribute(\"CAMERA_X1\") + WIDTH*SCALE,\n (int)gsm.getAttribute(\"CAMERA_Y1\") + HEIGHT*SCALE,\n (int)gsm.getAttribute(\"WORLD_X1\"),\n (int)gsm.getAttribute(\"WORLD_Y1\"),\n (int)gsm.getAttribute(\"WORLD_X1\") + WIDTH,\n (int)gsm.getAttribute(\"WORLD_Y1\") + HEIGHT,\n this);\n\t\t/*g2.drawImage(image, 0, 0,\n\t\t\t\tWIDTH * SCALE, HEIGHT * SCALE,\n\t\t\t\tnull);*/\n\t\tg2.dispose();}", "private void draw() {\n gsm.draw(g);\n }", "@Override\n public void draw() {\n /** preparacion de la ventana **/\n background(255);\n lights();\n directionalLight(40, 90, 100, 1, 40, 40);\n\n translate(origin.x,origin.y);\n scale(zoom);\n\n\n /** entrada del usuario **/\n userInput();\n /** ejes X Y Z **/\n drawAxes();\n /** aplicar ik **/\n writePos();\n\n /** escala de los objetos**/\n scale(-1.2f);\n\n /** esfera que muestra la posicion en coord X Y Z\n *\n * X -> coord[0]\n * Y -> coord[1]\n * Z -> coord[2]\n *\n * **/\n pushMatrix();\n noStroke();\n fill(250, 100, 1);\n translate(-coord_cartesian[1] ,-coord_cartesian[2] -11,-coord_cartesian[0] );\n sphere(2);\n popMatrix();\n\n\n /**\n * Dibuja el brazo\n */\n pushMatrix();\n arm.drawArm();\n popMatrix();\n }", "public void draw() {\n \n }", "public void Draw(Graphics2D g2d)\n {\n this.Update();\n \n for (int i = 0; i < xPositions.length; i++)\n {\n g2d.drawImage(image, (int)xPositions[i], yPosition, null);\n }\n }", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void draw() {\n\t\t\r\n\t}", "@Override\n\tpublic void draw(Graphics g) {\n\n\t\tg.drawImage(MyImages.img_me, x, y, null);\n\t\t// g.drawRect(this.pos.x, this.pos.y, this.pos.width, this.pos.height);\n\t\t// this.pos.width+ rect_space_x, this.pos.height + rect_space_y);\n\n\t}", "private void draw() {\n this.player.getMap().DrawBackground(this.cameraSystem);\n\n //Dibujamos al jugador\n player.draw();\n\n for (Character character : this.characters) {\n if (character.getMap() == this.player.getMap()) {\n character.draw();\n }\n }\n\n //Dibujamos la parte \"superior\"\n this.player.getMap().DrawForeground();\n\n //Sistema de notificaciones\n this.notificationsSystem.draw();\n\n this.player.getInventorySystem().draw();\n\n //Hacemos que la cámara se actualice\n cameraSystem.draw();\n }", "@Override\r\n\tpublic void draw() {\n\t\tPoint p = this.getP();\r\n\t\tint start_point = p.getX();\r\n\t\tint end_point = p.getY();\r\n\t\t\r\n\t\tint width = this.getWidth();\r\n\t\tint height = this.getHeight();\r\n\t\t\r\n\t\tSystem.out.println(\"�l�p�`��`�� �_(\" + start_point +\",\"+ end_point + \")����Ƃ��āA��\"+ width +\"����\"+ height +\"�̎l�p�`\");\r\n\t}", "public abstract void draw( Graphics2D gtx );", "public void draw();", "public void draw();", "public void draw();", "@Override\n public void draw(Graphics2D g2d) {\n g2d.drawImage(getBulletImg(), this.getX(), this.getY(), null);\n \n }", "@Override\r\n public void Draw(Graphics g)\r\n {\r\n g.drawImage(image, (int)x, (int)y, width, height, null);\r\n\r\n\r\n ///doar pentru debug daca se doreste vizualizarea dreptunghiului de coliziune altfel se vor comenta urmatoarele doua linii\r\n //g.setColor(Color.blue);\r\n //g.fillRect((int)(x + bounds.x), (int)(y + bounds.y), bounds.width, bounds.height);\r\n }", "@Override\n public void render(Graphics g) {\n if (isVisible()) { \n g.drawImage(getImage(), (int)position.getX(), (int) position.getY(), width, height, null);\n }\n }", "@Override\r\n public void draw() {\n }", "public void draw() {\n }", "private void draw()\n {\n Canvas canvas = Canvas.getCanvas();\n canvas.draw(this, color, new Ellipse2D.Double(xPosition, yPosition, \n diameter, diameter));\n canvas.wait(10);\n }", "public void draw() {\r\n if(isVisible()) {\r\n Canvas canvas = Canvas.getCanvas();\r\n canvas.draw(this,getColor(),\r\n new Rectangle(\r\n (int)round(getXposition()),\r\n (int)round(getYposition()),\r\n (int)round(size),\r\n (int)round(size)));\r\n canvas.wait(10);\r\n }\r\n }", "public WorldImage draw() {\n return new OverlayImage(\n new Stem(this.leftLength, this.leftTheta, this.left).draw(),\n new Stem(this.rightLength, this.rightTheta, this.right).draw()); \n }", "@Override\n\tpublic void draw(GraphicsContext gc) {\n\t\tif(directY != 0){\n\t\t\tif(directX == 1){\n\t\t\t\thanzoBody = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),150, 0, 150, 150);\n\t\t\t\thanzoLeg = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),900, 150, 150, 150);\n\t\t\t}else if(directX == -1){\n\t\t\t\thanzoBody = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),450, 0, 150, 150);\n\t\t\t\thanzoLeg = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),1050, 150, 150, 150);\n\t\t\t}else{\n\t\t\t\tif(lastDirectX == 1){\n\t\t\t\t\thanzoBody = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),150, 0, 150, 150);\n\t\t\t\t\thanzoLeg = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),900, 150, 150, 150);\n\t\t\t\t}else{\n\t\t\t\t\thanzoBody = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),450, 0, 150, 150);\n\t\t\t\t\thanzoLeg = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),1050, 150, 150, 150);\n\t\t\t\t}\n\t\t\t}\n\t\t}else if(isMove){\n\t\t\tif(directX == 1){\n\t\t\t\thanzoBody = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),150, 0, 150, 150);\n\t\t\t\thanzoLeg = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),((Main.getInstance().getCurrentFrame() % 2) + 1) * 150, 150, 150, 150);\n\t\t\t}else if(directX == -1){\n\t\t\t\thanzoBody = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),450, 0, 150, 150);\n\t\t\t\thanzoLeg = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),((Main.getInstance().getCurrentFrame() % 2) + 4)* 150, 150, 150, 150);\n\t\t\t}\n\t\t}else{\n\t\t\tif(lastDirectX == 1){\n\t\t\t\thanzoBody = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),150, 0, 150, 150);\n\t\t\t\thanzoLeg = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),0, 150, 150, 150);\n\t\t\t}else{\n\t\t\t\thanzoBody = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),450, 0, 150, 150);\n\t\t\t\thanzoLeg = new WritableImage(ObjectHolder.getInstance().hanzoPic.getPixelReader(),450, 150, 150, 150);\n\t\t\t}\n\t\t\t\n\t\t}\n\t\tgc.drawImage(hanzoBody, x-55, y-50);\n\t\tgc.drawImage(hanzoLeg, x-55, y-50);\n\t\t//gc.drawImage(hanzoFX, x-55, y-50);\n\t\t\n\t}", "public abstract void draw(Graphics2D graphics);", "@Override\n\tpublic void draw() {\n\n\t}", "@Override\n\tpublic void draw() {\n\n\t}", "abstract void draw();", "abstract void draw();", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic void draw() {\n\t\t\n\t}", "@Override\n\tpublic void draw(Graphics2D g, int x, int y,int width,int height) {\n\n\t}", "public void drawImage(Graphics gameImage){\n AffineTransform currRotation = AffineTransform.getTranslateInstance(x, y);\n currRotation.rotate(Math.toRadians(angle),this.objectImg.getWidth() / 2.0, this.objectImg.getHeight() /2.0);\n Graphics2D currImage = (Graphics2D) gameImage;\n currImage.drawImage(this.objectImg, currRotation, null);\n\n if(drawHitBox){\n gameImage.setColor(Color.GREEN);\n gameImage.drawRect(x,y,this.objectImg.getWidth(),this.objectImg.getHeight());\n }\n }", "public void draw() {\n p.pushMatrix(); // save old visual style for other sprites\n p.translate(pos.x, pos.y); \n if (localpen) p.image(pen.get(0,0,p.width,p.height),p.width/2-pos.x, p.height/2-pos.y);\n if (visible) {\n // locked left-right rotation\n if (((direction%360<=270) & (direction%360>=90)) & rotationStyle==rotationStyle_leftRight) p.scale(-1.0f,1.0f);\n if (rotationStyle==rotationStyle_allAround) p.rotate(p.radians(-direction));\n if (ghostEffect > 0) {\n int calculatedAlpha = (int)p.map(ghostEffect,100,0,0,255);\n \n int[] alpha = new int[costumes.get(costumeNumber).width*costumes.get(costumeNumber).height];\n for (int i=0; i<alpha.length; i++) {\n // only fade non-zero pixels; 0 is full-transparency\n if (costumes.get(costumeNumber).pixels[i]!=0) alpha[i]=calculatedAlpha;\n }\n costumes.get(costumeNumber).mask(alpha);\n }\n p.image(costumes.get(costumeNumber), 0, 0, costumes.get(costumeNumber).width*(size/100),\n costumes.get(costumeNumber).height*(size/100));\n }\n p.popMatrix(); // restore default visual style\n }", "public abstract void draw();", "public abstract void draw();", "public abstract void draw();", "public void drawImage() {\n mTextureRender.drawFrame(mSurfaceTexture);\n }", "public void draw() {\r\n\t\tfor(int i=0; i<2; i++) {\r\n\t\t\trenderer[i].setView(camera[i]);\r\n\t\t\trenderer[i].render();\r\n\t\t}\r\n\t}", "@Override\n public void draw()\n {\n }", "private void render() {\n\t\ttheMap.draw(g);\n\t\ttheTrainer.draw(g);\n\t}", "public void draw(Graphics2D g) {\n \t switch(id){\n \t case NORMAL:\n \t g.drawImage(img,getX(),getY(),2*getWidth(),2*getHeight(),null);\n\t Graphics2D graphics = (Graphics2D)g.create();\n \t graphics.setColor(Color.red);\n \t graphics.fill3DRect(getX()+10,getY()-10,health,10,true);\n \t graphics.dispose();\n \t break;\n \t case BOSS:\n \t g.drawImage(img,getX(),getY(),getWidth(),getHeight(),null);\n\t Graphics2D graphics = (Graphics2D)g.create();\n \t graphics.setColor(Color.red);\n \t graphics.fill3DRect(getX()+10,getY()-10,health,10,true);\n \t graphics.dispose();\n \t\t break;\n \t }\n \t}", "public void draw()\n\t{\n\t\tgl.glBindTexture(GL10.GL_TEXTURE_2D, texture_id);\n\t\tdrawMesh(gl);\n\t}", "public WorldImage draw() {\n return new OverlayImage(\n this.tree.draw(),\n new LineImage(new Posn((int) this.deltaX(), (int) this.deltaY()), Color.RED)\n .movePinhole(-this.deltaX() / 2, -this.deltaY() / 2)).movePinhole(this.deltaX(),\n this.deltaY());\n }", "@Override\n\tpublic void draw() {\n\t}", "@Override\n public void draw() {\n }", "@Override\r\n\tpublic void render(Graphics g) {\n\t\tg.drawImage(image, (int) (x - handler.getGameCamera().getxOffset()), \r\n\t\t\t\t(int) (y - handler.getGameCamera().getyOffset()), width, height, null);\r\n\t}", "private void render() {\n if (drawingArea != null) {\n //get graphics of the image where coordinate and function will be drawn\n Graphics g = drawingArea.getGraphics();\n\n //draw the x-axis and y-axis\n g.drawLine(0, originY, width, originY);\n g.drawLine(originX, 0, originX, height);\n\n //print numbers on the x-axis and y-axis, based on the scale\n for (int i = 0; i < lengthX; i++) {\n g.drawString(Integer.toString(i), (int) (originX + (i * scaleX)), originY);\n g.drawString(Integer.toString(-1 * i), (int) (originX + (-i * scaleX)), originY);\n }\n for (int i = 0; i < lengthY; i++) {\n g.drawString(Integer.toString(-1 * i), originX, (int) (originY + (i * scaleY)));\n g.drawString(Integer.toString(i), originX, (int) (originY + (-i * scaleY)));\n }\n\n // draw the lines\n for (int i = 0; i < points1.size() - 1; i++) {\n g.setColor(Color.BLACK);\n g.drawLine((int) (originX + points1.get(i).x * scaleX), (int) (originY - points1.get(i).y * scaleY),\n (int) (originX + points1.get(i + 1).x * scaleX), (int) (originY - points1.get(i + 1).y * scaleY));\n g.setColor(Color.RED);\n g.drawLine((int) (originX + points2.get(i).x * scaleX), (int) (originY - points2.get(i).y * scaleY),\n (int) (originX + points2.get(i + 1).x * scaleX), (int) (originY - points2.get(i + 1).y * scaleY));\n }\n }\n }", "@Override\n\tpublic void draw(Canvas game) {\n\t\tGraphicsContext gc = game.getGraphicsContext2D();\n\t\tgc.drawImage(image, posX, Y_LAND - image.getHeight());\n\t\t\n\t}", "private void renderEntity(MapEntity entity) {\n\t\tdrawEntityTexture(entity);\n\t}", "public void draw() {\n\t\t\tfloat[] vertices = new float[mVertices.size()];\n\t\t\tfor (int i = 0; i < vertices.length; i++)\n\t\t\t\tvertices[i] = mVertices.get(i);\n\t\t\t\n\t\t\tfloat[] textureCoords = null;\n\t\t\tif (mTextureID != 0) {\n\t\t\t\ttextureCoords = new float[mTextureCoords.size()];\n\t\t\t\tfor (int i = 0; i < textureCoords.length; i++)\n\t\t\t\t\ttextureCoords[i] = mTextureCoords.get(i);\n\t\t\t}\n\t\t\t\n\t\t\tshort[] indices = new short[mIndices.size()];\n\t\t\tfor (int i = 0; i < indices.length; i++)\n\t\t\t\tindices[i] = mIndices.get(i);\n\t\t\t\n\t\t\t// Get OpenGL\n\t\t\tGL10 gl = GameGraphics2D.this.mGL;\n\t\t\t\n\t\t\t// Set render state\n\t\t\tgl.glDisable(GL10.GL_LIGHTING);\n\t\t\tgl.glEnable(GL10.GL_DEPTH_TEST);\n\t\t\tgl.glEnable(GL10.GL_BLEND);\n\n\t\t\tif (mBlendingMode == BLENDING_MODE.ALPHA)\n\t\t\t\tgl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);\n\t\t\telse if (mBlendingMode == BLENDING_MODE.ADDITIVE)\n\t\t\t\tgl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE);\n\t\t\t\n\t\t\tif (mTextureID != 0)\n\t\t\t\tgl.glEnable(GL10.GL_TEXTURE_2D);\n\t\t\telse\n\t\t\t\tgl.glDisable(GL10.GL_TEXTURE_2D);\n\t\t\t\n\t\t\t// Draw the batch of textured triangles\n\t\t\tgl.glColor4f(Color.red(mColour) / 255.0f,\n\t\t\t\t\t\t Color.green(mColour) / 255.0f,\n\t\t\t\t\t\t Color.blue(mColour) / 255.0f,\n\t\t\t\t\t\t Color.alpha(mColour) / 255.0f);\n\t\t\t\n\t\t\tif (mTextureID != 0) {\n\t\t\t\tgl.glBindTexture(GL10.GL_TEXTURE_2D, mTextureID);\n\t\t\t\tgl.glTexCoordPointer(2, GL10.GL_FLOAT, 0, GameGraphics.getFloatBuffer(textureCoords));\n\t\t\t}\n\t\t\t\n\t\t\tgl.glVertexPointer(3, GL10.GL_FLOAT, 0, GameGraphics.getFloatBuffer(vertices));\n\t\t\tgl.glDrawElements(GL10.GL_TRIANGLES, indices.length,\n\t\t\t\t\tGL10.GL_UNSIGNED_SHORT, GameGraphics.getShortBuffer(indices));\n\t\t}", "public void draw() {\n\n }", "public abstract void draw( );", "@Override public void draw(){\n // this take care of applying all styles (colors/stroke)\n super.draw();\n // draw our shape\n pg.ellipseMode(PGraphics.CORNER); // TODO: make configurable\n pg.ellipse(0,0,getSize().x,getSize().y);\n }", "public void draw(Graphics graphics);", "public void draw(){\n }", "@Override\r\n\tpublic void render(Graphics g) {\n\t\timg.setPosition(x - cam.getX(), y - cam.getY());\r\n\t\timg.render(g);\r\n\t}", "public void draw() {\n\t\tSystem.out.println(getMessageSource().getMessage(\"greeting2\", null, null));\r\n\r\n\t\tSystem.out.println(getMessageSource().getMessage(\"drawing.circle\", null, null));\r\n\t\tSystem.out.println(\"Center's Coordinates: (\" + getCenter().getX() + \", \" + getCenter().getY() + \")\");\r\n\t\tSystem.out.println(getMessageSource().getMessage(\"drawing.center\",\r\n\t\t\t\tnew Object[] { getCenter().getX(), getCenter().getY() }, \"Default point coordinates msg\", null));\r\n\t}", "public void draw() {\n //Grey background, which removes the tails of the moving elements\n background(0, 0, 0);\n //Running the update function in the environment class, updating the positions of stuff in environment\n //update function is a collection of the methods needing to be updated\n if(stateOfProgram == 0) { startTheProgram.update(); }\n if(stateOfProgram == 1) {\n theEnvironment.update();\n //update function is a collection of the methods needing to be updated\n //Running the update function in the Population class, updating the positions and states of the rabbits.\n entitiesOfRabbits.update();\n entitiesOfGrass.update();\n entitiesOfFoxes.update();\n\n entitiesOfRabbits.display();\n entitiesOfGrass.display();\n entitiesOfFoxes.display();\n openGraph.update();\n }\n }", "void draw(GraphicsContext context);", "public void render()\n\t{\n\t\tBufferStrategy bs = this.getBufferStrategy();\n\n\t\tif (bs == null)\n\t\t{\n\t\t\tcreateBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\n\t\tGraphics g = bs.getDrawGraphics();\n\t\t//////////////////////////////\n\n\t\tg.setColor(Color.DARK_GRAY);\n\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\t\tif (display != null && GeneticSimulator.updateRendering)\n\t\t{\n\t\t\tg.drawImage(display, 0, 0, getWidth(), getHeight(), this);\n\t\t}\n\n\t\tWorld world = GeneticSimulator.world();\n\n\t\tworld.draw((Graphics2D) g, view);\n\n\t\tg.setColor(Color.WHITE);\n\t\tg.drawString(String.format(\"view: [%2.1f, %2.1f, %2.1f, %2.1f, %2.2f]\", view.x, view.y, view.width, view.height, view.PxToWorldScale), (int) 10, (int) 15);\n\n\t\tg.drawString(String.format(\"world: [time: %2.2f pop: %d]\", world.getTime() / 100f, World.popCount), 10, 30);\n\n\t\tg.drawRect(view.pixelX, view.pixelY, view.pixelWidth, view.pixelHeight);\n//\t\tp.render(g);\n//\t\tc.render(g);\n\n\n\t\t//g.drawImage(player,100,100,this);\n\n\t\t//////////////////////////////\n\t\tg.dispose();\n\t\tbs.show();\n\t}", "public void draw(Graphics g) {\n sprite.draw(g, (int) x, (int) y);\n }", "public void draw() {\n\t\tp.pushStyle();\n\t\t{\n\t\t\tp.rectMode(PConstants.CORNER);\n\t\t\tp.fill(360, 0, 70, 180);\n\t\t\tp.rect(60f, 50f, p.width - 110f, p.height * 2f * 0.33f - 50f);\n\t\t\tp.rect(60f, p.height * 2f * 0.33f + 50f, p.width - 110f, p.height * 0.33f - 130f);\n\t\t}\n\t\tp.popStyle();\n\n\t\tlineChart.draw(40f, 40f, p.width - 80f, p.height * 2f * 0.33f - 30f);\n\t\tlineChart2.draw(40f, p.height * 2f * 0.33f + 45f, p.width - 80f, p.height * 0.33f - 110f);\n\t\t//p.line(x1, y1, x2, y2);\n\n\t}", "public void render()\n\t{\n\t\t// Get or create the BufferStrategy to plan rendering\n\t\tBufferStrategy bs = getBufferStrategy();\n\t\tif (bs == null)\n\t\t{\n\t\t\tcreateBufferStrategy(3);\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Get the graphics that can be drawn to\n\t\tg = bs.getDrawGraphics();\n\t\t\n\t\t// Set the Graphics2D\n\t\tg2d = (Graphics2D)g;\n\t\t\n\t\t// Create a black rectangle to fill the canvas as a base background\n\t\tg.setColor(Color.black);\n\t\tg.fillRect(0, 0, getWidth(), getHeight());\n\t\t\n\t\tif (screenLoaded)\n\t\t{\n\t\t\t// Draw the static background\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null)\n\t\t\t\tgame.getScreenHandler().getCurrentScreen().drawStaticBackground(g);\n\t\t\t\n\t\t\t// Translate the screen based on the Camera\n\t\t\tif (game.getCamera() != null && game.usesCamera())\n\t\t\t\tg2d.translate(game.getCamera().getxPos(), \n\t\t\t\t\t\t \t game.getCamera().getyPos());\n\t\t\t\n\t\t\t// Draw the background layer\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null)\n\t\t\t\tgame.getScreenHandler().getCurrentScreen().drawBackground(g);\n\t\t\t\n\t\t\t// Render all of the Tiles\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null && game.usesWorld())\n\t\t\t\tgame.getWorldHandler().renderTiles(g);\n\t\t\t\n\t\t\t// Render all of the GameObjects\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null && game.usesGameObjects())\n\t\t\t\tgame.getObjectHandler().renderGameObjects(g);\n\t\t\t\n\t\t\t// Draw the foreground layer\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null)\n\t\t\t\tgame.getScreenHandler().getCurrentScreen().drawForeground(g);\n\t\t\t\n\t\t\t// Draw the lighting\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null && game.usesLighting())\n\t\t\tg.drawImage(game.getLightHandler().getLightmap(), -1500, -3100, null);\n\t\t\t\n\t\t\t// Translate the screen based on the Camera\n\t\t\tif (game.getCamera() != null && game.usesCamera())\n\t\t\t\tg2d.translate(-game.getCamera().getxPos(), \n\t\t\t\t\t\t \t -game.getCamera().getyPos());\n\t\t\t\n\t\t\t// Draw the gui layer\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null)\n\t\t\t\tgame.getScreenHandler().getCurrentScreen().drawGui(g);\n\t\t\t\n\t\t\t// Draw the debug layer\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null\n\t\t\t\t&& game.getDebugScreen() != null\n\t\t\t\t&& game.isDebugShown())\n\t\t\t\tgame.getDebugScreen().showDebug(g);\n\t\t\t\n\t\t\t// Draw the loading \"curtain\" if the screen is still loading\n\t\t\tif (game.getScreenHandler().getCurrentScreen() != null &&\n\t\t\t\t!screenLoaded)\n\t\t\t{\n\t\t\t\tif (timeCount < game.getFps() / 4)\n\t\t\t\t{\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tif (loadingFont == null)\n\t\t\t\t\t\tg.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\t\telse\n\t\t\t\t\t\tg.setFont(loadingFont);\n\t\t\t\t\tg.drawString(\"Loading . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t\t}\n\t\t\t\telse if (timeCount < (game.getFps() / 4) * 2)\n\t\t\t\t{\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tif (loadingFont == null)\n\t\t\t\t\t\tg.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\t\telse\n\t\t\t\t\t\tg.setFont(loadingFont);\n\t\t\t\t\tg.drawString(\"Loading . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t\t}\n\t\t\t\telse if (timeCount < (game.getFps() / 4) * 3)\n\t\t\t\t{\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tif (loadingFont == null)\n\t\t\t\t\t\tg.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\t\telse\n\t\t\t\t\t\tg.setFont(loadingFont);\n\t\t\t\t\tg.drawString(\"Loading . . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tg.setColor(Color.black);\n\t\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\t\tg.setColor(Color.white);\n\t\t\t\t\tif (loadingFont == null)\n\t\t\t\t\t\tg.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\t\telse\n\t\t\t\t\t\tg.setFont(loadingFont);\n\t\t\t\t\tg.drawString(\"Loading . . . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// Dispose of all graphics\n\t\t\tg.dispose();\n\t\t\t// Show all graphics prepared on the BufferStrategy\n\t\t\tbs.show();\n\t\t}\n\t\telse\n\t\t{\n\t\t\tGraphics2D g2 = (Graphics2D)g;\n\t\t\tg2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);\n\t\t\t\n\t\t\tif (timeCount < game.getFps() / 4)\n\t\t\t{\n\t\t\t\tg.setColor(Color.black);\n\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\tg2.setColor(Color.white);\n\t\t\t\tif (loadingFont == null)\n\t\t\t\t\tg2.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\telse\n\t\t\t\t\tg2.setFont(loadingFont);\n\t\t\t\tg2.drawString(\"Loading . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t}\n\t\t\telse if (timeCount < (game.getFps() / 4) * 2)\n\t\t\t{\n\t\t\t\tg.setColor(Color.black);\n\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\tg2.setColor(Color.white);\n\t\t\t\tif (loadingFont == null)\n\t\t\t\t\tg2.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\telse\n\t\t\t\t\tg2.setFont(loadingFont);\n\t\t\t\tg2.drawString(\"Loading . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t}\n\t\t\telse if (timeCount < (game.getFps() / 4) * 3)\n\t\t\t{\n\t\t\t\tg.setColor(Color.black);\n\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\tg2.setColor(Color.white);\n\t\t\t\tif (loadingFont == null)\n\t\t\t\t\tg2.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\telse\n\t\t\t\t\tg2.setFont(loadingFont);\n\t\t\t\tg2.drawString(\"Loading . . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tg.setColor(Color.black);\n\t\t\t\tg.fillRect(0, 0, game.getWindow().getWidth(), \n\t\t\t\t\t\tgame.getWindow().getHeight());\n\t\t\t\tg2.setColor(Color.white);\n\t\t\t\tif (loadingFont == null)\n\t\t\t\t\tg2.setFont(new Font(\"Verdana\", Font.PLAIN, 32));\n\t\t\t\telse\n\t\t\t\t\tg2.setFont(loadingFont);\n\t\t\t\tg2.drawString(\"Loading . . . \", (game.getWindow().getWidth() / 2) - 80, \n\t\t\t\t\t\t(game.getWindow().getHeight() / 2) - 80);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Dispose of all graphics\n\t\tg.dispose();\n\t\t// Show all graphics prepared on the BufferStrategy\n\t\tbs.show();\n\t}", "public abstract void render(Graphics2D graphics);", "public void draw(Matrix4 projectionMatrix){\n batch.setProjectionMatrix(projectionMatrix);\n batch.begin();\n boatSprite.setPosition(boatPosition.getPosX(), boatPosition.getPosY());\n boatSprite.draw(batch);\n batch.end();\n }", "abstract public void draw(Graphics2D g);", "private void renderTex() {\n final float\n w = xdim(),\n h = ydim(),\n x = xpos(),\n y = ypos() ;\n GL11.glBegin(GL11.GL_QUADS) ;\n GL11.glTexCoord2f(0, 0) ;\n GL11.glVertex2f(x, y + (h / 2)) ;\n GL11.glTexCoord2f(0, 1) ;\n GL11.glVertex2f(x + (w / 2), y + h) ;\n GL11.glTexCoord2f(1, 1) ;\n GL11.glVertex2f(x + w, y + (h / 2)) ;\n GL11.glTexCoord2f(1, 0) ;\n GL11.glVertex2f(x + (w / 2), y) ;\n GL11.glEnd() ;\n }", "@Override\n public void draw(Graphics2D g) {\n\n AffineTransform at = g.getTransform();\n g.translate(position.x, position.y);\n g.drawImage(texture, this.spriteAffine, null);\n\n g.setTransform(at);\n\n }", "private void render() {\n bs = display.getCanvas().getBufferStrategy();\n /* if it is null, we define one with 3 buffers to display images of\n the game, if not null, then we display every image of the game but\n after clearing the Rectanlge, getting the graphic object from the \n buffer strategy element. \n show the graphic and dispose it to the trash system\n */\n if (bs == null) {\n display.getCanvas().createBufferStrategy(3);\n } else {\n g = bs.getDrawGraphics();\n g.drawImage(Assets.background, 0, 0, width, height, null);\n g.setColor(Color.white);\n g.drawLine(0, 500, 595, 500);\n player.render(g);\n for (int i = 0; i < aliens.size(); i++) {\n Alien al = aliens.get(i);\n al.render(g);\n }\n if (shotVisible) {\n shot.render(g);\n }\n\n if(gameOver==false)\n {\n gameOver();\n }\n for(Alien alien: aliens){\n Bomb b = alien.getBomb();\n b.render(g);\n }\n g.setColor(Color.red);\n Font small = new Font(\"Helvetica\", Font.BOLD, 20);\n g.setFont(small);\n g.drawString(\"G - Guardar\", 10, 50);\n g.drawString(\"C - Cargar\", 10, 70);\n g.drawString(\"P - Pausa\", 10, 90);\n\n if(keyManager.pause)\n {\n g.drawString(\"PAUSA\", 250, 300);\n }\n \n bs.show();\n g.dispose();\n }\n\n }", "private void render() {\n\n // Clear the whole screen\n gc.clearRect(0, 0, canvas.getWidth(), canvas.getHeight());\n\n // Draw the background image\n gc.drawImage(curMap.getMap(), 0,0, canvas.getWidth(), canvas.getHeight());\n\n // Draw Paths\n for(DrawPath p : pathMap.values()) {\n p.draw(gc);\n }\n\n // Draw all of the lines and edges\n\n // Lines\n for(Line l : lineMap.values()) {\n l.draw(gc);\n }\n\n // Points\n for(Point p : pointMap.values()) {\n p.draw(gc);\n }\n\n // Images\n for(Img i : imgMap.values()) {\n i.draw(gc);\n }\n\n // Text\n for(Text t : textMap.values()) {\n t.draw(gc);\n }\n }", "public Shapes draw ( );", "@Override\r\n\tpublic void render(Graphics g) {\r\n\t\tg.drawImage(objectsType.texture, (int) (x - handler.getGameCamera().getxOffset()),\r\n\t\t\t\t(int) (y - handler.getGameCamera().getyOffset()), width, height);\r\n\r\n\t\tif (DEBUGMODE) {\r\n\t\t\tg.setColor(Color.WHITE);\r\n\t\t\tg.drawRect((int) (x + bounds.x - handler.getGameCamera().getxOffset()),\r\n\t\t\t\t\t(int) (y + bounds.y - handler.getGameCamera().getyOffset()), bounds.width, bounds.height);\r\n\t\t}\r\n\r\n\t}", "@Override\n public void draw(Graphics graphics){\n graphics.fillRect(referencePoint.getX() + width / 3, referencePoint.getY() + height / 3, width / 3, height / 3);\n }", "void draw(IViewShapes shape);" ]
[ "0.7716353", "0.75920004", "0.7414604", "0.7365129", "0.730389", "0.7148276", "0.69811124", "0.6974471", "0.6962596", "0.6952391", "0.68866897", "0.6871396", "0.6821766", "0.6770788", "0.67681456", "0.67422307", "0.67364633", "0.67088336", "0.67088336", "0.67088336", "0.67088336", "0.66764724", "0.6675752", "0.6674034", "0.66660374", "0.66506314", "0.6649581", "0.66394323", "0.6635546", "0.6630637", "0.6604583", "0.65939415", "0.65939415", "0.65562946", "0.6553683", "0.65489906", "0.6548107", "0.65464425", "0.65464425", "0.65464425", "0.65443903", "0.65404725", "0.6522745", "0.65075606", "0.6498936", "0.6497944", "0.64934963", "0.64916724", "0.6481714", "0.64815915", "0.6474257", "0.6474257", "0.6463729", "0.6463729", "0.6447825", "0.6447825", "0.643186", "0.6424473", "0.64234", "0.6421979", "0.6421979", "0.6421979", "0.6421646", "0.64147455", "0.641469", "0.6412565", "0.6410928", "0.64043564", "0.64027005", "0.6396549", "0.6384373", "0.637884", "0.6378423", "0.637839", "0.6367834", "0.6367771", "0.63570297", "0.63564867", "0.63524383", "0.63518864", "0.6350771", "0.6345839", "0.634552", "0.63431007", "0.63329756", "0.6325148", "0.6323032", "0.63185555", "0.6317779", "0.6305058", "0.6303041", "0.6301819", "0.62929386", "0.62906075", "0.6287634", "0.6283625", "0.6278374", "0.6276552", "0.62732923", "0.62633306" ]
0.7117642
6
Give the bounding box of the entity, it's a rectangle
@Override public Rectangle getBoundingBox() { Rectangle rectangle = new Rectangle(this.image.getWidth(), this.image.getWidth()); rectangle.setLocation(this.position); return rectangle; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Rectangle getBoundingBox(Rectangle rect);", "public Rectangle getBoundingBox() {\n return new Rectangle(this);\r\n }", "public Rectangle getBoundingBox() {\n\t\treturn getBounds();\n\t}", "@Override\n\tpublic BoundaryRectangle getBoundingBox() {\n\t\treturn new BoundaryRectangle(0, 0, drawView.getWidth(), drawView.getHeight());\n\t}", "@Override\r\n\tpublic Rectangle getBound() {\n\t\treturn new Rectangle((int)x, (int)y, (int)width, (int)height);\r\n\t}", "public static Box getBoundingBox(Entity entity)\n\t{\n\t\treturn (new REntity(entity)).getBox().getBox();\n\t}", "Rectangle getBounds();", "Rectangle getCollisionBox();", "public CCAABoundingRectangle boundingRect(){\n\t\treturn _myBoundingRectangle;\n\t}", "@Override\n \tpublic Rectangle2D GetBoundingBox() {\n\t\treturn null;\n \t}", "public Rectangle getBounds();", "public Rectangle getBounds();", "public Rectangle getBoundingBox() {\n return location;\n }", "public GJBox2D boundingBox() {\n\t\tdouble xmin = Double.MAX_VALUE;\n\t\tdouble ymin = Double.MAX_VALUE;\n\t\tdouble xmax = Double.MIN_VALUE;\n\t\tdouble ymax = Double.MIN_VALUE;\n\n\t\t// coordinates of current point\n\t\tdouble x, y;\n\t\t\n\t\t// Iterate on each control point of each segment\n\t\tfor (Segment seg : this.segments) {\n\t\t\tfor (GJPoint2D p : seg.controlPoints()) {\n\t\t\t\t// get current coordinates\n\t\t\t\tx = p.x();\n\t\t\t\ty = p.y();\n\t\t\t\t\n\t\t\t\t// update bounds\n\t\t\t\txmin = Math.min(xmin, x);\n\t\t\t\tymin = Math.min(ymin, y);\n\t\t\t\txmax = Math.max(xmax, x);\n\t\t\t\tymax = Math.max(ymax, y);\n\t\t\t}\n\t\t}\n\t\t\n\t\t// createFromCollection a new GJBox2D with the bounds\n\t\treturn new GJBox2D(xmin, xmax, ymin, ymax);\n\t}", "@Override\n\tpublic MyRectangle getMyBoundingBox() {\n\t\t\n\t\treturn this;\n\t}", "public Rectangle getBound(){\n \tint x = (int)location.getX();\n \tint y = (int)location.getY();\n \t\n \tif(isExploded == false)\n \t\treturn new Rectangle(x, y, image.getWidth(null), image.getHeight(null));\n \telse\n \t\treturn new Rectangle(x,y, 1,1);\n }", "public Rectangle getBounds() {\n\treturn new Rectangle((int)x,(int)y,32,32);\n\t}", "public abstract Rectangle getBounds();", "public abstract Rectangle getBounds();", "public abstract Rectangle getBounds();", "public Rectangle getBounds()\n {\n return new Rectangle ((int)x,(int)y,32,32);\n }", "Rectangle getCollisionRectangle();", "Rectangle getCollisionRectangle();", "public LatLongRectangle getBoundingRectangle() {\n return boundingRectangle;\n }", "public Rectangle getBounds() {\n\t\tRectangle Box = new Rectangle(x, y, 48, 48);\n\t\treturn Box;\n\t}", "@Override\n\tpublic Rectangle getBound() {\n\t\trectBound.setX(posX+20);\n\t\trectBound.setY(Y_LAND - image.getHeight() +10);\n\t\trectBound.setWidth(image.getWidth()-10);\n\t\trectBound.setHeight(image.getHeight());\n\t\treturn rectBound;\n\t}", "public String getRectangleBounds() {\n checkAvailable();\n return impl.getRectangle();\n }", "@Override\n public Rectangle getBounds() {\n return new Rectangle(x,y,64,64);\n }", "public Rectangle getBounds() {\r\n return new Rectangle(x, y, 55, 51);\r\n }", "public Shape getBgetBoundingBox() {\r\n\t\t\r\n\t\tEllipse2D elilipse = new Ellipse2D.Double(0, 0, imageWidth, imageHeight);\r\n\t\tAffineTransform at = new AffineTransform(); \r\n\t\tat.translate(locationX, locationY);\r\n\t\tat.rotate(Math.toRadians(angle*sizeAngles));\r\n\t\t at.scale(0.5, 0.5);\r\n\t\tat.translate(-imageWidth/2, -imageHeight/2);\r\n\t\t\r\n\t\tShape rotatedRect = at.createTransformedShape(elilipse);\r\n\t\treturn rotatedRect;\r\n\t}", "public Rectangle getBounds(){\r\n return new Rectangle(x, y, w, w);\r\n }", "public GeographicBoundingBox getBoundingBox()\r\n {\r\n return myBoundingBox;\r\n }", "public abstract Rectangle getSnapshotBounds();", "protected Rectangle determineBounds() {\n return getNetTransform().createTransformedShape( _bounds ).getBounds();\n }", "public java.awt.Rectangle getBounds(){\r\n return new java.awt.Rectangle((int)Math.round(x), (int)Math.round(y), (int)Math.round(getWidth()), (int)Math.round(getHeight()));\r\n }", "public Rectangle getBounds() {\n return new Rectangle(x, y, 32, 32);\n }", "public Rect getBound() {\n return new Rect((int) (x - radius), (int) (y - radius), (int) (x + radius), (int) (y + radius));\n }", "public abstract Rectangle getSnapshotSquareBounds();", "Rectangle getBounds() {\n return new Rectangle(getLocation(), getSize());\n }", "public RMRect getBoundsInside() { return new RMRect(0, 0, getWidth(), getHeight()); }", "public Rectangle getBounds() {\n\t\treturn new Rectangle((int) xPos, (int) yPos, (int) width, (int) height);\n\t}", "public Rectangle bounds()\n\t{\n\t\treturn (new Rectangle(x, y, 10, 10));\n\t}", "public BoundingBox getBoundingBox ( ) {\n\t\t// TODO: backwards compatibility required\n\t\treturn invokeSafe ( \"getBoundingBox\" );\n\t}", "public RMRect getBounds() { return new RMRect(getX(), getY(), getWidth(), getHeight()); }", "public BoundingBox()\n\t{\n\t\tcenter = new Vector2(0.0, 0.0);\n\t\twidth = 1.0;\n\t\theight = 1.0;\n\t}", "public Rectangle getBounds() {\r\n return bounds;\r\n }", "public Rectangle getBounds()\r\n\t{\r\n\t\treturn new Rectangle(x, y, w, h);\r\n\t}", "public RectF getBounds()\n {\n return bounds;\n }", "RectangleLatLng getBounds();", "public Rect getBBox() throws PDFNetException {\n/* 857 */ return new Rect(GetBBox(this.a));\n/* */ }", "public RMRect bounds() { return new RMRect(x(), y(), width(), height()); }", "public Rectangle getRectangle();", "@Override\n\tpublic Rect getHitbox() \n\t{\n\t\treturn _bounds;\n\t}", "public Rectangle getBounds() {\n return new Rectangle((int) getX() - 20, (int) getY() - 20, 40, 40);\n }", "public Rectangle getBounds() {\n return new Rectangle(x, y, DIAMETER, DIAMETER); // returns a rectangle with its dimensions\r\n }", "public sRectangle getSRectangleBound()\n {\n return form.getSRectangleBound();\n }", "@Override\n public STRegion getBoundingBox() {\n\n SQLiteDatabase db = this.getReadableDatabase();\n\n String query = \"SELECT minX FROM \" + this.table_identifier + \" ORDER BY minX ASC LIMIT 1;\";\n float minX = getRowValueHelper(db, query, 0);\n query = \"SELECT minY FROM \" + this.table_identifier + \" ORDER BY minY ASC Limit 1;\";\n float minY = getRowValueHelper(db, query, 0);\n query = \"SELECT minT FROM \" + this.table_identifier + \" ORDER BY minT ASC Limit 1;\";\n float minT = getRowValueHelper(db, query, 0);\n query = \"SELECT maxX FROM \" + this.table_identifier + \" ORDER BY maxX DESC Limit 1;\";\n float maxX = getRowValueHelper(db, query, 0);\n query = \"SELECT maxY FROM \" + this.table_identifier + \" ORDER BY maxY DESC Limit 1;\";\n float maxY = getRowValueHelper(db, query, 0);\n query = \"SELECT maxT FROM \" + this.table_identifier + \" ORDER BY maxT DESC Limit 1;\";\n float maxT = getRowValueHelper(db, query, 0);\n\n return new STRegion(new STPoint(minX, minY, minT), new STPoint(maxX, maxY, maxT));\n }", "public Rectangle getBounds () {\r\n\tcheckWidget();\r\n\tPhArea_t area = new PhArea_t ();\r\n\tOS.PtWidgetArea (handle, area);\r\n\treturn new Rectangle (area.pos_x, area.pos_y, area.size_w, area.size_h);\r\n}", "@NonNull\n public Rect getBounds() {\n return new Rect(mBounds);\n }", "@Override\n public Rectangle getBounds() {\n return new Rectangle(this.bounds);\n }", "public Rectangle getBounds() {\n\t\treturn new Rectangle(getX(),getY(),width, width);\n\t}", "public BoundingBox(Rectangle r) {\n\t\tthis(new Coord(r.x, r.y), r.width, r.height);\n\t}", "public Rectangle get_bounds() {\n return new Rectangle(x,y, width-3, height-3);\n }", "public AxisAlignedBB getBoundingBox()\r\n {\r\n return null;\r\n }", "public Rectangle getBounds() {\r\n\t\treturn new Rectangle((int) (x * scalingX), (int) (y * scalingY), (int) rocketWidth, (int) rocketHeight);\r\n\t}", "public Rectangle getHitBox()\n\t{\n\t\treturn new Rectangle(x, y, width, height);\n\t}", "public BoundingShape getBoundingShape() {\n\treturn boundingShape;\n }", "public Shape getRectangle() {\n return rectangle;\n }", "private RectHV rectLb() {\n\n if (!horizontal) {\n return new RectHV(\n rect.xmin(),\n rect.ymin(),\n p.x(),\n rect.ymax()\n );\n\n\n } else {\n return new RectHV(\n rect.xmin(),\n rect.ymin(),\n rect.xmax(),\n p.y()\n );\n }\n }", "public Rectangle2D getBoundary() {\n return new Rectangle2D(x, y, width, height);\n }", "public Rectangle2D getBox(\n )\n {return box;}", "public Rectangle getRectangle() {\n return rectangle;\n }", "public Rectangle getCollisionRectangle() {\r\n return new Rectangle(this.rectangle.getUpperLeft(), this.rectangle.getWidth(), this.rectangle.getHeight());\r\n }", "public void addBoundingBox() {\n abstractEditor.drawNewShape(new EBoundingBoxDT());\n }", "public Rectangle getBounds() {\n return new Rectangle(getMinX(), getMinY(), getWidth(), getHeight());\n }", "public Rectangle getBounds() {\n return super.getBounds();\n }", "Rectangle getRect(){\n \treturn new Rectangle(x,y,70,25);\n }", "@ApiModelProperty(value = \"Rectangle area where searched original text.\")\n public Rectangle getRect() {\n return rect;\n }", "public Rectangle getBounds() {\n return null;\n }", "public Bounds getBounds () { return (bounds); }", "public Rectangle getBounds() {\n\t\tif (img == null)\n\t\t\treturn new Rectangle();\n\t\treturn new Rectangle(new Dimension(img.getWidth(), img.getHeight()));\n\t}", "public Rect hitBox(){\n return new Rect((int)getX(), (int)getY(), (int)getX() + spriteWidth, (int)getY() + spriteHeight);\n }", "public Rectangle getCollisionRectangle() {\n return this.rectangle;\n }", "@Override\n\tpublic GRectangle getBounds() {\n\t\tif (isEmpty()) {\n\t\t\treturn new GRectangle();\n\t\t} else {\n\t\t\tGPoint p0 = points.get(0);\n\t\t\tdouble minX = p0.getX();\n\t\t\tdouble maxX = minX;\n\t\t\tdouble minY = p0.getY();\n\t\t\tdouble maxY = minY;\n\t\t\tfor (int i = 1; i < size(); i++) {\n\t\t\t\tGPoint p1 = points.get(i);\n\t\t\t\tminX = Math.min(minX, p1.getX());\n\t\t\t\tmaxX = Math.max(maxX, p1.getX());\n\t\t\t\tminY = Math.min(minY, p1.getY());\n\t\t\t\tmaxY = Math.max(maxY, p1.getY());\n\t\t\t}\n\t\t\treturn new GRectangle(minX, maxX, minY, maxY);\n\t\t}\n\t}", "public Rectangle2D getBoundary()\n {\n \tRectangle2D shape = new Rectangle2D.Float();\n shape.setFrame(location.getX(),location.getY(),12,length);\n return shape;\n }", "public Rectangle getShape() \n\t{\n\t\treturn box;\n\t}", "public final BoundingBox getBounds() {\n\t\tif (bounds==null) {\n\t\t\tint srsID =( (Geometry)this.get(0).getDefaultGeometry()).getSRID();\n\t\t\tBoundingBox re = new BoundingBoxImpl(\"\"+srsID);\n\t\t\tfor (SimpleFeature f : this) {\n\t\t\t\tre.include(f.getBounds());\n\t\t\t}\n\t\t\tbounds = re;\n\t\t}\n\t\treturn bounds;\n\t}", "public Rectangle getRect() {\n return new Rectangle(x,y,(imageWeight-50),(imageHeight-50));\n }", "public BoundingBox(Vector2 c, double w, double h)\n\t{\n\t\tcenter = c;\n\t\twidth = w;\n\t\theight = h;\n\t}", "public Rectangle getBoundsBigger() {\n return new Rectangle(x-32,y-32,128,128);\n }", "void setBounds(Rectangle rectangle);", "public Rectangle getRectangle() {\r\n return new Rectangle((int) x, (int) y, cwidth, cheight);\r\n }", "public void computeBoundingBox() {\n\taveragePosition = new Point3(center);\n tMat.rightMultiply(averagePosition);\n \n minBound = new Point3(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY);\n maxBound = new Point3(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY);\n // Initialize\n Point3[] v = new Point3[8];\n for (int i = 0; i < 8; i++)\n \tv[i] = new Point3(center);\n // Vertices of the box\n v[0].add(new Vector3(-radius, -radius, -height/2.0));\n v[1].add(new Vector3(-radius, radius, -height/2.0));\n v[2].add(new Vector3(radius, -radius, -height/2.0));\n v[3].add(new Vector3(radius, radius, -height/2.0));\n v[4].add(new Vector3(-radius, -radius, height/2.0));\n v[5].add(new Vector3(-radius, radius, height/2.0));\n v[6].add(new Vector3(radius, -radius, height/2.0));\n v[7].add(new Vector3(radius, radius, height/2.0));\n // Update minBound and maxBound\n for (int i = 0; i < 8; i++)\n {\n \ttMat.rightMultiply(v[i]);\n \tif (v[i].x < minBound.x)\n \t\tminBound.x = v[i].x;\n \tif (v[i].x > maxBound.x)\n \t\tmaxBound.x = v[i].x;\n \tif (v[i].y < minBound.y)\n \t\tminBound.y = v[i].y;\n \tif (v[i].y > maxBound.y)\n \t\tmaxBound.y = v[i].y;\n \tif (v[i].z < minBound.z)\n \t\tminBound.z = v[i].z;\n \tif (v[i].z > maxBound.z)\n \t\tmaxBound.z = v[i].z;\n }\n \n }", "ObjectProperty<Bounds> drawAreaBoundsProperty();", "public MyRectangle getRectangle() {\n\t\treturn new MyRectangle(x, y, width, height);\n\t}", "public PRectangle getFontBBox() {\n Object value = library.getObject(entries, FONT_BBOX);\n if (value instanceof Vector) {\n Vector rectangle = (Vector) value;\n return new PRectangle(rectangle);\n }\n return null;\n }", "public Rectangle get_rect() {\n\t\treturn new Rectangle(\n\t\t\t\torigin_x+component_x, \n\t\t\t\torigin_y+component_y-component_height+3, \n\t\t\t\tcomponent_width, \n\t\t\t\tcomponent_height\n\t\t\t);\n\t}", "public ERectangle getPrimitiveBounds() {\n ERectangle primitiveBounds = this.primitiveBounds;\n if (primitiveBounds != null) return primitiveBounds;\n return this.primitiveBounds = computePrimitiveBounds();\n }", "godot.wire.Wire.Rect2 getRect2Value();", "public Rectangle2D getRectangle() {\n return rectangle;\n }" ]
[ "0.8261532", "0.7713992", "0.76321113", "0.7533775", "0.7511512", "0.7468098", "0.7446029", "0.73271435", "0.7301499", "0.7296774", "0.72562844", "0.72562844", "0.72287315", "0.71629053", "0.71248955", "0.7120112", "0.7117591", "0.7108482", "0.7108482", "0.7108482", "0.7107066", "0.709818", "0.709818", "0.70735854", "0.70633006", "0.7036343", "0.699665", "0.69624513", "0.6955875", "0.69053197", "0.6898537", "0.6890682", "0.68854403", "0.6885176", "0.68805975", "0.6879382", "0.68778", "0.68712246", "0.68656796", "0.6851347", "0.68495893", "0.68233985", "0.6821645", "0.6815789", "0.6791426", "0.67908156", "0.67804146", "0.6776042", "0.6774248", "0.6774069", "0.6708229", "0.6689894", "0.66853166", "0.66270685", "0.66214263", "0.6613077", "0.661212", "0.66110986", "0.660833", "0.6604668", "0.6601264", "0.6598386", "0.6594858", "0.6575143", "0.6564773", "0.6545742", "0.65383554", "0.6538294", "0.65196764", "0.65051764", "0.6504361", "0.649705", "0.6491671", "0.648153", "0.64659417", "0.6461419", "0.64511424", "0.64441055", "0.6434472", "0.641376", "0.64074975", "0.6398904", "0.6376476", "0.637138", "0.6354719", "0.633335", "0.6328385", "0.6327325", "0.6320922", "0.6320802", "0.6307928", "0.6305795", "0.63008", "0.6294241", "0.6289961", "0.62766343", "0.6272736", "0.62711686", "0.62499875", "0.6242089" ]
0.76254934
3
Return false because by definition a UnmovableEntity cannot move
@Override public boolean isMovable() { return false; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic boolean canMove() {\r\n\t\treturn false;\r\n\t}", "public boolean canMove() {\r\n return (state == State.VULNERABLE || state == State.INVULNERABLE);\r\n\r\n }", "private boolean legalMove() {\n\n\t\t// empty landing spot\n\t\tif (tilePath.size() == 0) {\n\t\t\tdebug(\"illegal, empty landing spot\");\n\t\t\treturn false;\n\t\t}\n\n\t\tif (!mBoard.tileIsEmpty(tilePath.get(tilePath.size() - 1))) {\n\t\t\tdebug(\"illegal, tile not empty\");\n\t\t\treturn false;\n\t\t}\n\n\t\t// start doesn't equal end\n\t\tif (tilePath.get(0).equals(tilePath.get(tilePath.size() - 1))) {\n\t\t\tdebug(\"illegal, start doesn't equal end\");\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "@Override\n public boolean canMove(double x, double y) {\n return !getOwner().isDead();\n }", "public boolean canMoveTo(Position position){\n return !isOccupied(position);\n }", "public abstract boolean canMove();", "@Override\n\tpublic boolean movable(Entity obj) {\n\t\treturn true;\n\t}", "private boolean isThereValidMove() {\n\t\treturn true;\n\t}", "@Override\n public boolean isMoving() {\n return _movementTask != null && !_movementTask.isDone();\n }", "public boolean canMoveEntity (Entity entity, Point dest) {\n if (entity == null) throw new IllegalArgumentException(\"Entity is null\");\n if (dest == null) throw new IllegalArgumentException(\"Point is null\");\n if (!grid.containsKey(dest)) throw new IllegalArgumentException(\"The cell is not on the grid\");\n\n Point origin = entity.getCoords();\n\n if (origin.equals(dest)) return false;\n\n Vector vector = Vector.findStraightVector(origin, dest);\n\n if (vector == null) return false;\n Vector step = new Vector(vector.axis(), (int) (1 * Math.signum(vector.length())));\n Point probe = (Point) origin.clone();\n while (!probe.equals(dest)) {\n probe = step.applyVector(probe);\n if (!grid.containsKey(probe)) return false;\n }\n\n\n return true;\n }", "public boolean canMove() {\n return (Math.abs(getDist())>=50);\n }", "public boolean isMoveable() {\n\t\treturn _moveable;\n\t}", "public boolean isLegalMove() {\n return iterator().hasNext();\n }", "public boolean canMove() {\n\n\tArrayList<Location> moveLocs = getValid(getLocation());\n\n\tif (isEnd == true) {\n\t return false;\n\t} \n\tif (!moveLocs.isEmpty()) {\n\t \n\t randomSelect(moveLocs);\n\t // selectMoveLocation(moveLocs);\n\t return true;\n\n\t} else {\n\t return false;\n\t}\n }", "@Override\n\tpublic boolean movable(Entity obj) {\n\t\tif (!(obj instanceof Player)) return false;\n\t\tPlayer player = (Player) obj;\n\t\t\n\t\tint futureX = this.getX();\n\t\tint futureY = this.getY();\n\t\t\n\t\t\n\t\tint playerX = player.getX();\n\t\tint playerY = player.getY();\n\t\t\n\t\tif (playerX == this.getX()) {\n\t\t\t// player moving either up or down\n\t\t\tif (playerY > this.getY()) {\n\t\t\t\t// player moving up so check what's up of boulder\n\t\t\t\tfutureY = this.getY() - 1;\n\t\t\t} else {\n\t\t\t\t// player moving down ''\n\t\t\t\tfutureY = this.getY() + 1;\n\t\t\t}\n\t\t} else if (playerY == this.getY()) {\n\t\t\t// player moving either left or right\n\t\t\tif (playerX > this.getX()) {\n\t\t\t\t// player moving left ''\n\t\t\t\tfutureX = this.getX() - 1;\n\t\t\t} else {\n\t\t\t\t// player moving right ''\n\t\t\t\tfutureX = this.getX() + 1;\n\t\t\t}\n\t\t}\n\t\t\n\t\tboolean result = checkMoveable(futureX, futureY);\n\t\treturn result;\n\t}", "boolean canMoveTo(Vector2d position);", "boolean canMove();", "public boolean canMove()\n {\n return canMove;\n }", "public boolean isMoveLegal() {\n if (!getGame().getBoard().contains(getFinalCoords())) {\n return false;\n }\n\n // for aero units move must use up all their velocity\n if (getEntity() instanceof Aero) {\n Aero a = (Aero) getEntity();\n if (getLastStep() == null) {\n if ((a.getCurrentVelocity() > 0) && !getGame().useVectorMove()) {\n return false;\n }\n } else {\n if ((getLastStep().getVelocityLeft() > 0) && !getGame().useVectorMove()\n && !(getLastStep().getType() == MovePath.MoveStepType.FLEE\n || getLastStep().getType() == MovePath.MoveStepType.EJECT)) {\n return false;\n }\n }\n }\n\n if (getLastStep() == null) {\n return true;\n }\n\n if (getLastStep().getType() == MoveStepType.CHARGE) {\n return getSecondLastStep().isLegal();\n }\n if (getLastStep().getType() == MoveStepType.RAM) {\n return getSecondLastStep().isLegal();\n }\n return getLastStep().isLegal();\n }", "private boolean isMove() {\n return this.getMoves().size() != 0;\n }", "public boolean canMoveTo(Position position){\n if(position.x > mapSize.x || position.x < 0 || position.y > mapSize.y || position.y < 0){\n return false;\n }\n return !isOccupied(position);\n }", "public boolean isValidMove(Card card)\n {\n return false;\n }", "boolean canMove(Tile t);", "public boolean isValidMove(CardStack stack)\n {\n return false;\n }", "@objid (\"7f09cb7d-1dec-11e2-8cad-001ec947c8cc\")\n public boolean allowsMove() {\n return true;\n }", "protected boolean couldShove(Entity source, int xa, int ya)\n {\n return couldMove(xa, ya, true);\n }", "public boolean continueExecuting()\n\t{\n\t\treturn this.entity.posX != this.xPosition && this.yPosition != this.entity.posY && this.entity.posZ != this.zPosition;\n\t}", "public boolean canMove() {\n ArrayList<Location> valid = canMoveInit();\n if (valid == null || valid.isEmpty()) {\n return false;\n }\n ArrayList<Location> lastCross = crossLocation.peek();\n for (Location loc : valid) {\n Actor actor = (Actor) getGrid().get(loc);\n if (actor instanceof Rock && actor.getColor().equals(Color.RED)) {\n next = loc;\n isEnd = true;\n return false;\n }\n if (!lastCross.contains(loc)) {\n lastCross.add(loc);\n next = loc;\n ArrayList<Location> nextCross = new ArrayList<>();\n nextCross.add(next);\n nextCross.add(last);\n crossLocation.push(nextCross);\n return probabilityAdd();\n }\n }\n next = lastCross.get(1);\n crossLocation.pop();\n return probabilitySub();\n }", "@Override\n\tpublic boolean isLegalMove(Square newPosition) {\n\t\treturn false;\n\t}", "@Override\n public boolean atDestination() {\n return myMovable.atDestination();\n }", "public boolean allowMove(Point p, int pos);", "public boolean moveable() {\n //check reach border\n if (reachBorder()) {\n return false;\n }\n //get the location of the next spot to move to\n //move up\n Point nextLocation = this.getCenterLocation();\n if (direction == 12) {\n nextLocation = new Point(this.getCenterX(),\n this.getCenterY() - speed);\n }\n //move right\n if (direction == 3) {\n nextLocation = new Point(this.getCenterX() + speed,\n this.getCenterY());\n\n }\n //move down\n if (direction == 6) {\n nextLocation = new Point(this.getCenterX(),\n this.getCenterY() + speed);\n\n }\n //move left\n if (direction == 9) {\n nextLocation = new Point(this.getCenterX() - speed,\n this.getCenterY());\n }\n\n // get all objects in a circle of radius tileSize * 2 around the players\n //these objects are those which can possibly colide with the players\n int checkRadius = GameUtility.GameUtility.TILE_SIZE * 2;\n for (GameObject gameObject : GameManager.getGameObjectList()) {\n if (GameUtility.GameUtility.distance(gameObject.getCenterLocation(),\n this.getCenterLocation()) < checkRadius) {\n if ((GameUtility.GameUtility.dectectCollision(\n gameObject.getCenterLocation(),\n nextLocation)) && !(GameUtility.GameUtility.dectectCollision(\n gameObject.getCenterLocation(),\n this.getCenterLocation())) && gameObject.getType() != GameObjectType.POWER_UP && gameObject.getType() != GameObjectType.MONSTER && gameObject.getType() != GameObjectType.PLAYER) {\n return false;\n }\n }\n }\n return true;\n\n }", "public abstract boolean canMove(int originX, int originY, int destX, int destY);", "public abstract boolean canMove(Board board, Spot from, Spot to);", "private boolean canMove() {\n return !(bestMove[0].getX() == bestMove[1].getX() && bestMove[0].getY() == bestMove[1].getY());\n }", "public boolean canMove(int dir) {\n return true;\n }", "public boolean canMove() {\n\t\tArrayList<Location> loc = getValid(getLocation());\n\t\tif (loc.isEmpty()) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tpath.add(getLocation());\n\t\t\tif (loc.size() >= 2) {\n\t\t\t\tcrossLocation.push(path);\n\t\t\t\tpath = new ArrayList<Location>();\n\t\t\t\tnext = betterDir(loc);\n\t\t\t}\n\t\t\tnext = loc.get(0);\n\t\t}\n\t\treturn true;\n\t}", "public boolean move();", "@Override\n\tpublic Boolean hasMoved() {\n\t\treturn moved;\n\t}", "boolean isLegal(Move move) {\r\n return isLegal(move.from(), move.to());\r\n }", "@Override\n boolean canMove(Cell source, Cell destination) {\n return true;\n }", "public final boolean isMoving() {\r\n\t\treturn moveStart > 0;\r\n\t}", "public boolean isMovable() {\n\t\treturn false;\n\t}", "public MoveResult canMovePiece(Alignment player, Coordinate from, Coordinate to);", "public boolean canMove ()\n {\n return ((ActiveAdvancer)_advancer).canMove();\n }", "public abstract boolean canMoveTo(Case Location);", "public boolean canMove()\n\t{\n\t\tif(delayMove>compareSpeed())\n\t\t{\n\t\t\tdelayMove=0;\n\t\t\treturn true;\n\t\t\t\n\t\t}else\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}", "public void InvalidMove();", "@Override\n\tpublic boolean hasMoved() {\n\t\treturn false;\n\t}", "public boolean checkMoveable(int x, int y) {\n\t\t\n \tif(!((y < dungeon.getHeight() - 1) && (y >= 0)))\treturn false;\n \tif(!((x < dungeon.getWidth() - 1) && (x >= 0)))\t\treturn false;\n \t\n \tArrayList<Entity> list = dungeon.getEntity(x, y);\n if(!list.isEmpty()) {\n \tfor (Entity e: list) {\n \t\tif(! e.movable(this)) return false;\n \t\tif(e instanceof Switch) {\n \t\t\te.interact(this);\n \t\t}\n }\n }\n return true;\n }", "boolean isMoving();", "public boolean canMoveTo(int x, int y) {\n if (x < 0 || x >= dungeon.getWidth() || y < 0 || y >= dungeon.getHeight() || characterStatus.equals(CharacterStatus.DEAD))\n return false;\n boolean canMove = true;\n for (Entity entity : dungeon.getEntities(x, y)) {\n if (entity instanceof FieldObject)\n ((FieldObject) entity).interact(this);\n if (entity instanceof FieldObject && ((FieldObject) entity).isObstacle()) {\n canMove = false;\n break;\n }\n }\n return canMove;\n }", "@Override\n\tpublic boolean isMoveValid(int srcRow, int srcCol, int destRow, int destCol) {\n\t\treturn false;\n\t}", "public boolean move() {\n\t double[] movePre = movePreProcessing();\n\n double dxbak=movePre[0], dybak=movePre[1], dthetabak=movePre[2];\n boolean collision = false;\n\t\t\n\t\tif (hasGrown!=0 || dx!=0 || dy!=0 || dtheta!=0) {\n\t\t\thasMoved = true;\n\t\t\t// Check it is inside the world\n\t\t\tcollision = !isInsideWorld();\n\t\t\t// Collision detection with biological corridors\n\t\t\tif (alive) {\n\t\t\t\tOutCorridor c = _world.checkHitCorridor(this);\n\t\t\t\tif (c != null && c.canSendOrganism()) {\n\t\t\t\t\tif (c.sendOrganism(this))\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Collision detection with other organisms.\n Organism otherOrganism = _world.checkHit(this);\n\t\t\tif (otherOrganism != null) {\n\t\t\t if (this.contact(otherOrganism)) {\n collision = true;\n }\n }\n\n\n\t\t\t// If there is a collision, undo movement.\n\t\t\tif (collision) {\n\t\t\t\thasMoved = false;\n\t\t\t\toffset(-dxbak,-dybak,-dthetabak);\n\t\t\t\tif (hasGrown!=0) {\n\t\t\t\t\t_growthRatio+=hasGrown;\n\t\t\t\t\tsymmetric();\n\t\t\t\t}\n\t\t\t\tcalculateBounds(hasGrown!=0);\n\t\t\t}\n\t\t}\n\t\t// Substract one to the time needed to reproduce\n\t\tif (_timeToReproduce > 0)\n\t\t\t_timeToReproduce--;\n\t\t// Check if it can reproduce: it needs enough energy and to be adult\n\t\tif (_energy > _geneticCode.getReproduceEnergy() + Utils.YELLOW_ENERGY_CONSUMPTION*(_nChildren-1)\n\t\t\t\t&& _growthRatio==1 && _timeToReproduce==0 && alive)\n\t\t\treproduce();\n\t\t// Check that it don't exceed the maximum chemical energy\n\t\tif (_energy > _geneticCode.getReproduceEnergy()) {\n\t\t\tif (_energy > 2*_geneticCode.getReproduceEnergy()) {\n\t\t\t\tuseEnergy(_energy - 2*_geneticCode.getReproduceEnergy());\n\t\t\t} else {\n\t\t\t useEnergy((_energy - _geneticCode.getReproduceEnergy()) / 300);\n\t\t\t}\n\t\t}\n\t\t// Maintenance\n\t\tbreath();\n\t\t// Check that the organism has energy after this frame\n\t\treturn _energy > Utils.tol;\n\t}", "boolean doMove();", "public boolean move() {\r\n\t\tif (direction == null) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tint newPosX = this.posX;\r\n\t\tint newPosY = this.posY;\r\n\r\n\t\tswitch (this.direction) {\r\n\t\tcase NORTH:\r\n\t\t\tnewPosY++;\r\n\t\t\tbreak;\r\n\t\tcase WEST:\r\n\t\t\tnewPosX--;\r\n\t\t\tbreak;\r\n\t\tcase SOUTH:\r\n\t\t\tnewPosY--;\r\n\t\t\tbreak;\r\n\t\tcase EAST:\r\n\t\t\tnewPosX++;\r\n\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tboolean canMoveToNewPosition = tabletop.canMove(newPosX, newPosY);\r\n\t\tif (!canMoveToNewPosition) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\tthis.posX = newPosX;\r\n\t\tthis.posY = newPosY;\r\n\r\n\t\treturn true;\r\n\t}", "@Override\n\tpublic boolean isMoveValid(int row, int col) {\n\t\tif (isValidSide(row, col)) {\n\t\t\taddMissileResult(row, col);\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}", "@Override\r\n\tpublic boolean Movement(Player arg0) {\n\t\treturn false;\r\n\t}", "@Override\r\n\tpublic boolean Movement(Player arg0) {\n\t\treturn false;\r\n\t}", "public boolean shouldExecute() {\n\t\t\tEntityMoveHelper entitymovehelper = this.parentEntity.getMoveHelper();\n\n\t\t\tif (!entitymovehelper.isUpdating()) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tdouble d0 = entitymovehelper.getX() - this.parentEntity.posX;\n\t\t\t\tdouble d1 = entitymovehelper.getY() - this.parentEntity.posY;\n\t\t\t\tdouble d2 = entitymovehelper.getZ() - this.parentEntity.posZ;\n\t\t\t\tdouble d3 = d0 * d0 + d1 * d1 + d2 * d2;\n\t\t\t\treturn d3 < 1.0D || d3 > 3600.0D;\n\t\t\t}\n\t\t}", "public boolean isMoving() {\n/* 270 */ throw new RuntimeException(\"Stub!\");\n/* */ }", "protected boolean shouldMoveTo(World worldIn, BlockPos pos)\n {\n Block block = worldIn.getBlockState(pos).getBlock();\n\n if (block == Blocks.FARMLAND)\n {\n pos = pos.up();\n IBlockState iblockstate = worldIn.getBlockState(pos);\n block = iblockstate.getBlock();\n\n if (block instanceof BlockCrops && this.wantsToReapStuff && (this.currentTask == 0 || this.currentTask < 0))\n {\n this.currentTask = 0;\n return true;\n }\n\n }\n\n return false;\n }", "public boolean isMovable() {\r\n return movable;\r\n }", "public boolean canMove() {\n\n if (workers.size() == 0) return true;\n\n return workerCanMove(0) || workerCanMove(1);\n }", "public boolean attemptMove(Position2D pos)\n {\n return setPosition(pos);\n }", "private boolean canMove(Location location) {\n if (location == null) return false;\n return location.getWorld().intersects(this, Util.getRectangle(location, size)) == null && location.getY() >= 0 && location.getX() >= 0;\n }", "public boolean isMoving() {\n\t\treturn moveProgress > 0;\n\t}", "public boolean isMoving() {\n return this.movementComposer.isMoving();\n }", "private boolean hasPossibleMove()\n {\n for(int i=0; i<FieldSize; ++i)\n {\n for(int j=1; j<FieldSize; ++j)\n {\n if(field[i][j] == field[i][j-1])\n return true;\n }\n }\n for(int j=0; j<FieldSize; ++j)\n {\n for(int i=1; i<FieldSize; ++i)\n {\n if(field[i][j] == field[i-1][j])\n return true;\n }\n }\n return false;\n }", "@Override\n public boolean canMovePieceAtPoint(Point point) {\n return (getPiece(point) != null);\n }", "public boolean isMoveLegal(Move move){\n return legalMoves.contains(move);\n }", "protected boolean processIllegalMove(String moveString, String reason){return false;}", "public void illegalMove(){\r\n //Taken care of in view?\n \t//throw new RuntimeException(\"this is a illegal move\");\r\n }", "public boolean isValidMove(ArrayList<Cell> path) {\t\t\t\t\r\n\t\treturn value != -1 && !inPath(path);\r\n\t}", "public boolean canMove(Actor actor)\n\t {\n\t \t//PO: updated the methods after the move from the Bug Class to be called from\n\t \t//PO: the passed actor\n\t Grid<Actor> gr = actor.getGrid();\n\t if (gr == null)\n\t return false;\n\t Location loc = actor.getLocation();\n\t Location next = loc.getAdjacentLocation(actor.getDirection());\n\t if (!gr.isValid(next))\n\t return false;\n\t Actor neighbor = gr.get(next);\n\t return (neighbor == null) || (neighbor instanceof Flower);\n\t // ok to move into empty location or onto flower\n\t // not ok to move onto any other actor\n\t \n\t }", "@Override\n public boolean canMove(double x, double y) {\n double xr = this.x, yr = this.y - 32; //subtract y to get more accurate results\n //the thing is, subract to 32 (sprite size), so if we add 1 tile we get the next pixel tile with this\n //we avoid the shaking inside tiles with the help of steps\n if (direction == 0) {\n yr += sprite.getSize() - 1;\n xr += sprite.getSize() / 2;\n }\n if (direction == 1) {\n yr += sprite.getSize() / 2;\n xr += 1;\n }\n if (direction == 2) {\n xr += sprite.getSize() / 2;\n yr += 1;\n }\n if (direction == 3) {\n xr += sprite.getSize() - 1;\n yr += sprite.getSize() / 2;\n }\n int xx = Coordinates.pixelToTile(xr) + (int) x;\n int yy = Coordinates.pixelToTile(yr) + (int) y;\n Entity a = Board.getInstance().getEntity(xx, yy, this); //entity of the position we want to go\n return !a.collide(this);\n }", "public boolean isBlockingTo(Entity wantsToMoveHere)\n\t{\n\t\treturn false;\n\t}", "public boolean isNotPosibleMove(final int type) {\n switch (type) {\n case KeyEvent.VK_LEFT:\n isNotPossible = pacman.existWall(pacman.getX() - SIZE_ELEMENT, pacman.getY());\n break;\n case KeyEvent.VK_RIGHT:\n isNotPossible = pacman.existWall(pacman.getX() + SIZE_ELEMENT, pacman.getY());\n break;\n case KeyEvent.VK_UP:\n isNotPossible = pacman.existWall(pacman.getX(), pacman.getY() - SIZE_ELEMENT);\n break;\n case KeyEvent.VK_DOWN:\n isNotPossible = pacman.existWall(pacman.getX(), pacman.getY() + SIZE_ELEMENT);\n break;\n default:\n break;\n }\n return isNotPossible;\n }", "public boolean hasMoved() {\n return moved;\n }", "@Override\n public boolean isMoveDoable(final ScoreDirector scoreDirector) {\n return true;\n }", "@Override\r\n public boolean canMove() {\r\n Grid<Actor> gr = getGrid();\r\n int dirs[] = {\r\n Location.AHEAD, Location.HALF_CIRCLE, Location.LEFT,\r\n Location.RIGHT };\r\n // 当终点在周围时,不能移动且isEnd应当为true\r\n for (int i = 0; i < dirs.length; i++) {\r\n Location tarLoc = getLocation().getAdjacentLocation(dirs[i]);\r\n if (gr.isValid(tarLoc) && gr.get(tarLoc) != null) {\r\n // Color直接用==计算竟然不可行(真是哔了dog...\r\n if (gr.get(tarLoc) instanceof Rock\r\n && gr.get(tarLoc).getColor().equals(Color.RED)) {\r\n isEnd = true;\r\n return false;\r\n }\r\n }\r\n }\r\n ArrayList<Location> nextLocs = getValid(getLocation());\r\n // 当附近没有可以移动的位置时,不能移动\r\n if (nextLocs.size() == 0) {\r\n return false;\r\n }\r\n // 当可以移动的位置>1时,说明存在一个节点,这个节点应当被新建一个arraylist入栈\r\n if (nextLocs.size() > 1) {\r\n ArrayList<Location> newStackElem = new ArrayList<Location>();\r\n newStackElem.add(getLocation());\r\n crossLocation.push(newStackElem);\r\n }\r\n // 有可以移动的位置时,向概率最高的方向移动\r\n int maxProbLoc = 0;\r\n // 由于nextLocs不一定有4个location,所以只好循环判断取最大值\r\n for (int i = 0; i < nextLocs.size(); i++) {\r\n Location loc = nextLocs.get(i);\r\n int dirNum = getLocation().getDirectionToward(loc) / 90;\r\n if (probablyDir[dirNum] > probablyDir[maxProbLoc]) {\r\n maxProbLoc = i;\r\n }\r\n }\r\n next = nextLocs.get(maxProbLoc);\r\n return true;\r\n }", "boolean hasMove(Piece side) {\r\n List<Move> listOfLegalMoves = legalMoves(side);\r\n return listOfLegalMoves != null;\r\n }", "public boolean canMove (Location loc) {\n Grid<Actor> gr = getGrid();\n if (gr == null)\n return false;\n if (!gr.isValid(loc))\n return false;\n Actor neighbor = gr.get(loc);\n return !(neighbor instanceof Wall);\n }", "public boolean isMoving() {\r\n\t\treturn moving;\r\n\t}", "@Override\n\tpublic boolean isExists(ConquestMoveEffect entity) {\n\t\treturn false;\n\t}", "private boolean hasMovements(Color playerColor){\r\n for(Point pos : getPieces(playerColor)){\r\n if(canMove(pos) || canEats(pos)) return true;\r\n }\r\n return false;\r\n }", "public native boolean isMoveable() /*-{\n\t\tvar jso = [email protected]::getJsObj()();\n\t\treturn jso.moveable;\n }-*/;", "boolean legalMove(Move mov) {\n if (mov == null || !validSquare(mov.toIndex())\n || !validSquare(mov.fromIndex())) {\n throw new IllegalArgumentException(\"Illegal move\");\n }\n PieceColor from = get(mov.fromIndex());\n PieceColor to = get(mov.toIndex());\n if (!mov.isJump() && jumpPossible()) {\n return false;\n }\n if (from != _whoseMove) {\n return false;\n } else if (mov.isJump()) {\n return checkJump(mov, false);\n } else if (from == BLACK && row(mov.fromIndex()) == '1') {\n return false;\n } else if (from == WHITE && row(mov.fromIndex()) == '5') {\n return false;\n } else if (mov.isLeftMove()) {\n ArrayList<String> rec = _directions.get(mov.fromIndex());\n return get(mov.toIndex()) == EMPTY\n && !rec.get(rec.size() - 1).equals(\"Right\");\n } else if (mov.isRightMove()) {\n ArrayList<String> rec = _directions.get(mov.fromIndex());\n return get(mov.toIndex()) == EMPTY\n && !rec.get(rec.size() - 1).equals(\"Left\");\n } else if (from == BLACK) {\n if (mov.fromIndex() % 2 == 0 && to == EMPTY) {\n return mov.fromIndex() - mov.toIndex() == SIDE\n || mov.fromIndex() - mov.toIndex() == SIDE - 1\n || mov.fromIndex() - mov.toIndex() == SIDE + 1;\n } else {\n return mov.fromIndex() - mov.toIndex() == SIDE && to == EMPTY;\n }\n } else if (from == WHITE) {\n if (mov.fromIndex() % 2 == 0 && to == EMPTY) {\n return mov.toIndex() - mov.fromIndex() == SIDE\n || mov.toIndex() - mov.fromIndex() == SIDE + 1\n || mov.toIndex() - mov.fromIndex() == SIDE - 1;\n } else {\n return mov.toIndex() - mov.fromIndex() == SIDE && to == EMPTY;\n }\n }\n return false;\n }", "public boolean isMoving() {\n return moving;\n }", "public boolean isMoving() {\n\t\treturn state.getDirection() != Direction.STATIONARY;\n\t}", "public boolean isValidMove(Coordinates coordinates) {\n if (grid[coordinates.getRow()][coordinates.getColumn()].getSymbol() != 'X' &&\n grid[coordinates.getRow()][coordinates.getColumn()].getSymbol() != 'O') {\n return true;\n }\n\n return false;\n }", "@Override\n public boolean isValidMove(Move move) {\n if (board[move.oldRow][move.oldColumn].isValidMove(move, board))\n return true;\n //player will not be in check\n //move will get player out of check if they are in check\n return false;\n }", "private boolean validMove(int dir) {\n return !(dir == UPKEY && direction == DOWNKEY || dir == DOWNKEY && direction == UPKEY || dir == LEFTKEY && direction == RIGHTKEY || dir == RIGHTKEY && direction == LEFTKEY);\n }", "@Override\n\tpublic boolean shouldExecute() {\n\t\tif (!theEntity.isTamed())\n\t\t\treturn false;\n\t\telse if (theEntity.isInWater())\n\t\t\treturn false;\n\t\telse if (!theEntity.onGround)\n\t\t\treturn false;\n\t\telse {\n\t\t\tfinal EntityLivingBase var1 = theEntity.getOwner();\n\t\t\treturn var1 == null ? true\n\t\t\t\t\t: theEntity.getDistanceSqToEntity(var1) < 144.0D\n\t\t\t\t\t\t\t&& var1.getAITarget() != null ? false : isSitting;\n\t\t}\n\t}", "@SuppressWarnings(\"ConstantConditions\")\n private boolean isStuck(Position pos, Position posNow) {\n if (pos.isSimilar(posNow)) {\n return true;\n }\n\n Instance instance = getInstance();\n Chunk chunk = null;\n Collection<Entity> entities = null;\n\n /*\n What we're about to do is to discretely jump from the previous position to the new one.\n For each point we will be checking blocks and entities we're in.\n */\n double part = .25D; // half of the bounding box\n Vector dir = posNow.toVector().subtract(pos.toVector());\n int parts = (int) Math.ceil(dir.length() / part);\n Position direction = dir.normalize().multiply(part).toPosition();\n for (int i = 0; i < parts; ++i) {\n // If we're at last part, we can't just add another direction-vector, because we can exceed end point.\n if (i == parts - 1) {\n pos.setX(posNow.getX());\n pos.setY(posNow.getY());\n pos.setZ(posNow.getZ());\n } else {\n pos.add(direction);\n }\n BlockPosition bpos = pos.toBlockPosition();\n Block block = instance.getBlock(bpos.getX(), bpos.getY() - 1, bpos.getZ());\n if (!block.isAir() && !block.isLiquid()) {\n teleport(pos);\n return true;\n }\n\n Chunk currentChunk = instance.getChunkAt(pos);\n if (currentChunk != chunk) {\n chunk = currentChunk;\n entities = instance.getChunkEntities(chunk)\n .stream()\n .filter(entity -> entity instanceof LivingEntity)\n .collect(Collectors.toSet());\n }\n /*\n We won't check collisions with entities for first ticks of arrow's life, because it spawns in the\n shooter and will immediately damage him.\n */\n if (getAliveTicks() < 3) {\n continue;\n }\n Optional<Entity> victimOptional = entities.stream()\n .filter(entity -> entity.getBoundingBox().intersect(pos.getX(), pos.getY(), pos.getZ()))\n .findAny();\n if (victimOptional.isPresent()) {\n LivingEntity victim = (LivingEntity) victimOptional.get();\n victim.setArrowCount(victim.getArrowCount() + 1);\n callEvent(EntityAttackEvent.class, new EntityAttackEvent(this, victim));\n remove();\n return super.onGround;\n }\n }\n return false;\n }", "protected boolean shouldMoveTo(World worldIn, BlockPos pos) {\n Block block = worldIn.getBlockState(pos).getBlock();\n\n if (block == Blocks.FARMLAND) {\n pos = pos.up();\n IBlockState iblockstate = worldIn.getBlockState(pos);\n block = iblockstate.getBlock();\n\n if (block instanceof BlockCropPinto && ((BlockCropPinto) block).isMaxAge(iblockstate) && this.wantsToReapStuff && (this.currentTask == 0 || this.currentTask < 0)) {\n this.currentTask = 0;\n return true;\n }\n\n if (iblockstate.getMaterial() == Material.AIR && this.hasFarmItem && (this.currentTask == 1 || this.currentTask < 0)) {\n this.currentTask = 1;\n return true;\n }\n }\n return false;\n }", "private boolean moveCheck(Piece p, List<Move> m, int fC, int fR, int tC, int tR) {\n if (null == p) {\n // Legal move!\n m.add(new Move(fC, fR, tC, tR));\n // Continue checking for moves.\n return false;\n }\n if (p.owner != whoseTurn) {\n // Enemy sighted!\n // Legal move!\n m.add(new Move(fC, fR, tC, tR));\n // No more moves!\n }\n return true;\n }", "public boolean GetMove();", "public boolean moveStep() {\n\t\t// TODO: take orientation into account\n\t\t\n\t\t// Work out the distance to the destination\n\t\tDouble2D delta = destination.subtract(getPosition());\n//\t\tSystem.out.println(this.toString() + \"has \" + delta.length() + \" to go.\"); // Debug\n\t \n\t // If this is below a small value, we have arrived, return true\n\t if (delta.length() < 4) return true;\n\t \n\t // FIXME: a better model allow different speed for different vehicle class\n\t // update the speed of vehicle\n\t velocity.setTo(delta.x * 0.004, delta.y * 0.004);;\n\t \n\t // FIXME: avoidance?\n\t \n\t // FIXME: orientation?\n//\t\torientation += angularRate;\n\t // update the vehicle location\n\t\tDouble2D location = _siteState.getArea().getObjectLocation(this);\n\t\t_siteState.getArea().setObjectLocation(this, location.add(new Double2D(velocity)));\n\t \n\t\treturn false;\n\t}", "public boolean checkAndMove() {\r\n\r\n\t\tif(position == 0)\r\n\t\t\tdirection = true;\r\n\r\n\t\tguardMove();\r\n\r\n\t\tif((position == (guardRoute.length - 1)) && direction) {\r\n\t\t\tposition = 0;\r\n\t\t\treturn true;\r\n\t\t}\r\n\r\n\t\tif(direction)\r\n\t\t\tposition++;\r\n\t\telse\r\n\t\t\tposition--;\r\n\r\n\t\treturn false;\r\n\t}" ]
[ "0.7459672", "0.72733265", "0.72301686", "0.7154673", "0.70622367", "0.705572", "0.7037916", "0.7000601", "0.6967378", "0.6955855", "0.69485927", "0.69370836", "0.6920007", "0.6911075", "0.6892916", "0.6889149", "0.6850046", "0.6816857", "0.680877", "0.67757154", "0.6775438", "0.6753934", "0.6713804", "0.6712935", "0.6710236", "0.67087436", "0.6708023", "0.6697389", "0.6683522", "0.6634551", "0.6612092", "0.65765744", "0.6557509", "0.6537095", "0.6535238", "0.65314615", "0.6520215", "0.65136385", "0.65133965", "0.64950395", "0.64945054", "0.64816535", "0.64741707", "0.6459893", "0.6459537", "0.64584875", "0.6448512", "0.64475256", "0.6446454", "0.64457303", "0.6431837", "0.643067", "0.64278877", "0.6420195", "0.64085686", "0.639528", "0.6391141", "0.6387967", "0.6387967", "0.6362735", "0.6360036", "0.6347347", "0.63262814", "0.63154894", "0.63123125", "0.63110846", "0.63080704", "0.6307463", "0.6300479", "0.6298423", "0.6289693", "0.628644", "0.62835217", "0.6283083", "0.62810004", "0.6263711", "0.62501717", "0.62487745", "0.6238047", "0.62338793", "0.6226625", "0.62142646", "0.62140656", "0.6213909", "0.6213053", "0.6211467", "0.6210463", "0.62103075", "0.62098193", "0.6205784", "0.61977834", "0.61962265", "0.61946183", "0.6179503", "0.6168076", "0.6167892", "0.6146663", "0.6139183", "0.6134314", "0.6127112" ]
0.63923776
56
prints the game board; must be static
static void printBoard() { System.out.println("/---|---|---\\"); System.out.println("| " + board[0][0] + " | " + board[0][1] + " | " + board[0][2] + " |"); System.out.println("|-----------|"); System.out.println("| " + board[1][0] + " | " + board[1][1] + " | " + board[1][2] + " |"); System.out.println("|-----------|"); System.out.println("| " + board[2][0] + " | " + board[2][1] + " | " + board[2][2] + " |"); System.out.println("\\---|---|---/"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void printBoard() {\n\t\tSystem.out.println(\"Board:\");\r\n\t\tfor(int i=0; i<BoardSquare.numberOfSquare; i++) {\r\n\t\t\t\r\n\t\t\tSystem.out.print(String.format(\"%4s\", (i+1) + \":\"));\r\n\t\t\tif(BoardGame.board.get(i).isPlayerOne()) System.out.print(\" P1\"); \r\n\t\t\tif(BoardGame.board.get(i).isPlayerTwo()) System.out.print(\" P2\");\r\n\t\t\tif(BoardGame.board.get(i).isHasCard()) System.out.print(\" C\");\t\t\t\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t\t\r\n\t\t}\r\n\t\t\t\r\n\t\t\r\n\t}", "public void showBoard() {\n System.out.println(\"The board is\");\n System.out.println(\"| 1 | 2 | 3 |\\n| 4 | 5 | 6 | \\n| 7 | 8 | 9 |\");\n }", "public void printBoard() {\n printStream.println(\n \" \" + positions.get(0) + \"| \" + positions.get(1) + \" |\" + positions.get(2) + \"\\n\" +\n \"---------\\n\" +\n \" \" + positions.get(3) + \"| \" + positions.get(4) + \" |\" + positions.get(5) + \"\\n\" +\n \"---------\\n\" +\n \" \" + positions.get(6) + \"| \" + positions.get(7) + \" |\" + positions.get(8) + \"\\n\");\n }", "public void displayBoard(){\r\n System.out.println(board.toString());\r\n }", "static void showBoard() \n\t{\n\t\tSystem.out.println(\"|---|---|---|\");\n\t\tSystem.out.println(\"| \" + tictactoeBoard[1] + \" | \" + tictactoeBoard[2] + \" | \" + tictactoeBoard[3] + \" |\");\n\t\tSystem.out.println(\"|-----------|\");\n\t\tSystem.out.println(\"| \" + tictactoeBoard[4] + \" | \" + tictactoeBoard[5] + \" | \" + tictactoeBoard[6] + \" |\");\n\t\tSystem.out.println(\"|-----------|\");\n\t\tSystem.out.println(\"| \" + tictactoeBoard[7] + \" | \" + tictactoeBoard[8] + \" | \" + tictactoeBoard[9] + \" |\");\n\t\tSystem.out.println(\"|---|---|---|\");\n\t}", "public void showGameBoard() {\n for (int row = 0; row < BOARD_SIZE; row++) {\n for (int col = 0; col < BOARD_SIZE; col++) {\n System.out\n .printf(\"%3d\", playingBoard[row][col].getMoveNumber());\n if (col == BOARD_SIZE - 1) {\n System.out.println();\n }\n }\n }\n }", "public void printBoard() {\n \tfor(int i = 7; i >= 0; i--) {\n \t\tfor(int j = 0; j < 8; j++) {\n \t\t\tSystem.out.print(\"\"+getPiece(j, i).getColor().toString().charAt(0)+getPiece(j, i).getName().charAt(0)+\"\\t\");\n \t\t}\n \t\tSystem.out.println();\n \t}\n }", "public void printBoard() {\r\n\t\tif (getOpenTiles() != 0) {\r\n\t\t\tSystem.out.println(\"\\n\\nCurrent open tiles: \" + getOpenTiles() + \" | Total moves: \" + getMoves() + \" | Current board:\");\r\n\t\t}for (int i = 0; i < gameBoard.length; i++) {\r\n\t\t\tfor (int j = 0; j < gameBoard[i].length; j++) {\r\n\t\t\t\tif (gameBoard[i][j] != 0) {\r\n\t\t\t\t\tSystem.out.print(gameBoard[i][j]);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t}System.out.print(\" | \");\r\n\t\t\t}System.out.print(\"\\n--+\");\r\n\t\t\tfor (int k = 0; k < getSize(); k++) {\r\n\t\t\t\tSystem.out.print(\"---+\");\r\n\t\t\t}System.out.println();\r\n\t\t}\r\n\t}", "private static void showBoard()\n {\n System.out.println(board[1] + \" | \" + board[2] + \" | \" + board[3]);\n System.out.println(\"----------\");\n System.out.println(board[4] + \" | \" + board[5] + \" | \" + board[6]);\n System.out.println(\"----------\");\n System.out.println(board[7] + \" | \" + board[8] + \" | \" + board[9]);\n }", "public void printBoard() {\n\t\tSystem.out.print(\"\\r\\n\");\n\t\tSystem.out.println(\" A | B | C | D | E | F | G | H\");\n\t\tfor(int i = BOARD_SIZE ; i > 0 ; i--) {\n\t\t\tSystem.out.println(\" ___ ___ ___ ___ ___ ___ ___ ___\");\n\t\t\tfor(int j = 0; j < BOARD_SIZE ; j++) {\n\t\t\t\tif(j == 0) {\n\t\t\t\t\tSystem.out.print(i + \" |\");\n\t\t\t\t} \n\t\t\t\tif(this.tiles.get(i).get(j).getPiece() != null) {\n\t\t\t\t\tif(this.tiles.get(i).get(j).getPiece().getColor() == PrimaryColor.BLACK) {\n\t\t\t\t\t\tif(this.tiles.get(i).get(j).getPiece() instanceof Soldier)\n\t\t\t\t\t\t\tSystem.out.print(\" B |\");\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tSystem.out.print(\"B Q|\");\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tif(this.tiles.get(i).get(j).getPiece() instanceof Soldier)\n\t\t\t\t\t\t\tSystem.out.print(\" W |\");\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tSystem.out.print(\"W Q|\");\n\t\t\t\t\t}\n\t\t\t\t}else {\n\t\t\t\t\tSystem.out.print(\" |\");\n\t\t\t\t}\n\n\t\t\t\tif(j==BOARD_SIZE-1) {\n\t\t\t\t\tSystem.out.print(\" \" + i); \n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\tSystem.out.println(\" ___ ___ ___ ___ ___ ___ ___ ___\");\n\t\tSystem.out.println(\" A | B | C | D | E | F | G | H\\r\\n\");\n\n\t}", "public static void printBoard() {\n\t\tfor (int i = 0; i<3; i++) {\n\t\t\tSystem.out.println();\n\t\t\tfor (int j = 0; j<3; j++) {\n\t\t\t\tif (j == 0) {\n\t\t\t\t\tSystem.out.print(\"| \");\n\t\t\t\t}\n\t\t\t\tSystem.out.print(board[i][j] + \" | \");\n\t\t\t}\n\t\t}\n\t\tSystem.out.println();\n\t}", "public void printBoard() {\n System.out.println(\"---+---+---\");\n for (int x = 0; x < boardLength; x++) {\n for (int y = 0; y < boardWidth; y++) {\n char currentPlace = getFromCoordinates(x, y);\n System.out.print(String.format(\" %s \", currentPlace));\n\n if (y != 2) {\n System.out.print(\"|\");\n }\n }\n System.out.println();\n System.out.println(\"---+---+---\");\n }\n }", "public static void printBoard() {\n int separatorLen = 67;\n StringBuilder boardString = new StringBuilder();\n boardString.append(new String(new char [separatorLen]).replace(\"\\0\",\"*\"));\n boardString.append(\"\\n\");\n for(int y = Y_UPPER_BOUND - 1; y >= 0; y--)\n {\n boardString.append(y + 1).append(\" \");\n boardString.append(\"*\");\n for (int x = 0; x < X_UPPER_BOUND; x++)\n {\n Piece p = Board.board[x + y * X_UPPER_BOUND];\n if(p != null)\n {\n boardString.append(\" \").append(p).append(p.getColor()? \"-B\":\"-W\").append(\" \").append((p.toString().length() == 1? \" \":\"\"));\n }\n else\n {\n boardString.append(\" \");\n }\n boardString.append(\"*\");\n }\n boardString.append(\"\\n\").append((new String(new char [separatorLen]).replace(\"\\0\",\"*\"))).append(\"\\n\");\n }\n boardString.append(\" \");\n for(char c = 'A'; c <= 'H';c++ )\n {\n boardString.append(\"* \").append(c).append(\" \");\n }\n boardString.append(\"*\\n\");\n System.out.println(boardString);\n }", "public static void printBoard() {\n System.out.println(\"\\t-------------\");\n for (int row = 0; row < SIZE_ROW; row++) {\n System.out.print(\"\\t| \");\n for (int col = 0; col < SIZE_COL; col++) {\n System.out.print(board[row][col] + \" | \");\n }\n System.out.println(\"\\n\\t-------------\");\n }\n }", "public void ShowBoard(){\n System.out.println(\" ___________{5}_____{4}_____{3}_____{2}_____{1}_____{0}____________\");\n System.out.println(\"| ____ ____ ____ ____ ____ ____ ____ ____ |\");\n System.out.printf(\"| | | [_%2d_] [_%2d_] [_%2d_] [_%2d_] [_%2d_] [_%2d_] | | |\\n\",\n this.gameBoard[5], this.gameBoard[4], this.gameBoard[3],\n this.gameBoard[2], this.gameBoard[1], this.gameBoard[0]);\n System.out.println(\"| | | | | |\");\n System.out.printf(\"| | %2d | ____ ____ ____ ____ ____ ____ | %2d | |\\n\",\n this.gameBoard[6], this.gameBoard[13]);\n System.out.printf(\"| |____| [_%2d_] [_%2d_] [_%2d_] [_%2d_] [_%2d_] [_%2d_] |____| |\\n\",\n this.gameBoard[7], this.gameBoard[8], this.gameBoard[9],\n this.gameBoard[10], this.gameBoard[11], this.gameBoard[12]);\n System.out.println(\"|_________________________________________________________________|\");\n }", "public void PrintBoard() {\n\tSystem.out.println(\"printing from class\");\n\t\tString[][] a = this.piece;\n\t\tSystem.out.println(\" 0 1 2 3 4 5 6 7 <- X axis\");\n\t\tSystem.out.println(\" +----------------+ \");\n\t\t\n\t\tfor (int i=0; i<8 ;i++) {\n\t\t\tSystem.out.print(i + \" |\");\n\t\t\tfor (int j=0; j<8;j++) {\n\t\t\t\t\n\t\tSystem.out.print(\"\" + a[i] [j] + \" \");\n\t\t\t\t\t} \n\t\t\tSystem.out.println(\"|\");\n\t\t}\n\t\tSystem.out.println(\" +----------------+ \");\n\t\tSystem.out.println(\" 0 1 2 3 4 5 6 7 \");\n\t\n\t}", "public void printBoard() {\n String value = \"\";\n renderBoard();\n System.out.println(\"\");\n // loop to print out values in rows and columns\n for (int i = 0; i < game.getRows(); i++) {\n for (int j = 0; j < game.getCols(); j++) {\n if (grid[i][j] == 0)\n value = \".\";\n else\n value = \"\" + grid[i][j];\n System.out.print(\"\\t\" + value);\n }\n System.out.print(\"\\n\");\n }\n }", "public void printBoard() {\n\t\t// loop through board and add appropriate character based on board\n\t\t// contents\n\n\t\t// for each board column\n\t\tfor (int row = 0; row < board.length; row++) {\n\t\t\t// for each board row\n\t\t\tfor (int col = 0; col < board[row].length; col++) {\n\t\t\t\tif (board[row][col] == 0) {\n\t\t\t\t\tSystem.out.println(\" \");\n\t\t\t\t} else if (board[row][col] == 1) {\n\t\t\t\t\tSystem.out.println(\"X\");\n\t\t\t\t} else if (board[row][col] == 2) {\n\t\t\t\t\tSystem.out.println(\"0\");\n\t\t\t\t}\n\n\t\t\t\t// set the dividers\n\t\t\t\tif (col < board[row].length) {\n\t\t\t\t\tSystem.out.print(\"|\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println();\n\t\t\t\t\tSystem.out.println(\"-----\");\n\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// check if the board is occupied by player X, or player O, or neither\n\t\t// Print the correct character to the screen depending on the contents\n\t\t// of the square\n\t\t// System.out.print(\"stuff\") will print things on the same row\n\n\t\t// System.out.print(\"/n\") or System.out.println() will print a new line\n\t\t// Don't forget to add in the grid lines!\n\t}", "public void printboard(){\n \tfor(int i=0;i<9;i+=3){\n\t\t\t System.err.println(board[i]+board[i+1]+board[i+2]);\n\t\t\t}\n }", "public static void printBoard() {\n\t\tint i = 0;\n\t\tint j = 0;\n\n\t\t// Row Counter\n\t\tfor (i = 0; i < numPeople; i++) {\n\n\t\t\t// Column Counter\n\t\t\tfor (j = 0; j < numPeople; j++) {\n\t\t\t\tSystem.out.print(board[i][j] + \"\\t\");\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\n\t\t}\n\n\t}", "public void printBoard() {\r\n\t\tBoard.printBoard(this.board);\r\n\t}", "public void print()\n {\n System.out.println(\"------------------------------------------------------------------\");\n System.out.println(this.letters);\n System.out.println();\n for(int row=0; row<8; row++)\n {\n System.out.print((row)+\"\t\");\n for(int col=0; col<8; col++)\n {\n switch (gameboard[row][col])\n {\n case B:\n System.out.print(\"B \");\n break;\n case W:\n System.out.print(\"W \");\n break;\n case EMPTY:\n System.out.print(\"- \");\n break;\n default:\n break;\n }\n if(col < 7)\n {\n System.out.print('\\t');\n }\n\n }\n System.out.println();\n }\n System.out.println(\"------------------------------------------------------------------\");\n }", "public void printBoard() {\n\t\tSystem.out.println();\n\t\tint i;\n\t\tfor (i = 0; i < 7; i++) {\n\t\t\tSystem.out.print(board[13 - i] + \" \");\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.printf(\" \");\n\t\twhile (i < 14) {\n\t\t\tSystem.out.print(board[i - 7] + \" \");\n\t\t\ti++;\n\t\t}\n\t\tSystem.out.println();\n\t}", "public static void draw() {\n\t\tSystem.out.println();\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println(\" \" + board[0][0] + \" | \" + board[0][1] + \" | \"\n\t\t\t\t+ board[0][2]);\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println(\"---+---+---\");\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println(\" \" + board[1][0] + \" | \" + board[1][1] + \" | \"\n\t\t\t\t+ board[1][2]);\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println(\"---+---+---\");\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println(\" \" + board[2][0] + \" | \" + board[2][1] + \" | \"\n\t\t\t\t+ board[2][2]);\n\t\tSystem.out.println(\" | | \");\n\t\tSystem.out.println();\n\t}", "public void print_board(){\n\t\tfor(int i = 0; i < size*size; i++){\n\t\t\tif(i%this.size == 0) System.out.println(); //just for divider\n\t\t\tfor(int j = 0; j < size*size; j++){\n\t\t\t\tif(j%this.size == 0) System.out.print(\" \"); //just for divider\n\t\t\t\tSystem.out.print(board[i][j]+\" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public static void printBoard(){\n \n System.out.println(board[0][0] + \" | \" + board[0][1] + \" | \" + board[0][2]);\n System.out.println(board[1][0] + \" | \" + board[1][1] + \" | \" + board[1][2]);\n System.out.println(board[2][0] + \" | \" + board[2][1] + \" | \" + board[2][2]);\n \n }", "private static void showBoard() {\n for (int i = 1; i < 10; i++) {\n for (int j = 1; j < 4; j++) {\n System.out.println(j + \".\" + board[i]);\n }\n\n }\n }", "public void Display_Boards(){\r\n\t\tfor(int i=0; i<13; i++){\r\n\t\t\tdisplay.putStaticLine(myBoard.Display(i)+\" \"+hisBoard.Display(i));\r\n\t\t}\r\n\t}", "public void printBoard() {\n\t\tfor (int colIndex = 0; colIndex < 4; colIndex++){\n\t\t\tfor (int rowIndex = 0; rowIndex < 4; rowIndex++){\n\t\t\t\tSystem.out.print(this.myBoard[colIndex][rowIndex] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void display() { \r\n\t\tfor (int i=0; i<3; i++){ \r\n\t\t\tSystem.out.print(\"|\"); \r\n\t\t\tfor (int j=0; j<3; j++){ \r\n\t\t\t\tSystem.out.print(board[i][j] + \"|\");\r\n\t\t\t}\r\n\t\t\tSystem.out.println(); \r\n\t\t}\r\n\t\tSystem.out.println(); \r\n\t}", "public static void drawBoard(){\n\t\tSystem.out.println(\"\\n\\t A B C\");\r\n\t\tSystem.out.println(\"\\t .-----------.\");\r\n\t\tSystem.out.println(\"\\t1 |_\"+TicTac.place[0]+\"_|_\"+TicTac.place[1]+\"_|_\"+TicTac.place[2]+\"_|\\n\");\r\n\t\tSystem.out.println(\"\\t2 |_\"+TicTac.place[3]+\"_|_\"+TicTac.place[4]+\"_|_\"+TicTac.place[5]+\"_|\\n\");\r\n\t\tSystem.out.println(\"\\t3 |_\"+TicTac.place[6]+\"_|_\"+TicTac.place[7]+\"_|_\"+TicTac.place[8]+\"_|\");\r\n\t\tSystem.out.println(\"\\t '-----------'\");\r\n\t}", "private void printBoard() {\n\n for (int j=Board.getSize()-1; j >= 0; j--) {\n for (int i=0; i < Board.getSize(); i++) {\n // make sure indexes get printed for my pieces\n if (board.layout[i][j] == player) {\n //System.out.print(\" \"+ getPieceIndex(i,j)+ \" \");\n } else {\n System.out.print(\" \"+ board.layout[i][j]+ \" \");\n }\n }\n System.out.print(\"\\n\");\n\n }\n }", "public void printBoard() {\n\t\tfor (int row=8; row>=0;row--){\n\t\t\tfor (int col=0; col<9;col++){\n\t\t\t\tSystem.out.print(boardArray[col][row]);\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}\n\t}", "public void printBoard()\n {\n // Print column numbers;\n System.out.print(\" \");\n for (int index = 0; index < columns; index++)\n System.out.print(\" \" + index);\n\n System.out.println();\n\n // Print the row numbers and the board contents.\n for (int index = 0; index < rows; index++)\n {\n System.out.print(index);\n\n for (int index2 = 0; index2 < columns; index2++)\n System.out.print(\" \" + board[index][index2]);\n\n System.out.println();\n }\n\n }", "public void consoleBoardDisplay(){\n\t\tString cell[][] = ttt.getCells();\n\t\tSystem.out.println(\"\\n\" +\n\t\t\t\"R0: \" + cell[0][0] + '|' + cell[0][1] + '|' + cell[0][2] + \"\\n\" +\n\t\t\t\" \" + '-' + '+' + '-' + '+' + '-' + \"\\n\" +\n\t\t\t\"R1: \" + cell[1][0] + '|' + cell[1][1] + '|' + cell[1][2] + \"\\n\" +\n\t\t\t\" \" + '-' + '+' + '-' + '+' + '-' + \"\\n\" +\n\t\t\t\"R2: \" + cell[2][0] + '|' + cell[2][1] + '|' + cell[2][2] + \"\\n\"\n\t\t);\n\t}", "public void printBoard() {\n System.out.println(\"Updated board:\");\n for (int row = 0; row < size; row++) {\n for (int col = 0; col < size; col++) {\n\n System.out.print(grid[row][col] + \" \");\n\n }\n System.out.println(\"\");\n }\n }", "private static void printBoard() {\n\n\t//\tJOptionPane.showMessageDialog(null, \"Heyoo\", \".-*Board*-.\", -1);\n\t\t//String name = JOptionPane.showInputDialog(\"Vat is dain name?\");\n\t\t//JOptionPane.showMessageDialog(null, \"Aiight you good, \" + name);\n\t\t\n\t\t\n\t\tString[] options = {\"Sten\", \"Sax\", \"Påse\"};\n\t\tString Val = (String)JOptionPane.showInputDialog(null, \"Sten, Sax eller Påse?\",\n \"Game nr\", JOptionPane.QUESTION_MESSAGE, null, options, options[2]);\n\t\t\n\t\t\n\t\t\n\t}", "public void gameBoard()\t\n\t{\n\t\tSystem.out.println();\n\t\t\n\t\t// for loop to read through the board array\n\t\tfor( int i = 0; i < board.length; i++ )\n\t\t{\n\t\t\tboard[ i ] = \" \";\n\t\t\t\n\t\t} // end of for( int i = 0; i < board.length; i++ )\n\t\t\n\t\t// prints the top vertical lines to create the board\n\t\tSystem.out.println( \" \" + board[ 1 ] + \" | \" + board[ 2 ] + \" | \" \n\t\t + board[ 3 ] );\n\t\t\n\t\t// prints top most horizontal line to create the board\n\t\tSystem.out.println( \"____________________________\");\n\t\t\n\t\t// prints the middle vertical lines to create the board\n\t\tSystem.out.println( \" \" + board[ 4 ] + \" | \" + board[ 5 ] + \" | \" \n + board[ 6 ] );\n\t\t\n\t\t// prints the second horizontal line to create the board\n\t\tSystem.out.println( \"____________________________\");\n\t\t\n\t\t// prints the middle vertical lines to create the board\n\t\tSystem.out.println( \" \" + board[ 7 ] + \" | \" + board[ 8 ] + \" | \" \n + board[ 9 ] );\n\t\t\n\t}", "public void printBoard() {\n for (int i = 0; i < rows; i++) {\n for (int j = 0; j <colls; j++) {\n System.out.print(board[i][j]);\n }\n if(i == 0) {\n System.out.print(\" Apples eaten: \" + appleCount);\n }\n System.out.println(\"\");\n }\n }", "void displayBoard();", "public void draw()\n\t{\n\t\tSystem.out.println(\" |-------------------------------|\");\n\t\t\n\t\tfor (int i = 0; i < board_size; i++)\n\t\t{\n\t\t\tSystem.out.print(board_size - i + \" |\");\n\t\t\t\n\t\t\tfor (int j = 0; j < board_size; j++)\n\t\t\t{\n\t\t\t\tif (getPiece(i,j) == null) {System.out.print(\" |\");}\n\t\t\t\telse {System.out.print(\" \" + getPiece(i,j).getSymbol().toChar() + \" |\");}\n\t\t\t}\n\t\t\t\n\t\t\tSystem.out.println(\"\");\n\t\t\tSystem.out.println(\" |-------------------------------|\");\n\t\t}\n\t\t\n\t\tSystem.out.println(\" A B C D E F G H \\n\");\n\t}", "private void printBoard() {\r\n for (int i = 0; i < board.length; i++) {\r\n for (int j = 0; j < board[i].length; j++) {\r\n System.out.print(board[j][i] + \" \");\r\n }\r\n System.out.println();\r\n }\r\n }", "public void displayBoard()\n {\n System.out.println(\"\");\n System.out.println(\" Game Board \");\n System.out.println(\" ---------------------------------\");\n for (int i = 0; i < ROW; i++)\n {\n System.out.print(i+1 + \" | \");\n for (int j = 0; j < COL; j++)\n {\n //board[i][j] = \"A\";\n System.out.print(board[i][j].getPieceName() + \" | \");\n }\n System.out.println();\n }\n System.out.println(\" ---------------------------------\");\n\n System.out.println(\" a b c d e f g h \");\n }", "public void displayBoard() {\n newLine();\n for (int row = _board[0].length - 1; row >= 0; row -= 1) {\n String pair = new String();\n for (int col = 0; col < _board.length; col += 1) {\n pair += \"|\";\n pair += _board[col][row].abbrev();\n }\n System.out.println(pair + \"|\");\n newLine();\n }\n }", "public void displayBoard(Board board) { //Print the whole current board\n System.out.print(\"\\n \");\n System.out.print(\"A B C D E F G H\");\n System.out.println();\n for (int row = 0; row < BOARD_SIZE; row++) {\n System.out.print((row + 1) + \" \");\n for (int column = 0; column < BOARD_SIZE; column++) {\n System.out.print(board.board[row][column] + \" \");\n }\n System.out.println();\n }\n System.out.println();\n }", "public void printShipBoard() {\n\t\tSystem.out.println(Arrays.deepToString(this.shipBoard));\n\t}", "public void printBoard() {\nString xAxis[] = {\"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\"};\n\t\tfor(int k = 0; k <8; k++) {\n\t\t\tSystem.out.print(\"\\t\" + xAxis[k]);\n\t\t}\n\t\tSystem.out.println(\"\\n\");\n\t\tfor(int i = 0; i<8;i++) {\n\t\t\tSystem.out.print((i + 1) + \"\\t\");\n\t\t\tfor(int j = 0; j<8;j++) {\n\t\t\t\tSystem.out.print(board.getBoard()[i][j] + \"\\t\");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tSystem.out.println();\n\t\tfor(int k = 0; k <8; k++) {\n\t\t\tSystem.out.print(\"\\t\" + xAxis[k]);\n\t\t}\n\t\tSystem.out.println();\n\t}", "private void boardPrint(){\t\t\n\t\tfor (int i=0;i<size;i++) {\n\t for (int j=0;j<size;j++) {\n\t System.out.print(\" ---- \");\n\t }\n\t System.out.println();\n\t for (int j=0;j<size;j++) {\n\t \tint value = (i*size) + j + 1;\n\t \tif(board[i][j] == '\\u0000'){\n\t \t\tif(value < 10)\n\t \t\t\tSystem.out.print(\"| \"+ value + \" |\");\n\t \t\telse\n\t \t\t\tSystem.out.print(\"| \"+ value + \" |\");\n\t \t}\n\t \telse\n\t \t\tSystem.out.print(\"| \"+ board[i][j] + \" |\");\n\t }\n\t System.out.println();\n\t }\n\n\t for (int i=0;i<size;i++){\n\t \tSystem.out.print(\" ---- \");\n\t }\n\t System.out.println();\n\t}", "public void drawBoard() {\n String[][] strBoard= new String[4][4];\n for(int x= 0; x<4; x++) {\n for(int y= 0; y<4; y++) {\n if(board[x][y]==0) {\n strBoard[x][y]= \".\";\n }\n else {\n // set color\n if(board[x][y]%3==2) {\n }\n strBoard[x][y]= \"\"+board[x][y];\n }\n }\n }\n \n String line= \"---------------------------------\";\n System.out.println(line);\n for(int x= 0; x<4; x++) {\n for(int y= 0; y<4; y++) {\n System.out.print(\"|\"+strBoard[x][y]+\"\\t\");\n }\n System.out.println(\"|\");\n }\n System.out.println(line);\n }", "public void printBoard() {\r\n // Print column numbers.\r\n System.out.print(\" \");\r\n for (int i = 0; i < BOARD_SIZE; i++) {\r\n System.out.printf(\" %d \", i+1);\r\n }\r\n System.out.println(\"\\n\");\r\n\r\n\r\n for (int i = 0; i < BOARD_SIZE; i++) {\r\n System.out.printf(\"%c %c \", 'A' + i, board[i][0].mark);\r\n\r\n for (int j = 1; j < BOARD_SIZE; j++) {\r\n System.out.printf(\"| %c \", board[i][j].mark);\r\n }\r\n\r\n System.out.println(\"\");\r\n\r\n if (i < BOARD_SIZE - 1) {\r\n System.out.print(\" \");\r\n for (int k = 1; k < BOARD_SIZE * 3 + BOARD_SIZE; k++) {\r\n System.out.print(\"-\");\r\n }\r\n System.out.println(\"\");\r\n }\r\n }\r\n System.out.println(\"\");\r\n }", "private void renderBoard() {\n Cell[][] cells = gameBoard.getCells();\n StringBuilder battleField = new StringBuilder(\"\\tA B C D E F G H I J \\n\");\n\n for (int i = 0; i < cells.length; i++) {\n battleField.append(i+1).append(\"\\t\");\n for (int j = 0; j < cells[i].length; j++) {\n if (cells[i][j].getContent().equals(Content.deck)) {\n battleField.append(\"O \");\n } else {\n battleField.append(\"~ \");\n }\n }\n battleField.append(\"\\n\");\n }\n\n System.out.println(battleField.toString());\n }", "public void printBoard(Tile[][] gameState) {\n\t\tint boardSize = gameState.length;\n\t\tSystem.out.println(printBoardLine());\n\t\tfor (int i = 0; i < boardSize; i++) {\n\t\t\tfor (int j = 0; j < boardSize; j++) {\n\t\t\t\tSystem.out.print(\"|\");\n\t\t\t\tif (gameState[i][j].getColorValue().equals(black)) {\n\t\t\t\t\tSystem.out.print(\" b \");\n\t\t\t\t} else if (gameState[i][j].getColorValue().equals(white)) {\n\t\t\t\t\tSystem.out.print(\" w \");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"|\");\n\t\t\tSystem.out.println(printBoardLine());\n\t\t}\n\t}", "private static void printBoard(char[][] board) {\n\n\t\t// header\n\t\tfor (int i = 0; i < board.length; i++) {\n\t\t\tSystem.out.print(\"- \");\n\t\t}\n\n\t\tSystem.out.println();\n\n\t\tfor (int i = 0; i < board.length; i++) {\n\t\t\tfor (int j = 0; j < board[0].length; j++) {\n\t\t\t\tSystem.out.print(board[i][j] + \" \");\n\t\t\t}\n\n\t\t\tSystem.out.println();\n\t\t}\n\n\t\t// footer\n\t\tfor (int j = 0; j < board.length; j++) {\n\t\t\tSystem.out.print(\"- \");\n\t\t}\n\n\t\tSystem.out.println();\n\t}", "String drawBoard();", "public void printBoard(){\n\t\tfor(int row = 0; row <9; row++)\n\t\t{\n\t\t\tfor(int column = row; column<25-row; column++)\n\t\t\t{\n\t\t\t\tBoard[row][column]='O';\n\t\t\t}\n\t\t}\n\t\tfor(int iteration_i = 0;iteration_i<9;iteration_i++){\n\t\t\tfor(int iteration_j=0;iteration_j<25;iteration_j++)\n\t\t\t{\t\n\t\t\t\tif (Board[iteration_i][iteration_j]=='\\u0000')\n\t\t\t\t\tSystem.out.print(\" \");\n\t\t\t\telse\n\t\t\t\t\tSystem.out.print(Board[iteration_i][iteration_j]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public static void printGameBoard(Player[][] board) {\n\t\tStringBuilder rowBuffer = new StringBuilder(); \n\t\tfor (int row = 0; row < Score4Constants.rowMax; row++) {\n\t\t\tfor (int col = 0; col < Score4Constants.colMax; col++) {\n\t\t\t\trowBuffer.append(board[row][col].getName());\n\t\t\t\trowBuffer.append(\" \");\n\t\t\t}\n\t\t\tlogger.info(\"ROW: {}: {}\", row + 1, rowBuffer);\n\t\t\trowBuffer.delete(0, rowBuffer.length());\n\t\t}\n\t}", "@Override\r\n\tvoid showGameState() {\r\n\t\t// TODO Auto-generated method stub\r\n\t\t \r\n System.out.println(\"-------------\");\r\n\t\t\r\n for (int i = 0; i < boardsize; i++) \r\n {\r\n System.out.print(\"| \");\r\n for (int j = 0; j < boardsize; j++) \r\n {\r\n \tif(board[i][j]==-1)\r\n \t\tSystem.out.print(\"_\" + \" | \");\r\n \telse if\t(board[i][j]==0)\r\n \t\tSystem.out.print( \"W | \");\r\n \telse\r\n \t\tSystem.out.print( \"B | \");\r\n }\r\n System.out.println();\r\n System.out.println(\"-------------\");\r\n }\r\n }", "public void showBoardState() {\n System.out.print(\" \");\n //top row X axis\n for(int i = 0; i < boardSize; i++){\n System.out.print(\" \" + i + \" \");\n }\n System.out.println();\n for (int i = 0; i < boardSize; i++) {\n //conversion 0-9 to char for display as Y axis\n System.out.print(\" \" + (char)(i + 'A') + \" \");\n for (int j = 0; j < boardSize; j++) {\n System.out.print(\" \" + board[i][j] + \" \");\n }\n System.out.println();\n\n }\n System.out.println();\n }", "private void displayBoard(Board board)\n {\n for (int i = 0; i < size; i++)\n {\n System.out.print(\"|\");\n for (int j = 0; j < size; j++)\n \n System.out.print(board.array[i][j] + \"|\");\n System.out.println();\n }\n }", "public void printBoard(LightModel board){\n String separatorSx = \"| \";\n String centralSep = \" | \";\n String separatorDx = \" |\";\n\n for(LightPlayer lp : board.getPlayers()){\n playersInfo.append(lp.getColor().toString()).append(\" = \").append(lp.getName()).append(\" \");\n }\n System.out.println(playersInfo);\n playersInfo.setLength(0);\n for(int j=0; j<=4;j++) {\n floorInfo.append(\"| \");\n pawnInfo.append(separatorSx);\n for (int i = 0; i < 4; i++) {\n if (board.getLightGrid()[j][i].isRoof()) {\n floorInfo.append(\"* \").append(board.getLightGrid()[j][i].getFloor()).append(\" | \");\n } else floorInfo.append(\" \").append(board.getLightGrid()[j][i].getFloor()).append(\" | \");\n if (board.getLightGrid()[j][i].getOccupied() == null) {\n pawnInfo.append(\" \").append(centralSep);\n } else\n pawnInfo.append(board.getLightGrid()[j][i].getOccupied().toString())\n .append(board.getLightGrid()[j][i].getOccupied().getNumber())\n .append(centralSep);\n }\n if (board.getLightGrid()[j][4].isRoof()) {\n floorInfo.append(\"* \").append(board.getLightGrid()[j][4].getFloor()).append(separatorDx);\n } else floorInfo.append(\" \").append(board.getLightGrid()[j][4].getFloor()).append(separatorDx);\n if (board.getLightGrid()[j][4].getOccupied() == null) {\n pawnInfo.append(\" \").append(separatorDx);\n } else\n pawnInfo.append(board.getLightGrid()[j][4].getOccupied().toString())\n .append(board.getLightGrid()[j][4].getOccupied().getNumber())\n .append(separatorDx);\n System.out.println(\"+ - - + - - + - - + - - + - - +\");\n System.out.println(floorInfo.toString());\n System.out.println(pawnInfo.toString());\n pawnInfo.setLength(0);\n floorInfo.setLength(0);\n\n }\n System.out.println(\"+ - - + - - + - - + - - + - - +\");\n }", "public static String printBoard(Game board) {\n return board.toString();\n }", "public String drawBoard() {\n fillBoard();\n return \"\\n\" +\n \" \" + boardArray[0][0] + \" | \" + boardArray[0][1] + \" | \" + boardArray[0][2] + \" \\n\" +\n \"------------\\n\" +\n \" \" + boardArray[1][0] + \" | \" + boardArray[1][1] + \" | \" + boardArray[1][2] + \" \\n\" +\n \"------------\\n\" +\n \" \" + boardArray[2][0] + \" | \" + boardArray[2][1] + \" | \" + boardArray[2][2] + \" \\n\";\n }", "public void displayBoard() {\n System.out.printf(\"%20s\",\"\"); // to add spacing\n for(int i = 0; i < space[0].length; i++) //Put labels for number axis\n {\n System.out.printf(\"%4d\",i+1);\n }\n System.out.println();\n for(int row = 0; row < this.space.length; row++) { //Put letter labels and appropriate coordinate values\n System.out.print(\" \"+ (char)(row+'A') + \"|\");\n for (String emblem: this.space[row]) //coordinate values\n System.out.print(emblem + \" \");\n System.out.println();\n }\n }", "public static void displayboard(String board[][]){\n\t\tint rowindicator[]=new int[boardwidth+1];\n\t\tint rowcount=1;\n\t\tfor(int i=1;i<=boardwidth;i++){\n\t\t\trowindicator[i]=rowcount;\n\t\t\trowcount++;\n\t\t}\n\t\tint columnindicator[]=new int[boardlength+1];\n\t\tint columncount=1;\n\t\tfor(int i=1;i<=boardlength;i++){\n\t\t\tcolumnindicator[i]=columncount;\n\t\t\tcolumncount++;\n\t\t}\n\t\tSystem.out.print(\"\\n \");\n\t\tfor(int i=1;i<=boardlength;i++){\n\t\t\t//displays column indicator\n\t\t\tSystem.out.print(\" \"+columnindicator[i]);\n\t\t}\n\t\t//displays board\n\t\tSystem.out.println(\"\");\n\t\tfor(int x=1;x<=boardwidth;x++){\n\t\t\t//displays row indicator\n\t\t\tSystem.out.print(\" \"+rowindicator[x]);\n\t\t\tfor(int i=1;i<=boardlength;i++){\n\t\t\t\tSystem.out.print(\" \"+board[x][i]);\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void PrintGameBoard(int [][] arr) {\r\n\t\tsb.append(\" | A B C D E F G H I J\");\r\n\t\tSystem.out.println(sb.toString());\r\n\t\tsb.delete(0, sb.length());\r\n\t\tfor (int i = 0; i <arr.length; i++ ) {\r\n\t\t\t\r\n\t\t\tfor (int j = 0; j < arr.length; j++) {\r\n\t\t\t\tif (arr[i][j] == 0 || arr[i][j] == 3) {\r\n\t\t\t\t\tsb.append(\"* \");\r\n\t\t\t\t}\r\n\t\t\t\telse if(arr[i][j] == 1) {\r\n\t\t\t\t\tsb.append(\"O \");\r\n\t\t\t\t}\r\n\t\t\t\telse if (arr[i][j] == 2) {\r\n\t\t\t\t\tsb.append(\"X \");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.println(i+\"| \"+sb.toString());\r\n\t\t\tsb.delete(0, sb.length());\r\n\t\t}\r\n\t}", "public static void printBoard(Player[] players) {\r\n\t\tint startCount = 0;\r\n\t\tint endCount = BOARD_LENGTH - 1;\r\n\t\t//top row\r\n\t\tfor (int i = 0; i < BOARD_SIZE; i++) {\r\n\t\t\tSystem.out.print(Spaces[startCount++].ID);\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\t//sides\r\n\t\tfor (int i = 0; i < BOARD_SIZE - 2; i++) {\r\n\t\t\tfor (int j = 0; j < BOARD_SIZE; j++) {\r\n\t\t\t\tif (j == 0) {\r\n\t\t\t\t\tSystem.out.print(Spaces[endCount--].ID);\r\n\t\t\t\t} else if (j == BOARD_SIZE - 1) {\r\n\t\t\t\t\tSystem.out.println(Spaces[startCount++].ID);\r\n\t\t\t\t} else {\r\n\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t//bottom row\r\n\t\tfor (int i = 0; i < BOARD_SIZE; i++) {\r\n\t\t\tSystem.out.print(Spaces[endCount--].ID);\r\n\t\t}\r\n\t\t//player information\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println();\r\n\t\tplayers[0].showPlayerInfo();\r\n\t\tplayers[1].showPlayerInfo();\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println();\r\n\t}", "public void Print()\n\t{\n\t\tSystem.out.print(\"\\n_____GRID______\");\n\t\n\t\tfor(int x = 0; x < 9; x++)\n\t\t{\n\t\t\t\tif(x%3 == 0)\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"\");\n\t\t\t\t}\n\t\t\t\tif(grid[x] !=0)\n\t\t\t\t{\n\t\t\t\t\tif(grid[x] == -1)\n\t\t\t\t\t\tSystem.out.print(\"|_\"+ \"O\" + \"_|\");\n\t\t\t\t\telse\n\t\t\t\t\t\tSystem.out.print(\"|_\"+ \"X\" + \"_|\");\n\t\t\t\t}\n\t\t\t\telse // blank square\n\t\t\t\t{\n\t\t\t\t\tSystem.out.print(\"|_\"+ \" \" + \"_|\");\n\t\t\t\t}\n\t\t\t\t\n\t\t}\n\t\tSystem.out.println(\"\");\n\t}", "private static void printBoard(char [][] board){\n for (int i = 0; i < 6; i++){\n for(int j = 0; j < 7; j++){\n System.out.print(\"|\"+board[i][j]);\n }\n System.out.println(\"|\");\n }\n System.out.println();\n }", "public void printBoard(int[][] board) //creates a user-freindly representation of the board and prints it for the user\n {\n for (int i = 0; i < 9; i++) //n\n {\n if (i == 0) { //1\n System.out.println(\"-------------------------\"); //prints top border of board //1\n }\n \n for (int j = 0; j < 9; j++) //n\n {\n if (j == 0)\n {\n System.out.print(\"| \" + board[i][j] + \" \");\n }\n else if ((j+1) % 3 == 0) // 3\n {\n System.out.print(board[i][j] + \" | \"); //prints divider to separate into sets of 3 columns //3\n }\n else \n {\n System.out.print(board[i][j] + \" \");\n }\n }\n System.out.println(); //1\n\n if ((i+1) % 3 == 0) //3\n {\n System.out.println(\"-------------------------\"); //prints to separate into sets of 3 rows //1\n }\n }\n }", "public void showBoard(){\n }", "public void printTiles() {\r\n for (int row=0; row<BOARD_MAX_WIDTH; row++) {\r\n for (int col=0; col<BOARD_MAX_WIDTH; col++) {\r\n System.out.print(tiles[row][col]);\r\n }\r\n System.out.println();\r\n }\r\n System.out.println();\r\n }", "String displayMyBoard();", "@Override\n public String displayGameBoard(int stage) {\n String out=\"\";\n switch(stage) {\n case 0:\n out = \"Initial State: \";\n for (int i = 0; i < this.squareCount; i++) {\n out = out.concat(this.mySquares[i].statusSquare());\n }\n break;\n case 1:\n out = String.format(\"%s rolls %d:\", this.currentPlayer.getName(), this.numSquares);\n for (int i = 0; i < this.squareCount; i++) {\n out = out.concat(this.mySquares[i].statusSquare());\n }\n break;\n case 2:\n out = \"Final State: \";\n for (int i = 0; i < this.squareCount; i++) {\n out = out.concat(this.mySquares[i].statusSquare());\n }\n break;\n case 3:\n out = String.format(\"%s wins!\",this.currentPlayer.getName());\n break;\n }\n return(out);\n }", "public String showBoard() {\n return name + \"\\r\\n\" + myBoard.displayMyBoard() + \"\\r\\n\" + opponentsBoard.displayShotsTaken();\n }", "public void print()\n {\n System.out.println();\n for (int i = 0; i < 6; i++) {\n for (int j = 0; j < 6; j++) {\n int index=0;\n if(j>2)\n index++;\n if(i>2)\n index+=2;\n char c='○';\n if(blocks[index].getCells()[i%3][j%3]==CellType.Black)\n c='B';\n if(blocks[index].getCells()[i%3][j%3]==CellType.Red)\n c='R';\n System.out.print(c+\" \");\n if(j==2)\n System.out.print(\"| \");\n }\n System.out.println();\n if(i==2)\n System.out.println(\"-------------\");\n }\n }", "public void printBoard(){\n for (int i = 0; i < boardRows ; i++) {\n for (int j = 0; j < boardColumns; j++) {\n if(this.currentBoardState[i][j] == 0){\n System.out.print(\"0 \");\n }else{\n System.out.print(currentBoardState[i][j] + \" \");\n }\n }\n System.out.println();\n }\n }", "public void print(){\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" \");\n\t\tSystem.out.println(\" ~ THREE ROOM DUNGEON GAME ~ \");\n\t\tfor(int i = 0; i < this.area.length;i++){\n\t\t\tSystem.out.println(\" \");\n\t\t\tSystem.out.print(\" \");\n\t\t\tfor(int p = 0 ; p < this.area.length; p++){\n\t\t\t\tif(this.Garret[i][p] == 1){\n\t\t\t\t\tSystem.out.print(\":( \");\n\t\t\t\t}\n\t\t\t\telse if(this.Ari[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" ? \");\n\t\t\t\t}\n\t\t\t\telse if(this.position[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" + \");\n\t\t\t\t}\n\t\t\t\telse if(this.Items[i][p] != null){\n\t\t\t\t\tSystem.out.print(\"<$>\");\n\t\t\t\t}\n\t\t\t\telse if(this.Door[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" D \");\n\t\t\t\t}\n\t\t\t\telse if(this.Stairs[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" S \");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(this.area[i][p]);\n\t\t\t\t}\n\t\t\t}//end of inner for print\n\t\t}//end of outter for print\n\n\t}", "public void printBoard(){\n if(this.isEmpty()){\n System.out.println(\"Board empty: place anything\");\n } else {\n\n System.out.println(\"Dominos played:\");\n for (Dominos s : this) {\n if(this.indexOf(s)%2==0) {\n System.out.print(\"[\" + s.toString() + \"]\" + \" \");\n }\n }\n System.out.println();\n System.out.print(\" \");\n for (Dominos s : this) {\n if(this.indexOf(s)%2==1) {\n System.out.print(\"[\" + s.toString() + \"]\" + \" \");\n }\n }\n System.out.println();\n\n\n// System.out.println(\"Left domino: \" + this.getFirst()\n// + \", Right Domino: \" + this.getLast());\n }\n }", "public static void display(int[][] board) {\r\n\t\tfor (int i = 0; i < board.length; i++) {\r\n\t\t\tfor (int j = 0; j < board[0].length; j++)\r\n\t\t\t\tSystem.out.print(board[i][j] + \" \");\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "public void showBoard() {\n for (int i = 0; i < booleanBoard.length; i++) {\n for (int j = 0; j < booleanBoard.length; j++) {\n if (strBoard[i][j].equals(\"possible move\") || strBoard[i][j].equals(\"castling\")) {\n gA.getBoard()[i][j].setBackgroundResource(R.color.green);\n }\n if (strBoard[i][j].equals(\"possible kill\")) {\n gA.getBoard()[i][j].setBackgroundResource(R.color.red);\n }\n if (booleanBoard[i][j]) {\n if (figBoard[i][j].getColor().equals(\"white\")) {\n gA.getBoard()[i][j].setRotation(180);\n } else {\n gA.getBoard()[i][j].setRotation(0);\n }\n gA.getBoard()[i][j].setImageResource(figBoard[i][j].getImageResource());\n } else {\n gA.getBoard()[i][j].setImageResource(0);\n }\n }\n }\n }", "public static void display(){\n\tfor(int j=0;j<3;j++){\r\n\t\tfor(int k=0;k<3;k++){\r\n\t\t\tif(gamebd[j][k]==1)\r\n\t\t\tSystem.out.print(\"X \");\r\n\t\t\telse if(gamebd[j][k]==2)\r\n\t\t\t\tSystem.out.print(\"O \");\t\r\n\t\t\telse\r\n\t\t\t\tSystem.out.print(\"- \");\r\n\t\t}\r\n\tSystem.out.println();\r\n\t\t}\r\n}", "public static void printCheckerboard(int width,int height)\r\n{\n\tfor (int row=0; row<width; row++)\r\n\t{\r\n\r\n\t // for each column in this row\r\n\t for (int col=0; col<height; col++)\r\n\t {\r\n\t\t if (row % 2 == 0)\r\n\t\t\t{\r\n\t\t\t \tif (col % 2 == 0)\r\n\t\t\t \t\t{\r\n\t\t\t \t\t\tSystem.out.print(\"#\");\r\n\t\t\t \t\t}\r\n\t\t\t \tif (col % 1 == 0)\r\n\t\t\t \t\t{\r\n\t\t\t \t\t\tSystem.out.print(\" \");\r\n\t\t\t \t\t}\r\n\t\t\t}\r\n\t\t if (row % 1 == 0)\r\n\t\t {\r\n\t\t\t\tif (col % 2 == 0)\r\n\t\t \t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\" \");\r\n\t\t \t\t\t}\r\n\t\t\t\r\n\t\t \t\tif (col % 1 == 0)\r\n\t\t \t\t\t{\r\n\t\t \t\t\t\tSystem.out.print(\"#\");\r\n\t\t \t\t\t}\r\n\t\t }\r\n\t\t System.out.println(\"\");\r\n\t }\r\n\t System.out.println(\"\");\r\n\t}\r\n}", "void print() {\n for (int i = 0; i < 8; i--) {\n System.out.print(\" \");\n for (int j = 0; j < 8; j++) {\n System.out.print(_pieces[i][j].textName());\n }\n System.out.print(\"\\n\");\n }\n }", "public void print() {\r\n\t\tObject tmp[] = piece.values().toArray();\r\n\t\tfor (int i = 0; i < piece.size(); i++) {\r\n\t\t\tChessPiece p = (ChessPiece)tmp[i];\r\n\t\t\tSystem.out.println(i + \" \" + p.chessPlayer + \":\" + p.position + \" \" + p.isEnabled());\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(body.countComponents());\r\n\t}", "@Override\n public void printBoard(PrintStream output) {\n this.board.printBoard();\n }", "public void PrintBoard(Board b);", "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n\n //Print board\n int c = 0;\n for (Piece piece : board) {\n if (piece == null) {\n sb.append(\"\\t\");\n } else {\n sb.append(piece.pieceString()).append(\"\\t\");\n }\n if (++c % 4 == 0) {\n sb.append(\"\\n\");\n }\n }\n sb.append(\"\\n\");\n\n return sb.toString();\n }", "public void display() {\n drawLine();\n for(int i=0; i < nRows; i++) {\n System.out.print(\"|\");\n for(int j=0; j < nCols; j++) {\n if(used[i][j] && board[i][j].equals(\" \")) {\n System.out.print(\" x |\");\n }\n else {\n System.out.print(\" \" + board[i][j] + \" |\");\n }\n }\n System.out.println(\"\");\n drawLine();\n }\n }", "public void Print() {\r\n\t\tfor(Cell2048[] a : game) {\r\n\t\t\tfor(Cell2048 b : a) {\r\n\t\t\t\tSystem.out.print(b.getValue() + \" \");\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t\tSystem.out.println(\"score : \"+ score);\r\n\t}", "public void Print(Board b, int turn, int[] moves);", "public static void printGame(){\n System.out.println(\"Spielrunde \" + GameController.AKTUELLE_RUNDE);\n System.out.println(GameController.AKTUELLER_SPIELER +\" ist an der Reihe.\");\n System.out.println(\"Er attackiert \" +\n GameController.AKTUELLER_VERTEIDIGER + \" und verursacht \"\n + GameController.SCHADEN +\" Schaden. \");\n System.out.println();\n }", "public void DisplayBoard(Board bord);", "public static void drawPlayerBoard()\n {\n char rowLetter=' '; //Letra de las filas.\n \n System.out.println(\" 1 2 3 4 \" ); //Imprime la parte superior del tablero.\n System.out.println(\" +-------+-------+\");\n \n \n for (int i = 0; i< BOARD_HEIGHT; i++) //Controla los saltos de fila.\n {\n switch(i)\n {\n case 0: rowLetter='A';\n break;\n case 1: rowLetter='B';\n break;\n case 2: rowLetter='C';\n break;\n case 3: rowLetter='D';\n break;\n }\n \n System.out.print(rowLetter);\n \n for (int j = 0; j < BOARD_WIDTH; j++ ) //Dibuja las filas.\n {\n if (playerBoardPos[i][j]==0)\n {\n System.out.print(\"| · \");\n }\n else\n {\n System.out.print(\"| \" + playerBoardPos[i][j] + \" \");\n }\n }\n System.out.println(\"|\");\n \n if (i==((BOARD_HEIGHT/2)-1)) //Si se ha dibujado la mitad del tablero.\n {\n System.out.println(\" +-------+-------+\"); //Dibuja una separación en medio del tablero.\n }\n }\n \n System.out.println(\" +-------+-------+\"); //Dibuja linea de fin del tablero.\n }", "public void display() {\n\t\tfor (int i = 0; i < player.length; ++i) {\n\t\t\t// inserting empty line in every 3 rows.\n\t\t\tif (i % 3 == 0 && i != 0) {\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\tfor (int j = 0; j < player[i].length; ++j) {\n\t\t\t\t// inserting empty space in every 3 columns.\n\t\t\t\tif (j % 3 == 0 && j != 0) {\n\t\t\t\t\tSystem.out.print(' ');\n\t\t\t\t}\n\t\t\t\tif (problem[i][j] == 0 && player[i][j] == 0) {\n\t\t\t\t\tSystem.out.print(\"( )\");\n\t\t\t\t} else if (problem[i][j] == 0) {\n\t\t\t\t\tSystem.out.print(\"(\" + player[i][j] + \")\");\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(\"[\" + player[i][j] + \"]\");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tSystem.out.println();\n\t}", "public void displayBoard(char[][] grid) {\n System.out.println();\n System.out.println(\" 0 1 2 3 4 5 6\");\n System.out.println(\"---------------\");\n for (int row = 0; row < grid.length; row++) {\n System.out.print(\"|\");\n for (int col = 0; col < grid[0].length; col++) {\n System.out.print(grid[row][col]);\n System.out.print(\"|\");\n }\n System.out.println();\n System.out.println(\"---------------\");\n }\n System.out.println(\" 0 1 2 3 4 5 6\");\n System.out.println();\n }", "public void print(){\n for (int i = 0; i < rows; i++)\n {\n for (int j = 0; j < cols; j++)\n {\n if (start.getCol()==j&&start.getRow()==i)\n System.out.print('S');\n else if (end.getCol()==j&&end.getRow()==i)\n System.out.print('E');\n else if (maze[i][j]==1)\n System.out.print('\\u2588');\n else if (maze[i][j]==0)\n System.out.print('\\u2591');\n if (j!=cols-1){\n System.out.print(\" \");\n }\n }\n System.out.println();\n }\n //System.out.println(\"-------\");\n }", "public void displayGame()\n { \n System.out.println(\"\\n-------------------------------------------\\n\");\n for(int i=3;i>=0;i--)\n {\n if(foundationPile[i].isEmpty())\n System.out.println(\"[ ]\");\n else System.out.println(foundationPile[i].peek());\n }\n System.out.println();\n for(int i=6;i>=0;i--)\n {\n for(int j=0;j<tableauHidden[i].size();j++)\n System.out.print(\"X\");\n System.out.println(tableauVisible[i]);\n }\n System.out.println();\n if(waste.isEmpty())\n System.out.println(\"[ ]\");\n else System.out.println(waste.peek());\n if(deck.isEmpty())\n System.out.println(\"[O]\");\n else System.out.println(\"[X]\");\n }", "public void print_maze () {\n \n System.out.println();\n\n for (int row=0; row < grid.length; row++) {\n for (int column=0; column < grid[row].length; column++)\n System.out.print (grid[row][column]);\n System.out.println();\n }\n\n System.out.println();\n \n }", "public void print() {\n\t\tcounter++;\n\t\tSystem.out.print(counter + \" \");\n\t\tfor (int i = 0; i < size; i++) {\n\t\t for (int j = 0; j < size; j++) {\n\t\t\t\tSystem.out.print(squares[j][i].getValue());\n\t\t }\n\t\t System.out.print(\"//\");\n\t\t}\n\t\tSystem.out.println();\n }", "public void printPuzzle() {\n\t\tSystem.out.print(\" +-----------+-----------+-----------+\\n\");\n\t\tString value = \"\";\n\t\tfor (int row = 0; row < puzzle.length; row++) {\n\t\t\tfor (int col = 0; col < puzzle[0].length; col++) {\n\t\t\t\t// if number is 0, print a blank\n\t\t\t\tif (puzzle[row][col] == 0) value = \" \";\n\t\t\t\telse value = \"\" + puzzle[row][col];\n\t\t\t\tif (col % 3 == 0)\n\t\t\t\t\tSystem.out.print(\" | \" + value);\n\t\t\t\telse\n\t\t\t\t\tSystem.out.print(\" \" + value);\n\t\t\t}\n\t\t\tif ((row + 1) % 3 == 0)\n\t\t\t\tSystem.out.print(\" |\\n +-----------+-----------+-----------+\\n\");\n\t\t\telse\n\t\t\t\tSystem.out.print(\" |\\n\");\n\t\t}\n\t}" ]
[ "0.85774183", "0.8449436", "0.84132004", "0.834984", "0.8284499", "0.82622564", "0.8244837", "0.8236626", "0.8218346", "0.81959915", "0.81747806", "0.8153473", "0.8151843", "0.81483954", "0.8146779", "0.81166273", "0.81156707", "0.81034935", "0.8101362", "0.81008554", "0.8100561", "0.8095905", "0.80771124", "0.80439955", "0.8040475", "0.8029263", "0.7986952", "0.79805577", "0.7963878", "0.79261523", "0.79087913", "0.78463393", "0.78349435", "0.7788107", "0.7761899", "0.77582526", "0.7757013", "0.7753602", "0.7747923", "0.77415025", "0.77308303", "0.7714845", "0.7699501", "0.76980716", "0.7696394", "0.7649997", "0.7624558", "0.75940245", "0.75894445", "0.7586045", "0.7583986", "0.7559084", "0.75568503", "0.75528467", "0.75483614", "0.7537981", "0.75375974", "0.7532463", "0.7522781", "0.7522058", "0.7500591", "0.7492816", "0.7485993", "0.74807215", "0.7433509", "0.74266136", "0.7418604", "0.73861825", "0.73840755", "0.7362679", "0.73576546", "0.7349066", "0.7341075", "0.7340246", "0.73134226", "0.72785366", "0.72526157", "0.7243228", "0.7228975", "0.7219061", "0.72105676", "0.7208098", "0.7205808", "0.7204802", "0.71929604", "0.71924967", "0.7178503", "0.71623236", "0.71564615", "0.71259767", "0.7106884", "0.7102564", "0.7089142", "0.7085468", "0.7080729", "0.7078263", "0.70507956", "0.7043171", "0.70396894", "0.70375216" ]
0.8549281
1
Ex_6_Query_3 Get all suppliers that do not import parts from abroad. Get their id, name and the number of parts they can offer to supply.
@Query(value = "SELECT * " + "FROM suppliers as s\n" + "inner JOIN parts p on s.id = p.supplier_id\n" + "WHERE is_importer = false\n" + "GROUP BY s.id;",nativeQuery = true) List<Supplier> findAllThatDoNotImport();
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public List zipcodeWithSuppliersList() throws AdException {\r\n\t\t try {\r\n\t\t begin();\r\n\t\t Query q = getSession().createSQLQuery(\"select DISTINCT zipcode from Zipcode\");\r\n\t\t List list = q.list();\r\n\t\t commit();\r\n\t\t return list;\r\n\t\t } catch (HibernateException e) {\r\n\t\t rollback();\r\n\t\t throw new AdException(\"Could not list the zipcodes where suppliers are present \", e);\r\n\t\t }\r\n\t\t }", "public List<Supplier> getSuppliers(){ \n\t List<Supplier> list=new ArrayList<Supplier>(); \n\t list=template.loadAll(Supplier.class); \n\t return list; \n\t}", "public final Data execeuteQueries() throws SQLException {\r\n\r\n\t\tStatement stat = con.createStatement();\r\n\t\tStatement stat2 = con.createStatement();\r\n\t\tStatement stat3 = con.createStatement();\r\n\r\n\t\t// will provide a list of all the parts starting from the one with the\r\n\t\t// highest cost\r\n\t\tResultSet result1 = stat\r\n\t\t\t\t.executeQuery(\"select sp.part_name,sp.cost_in_cents,sp.part_code from supplier_parts sp \"\r\n\t\t\t\t\t\t+ \"ORDER BY cost_in_cents DESC\");\r\n\r\n\t\t// getting all the suppliers\r\n\t\tResultSet result2 = stat2.executeQuery(\"SELECT * from suppliers\");\r\n\r\n\t\t// will provide the list of suppliers with their supplied parts\r\n\t\tResultSet result3 = stat3\r\n\t\t\t\t.executeQuery(\"select s.supplier_id,s.name, sp.part_name,sp.part_code\"\r\n\t\t\t\t\t\t+ \" from supplier_parts sp \"\r\n\t\t\t\t\t\t+ \"INNER JOIN suppliers s ON s.supplier_id = sp.supplier_id\");\r\n\r\n\t\t// adding all the parts to the total parts list\r\n\t\twhile (result1.next()) {\r\n\t\t\tString part_name = result1.getString(\"part_name\");\r\n\t\t\tint cost_of_part = result1.getInt(\"cost_in_cents\");\r\n\t\t\tString part_id = result1.getString(\"part_code\");\r\n\r\n\t\t\t/*\r\n\t\t\t * if (checkIfPartExists(dat, part_name)) {\r\n\t\t\t * System.out.println(\"Multiple records found for the same part\");\r\n\t\t\t * System.out.println(\"Part:\" + part_name +\r\n\t\t\t * \" already exists!! Skipping this part!!\"); } else {\r\n\t\t\t * dat.getParts_list().add( new Parts(part_name, part_id,\r\n\t\t\t * cost_of_part)); }\r\n\t\t\t */\r\n\r\n\t\t\t// assuming that all the parts are distinct\r\n\t\t\tdat.getParts_list()\r\n\t\t\t\t\t.add(new Parts(part_name, part_id, cost_of_part));\r\n\t\t}\r\n\r\n\t\t// adding all the suppliers to the list irrespective of parts supplied;\r\n\t\twhile (result2.next()) {\r\n\t\t\tint id = result2.getInt(\"supplier_id\");\r\n\t\t\tString name = result2.getString(\"name\");\r\n\t\t\tString code = result2.getString(\"code\");\r\n\t\t\tString tele = result2.getString(\"telephone_number\");\r\n\t\t\tString email = result2.getString(\"email_address\");\r\n\t\t\t// not checking for multiple entries because of id as the primary\r\n\t\t\t// key\r\n\t\t\tdat.getSuppliers_list().add(\r\n\t\t\t\t\tnew Supplier(id, name, code, tele, email));\r\n\t\t}\r\n\r\n\t\t// adding the parts to their suppliers\r\n\t\twhile (result3.next()) {\r\n\t\t\tString supplier_name = result3.getString(\"name\");\r\n\t\t\tString part_supplied = result3.getString(\"part_name\");\r\n\t\t\tint supplier_id = result3.getInt(\"supplier_id\");\r\n\t\t\tString part_code = result3.getString(\"part_code\");\r\n\r\n\t\t\tParts part = findPart(part_code, dat);\r\n\t\t\tif (part == null) {\r\n\t\t\t\tpart = new Parts(part_supplied, part_code);\r\n\t\t\t}\r\n\t\t\t// checking if it is a known supplier; if so part is added to the\r\n\t\t\t// supplied parts list\r\n\t\t\t// else new supplier is created with the part supplied\r\n\t\t\tif (checkIfSupplierExists(supplier_id, part, dat) == false) {\r\n\t\t\t\tdat.getSuppliers_list().add(\r\n\t\t\t\t\t\tnew Supplier(supplier_id, supplier_name, part));\r\n\t\t\t}\r\n\t\t}\r\n\t\t// closing all the connections\r\n\t\tstat.close();\r\n\t\tstat2.close();\r\n\t\tstat3.close();\r\n\t\tcon.close();\r\n\t\treturn dat;\r\n\t}", "public List getEpSupplier() {\n\t\treturn getHibernateTemplate().find(\" from JSupplierNh \");\n\t}", "public String supplierList(SupplierDetails s);", "public static ArrayList<String> getAvailableParts() {\n ArrayList<String> allParts = new ArrayList<String>();\n String pattern = \"_db.dat\";\n File dir = new File(getRapidSmithPath() + File.separator + \"devices\");\n if (!dir.exists()) {\n MessageGenerator.briefErrorAndExit(\"ERROR: No part files exist. Please run \" +\n Installer.class.getCanonicalName() + \" to create part files.\");\n }\n for (String partFamily : dir.list()) {\n File partDir = new File(dir.getAbsolutePath() + File.separator + partFamily);\n for (String part : partDir.list()) {\n if (part.endsWith(pattern)) {\n allParts.add(part.replace(pattern, \"\"));\n }\n }\n }\n return allParts;\n }", "List<ProductPurchaseItem> getAllSupplierProductPurchaseItems(long suppId, String searchStr);", "public int getSupplies() {\n\t\treturn supplies;\n\t}", "private static boolean checkIfSupplierExists(int supplier_id, Parts part,\r\n\t\t\tData dat) {\r\n\r\n\t\tfor (Supplier sup : dat.getSuppliers_list()) {\r\n\t\t\tif (sup.getID() == supplier_id) {\r\n\t\t\t\t// int i = dat.getSuppliers_list().indexOf(sup);\r\n\t\t\t\tsup.getParts_supplied().add(part);\r\n\t\t\t\t// dat.getSuppliers_list().get(i).getParts_supplied().add(part);\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 Short getSuppliersId() {\n return suppliersId;\n }", "public List getEpIndepot(String suppliers) {\n\t\treturn getHibernateTemplate().find(\" from DIndepot a where a.SupplierId in \"+suppliers+\"\");\n\t}", "public String getSuppliersInforId() {\n return suppliersInforId;\n }", "public List<ProductDetails> retrieveOfferNamesAndIds() throws MISPException\n\t{\n\t\tlogger.entering(\"retrieveOfferNamesAndIds\");\n\t\t\n\t\tList<ProductDetails> products = null;\n\t\t\n\t\ttry{\t\t\n\t\t\tproducts = offerDetailsMgr.retrieveOfferNamesAndIds();\n\t\t}\n\t\tcatch (DBException exception){\t\t\t\n\t\t\tlogger.error\n\t\t\t\t\t(\"An exception occured while retrieving offers.\",exception);\n\t\t\tthrow new MISPException(exception);\n\t\t}\n\t\t\n\t\tlogger.exiting(\"retrieveOfferNamesAndIds\");\n\t\treturn products;\t\t\n\t}", "PriorityQueue<Ride> queryRidesFromAllSuppliers(Trip trip){\n Map<String, Ride> rides = new HashMap<>();\n\n for(Supplier supplier : Supplier.values()){\n Set<Ride> ridesFromSupplier = queryRidesFromSupplier(trip, supplier);\n for(Ride ride : ridesFromSupplier){\n if(!rides.containsKey(ride.getCar().CAR_TYPE)\n || ride.getPrice() < rides.get(ride.getCar().CAR_TYPE).getPrice()){\n rides.put(ride.getCar().CAR_TYPE, ride);\n }\n }\n }\n\n return orderRidesByPriceAscending(rides);\n }", "public List<ProductWithSupplierTO> getAllProducts(long storeID) throws NotInDatabaseException;", "public String getSupplierPartId() {\r\n return this.supplierPartId;\r\n }", "@Override\n\tpublic List<Supplier> getAllSupplier() {\n\t\tString sql=\"SELECT * FROM supplier\";\n\t\tRowMapper<Supplier> rowmapper=new BeanPropertyRowMapper<Supplier> (Supplier.class);\n\t\treturn this.getJdbcTemplate().query(sql, rowmapper);\n\t}", "public List<SupplierEntity> getAllSuppliers() {\n\n List<SupplierEntity> suppliers = new ArrayList<SupplierEntity>();\n Session session = SessionFactoryProvider.getSessionFactory().openSession();\n Transaction tx = null;\n\n try {\n\n tx = session.beginTransaction();\n suppliers = session.createQuery(\"FROM SupplierEntity ORDER BY supplierId\").list();\n tx.commit();\n\n } catch (HibernateException e) {\n\n if (tx != null) {\n tx.rollback();\n }\n\n e.printStackTrace();\n\n } finally {\n\n session.close();\n\n }\n\n return suppliers;\n\n }", "public List<UserSupplier> completeSupplier(String query) {\n List<UserSupplier> userSuppliers = user.getUserSuppliers();\n\n List<UserSupplier> suppliers = new ArrayList<>();\n for (UserSupplier userSupplier : userSuppliers) {\n if (userSupplier.getSupplier().getLabel().startsWith(query)) {\n suppliers.add(userSupplier);\n }\n }\n return suppliers;\n }", "@Override\n public List<KitchenSupplier> getKitchenSupplier(String supplierName) {\n Query query = em.createQuery(\"SELECT k FROM KitchenSupplier k WHERE k.ksupplierName = :inSupplierName\");\n query.setParameter(\"inSupplierName\", supplierName);\n List<KitchenSupplier> s = null;\n try {\n s = query.getResultList();\n } catch (NoResultException ex) {\n System.out.println(\"caught no result exception\");\n }\n return s;\n }", "@Override\n\tpublic List<SupplierView> getAllSupplierInfo() {\n\t\tString sql=\"SELECT s.supplier_id, s.supplier_name, s.supplier_type, s.permanent_address, s.temporary_address,h.quantity,h.supplier_unique_id ,h.cost,h.buy_date,h.username,i.product_id, i.product_name FROM supplier s INNER JOIN supplier_product h on s.supplier_id=h.supplier_supplier_id INNER JOIN product i on h.product_product_id=i.product_id\";\n\t\tRowMapper<SupplierView> rowmapper=new BeanPropertyRowMapper<SupplierView> (SupplierView.class);\n\t\treturn this.getJdbcTemplate().query(sql,rowmapper);\n\t}", "public Producer getProducerByProducerIDFetchingAddressFetchingProducts(String producerID);", "public static ArrayList<String> getAvailableParts(FamilyType type) {\n ArrayList<String> allParts = new ArrayList<String>();\n String pattern = \"_db.dat\";\n File dir = new File(getRapidSmithPath() + File.separator + \"devices\" + File.separator + type.toString().toLowerCase());\n if (!dir.exists()) {\n MessageGenerator.briefErrorAndExit(\"ERROR: No part files exist. Please run \" +\n Installer.class.getCanonicalName() + \" to create part files.\");\n }\n for (String part : dir.list()) {\n if (part.endsWith(pattern)) {\n allParts.add(part.replace(pattern, \"\"));\n }\n }\n return allParts;\n }", "public Collection<Integer> getIncludedServiceBrands();", "public Collection<Integer> getExcludedServiceBrands();", "@Override\r\n\tpublic List<Supplies> checkbythreed(Supplies supplies) {\n\t\treturn suppliesDao.checkbythreed(supplies);\r\n\t}", "ArrayList<Relation> attributeCountLT4ForPropertiesbySupplierId(String supplierId);", "@Override\r\n\tpublic List<Supplies> findall() {\n\t\treturn suppliesDao.findall();\r\n\t}", "public ArrayList<GroupSupplier> getGroupSupplierList(){\n\t\tSession session = HibernateUtils.getSessionFactory().openSession();\n\t\tArrayList<GroupSupplier> list = new ArrayList<GroupSupplier>();\n\t\ttry{\n\t\t\tCriteria cr = session.createCriteria(TblGroupSupplier.class);\n\t\t\tList<TblGroupSupplier> groupsuppliers = cr.list();\n\t\t\tif (groupsuppliers.size() > 0){\n\t\t\t\tfor (Iterator<TblGroupSupplier> iterator = groupsuppliers.iterator(); iterator.hasNext();){\n\t\t\t\t\tTblGroupSupplier tblgroupsupplier = iterator.next();\n\t\t\t\t\tGroupSupplier groupsupplier = new GroupSupplier();\n\t\t\t\t\tgroupsupplier.convertFromTable(tblgroupsupplier);\n\t\t\t\t\tlist.add(groupsupplier);\n\t\t\t\t}\n\t\t\t}\n\t\t}catch(HibernateException e){\n\t\t\tSystem.err.println(\"ERROR IN LIST!!!!!!\");\n\t\t\te.printStackTrace();\n\t\t\tthrow new ExceptionInInitializerError(e);\n\t\t}finally{\n\t\t\tsession.close();\n\t\t}\n\t\treturn list;\n\t}", "public List<ProductDetails> retrieveOffers() throws MISPException {\n\n\t\tlogger.entering(\"retrieveOffers\");\n\n\t\tList<ProductDetails> productsList = null;\n\n\t\ttry {\n\n\t\t\tproductsList = this.offerDetailsMgr.retrieveOffers();\n\n\t\t} catch (DBException exception) {\n\n\t\t\tlogger.error(\n\t\t\t\t\t\"An exception occured while retrieving offer details.\",\n\t\t\t\t\texception);\n\t\t\tthrow new MISPException(exception);\n\t\t}\n\n\t\tlogger.exiting(\"retrieveOffers\", productsList);\n\n\t\treturn productsList;\n\n\t}", "@Override\n\tpublic List<SupplierView> getSupplierDistinctName() {\n\t\tString sql=\"SELECT DISTINCT(s.supplier_name) FROM supplier s INNER JOIN supplier_product h on s.supplier_id=h.supplier_supplier_id INNER JOIN product i on h.product_product_id=i.product_id\";\n\t\tRowMapper<SupplierView> rowmapper=new BeanPropertyRowMapper<SupplierView> (SupplierView.class);\n\t\treturn this.getJdbcTemplate().query(sql,rowmapper);\n\t}", "@GET\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response returnAllPcParts() throws Exception{\n\n\t\tPreparedStatement query = null;\n\t\tConnection conn = null;\n\t\tString returnString = null;\n\t\tResponse rp = null;\n\n\t\ttry{\n\t\t\tSQLServerDataSource ds = new SQLServerDataSource();\n\t\t\tconn = ds.getConnection();\n\t\t\tquery = conn.prepareStatement(\"SELECT * FROM PC_PARTS\");\n\t\t\t\n\t\t\tResultSet rs = query.executeQuery(); // records set\n\n\t\t\tToJSON converter = new ToJSON(); // bring in instance\n\t\t\tJSONArray json = new JSONArray(); // holds array\n\n\t\t\tjson = converter.toJSONArray(rs); // puts in records\n\t\t\tquery.close();\n\n\t\t\treturnString = json.toString();\n\t\t\t// building a response from our string\n\t\t\trp = Response.ok(returnString).build();\n\n\t\t}catch(SQLException e){\n\t\t\tSystem.out.println(\"msg: \" + e.getMessage());\n\t\t}finally{\n\t\t\tif(conn != null){\n\t\t\t\tconn.close();\n\t\t\t}\n\t\t}\n\t\treturn rp;\n\t}", "public SupplyDemand() {\r\n\t\t//begin\r\n\t\tproducerList = new ArrayList<>();\r\n\t\tretailerList = new ArrayList<>();\r\n\t\t//end\r\n\t}", "public List<ProductDetails> retrieveOffersWithOfferType()\n\t\t\tthrows MISPException {\n\n\t\tlogger.entering(\"retrieveOffersWithOfferType\");\n\n\t\tList<ProductDetails> productsList = null;\n\n\t\ttry {\n\n\t\t\tproductsList = this.offerDetailsMgr.retrieveOffersWithOfferType();\n\n\t\t} catch (DBException exception) {\n\n\t\t\tlogger.error(\n\t\t\t\t\t\"An exception occured while retrieving offer Details.\",\n\t\t\t\t\texception);\n\t\t\tthrow new MISPException(exception);\n\t\t}\n\n\t\tlogger.exiting(\"retrieveOffersWithOfferType\", productsList);\n\n\t\treturn productsList;\n\n\t}", "public List<SupplierEntity> getSuppliersExclType(String typeName) {\n\n List<SupplierEntity> suppliers = new ArrayList<>();\n\n Session session = SessionFactoryProvider.getSessionFactory().openSession();\n\n Criteria criteria = session.createCriteria(SupplierEntity.class);\n criteria.createCriteria(\"supplierType\").add(Restrictions.ne(\"name\", typeName));\n\n // Language lang = (Language)super.findByCriteria(criteria).get(0);\n\n Transaction tx = null;\n\n try {\n\n tx = session.beginTransaction();\n suppliers = criteria.list();\n\n } catch (HibernateException e) {\n\n if (tx != null) {\n tx.rollback();\n }\n\n log.error(e.getStackTrace());\n\n } finally {\n session.close();\n }\n\n return suppliers;\n\n }", "@Override\r\n\tpublic List<Applier> retrieveAllAppliers() {\n\t\treturn em.createQuery(\"Select a from Applier a\").getResultList();\r\n\t}", "@Test\n\tpublic void testSuppServices() {\n\t\tList<SuppServices> suppServices = suppServicesService.selectList();\n\n\t\tfor (SuppServices supp : suppServices) {\n\n\t\t\tSystem.out.println(supp);\n\t\t}\n\t}", "public Product[] getConsumerVisibleProducts () {\n return null;\n }", "public void showSupplierList(){\n\t\tfor(int i = 0; i<supplierList.size();i++) {\n\t\t\tSystem.out.println(supplierList.get(i).getSupID()+\";\"+\n\t\t\t\t\tsupplierList.get(i).getCompanyName()+\";\"+\n\t\t\t\t\tsupplierList.get(i).getAddress()+\";\"+\n\t\t\t\t\tsupplierList.get(i).getSaleRep());\n\t\t}\n\t}", "private List<AmountResource> getAvailableDessertResources(double amountNeeded, boolean isThirsty) {\n\n\t\tList<AmountResource> result = new ArrayList<AmountResource>();\n\n\t\tUnit containerUnit = person.getContainerUnit();\n\t\tif (!(containerUnit instanceof MarsSurface)) {\n\t\t\tInventory inv = containerUnit.getInventory();\n\n\t\t\tboolean option = true;\n\n\t\t\tAmountResource[] ARs = PreparingDessert.getArrayOfDessertsAR();\n\t\t\tfor (AmountResource ar : ARs) {\n\t\t\t\tif (isThirsty)\n\t\t\t\t\toption = ar.getName().contains(JUICE) || ar.getName().contains(MILK);\n\t\t\t\t\n\t\t\t\tboolean hasAR = false;\n\t\t\t\tif (amountNeeded > MIN) {\n\t\t\t\t\thasAR = Storage.retrieveAnResource(amountNeeded, ar, inv, false);\n\t\t\t\t}\n\t\t\t\tif (option && hasAR) {\n\t\t\t\t\tresult.add(ar);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t}", "public List getAllUnPaidBillAmount(HttpServletRequest request, HttpServletResponse response) {\n\r\n\t\tString supplierId = request.getParameter(\"supplier\");\r\n\r\n\t\tMap<Long, GetSupplierDetails> map = new HashMap<Long, GetSupplierDetails>();\r\n\r\n\t\tSupplierDetailDao dao = new SupplierDetailDao();\r\n\t\tList<GetSupplierDetails> custList = dao.getAllUnPaidBillAmount(supplierId);\r\n\r\n\t\treturn custList;\r\n\t}", "Set<Ride> queryRidesFromSupplier(Trip trip, Supplier supplier){\n Map<String, String> parameters = journeyRequestLocationsToParameters(trip);\n String parsedParameters = new HttpUrlParameterParser().parseParameters(parameters);\n String urlAddress = REQUEST_ROOT_URL + supplier.toString() + \"?\" + parsedParameters;\n IConnection<HttpURLConnection, String> httpConnectionHandler = new HttpConnectionHandler();\n HttpURLConnection connection = httpConnectionHandler.connect(urlAddress);\n\n if(connection == null){\n return new HashSet<>();\n }\n\n String response = httpConnectionHandler.getResponse(connection);\n return extractRidesFromResponse(response, trip.getNumPassengers(), supplier);\n }", "public List<ProductWithSupplierAndStockItemTO> getProductsWithStockItems(long storeID) throws NotInDatabaseException;", "public ObservableList<Part> getAllParts() { return allParts; }", "int getPartsCount();", "int getPartsCount();", "public void setSupplierPartId(String supplierPartId) {\r\n this.supplierPartId = supplierPartId;\r\n }", "ProductPurchaseItem getSupplierProductPurchaseItemPerCatalogNo(long suppId, String catalogNo);", "public ArrayList<Product> getMissingProduct(){\r\n\t\tString sql=\"SELECT Barcode FROM ProductTable WHERE (Quantity_In_Store+Quantity_In_storeroom)<=\"\r\n\t\t\t\t+ \"(Average_Sales_Per_Day*Delivery_Time)\";\r\n\t\tArrayList<Product> products = new ArrayList<>();\r\n\t\t try (Connection conn = this.connect();\r\n\t Statement stmt = conn.createStatement();\r\n\t ResultSet rs = stmt.executeQuery(sql)){\r\n\t\t\t while(rs.next()){\r\n\t\t\t\t products.add(getProductByID(rs.getInt(\"Barcode\")));\r\n\t\t\t }\r\n\t\t }\r\n\t\t catch (SQLException e) {\r\n\t\t\t System.out.println(\"getMissingProduct: \"+e.getMessage());\r\n\t\t\t return null;\r\n\t\t }\r\n\t\treturn products;\r\n\t}", "public int getAvailNumComps(){\n return this.mFarm.getAvailNumComps();\n }", "public void setSupplies(int supplies) {\n\t\tthis.supplies = supplies;\n\t}", "public List<PartDto> getAllParts(){\n var result = this.repoParts.findAll();\n ArrayList<PartDto> parts = new ArrayList<>();\n return mapper.mapList(result, false);\n }", "public static void getPartNumberDetails(ArrayList<String> data, String table, String partNumber)\n {\n PreparedStatement stmt = null;\n ResultSet myRst = null;\n\n try\n {\n String pstmt = \"SELECT * FROM \" + table + \" WHERE \" + table + \"_Part_Number\" + \" = ?\";\n\n stmt = DBConnectionManager.con.prepareStatement(pstmt);\n stmt.setString(1,partNumber);\n\n\n myRst = stmt.executeQuery();\n ResultSetMetaData rsmd = myRst.getMetaData();\n\n //move the cursor to the first position\n myRst.next();\n\n //size is the number of columns present in the specified product category table\n //we are looking through. This loop just goes through the entry we just got and\n //inputs them into the 'data' array in order\n int size = rsmd.getColumnCount();\n\n for(int j=1; j<=size; j++)\n {\n data.add(myRst.getString(j));\n }\n\n } catch (SQLException e)\n {\n e.printStackTrace();\n }\n finally\n {\n try { if (myRst != null) myRst.close(); } catch (Exception ignored) {}\n try { if (stmt != null) stmt.close(); } catch (Exception ignored) {}\n }\n }", "public int getmRaidSupplies() {\n\t\treturn mRaidSupplies;\n\t}", "List<EcsSupplierRebate> selectAll();", "Query getUsedComponentList(final ResourceResolver resourceResolver, List<String> conditions,boolean excludeChildrenPages);", "List<PartDetail> getDetails();", "private List<TntMgImpIpEx> getPartsStockIPInfoList(String officeCode) {\n\n // parameter\n TntMgImpIpEx mgImpIpInfo = new TntMgImpIpEx();\n mgImpIpInfo.setOfficeCode(officeCode);\n\n return baseMapper.selectList(this.getSqlId(\"getPartsStockIPInfoListForPatch\"), mgImpIpInfo);\n }", "@Test\n public void getListSupplierByNotStartTime() {\n List<SupplierAnalysis> listSupplier = SupplierAnalysisDAO.supplierByTime(\"\", \"2021-12-01\", 1);\n\n Assert.assertTrue(listSupplier.size() > 0);\n }", "public Supplier findSupplier(int suppliernum, boolean retrieveAssociation);", "@Override\r\n\tpublic List<Supplies> findbyname(String name) {\n\t\treturn suppliesDao.findbyname(name);\r\n\t}", "public Collection<Long> getAvailableItems();", "public void setAvailNumComps(int availNumComps){\n this.mFarm.setAvailNumComps(availNumComps);\n }", "@Override\r\n public List querySupplierIdByAdcolumn(String str) throws SQLException {\n return sqlMapClient.queryForList(\"CMS_SUPPLIER_ADCOLUMN.abatorgenerated_querySupplierIdByAdcolumn\", str);\r\n }", "@Override\r\n\tpublic List<SenderdataMaster> fetchDataBasedonSupplier(List<String> incomingRefNbr, String supplier) {\n\t\treturn senderDataRepository.fetchDataBasedonSupplier(incomingRefNbr, supplier);\r\n\t}", "String getSupplierID();", "public ArrayList<String> getSellers(String productName);", "List<Long> getSuppliersWithStoresNotVisited(Date date);", "Collection<? extends Object> getDeprecatedBookNo();", "public Map getAllBillBySuppliers(String supplierId) {\n\t\tSupplierDetailDao dao = new SupplierDetailDao();\r\n\t\tList list = dao.getAllBillBySuppliers(supplierId);\r\n\t\tMap map = new HashMap();\r\n\t\tfor (int i = 0; i < list.size(); i++)\r\n\t\t{\r\n\t\t\tObject[] o = (Object[]) list.get(i);\r\n\t\t\tcom.smt.bean.GetSupplierDetails bean = new com.smt.bean.GetSupplierDetails();\r\n\t\t\tSystem.out.println(Arrays.toString(o));\r\n\r\n\t\t\tString pendingBal = o[2].toString();\r\n\t\t\tif (pendingBal.equals(\"0\")) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tbean.setBillNo(o[0].toString());\r\n\t\t\t\t//bean.setItemName(o[0].toString());\r\n\t\t\t\tbean.setSize(o[1].toString());\r\n\t\t\t\tbean.setBarcode(o[2].toString());\t\t\t\r\n\t\t\t}\r\n\t\t\t// bean.setTotalAmount((Double)o[1]);\r\n\t\t\tSystem.out.println(\"***************\" + o[0]);\r\n\t\t\tmap.put(bean.getBillNo(), bean);\r\n\r\n\t\t}\r\n\t\treturn map;\r\n\t}", "List<PurchaseOrderHeader> getAllOutstandingAndConfirmedPurchaseOrderHeaderPerOrguIdAndSupplierId(long supplierId);", "private void populateAvailableProviders() {\n allAvailableProviders = new HashSet<Provider>();\n\n DataType dataType = DataType.valueOfIgnoreCase(this.dataType);\n try {\n for (Provider provider : DataDeliveryHandlers.getProviderHandler()\n .getAll()) {\n\n ProviderType providerType = provider.getProviderType(dataType);\n if (providerType != null) {\n allAvailableProviders.add(provider);\n }\n }\n } catch (RegistryHandlerException e) {\n statusHandler.handle(Priority.PROBLEM,\n \"Unable to retrieve the list of providers.\", e);\n }\n }", "public Map getAllBillBySuppliers1(String supplierId) {\n\t\tSupplierDetailDao dao = new SupplierDetailDao();\r\n\t\tList list = dao.getAllBillBySuppliers1(supplierId);\r\n\t\tMap map = new HashMap();\r\n\t\tfor (int i = 0; i < list.size(); i++) {\r\n\t\t\tObject[] o = (Object[]) list.get(i);\r\n\t\t\tcom.smt.bean.GetSupplierDetails bean = new com.smt.bean.GetSupplierDetails();\r\n\t\t\tSystem.out.println(Arrays.toString(o));\r\n\t\t\tbean.setBillNo(o[0].toString());\r\n\r\n\t\t\t// bean.setTotalAmount((Double)o[1]);\r\n\t\t\tSystem.out.println(\"***************\" + o[0]);\r\n\t\t\tmap.put(bean.getBillNo(), bean);\r\n\r\n\t\t}\r\n\t\treturn map;\r\n\t}", "public static ObservableList<Part> getAllParts() {\n return allParts;\n }", "Product getPProducts();", "@Override\n\tpublic int getNoofSupplier() {\n\t\tString sql=\"SELECT COUNT(supplier_supplier_id) FROM supplier_product\";\n\t int total=this.getJdbcTemplate().queryForObject(sql, Integer.class);\n\t\treturn total;\n\t}", "public void checkExtraParts() { // done before deleting\n\t\tString[] full = new String[this.bestCombination.length];\n\t\tString[] unique = Arrays.stream(this.bestCombination).distinct().toArray(String[]::new);\n\t\tString[] temp = new String[this.foundRequest[0].length];\n\t\tString[] newTemp = new String[this.foundRequest[0].length];\n\n\t\tfor (String id : unique) {// sets temp[] to the row in foundRequest matching the id;\n\t\t\tfor (String[] row : this.foundRequest) { // goes through each row in foundRequest\n\t\t\t\tList<String> list = Arrays.asList(row); // converts the row to a list\n\t\t\t\tif (list.contains(id)) { // if the row represents the desired id\n\t\t\t\t\tint i = 0;\n\t\t\t\t\tfor (String element : row) {\n\t\t\t\t\t\ttemp[i++] = element; // copying each element in the row to temp\n\t\t\t\t\t}\n\t\t\t\t\t// Example: temp = [id, type, y/n, y/n, y/n, y/n, price, manID]\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (int i = 0; i < full.length; i++) { // For each element in full\n\t\t\t\tif (temp[i + 2].equals(\"Y\") && full[i] == null) {\n\t\t\t\t\tfull[i] = \"Y\";\n\t\t\t\t\ttemp[i + 2] = \"N\";\n\t\t\t\t} else if (temp[i + 2].equals(\"Y\") && full[i].equals(\"Y\")) {\n\t\t\t\t\tnewTemp = formatTemp(temp, full); // changes temp comparing to full: yn -> n and yy->y and nn-> n\n\t\t\t\t\taddExtraPieces(newTemp); // adds temp[] to extraPieces** ADDED METHOD TO ADD temp TO foundRequest\n\t\t\t\t\t\t\t\t\t\t\t\t// pass by value\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public int getPartsCollected() {\n\t\tif (partsCollected.size() == 0) {\n\t\t\treturn 0;\n\t\t}else {\n\t\t\treturn partsCollected.size();\n\t\t\t}\n\t}", "public static int getSupplyUsed() {\n return Atlantis.getBwapi().getSelf().getSupplyUsed() / 2;\n }", "List<PurchaseOrderHeader> getAllPurchaseOrderHeaderPerOrguIdAndSupplierId(long supplierId);", "public String getSupplierNum() {\n return supplierNum;\n }", "public \tCollection<Purchaser> findPurchaserMoreArtworkBought(){\n\t\tcheckAdminRole();\n\t\tCollection<Purchaser> res=new ArrayList<Purchaser>();\n\t\tres=purchaserRepository.findPurchaserMoreArtworkBought();\n\t\treturn res;\n\t}", "Set<Ride> extractRidesFromResponse(String response, int numPassengers, Supplier supplier){\n JSONArray carOptions;\n Set<Ride> rides = new HashSet<>();\n\n try{\n JSONObject responseJSON = new JSONObject(response);\n carOptions = responseJSON.getJSONArray(JSON_CAR_OPTIONS);\n }catch (JSONException e){\n return rides;\n }\n\n CarFactory carFactory = new CarFactory();\n\n for(int i = 0; i < carOptions.length(); i++){\n try{\n String carType = carOptions.getJSONObject(i).getString(\"car_type\");\n int price = carOptions.getJSONObject(i).getInt(\"price\");\n Car car = carFactory.createCar(carType);\n\n if(car != null && car.MAX_PASSENGERS >= numPassengers){\n rides.add(new Ride(car, price, supplier));\n }\n\n }catch (JSONException ignored){\n }\n }\n\n return rides;\n }", "public List<ProductWithStockItemTO> getProductsWithLowStock(long storeID);", "@Override\n public List<Partnership> getPartnerships(AuthContext context) throws DSException {\n\n isContextValidFor(context, roleId -> { if(roleId == -1) throw new DSAuthException(\"Invalid Context\"); }, 1,3);\n List<Partnership> partnerships = new ArrayList<>();\n try {\n List<Map<String,Object>> data = get(\"SELECT * FROM TblPartnerships\");\n for(Map<String,Object> map: data) {\n Partnership p = new Partnership(map);\n List<OperationalOfficer> officers = new ArrayList<>();\n get(\"SELECT * FROM TblOperationalOfficers WHERE ptship = ?\",p.getPtshipNum()).forEach(\n stringObjectMap -> officers.add(new OperationalOfficer(stringObjectMap))\n );\n p.setOfficers(officers);\n partnerships.add(p);\n }\n return partnerships;\n } catch (SQLException e) {\n throw new DSFormatException(e.getMessage());\n }\n }", "@Override\n\tpublic ServResponse getServSupplierList(ServRequest servRequest) {\n\t\tInteger loginUserId = servRequest.getUserId();\n\t\tServResponse servResponse = new ServResponse();\n\t\ttry {\n\t\t\tString catalogNo = servRequest.getCatalogNo();\n\t\t\tList<VendorServiceDTO> verdonServiceList = this.servService.getSupplierList(catalogNo);\n\t\t\tservResponse.setVerdonServiceList(verdonServiceList);\n\t\t\tservResponse.setHasException(Boolean.FALSE);\n\t\t} catch (Exception e) {\n\t\t\tWSException exDTO = exceptionUtil.getExceptionDetails(e);\n\t\t\texceptionUtil.logException(exDTO, this.getClass(), e,\n\t\t\t\t\tnew Exception().getStackTrace()[0].getMethodName(),\n\t\t\t\t\t\"INTF0207\", loginUserId);\n\t\t\tservResponse.setHasException(true);\n\t\t\tservResponse.setWsException(exDTO);\n\t\t}\n\t\treturn servResponse;\n\t}", "private void computeCoffeeMaker(){\n HashMap<String,String> notAvailableBeverages = coffeeMakerService.getNotAvailableBeverages();\n ArrayList<String> beverageNames = coffeeMakerService.getBeveragesName();\n for (String beverage: beverageNames) {\n if(notAvailableBeverages.containsKey(beverage)){\n System.out.println(notAvailableBeverages.get(beverage));\n }else{\n if(coffeeMakerService.canPrepareBeverage(beverage)){\n coffeeMakerService.prepareBeverage(beverage);\n System.out.println(beverage+\" is prepared\");\n }else{\n System.out.println(coffeeMakerService.getReasonForNotPreparation(beverage));\n }\n }\n }\n }", "private static List<Supplier> createSupplierData(ConsumerQuery query, boolean testing) {\n\t\tRepository repository;\n\t\t\n\t\t//use name of processes in query to retrieve subset of relevant supplier data from semantic infrastructure\n\t\tList<String> processNames = new ArrayList<String>();\t\n\n\t\tif (query.getProcesses() == null || query.getProcesses().isEmpty()) {\n\t\t\tSystem.err.println(\"There are no processes specified!\");\n\t\t} else {\n\t\t\n\t\tfor (Process process : query.getProcesses()) {\n\t\t\tprocessNames.add(process.getName());\n\t\t}\n\t\t}\n\t\t\t\n\t\t\n\t\tlong startTime = System.currentTimeMillis();\n\n\t\tif (testing == false) {\n\n\t\t\tMap<String, String> headers = new HashMap<String, String>();\n\t\t\theaders.put(\"Authorization\", AUTHORISATION_TOKEN);\n\t\t\theaders.put(\"accept\", \"application/JSON\");\n\n\t\t\trepository = new SPARQLRepository(SPARQL_ENDPOINT );\n\n\t\t\trepository.initialize();\n\t\t\t((SPARQLRepository) repository).setAdditionalHttpHeaders(headers);\n\n\t\t} else {\n\n\t\t\t//connect to GraphDB\n\t\t\trepository = new HTTPRepository(GRAPHDB_SERVER, REPOSITORY_ID);\n\t\t\trepository.initialize();\n\t\t}\n\t\t\n\t\t//creates a SPARQL query that is run against the Semantic Infrastructure\n\t\tString strQuery = SparqlQuery.createQueryMVP(processNames);\n\t\t\n\t\t//System.out.println(strQuery);\n\n\t\t//open connection to GraphDB and run SPARQL query\n\t\tSet<SparqlRecord> recordSet = new HashSet<SparqlRecord>();\n\t\tSparqlRecord record;\n\t\ttry(RepositoryConnection conn = repository.getConnection()) {\n\n\t\t\tTupleQuery tupleQuery = conn.prepareTupleQuery(QueryLanguage.SPARQL, strQuery);\t\t\n\n\t\t\t//if querying the local KB, we need to set setIncludeInferred to false, otherwise inference will include irrelevant results.\n\t\t\t//when querying the Semantic Infrastructure the non-inference is set in the http parameters.\n\t\t\tif (testing == true) {\n\t\t\t\t//do not include inferred statements from the KB\n\t\t\t\ttupleQuery.setIncludeInferred(false);\n\t\t\t}\n\n\t\t\ttry (TupleQueryResult result = tupleQuery.evaluate()) {\t\t\t\n\n\t\t\t\twhile (result.hasNext()) {\n\n\t\t\t\t\tBindingSet solution = result.next();\n\n\t\t\t\t\t//omit the NamedIndividual types from the query result\n\t\t\t\t\tif (!solution.getValue(\"processType\").stringValue().equals(\"http://www.w3.org/2002/07/owl#NamedIndividual\")\n\t\t\t\t\t\t\t&& !solution.getValue(\"certificationType\").stringValue().equals(\"http://www.w3.org/2002/07/owl#NamedIndividual\")\n\t\t\t\t\t\t\t&& !solution.getValue(\"materialType\").stringValue().equals(\"http://www.w3.org/2002/07/owl#NamedIndividual\")) {\n\n\t\t\t\t\t\trecord = new SparqlRecord();\n\t\t\t\t\t\trecord.setSupplierId(solution.getValue(\"supplierId\").stringValue().replaceAll(\"\\\\s+\",\"\"));\n\t\t\t\t\t\trecord.setProcess(stripIRI(solution.getValue(\"processType\").stringValue().replaceAll(\"\\\\s+\",\"\")));\n\t\t\t\t\t\trecord.setMaterial(stripIRI(solution.getValue(\"materialType\").stringValue().replaceAll(\"\\\\s+\",\"\")));\n\t\t\t\t\t\trecord.setCertification(stripIRI(solution.getValue(\"certificationType\").stringValue().replaceAll(\"\\\\s+\",\"\")));\n\n\t\t\t\t\t\trecordSet.add(record);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}\tcatch (Exception e) {\n\t\t\t\tSystem.err.println(e.getMessage());\n\t\t\t\tSystem.err.println(\"Wrong test data!\");\n\t\t\t}\n\t\t\t\n\n\t\t\t\n\n\t\t}\n\n\t\t//close connection to KB repository\n\t\trepository.shutDown();\n\n\t\tlong stopTime = System.currentTimeMillis();\n\t\tlong elapsedTime = stopTime - startTime;\n\n\t\tif (testing == true ) {\n\t\tSystem.out.println(\"The SPARQL querying process took \" + elapsedTime/1000 + \" seconds.\");\n\t\t}\n\n\t\t//get unique supplier ids used for constructing the supplier structure below\n\t\tSet<String> supplierIds = new HashSet<String>();\n\t\tfor (SparqlRecord sr : recordSet) {\n\t\t\tsupplierIds.add(sr.getSupplierId());\n\t\t}\n\n\t\tCertification certification = null;\n\t\tSupplier supplier = null;\n\t\tList<Supplier> suppliersList = new ArrayList<Supplier>();\n\n\t\t//create a map of processes and materials relevant for each supplier\n\t\tMap<String, SetMultimap<Object, Object>> multimap = new HashMap<String, SetMultimap<Object, Object>>();\n\n\t\tfor (String id : supplierIds) {\n\t\t\tSetMultimap<Object, Object> map = HashMultimap.create();\n\n\t\t\tString supplierID = null;\n\n\t\t\tfor (SparqlRecord sr : recordSet) {\n\n\t\t\t\tif (sr.getSupplierId().equals(id)) {\n\n\t\t\t\t\tmap.put(sr.getProcess(), sr.getMaterial());\n\n\t\t\t\t\tsupplierID = sr.getSupplierId();\n\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tmultimap.put(supplierID, map);\n\t\t}\t\t\n\n\t\tProcess process = null;\n\n\t\t//create supplier objects (supplier id, processes (including materials) and certifications) based on the multimap created in the previous step\n\t\tfor (String id : supplierIds) {\n\t\t\tSetMultimap<Object, Object> processAndMaterialMap = null;\n\n\t\t\tList<Certification> certifications = new ArrayList<Certification>();\n\t\t\tList<Process> processes = new ArrayList<Process>();\t\t\n\n\t\t\tfor (SparqlRecord sr : recordSet) {\n\n\t\t\t\tif (sr.getSupplierId().equals(id)) {\n\n\t\t\t\t\t//add certifications\n\t\t\t\t\tcertification = new Certification(sr.getCertification());\n\t\t\t\t\tif (!certifications.contains(certification)) {\n\t\t\t\t\t\tcertifications.add(certification);\n\t\t\t\t\t}\n\n\t\t\t\t\t//add processes and associated materials\n\t\t\t\t\tprocessAndMaterialMap = multimap.get(sr.getSupplierId());\n\n\t\t\t\t\tString processName = null;\n\n\t\t\t\t\tSet<Object> list = new HashSet<Object>();\n\n\t\t\t\t\t//iterate processAndMaterialMap and extract process and relevant materials for that process\n\t\t\t\t\tfor (Entry<Object, Collection<Object>> e : processAndMaterialMap.asMap().entrySet()) {\n\n\t\t\t\t\t\tSet<Material> materialsSet = new HashSet<Material>();\n\n\t\t\t\t\t\t//get list/set of materials\n\t\t\t\t\t\tlist = new HashSet<>(e.getValue());\n\n\t\t\t\t\t\t//transform to Set<Material>\n\t\t\t\t\t\tfor (Object o : list) {\n\t\t\t\t\t\t\tmaterialsSet.add(new Material((String)o));\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tprocessName = (String) e.getKey();\n\n\t\t\t\t\t\t//add relevant set of materials together with process name\n\t\t\t\t\t\tprocess = new Process(processName, materialsSet);\n\n\t\t\t\t\t\t//add processes\n\t\t\t\t\t\tif (!processes.contains(process)) {\n\t\t\t\t\t\t\tprocesses.add(process);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t}\n\n\t\t\t\t\tsupplier = new Supplier(id, processes, certifications );\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tsuppliersList.add(supplier);\n\t\t}\n\n\t\treturn suppliersList;\n\n\t}", "public ObservableList<Part> getAllParts() {\n return allParts;\n }", "public ObservableList<Part> getAllAssociatedParts() {\n return associatedParts;\n }", "public ObservableList<Part> getAllAssociatedParts() {\n return associatedParts;\n }", "int getNoOfParties();", "public ArrayList<Product> getProducts(int warehouseNumber) { return db.retrieve_warehouse(warehouseNumber); }", "public Set<ProductData> getAllProductData() {\n\t\tSet<ProductData> data = new HashSet<>();\n\n\t\t//Read ERP.txt file\n\t\ttry (Scanner reader = new Scanner(SupplierIntegrator.class.getResourceAsStream(\"ERP.txt\"))) {\n\t\t\twhile (reader.hasNextLine()) {\n\t\t\t\t//Read each line. Skip it, if it begins with the comment symbol '#'\n\t\t\t\tString line = reader.nextLine();\n\t\t\t\tif (line.startsWith(\"#\")) continue;\n\n\t\t\t\t//Read the information from the line using a new scanner with ':' as its delimiter\n\t\t\t\tScanner lineReader = new Scanner(line);\n\t\t\t\tlineReader.useDelimiter(\":\");\n\t\t\t\tint id = lineReader.nextInt();\n\t\t\t\tString name = lineReader.next();\n\t\t\t\tdouble price = lineReader.nextDouble();\n\n\t\t\t\t//Add product data\n\t\t\t\tdata.add(new ProductData(id, name, price));\n\t\t\t}\n\t\t}\n\n\t\treturn data;\n\t}", "@Override\n\tpublic List<Goods> GetGoodsBySell() {\n\t\treturn null;\n\t}", "public int getCountExemplarsFree() {\r\n \t\tif (book == null) {\r\n \t\t\treturn 0;\r\n \t\t}\r\n \r\n \t\tint freeCount = 0;\r\n \t\tList<Exemplar> exemplars = exemplarMgr.findByBook(book);\r\n \t\t// list exemplars\r\n \t\tfor (Exemplar exemplar : exemplars) {\r\n \t\t\tif (!exemplar.getIsBorrowed()) {\r\n \t\t\t\tfreeCount++;\r\n \t\t\t}\r\n \t\t}\r\n \r\n \t\treturn freeCount;\r\n \t}", "@Override\r\n\tpublic List<Product> findHots() throws Exception {\n\t\treturn null;\r\n\t}", "public List<SupplierEntity> getSuppliersByType(String typeName) {\n\n List<SupplierEntity> suppliers = new ArrayList<>();\n\n Session session = SessionFactoryProvider.getSessionFactory().openSession();\n\n Criteria criteria = session.createCriteria(SupplierEntity.class);\n criteria.createCriteria(\"supplierType\").add(Restrictions.eq(\"name\", typeName));\n\n // Language lang = (Language)super.findByCriteria(criteria).get(0);\n\n Transaction tx = null;\n\n try {\n\n tx = session.beginTransaction();\n suppliers = criteria.list();\n\n } catch (HibernateException e) {\n\n if (tx != null) {\n tx.rollback();\n }\n\n log.error(e.getStackTrace());\n\n } finally {\n session.close();\n }\n\n return suppliers;\n\n }", "Collection<? extends Equipment> getUses();", "@Override\n\tpublic Set<Book> getAvailableBooks() {\n\t\treturn null;\n\t}" ]
[ "0.6146872", "0.58566767", "0.5829563", "0.5754436", "0.5585512", "0.5554836", "0.55442023", "0.5462037", "0.54516315", "0.5417327", "0.541215", "0.5314491", "0.53071225", "0.5305741", "0.5304819", "0.5267095", "0.5245724", "0.52350897", "0.52206004", "0.52203655", "0.5214898", "0.51481605", "0.5136518", "0.5130221", "0.5120913", "0.51202655", "0.51005745", "0.5091142", "0.50861984", "0.50492936", "0.50404847", "0.5038004", "0.5023033", "0.49962664", "0.49870414", "0.49750718", "0.49659926", "0.49428752", "0.4938853", "0.49374917", "0.49333644", "0.49313858", "0.4904497", "0.4892745", "0.48897517", "0.48897517", "0.48887518", "0.48721823", "0.48716795", "0.485391", "0.48504812", "0.48479322", "0.48352373", "0.48334512", "0.48311895", "0.48265785", "0.48223934", "0.47993016", "0.47972158", "0.47869805", "0.47835702", "0.47780335", "0.47766018", "0.47729358", "0.4746777", "0.47428405", "0.47402525", "0.47179222", "0.47170228", "0.47166422", "0.4710631", "0.47098234", "0.47073674", "0.470008", "0.4697764", "0.46973905", "0.46890062", "0.46782312", "0.46775714", "0.46712536", "0.46675277", "0.46642408", "0.46638176", "0.4663396", "0.46552172", "0.46548057", "0.46502045", "0.4647089", "0.46470788", "0.4645535", "0.4645535", "0.4645355", "0.46423206", "0.46421722", "0.46358258", "0.463059", "0.4620612", "0.46191093", "0.46187067", "0.461635" ]
0.63159835
0
Applies regex on each input in the file to figure out the valid ones.
public static boolean isValidinput(String query){ Pattern regex = Pattern.compile("[$&+,:;=@#|]"); Matcher matcher = regex.matcher(query); if (matcher.find()){ return false; } else{ return true; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void processFilesForValidation() {\r\n\t\t// Process each file one at a time.\r\n\t\tfor (int i = 0; i < inScanners.length; i++) {\r\n\t\t\tScanner sc = inScanners[i];\r\n\t\t\tint articleCount = 1;\r\n\t\t\t// Read the input file.\r\n\t\t\ttry {\r\n\t\t\t\twhile(sc.hasNextLine()) {\r\n\t\t\t\t\tString s = sc.nextLine();\r\n\t\t\t\t\t// If we come across an article, read its contents and add it to the file.\r\n\t\t\t\t\tif(s.startsWith(\"@ARTICLE{\")) {\r\n\t\t\t\t\t\tauthor = journal = title = year = volume = number = pages = doi = ISSN = month = \"\";\r\n\t\t\t\t\t\twhile (!s.equals(\"}\")) {\r\n\t\t\t\t\t\t\ts = sc.nextLine();\r\n\t\t\t\t\t\t\tparseValue(s);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Throw an exception if a field is missing.\r\n\t\t\t\t\t\tif (author.isEmpty() || journal.isEmpty() || title.isEmpty() || year.isEmpty() || volume.isEmpty() \r\n\t\t\t\t\t\t\t\t|| number.isEmpty() || pages.isEmpty() || doi.isEmpty() || ISSN.isEmpty() || month.isEmpty()) {\r\n\t\t\t\t\t\t\tthrow new FileInvalidException(\"One or more fields are missing.\");\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t// Add the article to the file if valid.\r\n\t\t\t\t\t\tString author1 = author.replaceAll(\" and\", \",\");\r\n\t\t\t\t\t\tint andIndex = author.indexOf(\"and\");\r\n\t\t\t\t\t\tString author2 = andIndex != -1 ? author.replaceAll(author.substring(andIndex,author.length()), \"et al\") : author;\r\n\t\t\t\t\t\tString author3 = author.replaceAll(\"and\", \"&\");\r\n\t\t\t\t\r\n\t\t\t\t\t\t// IEEE\r\n\t\t\t\t\t\toutWriters[i][0].println(author1+\". \\\"\"+title+\"\\\", \"+journal+\", vol. \"+volume+\", no. \"+number+\", p. \"+pages+\", \"+month+\" \"+year+\".\\r\\n\");\r\n\t\t\t\t\t\t// ACM\r\n\t\t\t\t\t\toutWriters[i][1].println(\"[\"+articleCount+\"]\\t\"+author2+\". \"+year+\". \"+title+\". \"+journal+\". \"+volume+\", \"+number+\" (\"+year+\"), \"+pages+\". DOI:https://doi.org/\"+doi+\".\\r\\n\");\r\n\t\t\t\t\t\t// NJ\r\n\t\t\t\t\t\toutWriters[i][2].println(author3+\". \"+title+\". \"+journal+\". \"+volume+\", \"+pages+\"(\"+year+\").\\r\\n\");\r\n\t\t\t\t\t\tarticleCount++;\r\n\t\t\t\t\t}\t\r\n\t\t\t\t}\r\n\t\t\t\t// Close output writers once file has been read.\r\n\t\t\t\tfor (int j = 0; j < 3; j++) {\r\n\t\t\t\t\toutWriters[i][j].close();\r\n\t\t\t\t}\r\n\t\t\t\tnumValidFiles++;\r\n\t\t\t}\r\n\t\t\t// If file is invalid, close and delete the output files.\r\n\t\t\tcatch (FileInvalidException e) {\r\n\t\t\t\tSystem.out.println(\"Error: Detected Empty Field!\" \r\n\t\t\t\t\t\t + \"\\n============================\"\r\n\t\t\t + \"\\nProblem detected with input file: Latex\" + (i + 1) + \".bib\"\r\n\t\t\t\t\t\t + \"\\nFile is invalid: \" + e.getMessage() + \" Processing stopped at this point. \"\r\n\t\t\t\t\t\t + \"Other empty/missing fields may be present as well.\\n\");\r\n\t\t\t\tfor (int j = 0; j < 3; j++) {\r\n\t\t\t\t\toutWriters[i][j].close();\r\n\t\t\t\t\toutFiles[i][j].delete();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// Close input file after reading.\r\n\t\t\tsc.close();\r\n\t\t}\r\n\t}", "public void processInput(File theFile){\n\t\t//the list of input strings\n\t\tArrayList<String> theInputString=new ArrayList<String>();\n\t\t//the list of test results, could be {null,\"f\",\"a\"}\n\t\tArrayList<String> theTestResults=new ArrayList<String>();\n\n\t\ttry {\n\t\t\t// read input file containing machine description\n\t\t\tFileInputStream inStream = new FileInputStream(theFile);\n\t\t\tBufferedReader theReader = new BufferedReader(new InputStreamReader(inStream));\n\t\t\twhile (theReader.ready()) {\n\t\t\t\tString curLine=theReader.readLine();//read the line, trimming whitespace at beginning and end\n\t\t\t\tif(curLine.startsWith(\"#\")); //skip comments\n\t\t\t\telse if(curLine.isEmpty()){\n\t\t\t\t\ttheTestResults.add(\"\");\n\t\t\t\t\ttheInputString.add(\"\");\n\t\t\t\t\t//System.out.println(\"Adding input: [null string]\");\n\t\t\t\t//process the test result specifier\n\t\t\t\t}else{\n\t\t\t\t\tif(curLine.endsWith(\"#f\")){\n\t\t\t\t\t\ttheTestResults.add(\"f\");\n\t\t\t\t\t\tcurLine=curLine.split(\"\\\\#\")[0];\n\t\t\t\t\t}else if(curLine.endsWith(\"#a\")){\n\t\t\t\t\t\ttheTestResults.add(\"a\");\n\t\t\t\t\t\tcurLine=curLine.split(\"\\\\#\")[0];\n\t\t\t\t\t}else\n\t\t\t\t\t\ttheTestResults.add(\"\");\n\n\t\t\t\t\t//add the input string to the list of input strings\n\t\t\t\t\t//System.out.println(\"Adding input: \"+curLine);\n\t\t\t\t\ttheInputString.add(curLine);\n\t\t\t\t}\n\t\t\t}\n\t\t\t// close the file readers\n\t\t\tinStream.close();\n\t\t\ttheReader.close();\n\t\t\n\t\t} catch (FileNotFoundException e) {\n\t\t\tSystem.out.println(\"Input file not found.\");\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Cannot open input file.\");\n\t\t}\n\n\t\t//process the input strings\n\t\tint curIdx=0;\n\t\tfor(String s:theInputString){\n\t\t\tif(canHandleString(s)){\n\t\t\t\tSystem.out.println(\"[accept]\");\n\t\t\t\tboolean b = checkVaildity(s,true,theTestResults.get(curIdx));\n\t\t\t}else{\n\t\t\t\tSystem.out.println(\"[reject]\");\n\t\t\t}\n\t\t\tcurIdx++;\n\t\t}\n\t\t\n\t}", "@Test\n\tvoid testFormattedRE() {\n\t\tRegularLanguage rl[] = new RegularLanguage[lengthToFormatRE]; \n\t\tint i = 0;\n\t\tfor (String re : toFormatRE) {\n\t\t\trl[i++] = RegularExpression.isValidRE(re);\n\t\t}\n\t\t// Verify if all objects were created\n\t\tfor (RegularLanguage re : rl) {\n\t\t\tif (re.equals(null)) {\n\t\t\t\tfail(); // object couldn't be created\n\t\t\t}\n\t\t}\n\n\t\t// a***** -> a*\n\t\tassertEquals(\"a*\", rl[0].getRE().getFormattedRegex());\n\t\t// aa????? -> a?\n\t\tassertEquals(\"a?\", rl[1].getRE().getFormattedRegex());\n\t\t// a+++++ -> a+\n\t\tassertEquals(\"a+\", rl[2].getRE().getFormattedRegex());\n\t\t// a?*?*?***???* -> a*\n\t\tassertEquals(\"a*\", rl[3].getRE().getFormattedRegex());\n\t\t// a?+?+?+++???+ -> a*\n\t\tassertEquals(\"a*\", rl[4].getRE().getFormattedRegex());\n\t\t// a*+*+*++++***+* -> a*\n\t\tassertEquals(\"a*\", rl[5].getRE().getFormattedRegex());\n\t\t// a?+*?+?***???+++***?+?*+* -> a*\n\t\tassertEquals(\"a*\", rl[6].getRE().getFormattedRegex());\n\t\t\t\n\t}", "boolean input(String filename){\n\t\tScanner in = null;\n\t\tString word;\n\t\ttry {\t\t\t\n\t\t\tin=new Scanner(new BufferedReader(new FileReader(filename)));\n\t\t\t//in=new Scanner(new FileReader(filename));\n\t\t\tif(in.hasNext())\n\t\t\t\tword=in.next();\n\t\t\telse return false;\n\t\t\tif(word.equals(\"//tokens\")){\n\t\t\t\tif(in.hasNext())\n\t\t\t\t\tword=in.next();\n\t\t\t\twhile(!word.equals(\"//reserved\")){\t\t\t\t\t\n\t\t\t\t\tString token_name= word;\n\t\t\t\t\tif(in.hasNext())\n\t\t\t\t\t\tword=in.next();\n\t\t\t\t\telse return false;\n\t\t\t\t\tString token_RE=word;\n\t\t\t\t\tRegexPattern ptn=new RegexPattern(token_name,token_RE);\t\t//to be modified\n\t\t\t\t\ttable_pt.add(ptn);\n\t\t\t\t\tif(in.hasNext())\n\t\t\t\t\t\tword=in.next();\n\t\t\t\t\telse return false;\n\t\t\t\t}\n\t\t\t\tif(in.hasNext())\n\t\t\t\t\tword=in.next();\n\t\t\t\twhile(!word.equals(\"//operator\")){\t\t\t\t\t\n\t\t\t\t\tString name= word;\n\t\t\t\t\tif(in.hasNext())\n\t\t\t\t\t\tword=in.next();\n\t\t\t\t\telse return false;\n\t\t\t\t\tString value=word;\n\t\t\t\t\tReservedWord res=new ReservedWord(name,value);\t\t\n\t\t\t\t\ttable_res.add(res);\n\t\t\t\t\tif(in.hasNext())\n\t\t\t\t\t\tword=in.next();\n\t\t\t\t\telse return false;\n\t\t\t\t}\n\t\t\t\tif(in.hasNext())\n\t\t\t\t\tword=in.next();\n\t\t\t\twhile(!word.equals(\"//end\")){\t\t\t\t\t\n\t\t\t\t\tString name= word;\n\t\t\t\t\tif(in.hasNext())\n\t\t\t\t\t\tword=in.next();\n\t\t\t\t\telse return false;\n\t\t\t\t\tString value=word;\n\t\t\t\t\tReservedWord rsv=new ReservedWord(name,value);\t\t\n\t\t\t\t\ttable_res.add(rsv);\n\t\t\t\t\ttable_op.add(rsv);\n\t\t\t\t\tif(in.hasNext())\n\t\t\t\t\t\tword=in.next();\n\t\t\t\t\telse return false;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}\n\t\t\telse return false;\n\t\t} catch (FileNotFoundException e) {\n\t\t\te.printStackTrace();\t\t\t\n\t\t}finally{\n\t\t\tin.close();\n\t\t}\n\t\treturn true;\t\t\n\t}", "public interface RegExp {\n String NAME_REGEXP = \"^[А-Я][а-я]{2,30}$\";\n String AGE_REGEXP = \"^((1[012][0-9])|([1-9][0-9]))$\";\n String EMAIL_REGEXP = \"^[-z0-9_.]{1,30}@([A-z]+[A-z0-9]{1,15}.){1,2}([A-z]+[A-z0-9]{1,15})$\";\n String CELL_PHONE_REGEXP = \"([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|\" +\n \"(\\\\d{3}))[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{2}[\\\\s-]?\\\\d{2}$\";\n String CELL_PHONE_OPTIONAL_REGEXP = \"^(([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|\" +\n \"(\\\\d{3}))[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{2}[\\\\s-]?\\\\d{2})?\";\n String LOCAL_PHONE_REGEXP = \"^([\\\\+]\\\\d{2}\\\\s?)?(([\\\\(\\\\s]\\\\d{3}[\\\\)\\\\s])|(\\\\d{3}))?[\\\\s-]?\\\\d{3}[\\\\s-]?\\\\d{3}$\";\n String COMMENT_REGEXP = \"^([\\\\d\\\\s\\\\w\\\\.\\\\,\\\\!]){0,127}$\";\n String GROUP_REGEXP = \"^[А-я]{4,10}$\";\n String SKYPE_NICK_REGEXP = \"^[\\\\w\\\\d\\\\_]{3,20}$\";\n String INDEX_REGEXP = \"^[\\\\d]{8}$\";\n String CITY_STREET_REGEXP = \"^[А-Я][а-я]{3,20}$\";\n String BUILDING_REGEXP = \"^[\\\\d]{1,3}[\\\\w]?$\";\n String FLAT_REGEXP = \"^[\\\\d]{1,3}$\";\n}", "private void compilePattern() {\r\n\r\n pattern_startOfPage = Pattern.compile(regex_startOfPage);\r\n pattern_headerAttribute = Pattern.compile(regex_headerAttribute);\r\n pattern_messageFirstLine = Pattern.compile(regex_messageFirstLine);\r\n pattern_messageContinuationLine = Pattern.compile(regex_messageContinuationLine);\r\n }", "public static void main(String[] args) throws Exception {\r\n File file = new File(IPValidationRegex.class.getClassLoader().getResource(\"file/IpAddress.txt\").getFile());\r\n List<String> validIpAddresses = new ArrayList<>();\r\n BufferedReader reader = new BufferedReader(new FileReader(file));\r\n while (reader.read() != -1) {\r\n String ip = reader.readLine();\r\n if (isValidIP(ip)) {\r\n System.out.println(\"validip: \" + ip);\r\n validIpAddresses.add(ip);\r\n }\r\n }\r\n\r\n FileWriter writer = new FileWriter(file);\r\n for (String validIpAddress : validIpAddresses) {\r\n writer.write(validIpAddress);\r\n writer.write(\"\\n\");\r\n }\r\n writer.flush();\r\n }", "public static void RE( String s){\n \tString path = \"txt\";\t\n\t\tFile file = new File(path);\t\t\n\t\tFile[] fs = file.listFiles();\n\t\tString A [ ] = new String [fs.length];\n\t\tfor(int i=0;i<fs.length;i++) {\n\t\t\tA[i]=fs[i].toString();\t\t\n\t\t\tlib.In myfile=new lib.In (A[i]);\n\t\t\tString f=myfile.readAll();\n\t\t\tmyfile.close();\n \n//\t\t\tString pattern =\"[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\\\\.[a-zA-Z0-9_-]+)+\";\n//\t\t\tString pattern2 = \"(\\\\()?(\\\\d){3}(\\\\))?[- ](\\\\d){3}-(\\\\d){4}\";\n//\t\t\tString pattern3=\"([a-zA-Z0-9_-]+\\\\.)+w3.org\";\n//\t\t\tString pattern8=\"www.w3.org(/[a-zA-Z0-9_-]+)+/\";\n//\t\t\tString pattern9=\"www.w3.org(/[a-zA-Z0-9_-]+)+/#[a-zA-Z0-9_-]+\";\n//\t\t\tString pattern5=\"([a-zA-Z0-9_-]+\\\\.)+com\";\n//\t\t\tString pattern6=\"([a-zA-Z0-9_-]+\\\\.)+net\";\n//\t\t\tString pattern7=\"([a-zA-Z0-9_-]+\\\\.)+org\";\n\t\t\t\n\t\n\t\t\tString pattern10=s;\n\t\t\tPattern r = Pattern.compile(pattern10);\n\t\n\t\t\n\t\t\t// Now create matcher object.\n\t\t\tMatcher m = r.matcher(f);\n\t\t\twhile (m.find( )) {\n\t\t\t\tSystem.out.println(A[i]);\n\t\t\t\tSystem.out.println(\"Found value: \" + m.group(0) + \" at \" + m.start(0));\n\t\t\t} \n\t\t}\n }", "public static void inputs() {\n Core.init(true);\n\n while (running) {\n String input = Terminal.readLine();\n String[] groups = REG_CMD.createGroups(input);\n String[] groupsAdmin = REG_ADMIN.createGroups(input);\n String[] groupsLogin = REG_LOGIN.createGroups(input);\n String arg;\n\n //Set the regex type depending on input\n if (groups[1] == null && groupsAdmin[1] != null && groupsLogin[1] == null)\n arg = groupsAdmin[1];\n else if (groups[1] == null && groupsAdmin[1] == null && groupsLogin[1] != null)\n arg = groupsLogin[1];\n else\n arg = groups[1];\n\n if (arg != null && (REG_CMD.isValid(input) || REG_ADMIN.isValid(input) || REG_LOGIN.isValid(input))) {\n if (Core.getSystem().adminActive()) {\n inputsLogin(arg, groups);\n } else {\n inputsNoLogin(arg, groups, groupsAdmin, groupsLogin);\n }\n }\n else {\n Terminal.printError(\"command does not fit pattern.\");\n }\n }\n }", "private void scan(String filename){\n\t\tverifyAutomatons();\n\t\tsymbolTable = new SymbolTable();\n\t\tprogramInternalForm = new ProgramInternalForm();\n\n\t\tString[] tokensVal = getProgramFromFile(filename);\n\n\t\tint i = 0;\n\t\twhile (i < tokensVal.length) {\n\t\t\tverifySingleTokens(tokensVal[i]);\n\t\t\ti++;\n\t\t}\n\t}", "public static void main(String[] args){\n List<String> inputArrayList = new ArrayList<>();\n Path path = Paths.get(\"log.txt\");\n List<String> output = new ArrayList<>();\n\n try {\n inputArrayList = Files.readAllLines(path);\n Pattern IPAddress = Pattern.compile(\"https://*.com\");\n String substring;\n for (int i = 0; i < inputArrayList.size(); i++){\n Matcher m = IPAddress.matcher(inputArrayList.get(i));\n }\n\n } catch (IOException x){\n System.out.println(\"File not readable.\");\n }\n\n\n }", "public boolean matchesPatterns(final String filename) {\n\t\treturn false;\n\t}", "public void parseFileForInput(emailValidator sortingObject){\n File fileObj;\n try {\n fileObj = new File(sortingObject.getPath());\n Scanner scannerObj = new Scanner(fileObj);\n \n while(scannerObj.hasNextLine()){\n String currentEmail = scannerObj.nextLine();\n\n //for each email, call validate method on it\n if(isEmailValid(currentEmail) && !currentEmail.equals(\"end\")){\n String domainEnding = extractEmailEnding(currentEmail);\n sortingObject.allEmails.put(currentEmail, domainEnding);\n\n }\n else if(currentEmail.equals(\"end\")){\n scannerObj.close();\n break;\n }\n }\n scannerObj.close();\n } \n catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n}", "private static List<AttributesRule> parseRules(@Nullable File file) {\n if (file != null && file.exists() && file.isFile()) {\n try (InputStream stream = new FileInputStream(file)) {\n AttributesNode parsed = new AttributesNode();\n parsed.parse(stream);\n return parsed.getRules();\n } catch (IOException e) {\n // no need to crash the whole plugin\n System.err.println(\"Problem parsing \" + file.getAbsolutePath());\n e.printStackTrace();\n }\n }\n return Collections.emptyList();\n }", "private boolean parseInput(String fileName)\n {\n try\n {\n Scanner in = new Scanner(new File(fileName));\n\n this.numIntxns = in.nextInt();\n this.roads = new Road[in.nextInt()];\n this.cities = new City[in.nextInt()];\n\n for (int i = 0; i < this.roads.length; i++)\n {\n int start = in.nextInt();\n int end = in.nextInt();\n double length = in.nextDouble();\n\n this.roads[i] = new Road(start, end, length);\n }\n\n for (int i = 0; i < this.cities.length; i++)\n {\n int intersectionNum = in.nextInt();\n String name = in.next();\n\n this.cities[i] = new City(intersectionNum, name);\n }\n\n if (in.hasNextInt())\n {\n this.signs = new Sign[in.nextInt()];\n }\n\n for (int i = 0; i < this.signs.length; i++)\n {\n int start = in.nextInt();\n int end = in.nextInt();\n double length = in.nextDouble();\n\n this.signs[i] = new Sign(start, end, length);\n }\n }\n // lazy catch statement because computer science is hard\n catch (Exception e)\n {\n System.out.println(e.getMessage());\n return false;\n }\n\n return true;\n }", "public static void testCases(File file){\n\t\tif (file.toString().toUpperCase().contains(\"FAIL\")){\n\t\t\tboolean failed = false;\n\t\t\ttry {\n\t\t\t\tparse(new ANTLRReaderStream(new FileReader(file)));\n\t\t\t} catch (IllegalArgumentException e) {\n\t\t\t\t//System.out.println(\"PASS\");\n\t\t\t\tfailed = true;\n\t\t\t} catch (ContextualRestraintException e){\n\t\t\t\tfailed = true;\n\t\t\t} catch (FileNotFoundException e) {\n\t\t\t} catch (RecognitionException e) {\n\t\t\t} catch (IOException e) {\n\t\t\t}\n\t\t\tif (failed){\n\t\t\t\tSystem.out.println(\"FILE \" + file + \" OK\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"FILE \" + file + \" ERROR\");\n\t\t\t}\n\t\t}\n\t\n\t\tif (file.toString().toUpperCase().contains(\"PASS\")){\n\t\t\tboolean failed = false;\n\t\t\ttry {\n\t\t\t\tparse(new ANTLRReaderStream(new FileReader(file)));\n\t\t\t} catch (Exception e) {\n\t\t\t\tfailed = true;\n\t\t\t}\n\t\t\tif (failed){\n\t\t\t\tSystem.out.println(\"FILE \" + file + \" ERROR\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"FILE \" + file + \" OK\");\n\t\t\t}\n\t\t}\n\t}", "@Override\n\tprotected List<String> performScanning(String inputFilePath) {\n\t\tList<String> resultList = App.fileParser(inputFilePath);\n\t\treturn resultList;\n\t}", "@Override\n protected boolean validater(String[] line) {\n if (line.length != 9) {\n errorCounter(0);\n return false;\n }\n\n changeNulls(line);\n\n if (!isAirlineValid(line[airline])) {\n errorCounter(1);\n return false;\n }\n\n if (!isAirlineIDValid(line[airlineID])) {\n errorCounter(2);\n return false;\n }\n\n if (!isAirportValid(line[sourceAirport])) {\n errorCounter(3);\n return false;\n }\n\n if (!isAirportIDValid(line[sourceAirportID])) {\n errorCounter(4);\n return false;\n }\n\n if (!isAirportValid(line[destinationAirport])) {\n errorCounter(5);\n return false;\n }\n\n if (!isAirportIDValid(line[destinationAirportID])) {\n errorCounter(6);\n return false;\n }\n\n if (!isCodeshareValid(line[codeshare])) {\n errorCounter(7);\n return false;\n }\n\n if (!isStopsValid(line[stops])) {\n errorCounter(8);\n return false;\n }\n\n if (!isEquipmentValid(line[equipment])) {\n errorCounter(9);\n return false;\n }\n\n return true;\n }", "@Test\n\tvoid testValidRE() {\n\t\tRegularLanguage rl[] = new RegularLanguage[lengthValid]; \n\t\tint i = 0;\n\t\tfor (String re : validRE) {\n\t\t\trl[i++] = RegularExpression.isValidRE(re);\n\t\t}\n\t\t// Should be different than null:\n\t\tfor (RegularLanguage lr : rl) {\n\t\t\tassertNotNull(lr);\n\t\t}\n\t\t// Should return a FA without error\n\t\tfor (RegularLanguage lr : rl) {\n\t\t\tlr.getFA();\n\t\t}\n\t\t\n\t\t\n\t}", "public void parseFile() {\n File file = new File(inputFile);\n try {\n Scanner scan = new Scanner(file);\n\n while (scan.hasNextLine()) {\n String line = scan.nextLine();\n line = line.replaceAll(\"\\\\s+\", \" \").trim();\n\n if (line.isEmpty()) {\n continue;\n }\n // System.out.println(line);\n String cmd = line.split(\" \")[0];\n String lineWithoutCmd = line.replaceFirst(cmd, \"\").trim();\n // System.out.println(lineWithoutCmd);\n\n // The fields following each command\n String[] fields;\n\n switch (cmd) {\n case (\"add\"):\n fields = lineWithoutCmd.split(\"<SEP>\");\n fields[0] = fields[0].trim();\n fields[1] = fields[1].trim();\n fields[2] = fields[2].trim();\n add(fields);\n break;\n case (\"delete\"):\n\n fields = split(lineWithoutCmd);\n delete(fields[0], fields[1]);\n break;\n case (\"print\"):\n if (lineWithoutCmd.equals(\"ratings\")) {\n printRatings();\n break;\n }\n fields = split(lineWithoutCmd);\n\n print(fields[0], fields[1]);\n\n break;\n case (\"list\"):\n // need to check if it is the movie or reviewer\n fields = split(lineWithoutCmd);\n list(fields[0], fields[1]);\n break;\n case (\"similar\"):\n // need to check if it is the movie or reviewer\n fields = split(lineWithoutCmd);\n similar(fields[0], fields[1]);\n break;\n default:\n break;\n }\n\n }\n\n }\n catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "public void validate() throws ValidationException {\r\n\r\n // unmapped request and image dirs are only used by LC, no validation needed\r\n\r\n // mapped image dir validation\r\n\r\n File useDir = (mapImageDir != null) ? mapImageDir : imageDir;\r\n\r\n // expand file into ascending list of files\r\n LinkedList list = new LinkedList();\r\n while (useDir != null) {\r\n list.addFirst(useDir);\r\n useDir = useDir.getParentFile();\r\n }\r\n\r\n // the first must be the UNC marker; cf. FileMapper.getRoot\r\n if ( ! ((File) list.removeFirst()).getPath().equals(\"\\\\\\\\\") ) throw new ValidationException(Text.get(this,\"e6\"));\r\n\r\n // the second is the UNC share name\r\n if (list.isEmpty()) throw new ValidationException(Text.get(this,\"e7\"));\r\n list.removeFirst();\r\n // no validation here; it can contain at least IP dots, possibly more\r\n\r\n // the rest must satisfy the strict rule\r\n while ( ! list.isEmpty() ) {\r\n File file = (File) list.removeFirst();\r\n if (ruleStrict.matcher(file.getName()).find()) throw new ValidationException(Text.get(this,\"e8\"));\r\n }\r\n\r\n // other validations\r\n\r\n if (ruleAlpha.matcher(prefix).find()) throw new ValidationException(Text.get(this,\"e3\"));\r\n\r\n if (useDigits < NDIGIT_ORDER_MIN) throw new ValidationException(Text.get(this,\"e4\",new Object[] { Convert.fromInt(NDIGIT_ORDER_MIN) }));\r\n\r\n if (prefix.length() + useDigits > NDIGIT_TOTAL_MAX) throw new ValidationException(Text.get(this,\"e5\",new Object[] { Convert.fromInt(NDIGIT_TOTAL_MAX) }));\r\n\r\n MappingUtil.validate(mappings);\r\n }", "public void processInput(String theFile){processInput(new File(theFile));}", "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 static void processDataFile() {\n final String INPUT_FILENAME = \"input/assn6input1.txt\";\n File inputFile = null;\n Scanner inputScanner = null;\n System.out.println(\"Reading data from file: \" + INPUT_FILENAME);\n System.out.println();\n try {\n inputFile = new File(INPUT_FILENAME);\n inputScanner = new Scanner(inputFile);\n } catch(FileNotFoundException e) {\n System.err.println(\"Error opening file \" + INPUT_FILENAME);\n }\n while(inputScanner.hasNext()) {\n String[] dataLine = inputScanner.nextLine().split(\",\");\n // Is the first token \"REALTOR\"?\n if(dataLine[0].toUpperCase().equals(\"REALTOR\")) {\n if(dataLine[1].toUpperCase().equals(\"ADD\")) {\n addRealtor(dataLine);\n }\n else if(dataLine[1].toUpperCase().equals(\"DEL\")) {\n //deleteRealtor(dataLine[2]);\n }\n else {\n \n }\n }\n // Is the first token \"PROPERTY\"?\n else if(dataLine[0].toUpperCase().equals(\"PROPERTY\")) {\n if(dataLine[1].toUpperCase().equals(\"ADD\")) {\n addProperty(dataLine);\n }\n else if(dataLine[1].toUpperCase().equals(\"DEL\")) {\n //deleteProperty(Integer.parseInt(dataLine[2]));\n }\n else {\n \n }\n } else {\n // not realtor or property in the first token\n System.out.println(\"\\tNeither realtor, nor property in first\"\n + \" token\");\n }\n }\n inputScanner.close();\n }", "protected abstract Regex pattern();", "public interface RegexRule {\n /**\n * yyyy-MM 格式校验\n */\n String START_END_TIME_RULE=\"(19|20)[0-9][0-9]-(0[1-9]|1[0-2])\";\n /**\n * yyyy-MM 格式校验\n */\n String START_END_TIME_RULE_Y_M = \"(19|20)[0-9][0-9]-(0[1-9]|1[0-2])\";\n /**\n * yyyy-MM-dd 时间格式校验\n */\n String START_END_TIME_RULE_Y_M_D = \"((\\\\d{2}(([02468][048])|([13579][26]))[\\\\-\\\\s]?((((0?[13578])|(1[02]))[\\\\-\\\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\\\-\\\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\\\-\\\\s]?((0?[1-9])|([1-2][0-9])))))|(\\\\d{2}(([02468][1235679])|([13579][01345789]))[\\\\-\\\\s]?((((0?[13578])|(1[02]))[\\\\-\\\\s]?((0?[1-9])|([1-2][0-9])|(3[01])))|(((0?[469])|(11))[\\\\-\\\\s]?((0?[1-9])|([1-2][0-9])|(30)))|(0?2[\\\\-\\\\s]?((0?[1-9])|(1[0-9])|(2[0-8]))))))\";\n /**\n * yyyy-MM-dd hh:mm:ss\n */\n String START_END_TIME_RULE_Y_M_D_H_M_S = \"^\\\\d{4}[-]([0][1-9]|(1[0-2]))[-]([1-9]|([012]\\\\d)|(3[01]))([ \\\\t\\\\n\\\\x0B\\\\f\\\\r])(([0-1]{1}[0-9]{1})|([2]{1}[0-4]{1}))([:])(([0-5]{1}[0-9]{1}|[6]{1}[0]{1}))([:])((([0-5]{1}[0-9]{1}|[6]{1}[0]{1})))$\";\n /**\n * 名称格式校验\n */\n String NAME_RULE = \"[^\\\\\\\\<>%'\\\"]{0,10}\";\n /**\n * 不含有特殊字符格式校验\n */\n String SPECIAL_WORD_RULE = \"[^\\\\\\\\<>%'\\\"]{1,50}\";\n /**\n * 不含有特殊字符格式校验\n */\n String SPECIAL_WORD_RULE_TWENTY = \"[^\\\\\\\\<>%'\\\"]{1,19}\";\n /**\n * 标题校验\n */\n String TITLE_RULE = \"[^\\\\\\\\<>%'\\\"]{1,60}\";\n /**\n * 用户昵称格式\n */\n String USERNAME_RULE = \"[^\\\\\\\\<>%'\\\"]{1,15}$\";\n /**\n * 时间的格式\n */\n String TIME_FORMAT_Y_M_D = \"yyyy-MM-dd\";\n /**\n * 时间的格式yyyy-MM-dd HH:MM:SS 12时制\n */\n String TIME_FARMAT_Y_M_D_H_M_S = \"yyyy-MM-dd hh:mm:ss\";\n /**\n * 24时制\n */\n String TIME_FARMAT_YYYY_MM_DD_HH_MM_SS_24 = \"yyyy-MM-dd HH:mm:ss\";\n\n /**\n * 1-50汉字格式校验\n */\n String CHINA_WORD = \"[^\\\\\\\\<>%'\\\"]{1,50}\";\n /**\n * 1-5汉字的格式检验\n */\n String CHINESE_RULE = \"^[\\\\u4e00-\\\\u9fa5 ]{1,5}$\";\n\n int FIVE_THOUSAND = 500;\n\n}", "public static void main(String[] args) throws IOException {\n if(args.length == 0) {\r\n System.out.println(\"Proper Usage is: java inputfile.txt outputfile.txt\");\r\n System.exit(0);\r\n }\r\n\r\n //Assign agruments\r\n String inputfile=args[0];\r\n String outputfile=args[1];\r\n\r\n //Verify inputfile size is not empty\r\n if (getFileSize(inputfile)<0) {\r\n System.out.println(\"Source input filesize is empty: \");\r\n System.exit(0);\r\n }\r\n\r\n List<String> rowsInputFile = new ArrayList<String>();\r\n rowsInputFile=retrieveAllRows(inputfile);\r\n\r\n ArrayList<Integer> errorList = new ArrayList<>();\r\n ArrayList<ParseString> validRowList = new ArrayList<ParseString>();\r\n\r\n\r\n //evaluateRows=evaluateRows(rowsInputFile);\r\n\r\n //errorList =\r\n //validRowList=\r\n\r\n for (int i = 0; i < rowsInputFile.size(); i++) {\r\n\r\n String pattern = \"\\\\d{3} \\\\d{3} \\\\d{4}\";\r\n String inputString = rowsInputFile.get(i);\r\n Pattern r = Pattern.compile(pattern);\r\n Matcher m = r.matcher(inputString);\r\n\r\n if (m.find()) { //Match\r\n validRowList.add(new ParseString(rowsInputFile.get(i), true));\r\n out.println(inputString);\r\n } else { //No Match\r\n out.println(inputString);\r\n int actualline = i + 1;\r\n errorList.add(actualline);\r\n }\r\n }\r\n\r\n sortJsonArray(validRowList);\r\n\r\n JsonObject json = new JsonObject();\r\n loadValidDataJson(json,validRowList);\r\n loadErrorDataJson(json,errorList);\r\n\r\n createJsonFile(json);\r\n\r\n }", "private void processBulk()\n {\n File inDir = new File(m_inDir);\n String [] fileList = inDir.list();\n \n for (int j=0; j<fileList.length; j++)\n {\n String file = fileList[j];\n if (file.endsWith(\".xml\"))\n {\n m_inFile = m_inDir + \"/\" + file;\n m_localeStr = Utilities.extractLocaleFromFilename(file);\n processSingle();\n }\n }\n }", "private void reformatInputFile() throws IOException, InvalidInputException{\r\n new InputFileConverter(this.inputFileName);\r\n }", "public static void processInput() throws IOException {\r\n\t\t\r\n\t\t//Out statement let user know the input file is being read\t\r\n\t\tScanner scnr;\r\n\t\tString[] splitString;\r\n\t\t\r\n\t\tFile file = new File(\"Project_04_Input01.txt\");\r\n\t\tscnr = new Scanner(file);\r\n\t\t\r\n\t\tSystem.out.println(\"Reading data from \" + file + \"...\");\r\n\t\t\r\n\t\twhile(scnr.hasNextLine()) {\r\n\t\t\tString line = scnr.nextLine();\r\n\t\t\tsplitString = line.split(\",\");\r\n\r\n\t\t\tif (splitString[0].contains(\"STUDENT\")) {\r\n\t\t\t\t\r\n\t\t\t\t// Call processStudentData\r\n\t\t\t\tprocessStudentData(splitString);\r\n\t\t\t\tSystem.out.println(\"'STUDENT' has been found in the file.\");\r\n\r\n\t\t\t} // End if\r\n\t\t\t\r\n\t\t\telse if (splitString[0].contains(\"GRADEITEM\") ) {\r\n\t\t\t\t\r\n\t\t\t\t// Call processGradeItemData\r\n\t\t\t\tprocessGradeItemData(splitString);\r\n\t\t\t\tSystem.out.println(\"'GRADEITEM' has been found in the file.\");\r\n\t\t\t\t\r\n\t\t\t} // End if\r\n\t\t} // End while\r\n\t\t\r\n\t\t// Close the file\r\n\t\tscnr.close();\r\n\t\t\t\r\n\t}", "static boolean processFilesForValidation(Scanner[] scanners, PrintWriter[] writers) {\r\n try {\r\n for (int id = 0; id < filenames.length; ++id) {\r\n Scanner scanner = (Scanner)scanners[id];\r\n PrintWriter writer = (PrintWriter)writers[id];\r\n String file = filenames[id];\r\n \r\n // Check fields\r\n if (!scanner.hasNextLine())\r\n throw new CSVFileInvalidException(file, 0, null);\r\n String line = scanner.nextLine();\r\n int missing = 0;\r\n String[] fields = getRecords(line);\r\n for (String s : fields) {\r\n if (s.trim().isEmpty())\r\n missing++;\r\n }\r\n if (missing > 0)\r\n throw new CSVFileInvalidException(file, missing, fields);\r\n \r\n // Check records\r\n writer.println(\"[\");\r\n boolean first = true;\r\n missing = 0;\r\n while (scanner.hasNextLine()) {\r\n missing++;\r\n line = scanner.nextLine();\r\n String[] records = getRecords(line);\r\n \r\n // Check if records are valid\r\n boolean valid = true;\r\n for (String record : records) {\r\n if (record.isEmpty()) {\r\n valid = false;\r\n break;\r\n }\r\n }\r\n if (!valid || records.length != fields.length) {\r\n writer.close();\r\n throw new CSVDataMissing(file, missing, fields, records);\r\n }\r\n\r\n if (!first)\r\n writer.println(\",\");\r\n first = false;\r\n\r\n writer.println(\" {\");\r\n for (int i = 0; i < fields.length; i++) {\r\n writer.println(\" \\\"\" + fields[i] + \"\\\": \\\"\" + \r\n records[i] + \"\\\",\");\r\n }\r\n writer.print(\" }\");\r\n }\r\n writer.println();\r\n writer.println(\"]\");\r\n writer.flush();\r\n writer.close();\r\n }\r\n } catch (CSVDataMissing | CSVFileInvalidException e) {\r\n return false;\r\n }\r\n return true;\r\n }", "public static void main(String[] args) {\n\t\t\n\t ArrayList<String> emails = new ArrayList<String>();\n\t \n\t // valid email addresses\n\t emails.add(\"[email protected]\");\n\t emails.add(\"[email protected]\");\n\t emails.add(\"[email protected]\");\n\t emails.add(\"[email protected]\");\n\t emails.add(\"[email protected]\");\n\t \n\t \n\t //invalid email addresses\n\t emails.add(\"@gmail.com\");\n\t emails.add(\"shagun&ag.com\");\n\t emails.add(\"raghu#@example.us.org\");\n\n\t //initialize the Pattern object\n\t Pattern pattern = Pattern.compile(regex);\n\n\t //searching for occurrences of regex\n\t for (String value : emails) {\n\t Matcher matcher = pattern.matcher(value);\n\t System.out.println(\"Email \" + value + \" is \" + (matcher.matches() ? \"valid\" : \"invalid\"));\n\t System.out.println(\"-----------------------------------------------------\");\n\t \n//\t \tboolean result = Pattern.compile(regex).matcher(value).matches();\n//\t \tSystem.out.println(result);\n\t }\n\n\t}", "public static void main(String[] args) {\n RegExp_final_version obj=new RegExp_final_version();\n BufferedReader br = null;\n\n\t\ttry {\n\n\t\t\tString sCurrentLine;\n \n\t\t\tbr = new BufferedReader(new FileReader(\"E:\\\\NetBeans Project workspace\\\\RegExp_final_version\\\\src\\\\regexp_final_version\\\\Inputs\"));\n\n System.out.println(\"Reading of Regular Exps: \");\n \n String [] exps=new String[Integer.parseInt(br.readLine())];\n for(int c1=0;c1<exps.length;c1++){\n System.out.println(exps[c1]=br.readLine());\n }\n System.out.println(\"\\n\\nReading The test Strings: \");\n String [] strs=new String[Integer.parseInt(br.readLine())];\n for(int c1=0;c1<strs.length;c1++){\n System.out.println(strs[c1]=br.readLine());\n }\n for (int i = 0; i < strs.length; i++) {\n for (int j = 0; j < exps.length; j++) {\n try{\n// System.out.println(\"CHECKER: i: \"+i+\": \"+exps[j]+\" , j: \"+j+\": \"+strs[i] );\n System.out.println(\"\\n-----------------------\"\n + \"\\n RESULTS: \"+\"i=\"+i+\" , j=\"+j+\"\\n ||\"\n + obj.supports(exps[j], strs[i])\n +\"||\\n---------------------\");\n\n }\n catch(Exception e){\n System.out.println(\"\\n_-___----__-\\nEXCEPTION: i: \"+i+\": \"+exps[i]+\" , j: \"+j+\": \"+strs[j] );\n// e.printStackTrace();\n }\n }\n }\n \n//\t\t\twhile ((sCurrentLine = br.readLine()) != null) {\n//\t\t\t obj.fullCode=obj.fullCode+sCurrentLine;\n// System.out.println(sCurrentLine);\n//\t\t\t}\n\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (br != null)br.close();\n\t\t\t} catch (IOException ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}\n \n }", "private List<String> findAnts(String inputFileName) {\n\nList<String> lines = new ArrayList<>();\ntry {\nBufferedReader br = new BufferedReader(new FileReader(inputFileName));\nString line = br.readLine();\nwhile (line != null) {\nlines.add(line);\nline = br.readLine();\n}\n} catch (Exception e) {\n\n}\n\nchar[] splitLineByLetterOrDigit;\nList<String> saveAnts = new ArrayList<>();\n\nfor (int k = 0; k < lines.size(); k++) {\nString singleLine = lines.get(k);\nsplitLineByLetterOrDigit = singleLine.toCharArray();\nfor (int i = 0; i < splitLineByLetterOrDigit.length; i++) {\nif (Character.isLetter(splitLineByLetterOrDigit[i])) {\n// first is row\nsaveAnts.add(String.format(\"%d %d %s\", k, i, splitLineByLetterOrDigit[i]));\n}\n}\n}\n\nreturn saveAnts;\n}", "public static void main(String[] args) {\n Scanner scanner = new Scanner(System.in);\n List<String> list = new ArrayList<>();\n while(scanner.hasNextLine()) {\n list.add(scanner.nextLine());\n }\n list.stream().filter(x -> x.matches(\".*[z]{1}.{3}[z]{1}.*\"))\n .forEach(System.out::println);\n\n}", "public int parseRulesFile() {\n\t BufferedReader reader = null;\n\t List<String> allLines = new ArrayList<String>();\n\t List<String> allLinesWithLintChecks = new ArrayList<String>();\n\t listOfRules = new ArrayList<String>();\n\t boolean eof = false;\n\t try {\n\t reader = new BufferedReader(new FileReader(pathTextFile));\n\t while (!eof) {\n\t String line = reader.readLine();\n\n\t if (line != null) {\n\t allLines.add(line);\n\t } else {\n\t eof = true;\n\t }\n\t }\n\n\t for (String line : allLines) {\n\t if (line.contains(\":\") && line.contains(\"\\\"\")) {\n\t allLinesWithLintChecks.add(line);\n\t }\n\t }\n\n\t for (String rule : allLinesWithLintChecks) {\n\t int position = rule.indexOf(\":\");\n\t listOfRules.add(rule.substring(1, position - 1));\n\t }\n\t } catch (FileNotFoundException ex) {\n\t System.err.println(\"File not found!\");\n\t ex.printStackTrace();\n\t } catch (IOException ex) {\n\t System.err.println(\"Error!!\");\n\t ex.printStackTrace();\n\t } finally {\n\t try {\n\t reader.close();\n\t } catch (IOException ex1) {\n\t System.out.println(\"Error when closing file !!\");\n\t }\n\t }\n\t return listOfRules.size();\n\t }", "@Test\n\tvoid runRegEx_IllegalCharacters() throws Exception {\n\t\tmaxScore += 10;\n\t\tRegEx.regEx = \"|*\";\n\t\ttry {\n\t\t\tRegExTree ret = RegEx.parse();\n\t\t\tAutomaton a = RegEx.RegExTreeToAutomaton(ret);\n\t\t\ta.toTable();\n\t\t\ta.eliminateEpsilonTransitions();\n\t\t\ta.minimize();\n\t\t\tfail();\n\t\t} catch (Exception e) {\n\t\t\tactualScore += 10;\n\t\t}\n\t}", "@Test\n\tvoid runRegExNoOperands_LegalCase() throws Exception {\n\t\tmaxScore += 10;\n\t\tRegEx.regEx = \"Sargon\";\n\t\ttry {\n\t\t\tRegExTree ret = RegEx.parse();\n\t\t\tAutomaton a = RegEx.RegExTreeToAutomaton(ret);\n\t\t\ta.toTable();\n\t\t\ta.eliminateEpsilonTransitions();\n\t\t\ta.minimize();\n\t\t\tArrayList<MatchResponse> response = a.search(\"books/babylon.txt\");\n\t\t} catch (Exception e) {\n\t\t\tfail();\n\t\t}\n\t\tactualScore += 10;\n\t}", "@Test\n\tvoid testInvalidRE() {\n\t\tRegularLanguage rl[] = new RegularLanguage[lengthInvalid];\n\t\tint i = 0;\n\t\tfor (String re: invalidRE) {\n\t\t\trl[i++] = RegularExpression.isValidRE(re);\n\t\t}\n\t\t// Should be null:\n\t\tfor (RegularLanguage l : rl) {\n\t\t\tassertNull(l);\n\t\t}\n\t}", "@BeforeEach\n\tvoid setUpValidRE(){\n\t\tvalidRE= new String[lengthValid];\n\t\t// ab\n\t\tvalidRE[0] = \"ab\";\n\t\t// (ab)\n\t\tvalidRE[1] = \"(ab)\";\n\t\t//(ab)*\n\t\tvalidRE[2] = \"(ab)*\";\n\t\t// a???\n\t\tvalidRE[3] = \"a???\";\n\t\t// a***\n\t\tvalidRE[4] = \"a***\";\n\t\t// a+++\n\t\tvalidRE[5] = \"a+++\";\n\t\t// (((a)))\n\t\tvalidRE[6] = \"(((a)))\";\n\t\t// (a | ab | c*)*\n\t\tvalidRE[7] = \"(a | ab | c*)*\";\n\t\t// (a | ab | c*)**??\n\t\tvalidRE[8] = \"(a | ab | c*)*??\";\n\t\t// ( a | (ab | cd)+ )+\n\t\tvalidRE[9] = \"(a | (ab | cd)+)+\";\n\t\t// 0 (01 | (02) * | (03)++) | (1?01?)\n\t\tvalidRE[10] = \"0 (01 | (02) * | (03)++) | (a?01?)\";\n\t\t// a | &\n\t\tvalidRE[11] = \"a | &\";\n\t\t// &*\n\t\tvalidRE[12] = \"&*\";\n\t\t// (())* (empty language)\n\t\tvalidRE[13] = \"(())*\";\n\t\t// (a*b)*\n\t\tvalidRE[14] = \"(a*b)*\";\n\t\t// (a | & | a*b?c+)*\n\t\tvalidRE[15] = \"(a | & | a*b?c+)*\";\n\t}", "@Test\n\tvoid runRegExFoundText_LegalCase() throws Exception {\n\t\tmaxScore += 10;\n\t\tRegEx.regEx = \"S(a|r|g)*on\";\n\t\ttry {\n\t\t\tRegExTree ret = RegEx.parse();\n\t\t\tAutomaton a = RegEx.RegExTreeToAutomaton(ret);\n\t\t\ta.toTable();\n\t\t\ta.eliminateEpsilonTransitions();\n\t\t\ta.minimize();\n\t\t\tArrayList<MatchResponse> response = a.search(\"books/babylon.txt\");\n\t\t\tassertEquals(30, response.size());\n\t\t} catch (Exception e) {\n\t\t\tfail();\n\t\t}\n\t\tactualScore += 10;\n\t}", "public static void main(String[] args) {\n splitRegex();\n\n }", "public void transform() {\n String delimiter = \" \";\n\n System.out.println(\"Using pathname \" + this.inputPath_ + \"\\n\");\n\n //create string to hold the entire input file\n String input = \"\";\n try { //use a scanner to get the contents of the file into a string\n Scanner inputScanner = new Scanner(new File(this.inputPath_));\n //use a delimiter that only matches the end of the file; this will give us the whole file\n input = inputScanner.useDelimiter(\"\\\\Z\").next();\n inputScanner.close();\n } catch (Exception e) {\n System.err.println(\"Couldn't read \" + this.inputPath_);\n System.exit(-100);\n }\n //if we are here, then there wasn't an exception\n\n //make sure not empty file\n if(input.isEmpty()) {\n System.err.print(\"Error: Empty file.\");\n System.exit(-200);\n }\n\n //create an array for the line strings\n ArrayList<String> inputLines = new ArrayList<>();\n\n //next, separate the input string into multiple strings, one for each line\n //delimiter string regex - only match line terminators\n String lineDelim = \"(\\n|\\r|\\r\\n|\\u0085|\\u2028|\\u2029)\";\n StringTokenizer inputLineTokenizer = new StringTokenizer(input, lineDelim); //create a string tokenizer\n\n //count number of lines\n int numberOfLines = inputLineTokenizer.countTokens();\n\n //add the lines to the array\n for(int i = 0; i < numberOfLines; i++) inputLines.add(inputLineTokenizer.nextToken(lineDelim));\n\n\n //split line into words\n\n //create arraylist of strings\n ArrayList<ArrayList<String>> lines = new ArrayList<>();\n\n for(int i = 0; i < inputLines.size(); i++) {\n //printout(\"Read line: \" + inputLines.get(i) + \"\\n\");\n\n //create a tokenizer and count number of tokens\n StringTokenizer tokenizer = new StringTokenizer(inputLines.get(i), delimiter);\n int numWords = tokenizer.countTokens();\n\n //create array of strings\n ArrayList<String> currentLine = new ArrayList<>();\n\n for(int j = 0; j < numWords; j++) { //add a word if it is valid\n String currentWord = cleanUpText(tokenizer.nextToken(delimiter));\n if(!currentWord.isEmpty()) currentLine.add(currentWord);\n }\n\n //add the current line to the list of typed lines if it had any valid words\n if(currentLine.size() > 0) lines.add(currentLine);\n }\n\n if(lines.size() <= 0) {\n System.err.println(\"ERROR! File did not contain a line with any valid words. Please try again with a different inpput file.\");\n System.exit(-444);\n } else {\n //send lines from array to pipe\n for(int i = 0; i < lines.size(); i++) {\n this.output_.put(lines.get(i));\n }\n\n\n\n //send a null terminator?\n //this causes the other filter to give an exception\n //the exception is caught by the other filter, which breaks the loop it uses to get new lines\n this.output_.put(null);\n //printout(\"Done with file input.\\n\");\n //stop the filter\n this.stop();\n }\n\n\n }", "public void ProcessFiles() {\n LOG.info(\"Processing SrcML files ...\");\n final Collection<File> allFiles = ctx.files.AllFiles();\n int processed = 0;\n final int numAllFiles = allFiles.size();\n final int logDiv = Math.max(1, Math.round(numAllFiles / 100f));\n\n for (File file : allFiles) {\n final String filePath = file.filePath;\n final FilePath fp = ctx.internFilePath(filePath);\n\n Document document = readSrcmlFile(filePath);\n DocWithFileAndCppDirectives extDoc = new DocWithFileAndCppDirectives(file, fp, document, ctx);\n\n internAllFunctionsInFile(file, document);\n processFeatureLocationsInFile(extDoc);\n\n if ((++processed) % logDiv == 0) {\n int percent = Math.round((100f * processed) / numAllFiles);\n LOG.info(\"Parsed SrcML file \" + processed + \"/\" + numAllFiles\n + \" (\" + percent + \"%) (\" + (numAllFiles - processed) + \" to go)\");\n }\n }\n\n LOG.info(\"Parsed all \" + processed + \" SrcML file(s).\");\n }", "private static void input(String[] args) {\n try (BufferedReader scanner = new BufferedReader(\n new InputStreamReader(args.length > 0 ? new FileInputStream(args[0]) : System.in))) {\n\n String linija;\n\n // regularne definicije\n while ((linija = scanner.readLine()) != null && linija.startsWith(\"{\")) {\n String tmp[] = linija.split(\" \");\n\n tmp[0] = tmp[0].substring(1, tmp[0].length() - 1);\n String naziv = tmp[0];\n String izraz = expandRegularDefinition(tmp[1]);\n\n regularneDefinicije.put(naziv, izraz);\n\n // System.out.println(naziv + \", \" + izraz);\n }\n\n // stanja\n while (!linija.startsWith(\"%X\")) {\n linija = scanner.readLine().trim();\n }\n\n skipSplitAdd(linija, stanjaLA);\n\n // leksicke jedinke\n while (!linija.startsWith(\"%L\")) {\n linija = scanner.readLine().trim();\n }\n\n skipSplitAdd(linija, leksickeJedinke);\n\n // pravila leksickog analizatora\n\n while ((linija = scanner.readLine()) != null) {\n while (!linija.startsWith(\"<\")) {\n linija = scanner.readLine();\n }\n\n String tmp[] = linija.split(\">\", 2);\n\n String stateName = tmp[0].substring(1, tmp[0].length());\n String regDef = tmp[1];\n\n regDef = expandRegularDefinition(regDef);\n\n // System.out.println(stateName + \"<> \" + regDef);\n LexerRule lexerRule = new LexerRule(regDef, stateName, 1, \"<\" + stateName + \">\" + regDef);\n lexerRules.add(lexerRule);\n\n scanner.readLine(); // preskoci {\n\n linija = scanner.readLine().trim();\n while (linija != null && scanner.ready() && !linija.equals(\"}\")) {\n // radi nesto s naredbom\n lexerRule.addAction(linija);\n linija = scanner.readLine().trim();\n }\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "void read() {\n try {\n pre_list = new ArrayList<>();\n suf_list = new ArrayList<>();\n p_name = new ArrayList<>();\n stem_word = new ArrayList<>();\n\n //reading place and town name\n for (File places : place_name.listFiles()) {\n fin = new FileInputStream(places);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n place.add(temp);\n }\n\n }\n\n //reading month name\n for (File mont : month_name.listFiles()) {\n fin = new FileInputStream(mont);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n month.add(temp);\n }\n }\n\n //reading compound words first\n for (File comp_word : com_word_first.listFiles()) {\n fin = new FileInputStream(comp_word);\n scan = new Scanner(fin);\n while (scan.hasNextLine()) {\n temp = scan.nextLine();\n temp = Normalization(temp);\n comp_first.add(temp);\n }\n }\n //reading next word of the compound\n for (File comp_word_next : com_word_next.listFiles()) {\n fin = new FileInputStream(comp_word_next);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n comp_next.add(temp);\n }\n }\n //reading chi square feature\n for (File entry : chifile.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n chiunion.add(temp);\n }\n newunions.clear();\n newunions.addAll(chiunion);\n chiunion.clear();\n chiunion.addAll(newunions);\n chiunion.removeAll(stop_word_list);\n chiunion.removeAll(p_name);\n chiunion.removeAll(month);\n chiunion.removeAll(place);\n }\n //reading short form from abbrivation \n for (File short_list : abbrivation_short.listFiles()) {\n fin = new FileInputStream(short_list);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n shortform.add(temp);\n }\n }\n //reading long form from the abrivation \n for (File long_list : abbrivation_long.listFiles()) {\n fin = new FileInputStream(long_list);\n scan = new Scanner(fin);\n while (scan.hasNextLine()) {\n temp = scan.nextLine();\n temp = Normalization(temp);\n longform.add(temp);\n }\n }\n //reading file from stop word\n for (File stoplist : stop_word.listFiles()) {\n fin = new FileInputStream(stoplist);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n stop_word_list.add(temp);\n }\n }\n\n //reading person name list\n for (File per_name : person_name.listFiles()) {\n fin = new FileInputStream(per_name);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n p_name.add(temp);\n }\n }\n\n //reading intersection union\n for (File entry : interfile.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (temp.length() < 2 && temp.length() > 9) {\n\n } else {\n interunion.add(temp);\n }\n }\n newunions.clear();\n newunions.addAll(interunion);\n interunion.clear();\n interunion.addAll(newunions);\n interunion.removeAll(stop_word_list);\n interunion.removeAll(p_name);\n interunion.removeAll(month);\n interunion.removeAll(place);\n }\n // reading ig union\n for (File entry : igfile.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (temp.length() < 2 && temp.length() > 9) {\n\n } else {\n igunion.add(temp);\n }\n }\n for (String str : igunion) {\n int index = igunion.indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n igunion.set(index, stem_word.get(i));\n }\n }\n }\n newunions.clear();\n newunions.addAll(igunion);\n igunion.clear();\n igunion.addAll(newunions);\n igunion.removeAll(stop_word_list);\n igunion.removeAll(p_name);\n igunion.removeAll(month);\n igunion.removeAll(place);\n }\n //read df uinfion\n for (File entry : dffile.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (temp.length() < 2 && temp.length() > 9) {\n\n } else {\n dfunion.add(temp);\n }\n }\n for (String str : dfunion) {\n int index = dfunion.indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n dfunion.set(index, stem_word.get(i));\n }\n }\n }\n newunions.clear();\n newunions.addAll(dfunion);\n dfunion.clear();\n dfunion.addAll(newunions);\n dfunion.removeAll(stop_word_list);\n dfunion.removeAll(p_name);\n dfunion.removeAll(month);\n dfunion.removeAll(place);\n }\n //reading unified model\n for (File entry : unionall_3.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (temp.length() < 2 && temp.length() > 9) {\n\n } else {\n union_3.add(temp);\n }\n }\n for (String str : union_3) {\n int index = union_3.indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n union_3.set(index, stem_word.get(i));\n }\n }\n }\n newunions.clear();\n newunions.addAll(union_3);\n union_3.clear();\n union_3.addAll(newunions);\n union_3.removeAll(stop_word_list);\n union_3.removeAll(p_name);\n union_3.removeAll(month);\n union_3.removeAll(place);\n }\n //unified feature for the new model\n for (File entry : unified.listFiles()) {\n\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n newunion.add(temp);\n\n }\n for (String str : newunion) {\n int index = newunion.indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n newunion.set(index, stem_word.get(i));\n }\n }\n }\n newunions.clear();\n newunions.addAll(newunion);\n newunion.clear();\n newunion.addAll(newunions);\n newunion.removeAll(stop_word_list);\n newunion.removeAll(p_name);\n newunion.removeAll(month);\n newunion.removeAll(place);\n\n // newunion.addAll(newunions);\n }\n // reading test file and predict the class\n for (File entry : test_doc.listFiles()) {\n fin = new FileInputStream(entry);\n scan = new Scanner(fin);\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n file_test.add(temp);\n\n }\n newunions.clear();\n newunions.addAll(file_test);\n file_test.clear();\n file_test.addAll(newunions);\n file_test.removeAll(stop_word_list);\n file_test.removeAll(p_name);\n file_test.removeAll(month);\n file_test.removeAll(place);\n }\n //reading the whole document under economy class\n for (File entry : economy.listFiles()) {\n fill = new File(economy + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n economydocument[count1] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n economydocument[count1].add(temp);\n if (temp.length() < 2) {\n economydocument[count1].remove(temp);\n }\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n economydocument[count1].remove(temp);\n }\n }\n for (String str : economydocument[count1]) {\n int index = economydocument[count1].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n economydocument[count1].set(index, stem_word.get(i));\n }\n }\n }\n }\n economydocument[count1].removeAll(stop_word_list);\n economydocument[count1].removeAll(p_name);\n economydocument[count1].removeAll(month);\n economydocument[count1].removeAll(place);\n allecofeature.addAll(economydocument[count1]);\n ecofeature.addAll(economydocument[count1]);\n allfeature.addAll(ecofeature);\n all.addAll(allecofeature);\n count1++;\n\n }\n //reading the whole documents under education category \n for (File entry : education.listFiles()) {\n fill = new File(education + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n educationdocument[count2] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n educationdocument[count2].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n educationdocument[count2].remove(temp);\n }\n }\n }\n\n for (String str : educationdocument[count2]) {\n int index = educationdocument[count2].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n educationdocument[count2].set(index, stem_word.get(i));\n }\n }\n }\n educationdocument[count2].removeAll(stop_word_list);\n educationdocument[count2].removeAll(p_name);\n educationdocument[count2].removeAll(month);\n educationdocument[count2].removeAll(place);\n alledufeature.addAll(educationdocument[count2]);\n edufeature.addAll(educationdocument[count2]);\n allfeature.addAll(edufeature);\n all.addAll(alledufeature);\n count2++;\n }\n// //reading all the documents under sport category\n for (File entry : sport.listFiles()) {\n fill = new File(sport + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n sportdocument[count3] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n sportdocument[count3].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n sportdocument[count3].remove(temp);\n }\n }\n }\n\n for (String str : sportdocument[count3]) {\n int index = sportdocument[count3].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n sportdocument[count3].set(index, stem_word.get(i));\n }\n }\n }\n sportdocument[count3].removeAll(stop_word_list);\n sportdocument[count3].removeAll(p_name);\n sportdocument[count3].removeAll(month);\n sportdocument[count3].removeAll(place);\n allspofeature.addAll(sportdocument[count3]);\n spofeature.addAll(sportdocument[count3]);\n allfeature.addAll(spofeature);\n all.addAll(allspofeature);\n count3++;\n }\n\n// //reading all the documents under culture category\n for (File entry : culture.listFiles()) {\n fill = new File(culture + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n culturedocument[count4] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n\n culturedocument[count4].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n culturedocument[count4].remove(temp);\n }\n }\n\n }\n for (String str : culturedocument[count4]) {\n int index = culturedocument[count4].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n culturedocument[count4].set(index, stem_word.get(i));\n }\n }\n }\n culturedocument[count4].removeAll(stop_word_list);\n culturedocument[count4].removeAll(p_name);\n culturedocument[count4].removeAll(month);\n culturedocument[count4].removeAll(place);\n allculfeature.addAll(culturedocument[count4]);\n culfeature.addAll(culturedocument[count4]);\n allfeature.addAll(culfeature);\n all.addAll(allculfeature);\n count4++;\n\n }\n\n// //reading all the documents under accident category\n for (File entry : accident.listFiles()) {\n fill = new File(accident + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n accedentdocument[count5] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n accedentdocument[count5].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n accedentdocument[count5].remove(temp);\n }\n }\n\n }\n\n for (String str : accedentdocument[count5]) {\n int index = accedentdocument[count5].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n accedentdocument[count5].set(index, stem_word.get(i));\n }\n }\n }\n accedentdocument[count5].removeAll(stop_word_list);\n accedentdocument[count5].removeAll(p_name);\n accedentdocument[count5].removeAll(month);\n accedentdocument[count5].removeAll(place);\n allaccfeature.addAll(accedentdocument[count5]);\n accfeature.addAll(accedentdocument[count5]);\n allfeature.addAll(accfeature);\n all.addAll(allaccfeature);\n count5++;\n }\n\n// //reading all the documents under environmental category\n for (File entry : environmntal.listFiles()) {\n fill = new File(environmntal + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n environmntaldocument[count6] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n environmntaldocument[count6].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n environmntaldocument[count6].remove(temp);\n }\n }\n }\n\n for (String str : environmntaldocument[count6]) {\n int index = environmntaldocument[count6].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n environmntaldocument[count6].set(index, stem_word.get(i));\n }\n }\n }\n environmntaldocument[count6].removeAll(stop_word_list);\n environmntaldocument[count6].removeAll(p_name);\n environmntaldocument[count6].removeAll(month);\n environmntaldocument[count6].removeAll(place);\n allenvfeature.addAll(environmntaldocument[count6]);\n envfeature.addAll(environmntaldocument[count6]);\n allfeature.addAll(envfeature);\n all.addAll(allenvfeature);\n count6++;\n }\n\n// //reading all the documents under foreign affairs category\n for (File entry : foreign_affair.listFiles()) {\n fill = new File(foreign_affair + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n foreign_affairdocument[count7] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n foreign_affairdocument[count7].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n foreign_affairdocument[count7].remove(temp);\n }\n }\n\n }\n for (String str : foreign_affairdocument[count7]) {\n int index = foreign_affairdocument[count7].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n foreign_affairdocument[count7].set(index, stem_word.get(i));\n }\n }\n }\n foreign_affairdocument[count7].removeAll(stop_word_list);\n foreign_affairdocument[count7].removeAll(p_name);\n foreign_affairdocument[count7].removeAll(month);\n foreign_affairdocument[count7].removeAll(place);\n alldepfeature.addAll(foreign_affairdocument[count7]);\n depfeature.addAll(foreign_affairdocument[count7]);\n allfeature.addAll(depfeature);\n all.addAll(alldepfeature);\n count7++;\n }\n\n// //reading all the documents under law and justices category\n for (File entry : law_justice.listFiles()) {\n fill = new File(law_justice + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n law_justicedocument[count8] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n law_justicedocument[count8].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n law_justicedocument[count8].remove(temp);\n }\n }\n\n }\n for (String str : law_justicedocument[count8]) {\n int index = law_justicedocument[count8].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n law_justicedocument[count8].set(index, stem_word.get(i));\n }\n }\n }\n law_justicedocument[count8].removeAll(stop_word_list);\n law_justicedocument[count8].removeAll(p_name);\n law_justicedocument[count8].removeAll(month);\n law_justicedocument[count8].removeAll(month);\n alllawfeature.addAll(law_justicedocument[count8]);\n lawfeature.addAll(law_justicedocument[count8]);\n allfeature.addAll(lawfeature);\n all.addAll(alllawfeature);\n count8++;\n }\n\n// //reading all the documents under other category\n for (File entry : agri.listFiles()) {\n fill = new File(agri + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n agriculture[count9] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n agriculture[count9].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n agriculture[count9].remove(temp);\n }\n }\n\n }\n for (String str : agriculture[count9]) {\n int index = agriculture[count9].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n agriculture[count9].set(index, stem_word.get(i));\n }\n }\n }\n agriculture[count9].removeAll(stop_word_list);\n agriculture[count9].removeAll(p_name);\n agriculture[count9].removeAll(month);\n agriculture[count9].removeAll(place);\n allagrifeature.addAll(agriculture[count9]);\n agrifeature.addAll(agriculture[count9]);\n allfeature.addAll(agrifeature);\n all.addAll(allagrifeature);\n count9++;\n }\n //reading all the documents under politics category\n for (File entry : politics.listFiles()) {\n fill = new File(politics + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n politicsdocument[count10] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n politicsdocument[count10].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n politicsdocument[count10].remove(temp);\n }\n }\n }\n for (String str : politicsdocument[count10]) {\n int index = politicsdocument[count10].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n politicsdocument[count10].set(index, stem_word.get(i));\n }\n }\n }\n politicsdocument[count10].removeAll(stop_word_list);\n politicsdocument[count10].removeAll(p_name);\n politicsdocument[count10].removeAll(month);\n politicsdocument[count10].removeAll(place);\n allpolfeature.addAll(politicsdocument[count10]);\n polfeature.addAll(politicsdocument[count10]);\n allfeature.addAll(polfeature);\n all.addAll(allpolfeature);\n count10++;\n }\n //reading all the documents under science and technology category\n for (File entry : science_technology.listFiles()) {\n fill = new File(science_technology + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n science_technologydocument[count12] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n science_technologydocument[count12].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n science_technologydocument[count12].remove(temp);\n }\n }\n\n }\n for (String str : science_technologydocument[count12]) {\n int index = science_technologydocument[count12].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n science_technologydocument[count12].set(index, stem_word.get(i));\n }\n }\n }\n science_technologydocument[count12].removeAll(stop_word_list);\n science_technologydocument[count12].removeAll(p_name);\n science_technologydocument[count12].removeAll(month);\n science_technologydocument[count12].removeAll(place);\n allscifeature.addAll(science_technologydocument[count12]);\n scifeature.addAll(science_technologydocument[count12]);\n allfeature.addAll(scifeature);\n all.addAll(allscifeature);\n count12++;\n\n }\n\n //reading all the documents under health category\n for (File entry : health.listFiles()) {\n fill = new File(health + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n healthdocument[count13] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n healthdocument[count13].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n healthdocument[count13].remove(temp);\n }\n }\n }\n for (String str : healthdocument[count13]) {\n int index = healthdocument[count13].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n healthdocument[count13].set(index, stem_word.get(i));\n }\n }\n }\n healthdocument[count13].removeAll(stop_word_list);\n healthdocument[count13].removeAll(p_name);\n healthdocument[count13].removeAll(month);\n healthdocument[count13].removeAll(place);\n allhelfeature.addAll(healthdocument[count13]);\n helfeature.addAll(healthdocument[count13]);\n allfeature.addAll(helfeature);\n all.addAll(allhelfeature);\n count13++;\n }\n\n //reading all the file of relgion categories \n for (File entry : army_file.listFiles()) {\n fill = new File(army_file + \"\\\\\" + entry.getName());\n fin = new FileInputStream(fill);\n scan = new Scanner(fin);\n army[count14] = new ArrayList<>();\n while (scan.hasNext()) {\n temp = scan.next();\n temp = Normalization(temp);\n set.add(temp);\n if (comp_first.contains(temp)) {\n int index = comp_first.indexOf(temp);\n next = comp_next.get(index);\n if (comp_next.contains(next)) {\n temp = temp + next;\n }\n }\n if (shortform.contains(temp)) {\n int i = shortform.indexOf(temp);\n temp = longform.get(i);\n }\n army[count14].add(temp);\n for (char dig : temp.toCharArray()) {\n if (Character.isDigit(dig)) {\n army[count14].remove(temp);\n }\n }\n\n }\n for (String str : army[count14]) {\n int index = army[count14].indexOf(str);\n for (int i = 0; i < stem_word.size(); i++) {\n if (inf_derv[i].contains(str)) {\n army[count14].set(index, stem_word.get(i));\n }\n }\n }\n army[count14].removeAll(stop_word_list);\n army[count14].removeAll(p_name);\n army[count14].removeAll(month);\n army[count14].removeAll(place);\n allarmfeature.addAll(army[count14]);\n armfeature.addAll(army[count14]);\n allfeature.addAll(armfeature);\n all.addAll(allarmfeature);\n count14++;\n }\n } catch (Exception ex) {\n System.out.println(\"here\");\n }\n }", "public void parse(String userInput) {\n\t\tString[] args = toStringArray(userInput, ' ');\n\t\tString key = \"\";\n\t\tArrayList<String> filePaths = new ArrayList<String>();\n\t\tboolean caseSensitive = true;\n\t\tboolean fileName = false;\n\n\t\t// resolves the given args\n\t\tfor (int i = 0; i < args.length; i++) {\n\t\t\tif (args[i].equals(\"-i\")) {\n\t\t\t\tcaseSensitive = false;\n\t\t\t} else if (args[i].equals(\"-l\")) {\n\t\t\t\tfileName = true;\n\t\t\t} else if (args[i].contains(\".\")) {\n\t\t\t\tfilePaths.add(args[i]);\n\t\t\t} else {\n\t\t\t\tkey = args[i];\n\t\t\t}\n\t\t}\n\t\t// in the case of multiple files to parse this repeats until all files\n\t\t// have been searched\n\t\tfor (String path : filePaths) {\n\t\t\tthis.document = readFile(path);\n\t\t\tfindMatches(key, path, caseSensitive, fileName);\n\t\t}\n\t}", "private void validateInput () throws IOException, Exception {\n\t\t\n\t\t// Check that the properties file exists\n\t\tFile propFile = new File(propertiesFile);\n\t\tif (!propFile.exists()) { \n\t\t\tthrow new IOException(\"Unable to open properties file \" + propertiesFile);\t\n\t\t}\n\t\t\n\t\t// Check that the list of register files is not empty\n\t\tif (inputFiles == null || inputFiles.isEmpty()) {\n\t\t\tthrow new Exception(\"No files to process\");\n\t\t}\n\t}", "public MapMessage processFile(File file) {\r\n\t\ttry {\r\n\r\n\t\t\tScanner input = new Scanner(file);\r\n\r\n\t\t\twhile (input.hasNext()) {\r\n\t\t\t\tString line = input.nextLine();\r\n\t\t\t\tif (!line.isEmpty()) {\r\n\t\t\t\t\tfileContent.append(line).append(\"\\n\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tinput.close();\r\n\r\n\t\t} catch (FileNotFoundException ex) {\r\n\t\t\tex.printStackTrace();\r\n\t\t}\r\n\t\tMapMessage mapMessage = validateMap(fileContent.toString());\r\n\t\treturn mapMessage;\r\n\t}", "private boolean valid(InputStream instream)\r\n\t\t\tthrows BaseException\r\n\t{\r\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(instream));\r\n\t\tString line = new String();\r\n\t\tboolean newspectrum = false;\r\n\t\ttry\r\n\t\t{\r\n\t\t\twhile ((line = in.readLine()) != null)\r\n\t\t\t{\r\n\t\t\t\t// Line with 3 columns (float, float, digit)\r\n\t\t\t\tif ((Pattern.matches(\"^\\\\d+\\\\.\\\\d*[ \\\\t]\\\\d+\\\\.?\\\\d*[ \\\\t]\\\\d\",\r\n\t\t\t\t\tline)))\r\n\t\t\t\t{\r\n\t\t\t\t\tnewspectrum = false;\r\n\t\t\t\t\twhile (!newspectrum)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ((line = in.readLine()) != null)\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tif (line.length() > 0)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t// Line with 2 columns (float, float)\r\n\t\t\t\t\t\t\t\tif (!Pattern.matches(\r\n\t\t\t\t\t\t\t\t\t\"^\\\\d+\\\\.\\\\d*[ \\\\t]\\\\d+\\\\.?\\\\d*\", line))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t// If m/z has 9 or more digits(+1 decimal sign),\r\n\t\t\t\t\t\t\t\t// annotate as\r\n\t\t\t\t\t\t\t\t// double precision\r\n\t\t\t\t\t\t\t\telse if (!mz_double_precision && Pattern\r\n\t\t\t\t\t\t\t\t\t.matches(\"^[\\\\d\\\\.]{10,}[ \\\\t]\\\\d+\\\\.?\\\\d*\",\r\n\t\t\t\t\t\t\t\t\t\tline))\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tmz_double_precision = true;\r\n\t\t\t\t\t\t\t\t\tlog.info(\"Double precision = 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\telse\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tnewspectrum = 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\telse\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\tnewspectrum = true;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\telse if (line.length() > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (IOException e)\r\n\t\t{\r\n\t\t\tthrow new BaseException(e);\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "private void handleFile(File file) {\n try {\n Scanner reader = new Scanner(file);\n while (reader.hasNextLine()) {\n // Get the next line\n String line = reader.nextLine();\n\n // Clean any lines from unwanted statements\n line = cleanLine(line);\n\n // Filter out the imports and save\n if (line.length() >= 7 && line.substring(0, 7).equals(\"import \")) {\n if (! (line.length() >= 12 && line.substring(0, 12).equals(\"import main.\"))) {\n imports.add(line);\n }\n } else if (! (line.length() >= 7 && line.substring(0, 7).equals(\"package\"))){\n lines.add(line);\n }\n }\n lines.add(\"\"); // Add an empty line between files\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n }", "@Override\n protected void compileRegex(String regex) {\n }", "@Override\n public long resultPart1() throws Exception {\n Scanner sc = inputScanner();\n \n int valid = 0;\n\n while(sc.hasNextLine()) {\n StringBuilder line = new StringBuilder(sc.nextLine());\n \n int min = Integer.parseInt(line.substring(0, line.indexOf(\"-\")));\n int max = Integer.parseInt(line.substring(line.indexOf(\"-\") + 1, line.indexOf(\" \")));\n line.delete(0, line.indexOf(\" \") + 1);\n\n char c = line.charAt(0);\n line.delete(0, line.indexOf(\" \") + 1);\n \n int count = 0;\n for(int i=0; i<line.length(); i++) {\n if(line.charAt(i) == c) count++;\n }\n\n if(count >= min && count <= max) valid++;\n }\n\n return valid;\n }", "private static void iterateInput(){\n boolean isReadingKnowledgeBase = false;\n boolean isReadingProveStatements = false;\n\n String[] kb = readInput().split(\"\\\\r?\\\\n\");\n for(String sentence : kb){\n if(sentence.contains(\"Knowledge Base:\")){\n isReadingKnowledgeBase = true;\n isReadingProveStatements = false;\n } else if(sentence.contains(\"Prove the following sentences by refutation:\")){\n isReadingKnowledgeBase = false;\n isReadingProveStatements = true;\n } else {\n if(isReadingKnowledgeBase && !sentence.isEmpty()) {\n knowledgeBase.add(evalSentence(sentence));\n } else if(isReadingProveStatements && !sentence.isEmpty()){\n proveStatements.add(evalSentence(sentence));\n }\n }\n }\n }", "public String validateRegexFormat(String input) {\n String regexFootball = \"^(.+?)(\\\\d+)-(\\\\d+)(.+?)$\";\n // Regex to check valid tennis game.\n String regexTennis = \"^(.+?) (\\\\W)(\\\\d+)(\\\\W) (\\\\d+) (.{2,})-(.{2,}) (\\\\W)(\\\\d+)(\\\\W) (.+?)$\";\n // Regex to check valid american football game.\n String regexAmericanFootball = \"^(.+?) (\\\\d+)-(\\\\d+) (.+) (.+(?= Quarter)) (Quarter)$\";\n\n\n if (input.matches(regexAmericanFootball)) {\n return this.getAmericanFootballResult(input);\n } else if (input.matches(regexTennis)) {\n return this.getTennisResult(input);\n } else if (input.matches(regexFootball)) {\n return this.getFootballResult(input);\n } else {\n return \"Format not detected! Verify the input text.\";\n }\n\n }", "@BeforeEach\n\tvoid setUpInvalidRE(){\n\t\tinvalidRE= new String[lengthInvalid];\n\t\t// (ab\n\t\tinvalidRE[0] = \"(ab\";\n\t\t// ab)\n\t\tinvalidRE[1] = \"ab)\";\n\t\t// *\n\t\tinvalidRE[2] = \"*\";\n\t\t// ?\n\t\tinvalidRE[3] = \"?\";\n\t\t// +\n\t\tinvalidRE[4] = \"+\";\n\t\t// a | b | +c\n\t\tinvalidRE[5] = \"a | b | +c\";\n\t\t// a | b | *c\n\t\tinvalidRE[6] = \"a | b | *c\";\n\t\t// a | b | ?c\n\t\tinvalidRE[7] = \"a | b | ?c\";\n\t\t// a | b | | c\n\t\tinvalidRE[8] = \"a | b | | c\";\n\t\t// uneven parenthesis\n\t\tinvalidRE[9] = \"(a(b(c(d)*)+)*\";\n\t\t// a | b |\n\t\tinvalidRE[10] = \"a | b | \";\n\t\t// invalid symbols\n\t\tinvalidRE[11] = \"a | b | $ | -\";\n\t\t// (*)\n\t\tinvalidRE[12] = \"(*)\";\n\t\t// (|a)\n\t\tinvalidRE[13] = \"(|a)\";\n\t\t// (.b)\n\t\tinvalidRE[14] = \"(.b)\";\n\t}", "@Override\n protected void dataParser() {\n for (String dataLine : dataFile) {\n if (totalErrors > 200) {\n totalErrors = 0;\n throw new RuntimeException(\n \"File rejected: more than 200 lines contain errors.\\n\" + getErrorMessage(false));\n }\n parseLine(dataLine);\n }\n }", "private void setupValidations() {\n for (Map.Entry<EditText, Validator> e : mValidators.entrySet()) {\n // On every keystroke, validate input and make text colour black or red\n e.getKey().addTextChangedListener(new MyTextWatcher() {\n @Override\n public void afterTextChanged(Editable s) {\n if (e.getValue().test(e.getKey().getText().toString()))\n e.getKey().setTextColor(mInputTextColorNormal);\n else\n e.getKey().setTextColor(mInputTextColorInvalid);\n }\n });\n // When the field loses focus, set an error icon if the input is invalid\n e.getKey().setOnFocusChangeListener((v, hasFocus) -> {\n if (hasFocus) return;\n if (!e.getValue().test(e.getKey().getText().toString()))\n e.getKey().setError(e.getValue().getWarnMsg(), e.getValue().getWarnIcon());\n });\n }\n }", "private void validateReflexMapFile(String mapToCheck) throws FileNotFoundException\n {\n //Initialize the map scanner\n reflexValidator = new Scanner(new File(mapToCheck));\n\n if (reflexValidator.next().contains(\"reflex\"))\n {\n reflexValidated = true;\n System.out.println(\"\\nThis is a valid Reflex Arena map file\");\n }\n\n else\n {\n System.out.println(\"\\nThis is not a Reflex Arena map file\");\n }\n }", "public List<RuleFailure> check(FoundFiles filesToCheck) {\n List<RuleFailure> failures = new LinkedList<>();\n\n AtomicInteger count = new AtomicInteger();\n\n filesToCheck.fileRequests()\n .stream()\n .filter(this::include)\n .forEach(fr -> {\n count.incrementAndGet();\n processFile(fr, failures);\n });\n\n if (failures.size() == 0) {\n Log.info(\"Inclusive naming processed \" + count.get() + \" files.\");\n } else {\n Log.info(\"Inclusive naming processed \" + count.get() + \" files, found \" + failures.size() + \" errors\");\n }\n return failures;\n }", "private void process(final IFile file) throws CoreException {\n\t\ttry {\n\t\t\t// run\n\t\t\tfinal List<String> command = buildCommand(file);\n\t\t\tfinal IOExecutor executor = new IOExecutor();\n\t\t\tfinal int exitCode = executor.run(command);\n\n\t\t\t// output?\n\t\t\tfinal String output = executor.getOutput();\n\t\t\tif (!output.isEmpty()) {\n\t\t\t\t// convert\n\t\t\t\tfinal TwigFile result = parseResult(output);\n\t\t\t\tif (result != null && !result.isEmpty()) {\n\t\t\t\t\t// add violations\n\t\t\t\t\tfinal ResourceText text = new ResourceText(file);\n\t\t\t\t\tfor (final TwigViolation violation : result) {\n\t\t\t\t\t\taddMarker(file, text, violation);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (exitCode != 0) { // error?\n\t\t\t\tIOException e = executor.getErrorException();\n\t\t\t\tfinal String error = executor.getError();\n\t\t\t\tif (!error.isEmpty()) {\n\t\t\t\t\te = new IOException(error, e);\n\t\t\t\t}\n\t\t\t\tfinal String msg = NLS.bind(\n\t\t\t\t\t\tMessages.ValidationVisitor_Error_Validate_Code,\n\t\t\t\t\t\tfile.getName(), exitCode);\n\t\t\t\thandleStatus(createErrorStatus(msg, e));\n\t\t\t}\n\t\t} catch (final IOException e) {\n\t\t\tfinal String msg = NLS.bind(\n\t\t\t\t\tMessages.ValidationVisitor_Error_Validate_Name,\n\t\t\t\t\tfile.getName());\n\t\t\thandleStatus(createErrorStatus(msg, e));\n\t\t}\n\t}", "public static void main(String[] args) {\n\t\tIreader reader = new FileReader();\n\t\tTokens tokens = new Tokens();\n\t\tString s = \"\";\n\t\ttry {\n\t\t\ts = reader.readFile(\"Data/code.txt\");\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tArrayList<Token> result = new ArrayList<>(), found = new ArrayList<>();\n\t\tfor (Token token : tokens.tokens) {\n\t\t\tfound = token.validate_2(s);\n\t\t\tif (!found.isEmpty()) {\n\t\t\t\tresult.addAll(found);\n\t\t\t\t//System.out.println(found);\n\t\t\t}\n\t\t}\n\t\t//System.out.println(result);\n\t\tCollections.sort(result, Comparator.comparing(Token::getStartpos));\n\t\tfor (int i = 0; i < result.size(); i++) {\n\t\t\tfor (int j = i + 1; j < result.size(); j++) {\n\t\t\t\tif (result.get(i).getStartpos() == result.get(j).getStartpos()) {\n\t\t\t\t\tif (result.get(j).getClassName().equals(\"ID\")) {\n\t\t\t\t\t\tresult.remove(j);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (int i = 0; i < result.size(); i++) {\n\t\t\tfor (int j = i + 1; j < result.size(); j++) {\n\n\t\t\t\tif (result.get(i).getStartpos() <= result.get(j).getStartpos()\n\t\t\t\t\t\t&& result.get(i).getEndpos() >= result.get(j).getEndpos()) {\n\t\t\t\t\tif(result.get(j).getClassName().equals(\"DOT\")&&\n\t\t\t\t\t result.get(j-1).getClassName().equals(\"FLOAT\")&&\n\t\t\t\t\t result.get(j+1).getClassName().equals(\"INT_LITERAL\")) {\n\t\t\t\t\t\tresult.remove(j-1);\n\t\t\t\t\t\tj--;\n\t\t\t\t\t\tcontinue;\n\n\t\t\t\t\t}\t\t\t\t\t\t\n\t\t\t\t\tresult.remove(j);\n\t\t\t\t\tj--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t//\tSystem.out.println(result);\n\t\tErrorHandler errorhandler = new ErrorHandler(s,result);\n\t\terrorhandler.printError();\n\t\ttry {\n\t\t\tWriter.writeTokens(result, \"Data/output.txt\");\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public interface RegExp {\n String NUMBER_OF_COMPOSITION = \"^[1-2][0-9]|[1-9]$\";\n String BREAK_DATE_BY_DOT = \"[.]\";\n String IDENTIFY_BUMDLE = \"^([E|e][N|n])|[У|у][К|к][Р|р]$\";\n String DURATION = \"^[1-9]|[1-9][0-9]|[1-4][0-9][0-9]$\";\n}", "public static ArrayList<String> parseFile(String f) throws Exception {\n\t\tArrayList<CommandNode> cmdNode = new ArrayList<CommandNode>();\n\t\tArrayList<MemoryNode> memNode = new ArrayList<MemoryNode>();\n\t\tparseFile(f,cmdNode,memNode);\n\t\treturn preCompile(cmdNode, memNode);\n\t}", "static void parseData(Map<String, Set<String>> sourceOutputStrings, Set<String> trueTuples) throws IOException{\n\t\tBufferedReader dataFile = new BufferedReader(new FileReader(DATAFILE));\n\t\t\n\t\tSet<String> bookSet = new HashSet<String>();\n\t\tSet<String> authorSet = new HashSet<String>();\n\t\tSet<String> tupleSet = new HashSet<String>();\n\t\tSet<String> sourceSet = new HashSet<String>();\n\t\t\n\t\tString s;\n\t\tSet<String> sourceBlackList = new HashSet<String>();\n\t\t// remove below books? increases isolated errors, although there should still be correlations between errors such as using first name\n\t\tsourceBlackList.add(\"A1Books\");\n\t\tsourceBlackList.add(\"Indoo.com\");\n\t\tsourceBlackList.add(\"Movies With A Smile\");\n\t\tsourceBlackList.add(\"Bobs Books\");\n\t\tsourceBlackList.add(\"Gunars Store\");\n\t\tsourceBlackList.add(\"Gunter Koppon\");\n\t\tsourceBlackList.add(\"Quartermelon\");\n\t\tsourceBlackList.add(\"Stratford Books\");\n\t\tsourceBlackList.add(\"LAKESIDE BOOKS\");\n\t\tsourceBlackList.add(\"Books2Anywhere.com\");\n\t\tsourceBlackList.add(\"Paperbackshop-US\");\n\t\tsourceBlackList.add(\"tombargainbks\");\n\t\tsourceBlackList.add(\"Papamedia.com\");\n\t\tsourceBlackList.add(\"\");\n\t\tsourceBlackList.add(\"\");\n\t\tsourceBlackList.add(\"\");\n\t\t\n\t\tPattern pattern = Pattern.compile(\"[^a-z]\", Pattern.CASE_INSENSITIVE);\n\t\twhile ((s = dataFile.readLine()) != null) {\n\t\t\tif (s.indexOf('\\t') == -1) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tString[] fields = s.split(\"\\t\");\n\t\t\tif (fields.length != 4) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfinal String sourceId = fields[0];\n\t\t\tif (sourceBlackList.contains(sourceId)) {\n\t\t\t\t//continue;\n\t\t\t}\n\t\t\tfinal String bookId = fields[1];\n\t\t\tfinal String authorString = fields[3];\n\t\t\tList<String> authorList = parseAuthorString(authorString);\n\t\t\t\n\t\t\tbookSet.add(bookId);\n\t\t\tauthorSet.addAll(authorList);\n\t\t\tsourceSet.add(sourceId);\n\t\t\tif (!sourceOutputStrings.containsKey(sourceId)) {\n\t\t\t\tsourceOutputStrings.put(sourceId, new HashSet<String>());\n\t\t\t}\n\t\t\tfor (String author : authorList) {\n\t\t\t\tMatcher matcher = pattern.matcher(author.trim());\n\t\t\t\tif (matcher.find()) {\n\t\t\t\t\tcontinue; // Skip author names that have a special character, since they are likely a parsing error.\n\t\t\t\t}\n\t\t\t\tif (author.equals(\"\")) { // Sometimes, trailing commas result in empty author strings. \n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tfinal String tuple = bookId + \"\\t\" + author.trim();\n\t\t\t\ttupleSet.add(tuple);\n\t\t\t\tsourceOutputStrings.get(sourceId).add(tuple);\n\t\t\t}\n\t\t}\n\t\tdataFile.close();\n\n\t\tBufferedReader labelledDataFile = new BufferedReader(new FileReader(ISBNLABELLEDDATAFILE));\t\t\n\t\twhile ((s = labelledDataFile.readLine()) != null) {\n\t\t\tString[] fields = s.split(\"\\t\");\n\t\t\tif (fields.length < 2) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tfinal String bookId = fields[0];\n\t\t\tfinal String authorString = fields[1];\n\t\t\tString[] authors = authorString.split(\"; \");\n\t\t\tfor (int i = 0; i < authors.length; i++) {\n\t\t\t\tauthors[i] = canonicalize(authors[i].trim());\n\t\t\t\ttrueTuples.add(bookId + \"\\t\" + authors[i]);\n\t\t\t}\n\t\t}\n\t\t\n\t\tlabelledDataFile.close();\n\t}", "@Test\n\tvoid runRegExUnfoundText_LegalCase() throws Exception {\n\t\tmaxScore += 10;\n\t\tRegEx.regEx = \"Introuvable\";\n\t\ttry {\n\t\t\tRegExTree ret = RegEx.parse();\n\t\t\tAutomaton a = RegEx.RegExTreeToAutomaton(ret);\n\t\t\ta.toTable();\n\t\t\ta.eliminateEpsilonTransitions();\n\t\t\ta.minimize();\n\t\t\tArrayList<MatchResponse> response = a.search(\"books/babylon.txt\");\n\t\t\tassertEquals(0, response.size());\n\t\t} catch (Exception e) {\n\t\t\tfail();\n\t\t}\n\t\tactualScore += 10;\n\t}", "private void parseInputFile(String inputFile) throws IOException {\n List<String> lines = Files.readAllLines(FileSystems.getDefault().getPath(inputFile), Charset.defaultCharset());\n for (int i = 1; i < lines.size(); ++i) {\n ParsedRecord record = new ParsedRecord(lines.get(i));\n if (!this.parsedRecords.containsKey(record.docName)) {\n this.parsedRecords.put(record.docName, new ArrayList<ParsedRecord>());\n }\n this.parsedRecords.get(record.docName).add(record);\n\n if (!this.docToMaxPosition.containsKey(record.docName) ||\n this.docToMaxPosition.containsKey(record.docName) && this.docToMaxPosition.get(record.docName) < record.position) {\n this.docToMaxPosition.put(record.docName, record.position);\n }\n }\n }", "boolean accept(String filename);", "public void parseInputFile(String filename) throws BadInputFormatException {\r\n\t\tString line;\r\n\r\n\t\ttry {\r\n\t\t\tInputStream fis = new FileInputStream(filename);\r\n\t\t\tInputStreamReader isr = new InputStreamReader(fis);\r\n\t\t\tBufferedReader br = new BufferedReader(isr);\r\n\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\tparseMessage(line);\r\n\t\t\t}\r\n\t\t\tbr.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "@Test\n public void testCanParseAllSamples() throws IOException {\n final File sampleDir = new File(\"sample_abc/\");\n final File[] abcFiles = sampleDir.listFiles((file) -> file.getName().endsWith(\".abc\"));\n\n for (File file : abcFiles) {\n try {\n final CharStream stream = new ANTLRFileStream(file.getAbsolutePath());\n AbcLexer lexer = new AbcLexer(stream);\n lexer.reportErrorsAsExceptions();\n\n AbcParser parser = new AbcParser(new CommonTokenStream(lexer));\n parser.addErrorListener(new BaseErrorListener() {\n public void syntaxError(Recognizer<?, ?> recognizer, Object offendingSymbol, int line,\n int charPositionInLine, String msg, RecognitionException e) {\n return;\n }\n });\n parser.reportErrorsAsExceptions();\n\n parser.abcTune();\n } catch (Exception e) {\n System.err.println(file);\n throw e;\n }\n }\n }", "public abstract boolean canDecodeInput(File file) throws IOException;", "public String inputNumbersMatchingRegex(String regex) {\r\n String input;\r\n while (true) {\r\n input = sc.nextLine();\r\n if (!input.matches(regex)) {\r\n view.printMessage(view.WRONG_INPUT_DATA);\r\n } else {\r\n break;\r\n }\r\n }\r\n return input;\r\n }", "public REparser (String input) throws IOException {\n fileIn = new FileReader(input);\n cout.printf(\"%nEchoing File: %s%n\", input);\n echoFile();\n fileIn = new FileReader(input);\n pbIn = new PushbackReader(fileIn);\n temp = new FileReader(input);\n currentLine = new BufferedReader(temp);\n curr_line = \"\";\n curr_line = currentLine.readLine();\n AbstractNode root;\n while(curr_line != null) {\n getToken();\n root = parse_re(0);\n printTree(root);\n curr_line = currentLine.readLine();\n }\n }", "public static void parseFromDirectory(File input){\n\t\t\n\t\tlong timer = System.currentTimeMillis();\n\t\t\n\t\tScanner nouns1;\n\t\tScanner nouns2;\n\t\tScanner nouns3;\n\t\tScanner nouns4;\n\t\tScanner nouns5;\n\t\t\n\t\tScanner verbs1;\n\t\tScanner verbs2;\n\t\tScanner verbs3;\n\t\tScanner verbs3IO;\n\t\tScanner verbs4;\n\t\t\n\t\tScanner adjectives12;\n\t\tScanner adjectives3;\n\t\t\n\t\tScanner adverbs;\n\t\tScanner prepositions;\n\t\tScanner conjunctions;\n\t\t\n\t\tif(!input.isDirectory()){\n\t\t\tthrow new IllegalArgumentException(\"Input file was not a directory!\");\n\t\t}\n\t\t\n\t\tString inputLocation = input.getAbsolutePath();\n\t\t\n\t\ttry {\n\t\t\t//Initialize everything\n\t\t\tnouns1 = new Scanner(new File(inputLocation+\"\\\\Nouns1.txt\"));\n\t\t\tnouns2 = new Scanner(new File(inputLocation+\"\\\\Nouns2.txt\"));\n\t\t\tnouns3 = new Scanner(new File(inputLocation+\"\\\\Nouns3.txt\"));\n\t\t\tnouns4 = new Scanner(new File(inputLocation+\"\\\\Nouns4.txt\"));\n\t\t\tnouns5 = new Scanner(new File(inputLocation+\"\\\\Nouns5.txt\"));\n\t\t\t\n\t\t\tverbs1 = new Scanner(new File(inputLocation+\"\\\\Verbs1.txt\"));\n\t\t\tverbs2 = new Scanner(new File(inputLocation+\"\\\\Verbs2.txt\"));\n\t\t\tverbs3 = new Scanner(new File(inputLocation+\"\\\\Verbs3.txt\"));\n\t\t\tverbs3IO = new Scanner(new File(inputLocation+\"\\\\Verbs3IO.txt\"));\n\t\t\tverbs4 = new Scanner(new File(inputLocation+\"\\\\Verbs4.txt\"));\n\t\t\t\n\t\t\tadjectives12 = new Scanner(new File(inputLocation+\"\\\\Adjectives12.txt\"));\n\t\t\tadjectives3 = new Scanner(new File(inputLocation+\"\\\\Adjectives3.txt\"));\n\t\t\t\n\t\t\tadverbs = new Scanner(new File(inputLocation+\"\\\\Adverbs.txt\"));\n\t\t\tprepositions = new Scanner(new File(inputLocation + \"\\\\Prepositions.txt\"));\n\t\t\tconjunctions = new Scanner(new File(inputLocation+\"\\\\Conjunctions.txt\"));\n\n\t\t\t//Make the arraylists to hold data\n\t\t\tallNouns = new TreeSet<Noun>();\n\t\t\tallVerbs = new TreeSet<Verb>();\n\t\t\tallAdjectives = new TreeSet<Adjective>();\n\t\t\tallAdverbs = new TreeSet<Adverb>();\n\t\t\tallConjunctions = new TreeSet<Conjunction>();\n\t\t\tallPrepositions = new TreeSet<Preposition>();\n\t\t\t\n\t\t\tallNouns.addAll(parseNouns(nouns1, Values.INDEX_NOUN_TYPE_DECLENSION_FIRST));\n\t\t\tallNouns.addAll(parseNouns(nouns2, Values.INDEX_NOUN_TYPE_DECLENSION_SECOND));\n\t\t\tallNouns.addAll(parse3rdNouns(nouns3));\n\t\t\tallNouns.addAll(parseNouns(nouns4, Values.INDEX_NOUN_TYPE_DECLENSION_FOURTH));\n\t\t\tallNouns.addAll(parseNouns(nouns5, Values.INDEX_NOUN_TYPE_DECLENSION_FIFTH));\n\t\t\t\n\t\t\tallVerbs.addAll(parseVerbs(verbs1, Values.INDEX_VERB_TYPE_CONJUGATION_FIRST));\n\t\t\tallVerbs.addAll(parseVerbs(verbs2, Values.INDEX_VERB_TYPE_CONJUGATION_SECOND));\n\t\t\tallVerbs.addAll(parseVerbs(verbs3, Values.INDEX_VERB_TYPE_CONJUGATION_THIRD));\n\t\t\tallVerbs.addAll(parseVerbs(verbs3IO, Values.INDEX_VERB_TYPE_CONJUGATION_THIRDIO));\n\t\t\tallVerbs.addAll(parseVerbs(verbs4, Values.INDEX_VERB_TYPE_CONJUGATION_FOURTH));\n\t\t\t\n\t\t\tallAdjectives.addAll(parseAdjective12(adjectives12));\n\t\t\tallAdjectives.addAll(parseAdjective3(adjectives3));\n\t\t\t\n\t\t\tallAdverbs.addAll(parseAdverbs(adverbs));\n\t\t\tallPrepositions.addAll(parsePrepositions(prepositions));\n\t\t\tallConjunctions.addAll(parseConjunctions(conjunctions));\n\t\t\t\n\t\t\t//make sure that everything is sorted by chapter!\n\t\t\t\n\t\t\t//close everything\n\t\t\tnouns1.close();\n\t\t\tnouns2.close();\n\t\t\tnouns3.close();\n\t\t\tnouns4.close();\n\t\t\tnouns5.close();\n\t\t\t\n\t\t\tverbs1.close();\n\t\t\tverbs2.close();\n\t\t\tverbs3.close();\n\t\t\tverbs3IO.close();\n\t\t\tverbs4.close();\n\t\t\t\n\t\t\tadjectives12.close();\n\t\t\tadjectives3.close();\n\t\t\t\n\t\t\tadverbs.close();\n\t\t\tprepositions.close();\n\t\t\tconjunctions.close();\n\t\t\t\n\t\t} catch (FileNotFoundException e1) {\n\t\t\tSystem.out.println(\"Failed to open files!\");\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\tint totalWords = allAdjectives.size() + allNouns.size() + allVerbs.size() + allAdverbs.size() + allConjunctions.size() + allPrepositions.size();\n\t\t\n\t\tSystem.out.printf(\"Done in: %d milliseconds! \\nParsed %d words. \\nFINISHED PARSING. \\n\", (System.currentTimeMillis()-timer), totalWords);\n\t\t\n\t}", "@Test\n @Disabled\n public void testValidateFormat() {\n assertTrue(RegExprMain.validateFormat(\"CC222CC\"));\n assertTrue(RegExprMain.validateFormat(\"DD333DD\"));\n assertTrue(RegExprMain.validateFormat(\"AA999AA\"));\n assertTrue(RegExprMain.validateFormat(\"VV555VV\"));\n assertTrue(RegExprMain.validateFormat(\"JJ777JJ\"));\n assertFalse(RegExprMain.validateFormat(\"J777JJ\"));\n assertFalse(RegExprMain.validateFormat(\"JJ777J\"));\n assertFalse(RegExprMain.validateFormat(\"JJ77JJ\"));\n assertFalse(RegExprMain.validateFormat(\"JJ777AA\"));\n assertFalse(RegExprMain.validateFormat(\"AA777JJ\"));\n \n\n }", "private static void ProcessFile(File fileEntry) throws FileNotFoundException {\n \n\t wordCount(fileEntry) ;\n\t\t\n countVowels(fileEntry);\n\t\n\t\t\n}", "private void generateFileNameValidationChecks(FileValidationReport fileValRep) {\n\t\tList<FileNameValidationCheck> fileNameChecks = new ArrayList<>();\n\n\t\tfor (FileNameValidationRule rule : fileNameRules) {\n\t\t\tFileNameValidationCheck check = FileNameRuleChecker.checkByValidatingUploadWithRule(rule, fileUpload,\n\t\t\t\t\tthis.regExPatternMap);\n\t\t\tif (check.getOutcome() == ValidationOutcome.NOT_VALID) {\n\t\t\t\tfileNameChecks.add(check);\n\t\t\t}\n\t\t}\n\n\t\tfileValRep.addFailedChecks(fileNameChecks);\n\t}", "public static Match[] init () throws FileNotFoundException{\n\n\t\tint numLine = 0;\n\t\t//reads the input file ExchangeRate.txt\n\t\tScanner input1 = new Scanner (new File (\"src/ExchangeRate.txt\"));\n\n\t\t//This loop goes through each line\n\t\twhile (input1.hasNextLine()) {\n\t\t\tinput1.nextLine();\n\t\t\tnumLine++;\n\t\t}\n\n\t\t//Close it in order to start from 0 again for the next loop\n\t\tinput1.close();\n\n\n\t\tMatch [] data = new Match [numLine];\n\t\tint i = 0;\n\t\tScanner input = new Scanner (new File(\"src/ExchangeRate.txt\"));\n\n\t\t//This while loop insures that the program names each section correctly. \n\t\twhile (input.hasNext()) {\n\t\t\tString curr1 = input.next(); //Set curr1 to the first section on the certain line\n\t\t\tString curr2 = input.next(); //Set curr2 to the second section on that same line\n\t\t\tdouble ex = input.nextDouble(); //Set ex to the third section on the same line\n\t\t\t//Sets currency2, currency2, and the exchange rate into an array\n\t\t\tdata[i] = new Match(curr1, curr2, ex);\n\t\t\ti++;\n\t\t}\n\t\tinput.close();\n\t\treturn data;\n\n\t}", "private void loadAndProcessInput(){\n transactions_set = new ArrayList<>();\n strItemToInt = new HashMap<>();\n intToStrItem = new HashMap<>();\n \n try{\n BufferedReader br = new BufferedReader(\n new InputStreamReader(\n new FileInputStream(this.inputFilePath)\n ));\n \n String line;\n while((line = br.readLine()) != null){\n String[] tokens = line.split(\" \");\n ArrayList<Integer> itemsId = new ArrayList();\n \n for(String item : tokens){\n if( ! strItemToInt.containsKey(item)){\n strItemToInt.put(item, strItemToInt.size()+1);\n intToStrItem.put(strItemToInt.size(), item);\n }\n itemsId.add(strItemToInt.get(item));\n }\n transactions_set.add(itemsId);\n }\n }\n catch(IOException fnfEx){\n System.err.println(\"Input Error\");\n fnfEx.printStackTrace();\n }\n \n }", "public static void main(String[] args){\n String filename = \"\";\n if (args.length >= 1){\n filename = args[0];\n } else {\n return;\n }\n\n int abs = 0;\n int diectic = 0;\n int timeOfDay = 0;\n\n Pattern absPattern = Pattern.compile(absoluteDateRegex);\n //Pattern absPattern = Pattern.compile(mmddyyyy);\n //Pattern absPattern = Pattern.compile(holidays);\n Pattern diecticPattern = Pattern.compile(diecticDateRegex);\n Pattern timeOfDayPattern = Pattern.compile(timeOfDayRegex);\n\n Matcher absMatcher = null;\n Matcher diecticMatcher = null;\n Matcher timeOfDayMatcher = null;\n\n //System.out.println(absoluteDateRegex + \"\\n\");\n //System.out.println(diecticDateRegex + \"\\n\");\n //System.out.println(timeOfDayRegex + \"\\n\");\n\n HashMap <String, Integer> absMap = new HashMap<>();\n HashMap <String, Integer> diecticMap = new HashMap<>();\n HashMap <String, Integer> timeOfDayMap = new HashMap<>();\n\n String tmp = \"\";\n\n try{\n BufferedReader reader = new BufferedReader(\n new FileReader(filename));\n String line;\n while ((line = reader.readLine()) != null){\n absMatcher = absPattern.matcher(line);\n diecticMatcher = diecticPattern.matcher(line);\n timeOfDayMatcher = timeOfDayPattern.matcher(line);\n\n while (absMatcher.find()){\n abs++;\n tmp = absMatcher.group();\n //System.out.println(tmp);\n\n if (absMap.containsKey(tmp)){\n absMap.put(tmp, absMap.get(tmp) + 1);\n } else {\n absMap.put(tmp, 1);\n }\n }\n while (diecticMatcher.find()){\n diectic++;\n tmp = diecticMatcher.group();\n\n if (diecticMap.containsKey(tmp)){\n diecticMap.put(tmp, diecticMap.get(tmp) + 1);\n } else {\n diecticMap.put(tmp, 1);\n }\n //System.out.println(diecticMatcher.group());\n }\n while (timeOfDayMatcher.find()){\n timeOfDay++;\n tmp = timeOfDayMatcher.group();\n\n if (timeOfDayMap.containsKey(tmp)){\n timeOfDayMap.put(tmp, timeOfDayMap.get(tmp) + 1);\n } else {\n timeOfDayMap.put(tmp, 1);\n }\n //System.out.println(timeOfDayMatcher.group());\n }\n }\n reader.close();\n\n /*\n System.out.println(\"Absolute dates = \" + abs);\n System.out.println(\"Diectic dates = \" + diectic);\n System.out.println(\"Both dates = \" + (abs + diectic));\n System.out.println(\"time-of-day expressions = \" + timeOfDay);\n */\n\n System.out.println(\"2.4: Absolute\");\n printOutMap(absMap, abs);\n\n System.out.println(\"\\n2.5: Absolute && Diectic\");\n HashMap<String, Integer>datesMap = new HashMap<>();\n datesMap.putAll(absMap);\n datesMap.putAll(diecticMap);\n printOutMap(datesMap, diectic+abs);\n\n System.out.println(\"\\n2.6: Time Of Day\");\n printOutMap(timeOfDayMap, timeOfDay);\n\n System.out.println(\"\\nAll RegExs combined\");\n HashMap<String, Integer> allMap = new HashMap<>();\n allMap.putAll(datesMap);\n allMap.putAll(timeOfDayMap);\n printOutMap(allMap, timeOfDay + diectic + abs);\n } catch (Exception e){\n System.err.format(\"Exception occurred trying to read '%s'.\",\n filename);\n e.printStackTrace();\n return;\n }\n }", "public void readRules( String filename ) {\r\n\t\ttry {\r\n\t\t\ts.readRules(filename);\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "private\n\tRegExHelper()\n\t{\n\t\tsuper();\n\t}", "private void checkForPattern(Pattern grepPattern, Path[] filePathArray, BufferedWriter writer) {\n for (int j = 0; j < filePathArray.length; j++) {\n try (BufferedReader reader = Files.newBufferedReader(filePathArray[j], Jsh.encoding)) {\n outputMatchedLines(grepPattern, reader, writer);\n } catch (IOException e) {\n throw new RuntimeException(\"grep: cannot open \" + filePathArray[j].getFileName());\n }\n }\n }", "StringPatternCounter(ArrayList<StringPattern> stringPatternList, String fileInput)\n {\n super(fileInput);\n this.stringPatternList = stringPatternList;\n }", "@Override\n\t\t\tpublic boolean accept(File f) {\n\t\t\t\treturn (f.getName().toUpperCase().indexOf(finalRegEx)>=0 &&\n\t\t\t\t\t\tsupportedFilesFilter.accept(f));\n\t\t\t}", "protected abstract void parseFile(File f) throws IOException;", "public static void main(String[] args) {\n RegexParser regexParser = new RegexParser(new File(args[0]));\n regexParser.parseCharClasses();\n regexParser.parseTokens();\n regexParser.buildDFATable();\n // write DFA Table to file\n try {\n BufferedWriter tableWriter = new BufferedWriter(new FileWriter(new File(args[2])));\n for (int i = 0; i < regexParser.dfaTable.tableRows.size(); i++) {\n tableWriter.write(\"State\" + i);\n tableWriter.newLine();\n for (int j = 0; j < 95; j++) {\n //if (regexParser.dfaTable.tableRows.get(i).nextStates[j] != 1) {\n tableWriter.write(\" \" + (char)(j + 32) + \" \" + regexParser.dfaTable.tableRows.get(i).nextStates[j]);\n //}\n }\n tableWriter.newLine();\n }\n tableWriter.newLine();\n tableWriter.write(\"Accept States\");\n tableWriter.newLine();\n for (int j = 0; j < regexParser.dfaTable.tableRows.size(); j++) {\n for (int i = 0; i < regexParser.dfaTable.nfa.acceptStates.size(); i++) {\n if (regexParser.dfaTable.tableRows.get(j).nfaStates.contains(regexParser.dfaTable.nfa.acceptStates.get(i))) {\n tableWriter.write(\" \" + j);\n }\n }\n }\n tableWriter.close();\n }\n catch (Exception e) {\n System.out.println(\"Could not write to table file\");\n System.exit(0);\n }\n TableWalker tw = new TableWalker(regexParser.dfaTable, new File(args[1]), new File(args[3]));\n System.out.println(\"Success! Check your output files!\");\n//Part 2, piece 1: parsing the grammar\n LL1GrammarParser parser = new LL1GrammarParser(new File(args[4]), regexParser.specReader.tokens);\n parser.parseGrammar();\n\n//piece 2/3: first and follow sets \n System.out.println(\"Creating First and Follow Sets: \");\n\n LL1FFSets sets = new LL1FFSets(parser.rules);\n\n System.out.println(\"Working on the Parsing Table\");\n//piece 4/5: LL(1) parsing table and running it. Success/reject message here.\n LL1ParsingTable table = new LL1ParsingTable(sets, regexParser.specReader.tokens,tw.parsedTokens, parser.rules);\n System.out.println(table.run());\n\n\n }", "public String getRegEx();", "public void validate() throws CruiseControlException {\n ValidationHelper.assertIsSet(getMailHost(), \"mailhost\", this.getClass());\n ValidationHelper.assertIsSet(getReturnAddress(), \"returnaddress\", this.getClass());\n ValidationHelper.assertFalse(getUsername() != null && getPassword() == null,\n \"'password' is required if 'username' is set for email.\");\n ValidationHelper.assertFalse(getPassword() != null && getUsername() == null,\n \"'username' is required if 'password' is set for email.\");\n \n for (int i = 0; i < alertAddresses.length; i++) {\n try {\n alertAddresses[i].fileFilter = new GlobFilenameFilter(alertAddresses[i].fileRegExpr);\n } catch (MalformedCachePatternException mcpe) {\n ValidationHelper.fail(\"invalid regexp '\" + alertAddresses[i].fileRegExpr + \"'\", mcpe);\n }\n }\n }", "protected void parseValues(File file){\r\n\t\ttry {\r\n\t\t\tScanner scanner = new Scanner(file);\r\n\t\t\tString line;\r\n\t\t\tif(scanner.hasNext()) \r\n\t\t\t\tline = scanner.nextLine();\r\n\t\t\twhile (scanner.hasNextLine()) {\r\n\t\t\t\tline = scanner.nextLine();\r\n\t\t\t\taddToSupplyValues(line);\r\n\t\t\t}\r\n\t\t\tscanner.close();\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public static void processInput () throws IllegalArgumentException {\n \n File inputDataFile = null;\n Scanner inputFile = null; \n String line = \"\";\n \n try {\n inputDataFile = new File (INPUT_FILE);\n inputFile = new Scanner(inputDataFile);\n }\n catch (FileNotFoundException e) {\n System.out.println(\"File not found.\");\n System.exit (0);\n }\n \n while (inputFile.hasNextLine()) {\n for (int i = 0; i >= 15; i++) {\n \n \n \n Student[] newStudent = line.split (\",\", 10);\n \n inputFile.close();\n \n \n \n \n\n \n\n}// End processInput\n\n//*****************************************************************************\n\npublic static void processStudentData (String[] info) throws IllegalArgumentException {\n\n \n\n}// End processStudentData \n\n//*****************************************************************************\n\npublic static void processGradeItemData (String[] info) throws \n IllegalArgumentException {\n\n}// End processGradeItemData\n\n//*****************************************************************************\n\npublic static void generateReport () {\n\n\n}// End generateReport\n\n\n} // End JedidiahPrallNicholasRyan_03", "public static void main(String[] args) throws Exception {\n int numFiles = 0;\n boolean keepValid = false;\n for (int i=0; i<args.length; i++) {\n if (args[i].startsWith(\"-\")) {\n if (args[i].equals(\"-valid\")) keepValid = true;\n else {\n System.err.println(\"Warning: ignoring unknown command line flag \\\"\" +\n args[i] + \"\\\"\");\n }\n }\n else numFiles++;\n }\n\n if (numFiles == 0) {\n // read from stdin\n process(new BufferedReader(new InputStreamReader(System.in)), keepValid);\n }\n else {\n // read from file(s)\n for (int i=0; i<args.length; i++) {\n if (!args[i].startsWith(\"-\")) {\n process(new BufferedReader(new FileReader(args[i])), keepValid);\n }\n }\n }\n }", "public static boolean parse(File fi){\n\t\ttry {\n\t\t\tScanner sc = new Scanner(fi);\n\n\t\t\tsc.next();\n\t\t\tsc.next();\n\t\t\tname = sc.next();\n\t\t\tsc.next();\n\t\t\tsc.next();\n\t\t\tprepositionLength = sc.nextLong();\n\t\t\tsc.next();\n\t\t\tsc.next();\n\t\t\tprepositionDelay = sc.nextLong();\n\t\t\tsc.next();\n\t\t\tsc.next();\n\t\t\tsetOfStrings = new MekString[sc.nextInt()];\n\t\t\tfor(int i = 0; i < setOfStrings.length; i++){\n\t\t\t\tsc.next();\n\t\t\t\tsc.next();\n\t\t\t\tint low = sc.nextInt();\n\t\t\t\tsc.next();\n\t\t\t\tsc.next();\n\t\t\t\tint high = sc.nextInt();\n\t\t\t\tlong[] time = new long[(high - low)];\n\t\t\t\tsc.nextLine();\n\t\t\t\tString[] values = sc.nextLine().split(\",\");\n\t\t\t\tfor(int j = 0; j < values.length-1; j++){\n\t\t\t\t\ttime[j] = Long.parseLong(values[j].trim());\n\t\t\t\t}\n\t\t\t\tsetOfStrings[i] = new MekString(low, high, time);\n\t\t\t\tmekStringCursor++;\n\t\t\t}\n\t\t\tsc.close();\n\t\t} catch (FileNotFoundException e) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t}", "public List<String> validate()\n {\n List<String> errs = new ArrayList<String>();\n\n if (StringUtils.isEmpty(startingUrl))\n errs.add(\"Missing starting URL.\");\n else\n {\n String[] schemes = {\"http\", \"https\"};\n UrlValidator urlValidator = new UrlValidator(schemes);\n if (!urlValidator.isValid(startingUrl))\n errs.add(\"Invalid starting URL.\");\n }\n\n if (StringUtils.isEmpty(outputPath))\n errs.add(\"Missing output path.\");\n else\n {\n try\n {\n Path path = Paths.get(outputPath);\n File dir = path.toFile();\n if (!dir.exists())\n dir.mkdirs();\n else if (!dir.isDirectory())\n errs.add(\"Output path exists but is not a directory.\");\n }\n catch (Exception ex)\n {\n errs.add(\"Invalid output path or unable to create the directory.\");\n }\n }\n\n if (StringUtils.isEmpty(resultFile))\n errs.add(\"Missing result file.\");\n else if (errs.isEmpty())\n {\n // Only do this check if the output path is valid.\n try\n {\n Paths.get(outputPath, resultFile);\n }\n catch (Exception ex)\n {\n errs.add(\"Invalid result file.\");\n }\n }\n\n if (numThreads < CrawlerImpl.MIN_THREADS)\n numThreads = CrawlerImpl.MIN_THREADS;\n\n if (crawlTimeoutSeconds < MIN_CRAWL_TIMEOUT_SECONDS)\n crawlTimeoutSeconds = MIN_CRAWL_TIMEOUT_SECONDS;\n\n return errs;\n }", "public static boolean checkInputAll(String saInput) {\r\n\t\treturn checkGenericPatternAll(saInput) && checkGenericPatternAll(unalter(saInput));\r\n\t}", "private void readEntries(ArrayList<TextFinder> lst, NodeList nodes)\n throws VDDException {\n for (int k = 0; k < nodes.getLength(); k++) {\n Node node = nodes.item(k);\n if (node.getNodeType() != Node.ELEMENT_NODE) {\n continue;\n }\n if (!node.getNodeName().toLowerCase().equals(\"regex\")) {\n throw new VDDException(\"Unknown assert page entry type '\" +\n node.getNodeName() + \"'\");\n }\n\n lst.add(new TextFinder(node.getTextContent()));\n }\n }", "protected void validateNewFiles(java.lang.String[] param){\r\n \r\n }", "@Override\n protected void process() {\n final List<File> srtFiles = new FileFinder().collect(new File(Constants.FILEFIXER_ROOT_DIR), Constants.SRT_EXTENSION);\n\n // process each file, making a backup first if it is enabled\n for (final File srtFile : srtFiles) {\n System.out.println(\"Processing subtitle file :: \" + srtFile.getName());\n\n if (Constants.MAKE_BACKUPS) {\n backupFile(srtFile);\n }\n\n fix(srtFile);\n }\n }", "public static void main(String[] argv) {\n String pattern = \"([a-zA-Z0-9\\\\s_\\\\\\\\.\\\\-\\\\(\\\\):])+(.json|.doc|.docx|.pdf|.txt)$\";\n\n String input = \"C://FTPFile//weatherFile.txt\";\n\n Pattern p = Pattern.compile(pattern);\n\n boolean found = p.matcher(input).lookingAt();\n\n System.out.println(\"'\" + pattern + \"'\" +\n (found ? \" matches '\" : \" doesn't match '\") + input + \"'\");\n }", "protected boolean validate(final File mafFile, final QcContext context) throws IOException, ProcessorException {\r\n\r\n FileReader fileReader = null;\r\n BufferedReader bufferedReader = null;\r\n\r\n try {\r\n // initialize threadlocal\r\n initThreadLocals();\r\n\r\n boolean ok = true;\r\n context.setFile(mafFile);\r\n\r\n\r\n // set sampleTypes\r\n for (SampleType sample : sampleTypeQueries.getAllSampleTypes()) {\r\n sampleCodes.put(sample.getSampleTypeCode(), sample.getIsTumor());\r\n }\r\n\r\n // open file\r\n fileReader = new FileReader(mafFile);\r\n bufferedReader = new BufferedReader(fileReader);\r\n\r\n int lineNum = 0;\r\n\r\n // find first non-blank line not starting with #, this is the header\r\n String headerLine = bufferedReader.readLine();\r\n lineNum++;\r\n while (StringUtils.isEmpty(headerLine.trim()) || StringUtils.startsWith(headerLine, COMMENT_LINE_TOKEN)) {\r\n headerLine = bufferedReader.readLine();\r\n lineNum++;\r\n }\r\n\r\n final List<String> headers = Arrays.asList(headerLine.split(\"\\\\t\"));\r\n\r\n // get order of fields from header\r\n final Map<String, Integer> fieldOrder = mapFieldOrder(headers);\r\n // make sure the field order is correct\r\n for (int i = 0; i < getMafFieldList().size(); i++) {\r\n if (fieldOrder.get(getMafFieldList().get(i)) == null) {\r\n context.addError(MessageFormat.format(\r\n MessagePropertyType.MISSING_REQUIRED_COLUMN_ERROR,\r\n getMafFieldList().get(i)));\r\n // if a column is missing, just return false now\r\n return false;\r\n } else if (fieldOrder.get(getMafFieldList().get(i)) != i) {\r\n context.addError(MessageFormat.format(\r\n MessagePropertyType.MAF_FILE_PROCESSING_ERROR,\r\n mafFile.getName(),\r\n new StringBuilder().append(\"Expected column '\").append(getMafFieldList().get(i)).append(\"' to be at index '\").\r\n append((i + 1)).append(\"' but found at '\").append((fieldOrder.get(getMafFieldList().get(i)) + 1)).append(\"'\").toString()));\r\n // if order is wrong, make error but ok to continue rest of checks\r\n ok = false;\r\n }\r\n }\r\n\r\n String line;\r\n int initialErrorCount = context.getErrorCount();\r\n while ((line = bufferedReader.readLine()) != null) {\r\n lineNum++;\r\n if (!StringUtils.isBlank(line.trim()) && !StringUtils.startsWith(line, COMMENT_LINE_TOKEN)) {\r\n final String[] row = line.split(\"\\\\t\");\r\n\r\n if (row.length >= fieldOrder.size()) {\r\n boolean rowOk = validateRow(row, fieldOrder, lineNum, context, mafFile.getName());\r\n\r\n ok = ok && rowOk;\r\n } else {\r\n context.addError(MessageFormat.format(\r\n MessagePropertyType.MAF_FILE_VALIDATION_ERROR,\r\n mafFile.getName(),\r\n lineNum,\r\n new StringBuilder().append(\"Improper format: expected '\").append(fieldOrder.size()).append(\"' fields but found '\").\r\n append(row.length).append(\"'\").toString()));\r\n ok = false;\r\n }\r\n }\r\n if (context.getErrorCount() - initialErrorCount > 100) {\r\n context.addError(\"More than 100 errors found, halting MAF validation\");\r\n break;\r\n }\r\n\r\n }\r\n\r\n // validate remaining ids (barcodes or UUIDs)\r\n if (context.isStandaloneValidator()) {\r\n ok = batchValidate(null, context, mafFile.getName(), true, true);\r\n }\r\n\r\n if (!ok) {\r\n context.getArchive().setDeployStatus(Archive.STATUS_INVALID);\r\n }\r\n\r\n return ok;\r\n\r\n } finally {\r\n cleanupThreadLocals();\r\n if (bufferedReader != null) {\r\n bufferedReader.close();\r\n }\r\n\r\n if (fileReader != null) {\r\n fileReader.close();\r\n }\r\n }\r\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 }" ]
[ "0.6269113", "0.61125535", "0.56649745", "0.5605596", "0.55189216", "0.5487509", "0.5484236", "0.5466741", "0.54514426", "0.5431776", "0.5424148", "0.5333047", "0.5295188", "0.52807355", "0.52669835", "0.5246023", "0.5237399", "0.51836556", "0.5162575", "0.5153242", "0.5152859", "0.51237124", "0.5109202", "0.5083756", "0.5061273", "0.5050901", "0.50467664", "0.5046009", "0.5041101", "0.5033932", "0.503242", "0.5005869", "0.4994733", "0.49739283", "0.49708003", "0.49596754", "0.4934694", "0.49254", "0.49047527", "0.488032", "0.48776275", "0.4874112", "0.48645613", "0.4863099", "0.48623788", "0.48523298", "0.48509318", "0.4844805", "0.48437446", "0.48348644", "0.48261774", "0.4821843", "0.4811144", "0.48097292", "0.4803881", "0.47869077", "0.4776961", "0.4776035", "0.47735655", "0.47677034", "0.47562602", "0.4755566", "0.47532374", "0.47475109", "0.47411123", "0.4736853", "0.473449", "0.47267446", "0.4719289", "0.47140288", "0.4709341", "0.47082934", "0.47006536", "0.4700187", "0.4700111", "0.46971253", "0.46929792", "0.46889216", "0.4685792", "0.46793315", "0.46742287", "0.46638784", "0.4632878", "0.46280244", "0.46273825", "0.46215937", "0.46201798", "0.46198928", "0.46194398", "0.46051458", "0.46004686", "0.45925605", "0.45895538", "0.45808735", "0.4578758", "0.4575847", "0.45719928", "0.45712894", "0.45709547", "0.45678037", "0.4560682" ]
0.0
-1
Splits the query and returns an ArrayList containing only Roman numerals and elements
public static ArrayList<String> splitQuery(String query){ ArrayList<String> queryArray = new ArrayList<String>(Arrays.asList(query.split("((?<=:)|(?=:))|( )"))); int startIndex = 0, endIndex = 0; for (int i = 0; i < queryArray.size(); i++) { if(queryArray.get(i).toLowerCase().equals("is")){ startIndex = i+1; } else if(queryArray.get(i).toLowerCase().equals("?")){ endIndex = i; } } String[] array = queryArray.toArray(new String[queryArray.size()]); return new ArrayList<String>(Arrays.asList(java.util.Arrays.copyOfRange(array, startIndex, endIndex))); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public ArrayList<String> getIntergalacticToRomanNotes() {\n\t\tArrayList<String> intergacaticToRomanNotes = new ArrayList<String>();\n\t\t\n\t\t// Assumption: intergalactic numbers are in lower case only, \n\t\t// and roman numerals are in capitals only\n\t\tString validNoteRegex = \"^[a-z]+\\\\s+is\\\\s+[MDCLXVI]$\";\n\t\t\n\t\tfor (String line : contentsByLine) {\n\t\t\t\n\t\t\tPattern notePattern = Pattern.compile(validNoteRegex);\n\t\t\tMatcher match = notePattern.matcher(line);\n\t\t\t\n\t\t\tif (match.find()) {\n\t\t\t\tintergacaticToRomanNotes.add(line);\n\t\t\t}\n\t\t}\n\t\n\t\treturn intergacaticToRomanNotes;\n\t}", "public ArrayList<Query> processQuery(String[] questionQueryLines){\r\n\t\t\r\n\t\tArrayList<Query> queryReplyList = new ArrayList<Query>();\r\n\t\tfor (String query : questionQueryLines) {\r\n\t\t\t\r\n\t\t\tif (query.toLowerCase().startsWith(galacticToRomanQry)){\r\n\t\t\t\tQuery galacticToRomanQuery = QueryFactory.GalacticToRomanQuery(query);\r\n\t\t\t\tqueryReplyList.add(galacticToRomanQuery);\r\n\t\t\t}\r\n\t\t\telse if (query.toLowerCase().startsWith(metalPriceQry)){\r\n\t\t\t\tQuery metalPriceQuery = QueryFactory.MetalPriceQuery(query);\r\n\t\t\t\tqueryReplyList.add(metalPriceQuery);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn queryReplyList;\r\n\t}", "public ArrayList<String> tokeniseQuery(String query) {\n ArrayList<String> tokens;\n\n tokens = this.tokeniseString(query);\n\n // Normalise the tokens\n tokens = this.normaliseTokens(tokens);\n\n // Remove commas\n tokens = this.removeCommas(tokens);\n\n // Remove the stopwords\n this.removeStopwords(tokens);\n\n // Remove empty tokens that resulted from normalisation\n this.removeEmptyTokens(tokens);\n\n // Stem the tokens\n tokens = this.stemTokens(tokens);\n\n return tokens;\n }", "private static List<String> rastaviizraz(String regex) {\n List<String> izbori = new ArrayList<>();\n int br_zagrada = 0;\n int start = 0;\n for (int i = 0; i < regex.length(); i++) {\n if (regex.charAt(i) == '(' && je_operator(regex, i)) {\n br_zagrada++;\n } else if (regex.charAt(i) == ')' && je_operator(regex, i)) {\n br_zagrada--;\n } else if (br_zagrada == 0 && regex.charAt(i) == '|' && je_operator(regex, i)) {\n izbori.add(regex.substring(start, i));\n start = i + 1;\n }\n }\n if (start > 0) {\n izbori.add(regex.substring(start, regex.length()));\n }\n\n // for (String s : izbori) {\n // System.out.println(s);\n // }\n return izbori;\n }", "private List<String> normalizeCsv(String text) {\n logger.info (\"Text = \" + text);\n List<String> rr = new ArrayList<> ();\n\n StringBuilder line = new StringBuilder ();\n for (int i = 0; i < text.length (); i++) {\n\n String curr = \"\" + text.charAt (i);\n line.append (curr);\n try {\n\n if (text.charAt (i - 1) == ',' && (curr + \" \").equals (\"1 \") && (text.charAt (i + 1) == ' ' || Character.isAlphabetic (text.charAt (i + 1)))) {\n rr.add (line.toString ());\n line = new StringBuilder ();\n } else if (text.charAt (i - 1) == ',' && (curr + \" \").equals (\"2 \") && (text.charAt (i + 1) == ' ' || Character.isAlphabetic (text.charAt (i + 1)))) {\n rr.add (line.toString ());\n line = new StringBuilder ();\n } else if (text.charAt (i - 1) == ',' && (curr + \" \").equals (\"3 \") && (text.charAt (i + 1) == ' ' || Character.isAlphabetic (text.charAt (i + 1)))) {\n rr.add (line.toString ());\n line = new StringBuilder ();\n } else if (text.charAt (i - 1) == ',' && (curr + \" \").equals (\"4 \") && (text.charAt (i + 1) == ' ' || Character.isAlphabetic (text.charAt (i + 1)))) {\n rr.add (line.toString ());\n line = new StringBuilder ();\n } else if (text.charAt (i - 1) == ',' && (curr + \" \").equals (\"5 \") && (text.charAt (i + 1) == ' ' || Character.isAlphabetic (text.charAt (i + 1)))) {\n rr.add (line.toString ());\n line = new StringBuilder ();\n } else if (text.charAt (i - 1) == ',' && (curr + \" \").equals (\"6 \") && (text.charAt (i + 1) == ' ' || Character.isAlphabetic (text.charAt (i + 1)))) {\n rr.add (line.toString ());\n line = new StringBuilder ();\n } else if (text.charAt (i - 1) == ',' && (curr + \" \").equals (\"7 \") && (text.charAt (i + 1) == ' ' || Character.isAlphabetic (text.charAt (i + 1)))) {\n rr.add (line.toString ());\n line = new StringBuilder ();\n }\n\n } catch (Exception ex) {\n //System.out.println(ex.getMessage());\n }\n\n }\n return rr;\n }", "public static ArrayList<String> SelectQuery_StringArrayList(String query)\r\n {\n Connection conn = null;\r\n Statement stat = null;\r\n ResultSet rs = null;\r\n ArrayList<String> ary = new ArrayList<>();\r\n try\r\n {\r\n LoadDriver();\r\n conn = DriverManager.getConnection(DB_URL,userName,password);\r\n stat = conn.createStatement();\r\n rs = stat.executeQuery(query);\r\n while(rs.next())\r\n {\r\n ary.add(rs.getString(1));\r\n }\r\n }\r\n catch(SQLException ex)\r\n {\r\n ex.printStackTrace();\r\n }\r\n finally\r\n {\r\n try\r\n {\r\n if(conn != null)\r\n conn.close();\r\n if(stat != null)\r\n stat.close();\r\n }\r\n catch(Exception e)\r\n {\r\n e.printStackTrace();\r\n }\r\n }\r\n return ary;\r\n }", "private ArrayList<WordDocument> executeRegularQuery(){\n String[] splitedQuery = this.query.split(\" \");\n ArrayList<WordDocument> listOfWordDocuments = new ArrayList<WordDocument>();\n String word = \"\";\n\n for(int i = 0; i < splitedQuery.length; i++){\n if(!isOrderByCommand(splitedQuery[i]) && i == 0) {\n word = splitedQuery[i];\n\n if(cache.isCached(word))\n addWithoutDuplicate(listOfWordDocuments, cache.getCachedResult(word));\n else\n addWithoutDuplicate(listOfWordDocuments, getDocumentsWhereWordExists(word));\n\n }else if(i >= 1 && isOrderByCommand(splitedQuery[i])) {\n subQueries.add(word);\n listOfWordDocuments = orderBy(listOfWordDocuments, splitedQuery[++i], splitedQuery[++i]);\n break;\n }\n else\n throw new IllegalArgumentException();\n }\n\n return listOfWordDocuments;\n }", "public ArrayList separarRut(String rut){\r\n this.lista = new ArrayList<>();\r\n if(rut.length()==12 || rut.length()==11){ \r\n if(rut.length()==12){\r\n this.lista.add(Character.toString(rut.charAt(0))+Character.toString(rut.charAt(1)));\r\n this.lista.add(Character.toString(rut.charAt(3))+Character.toString(rut.charAt(4))+Character.toString(rut.charAt(5)));\r\n this.lista.add(Character.toString(rut.charAt(7))+Character.toString(rut.charAt(8))+Character.toString(rut.charAt(9)));\r\n this.lista.add(Character.toString(rut.charAt(11)));\r\n }else{\r\n this.lista.add(Character.toString(rut.charAt(0)));\r\n this.lista.add(Character.toString(rut.charAt(2))+Character.toString(rut.charAt(3))+Character.toString(rut.charAt(4)));\r\n this.lista.add(Character.toString(rut.charAt(6))+Character.toString(rut.charAt(7))+Character.toString(rut.charAt(8)));\r\n this.lista.add(Character.toString(rut.charAt(10)));\r\n } \r\n } \r\n return this.lista;\r\n }", "private static ArrayList<String> getAllKeyWord(String [] lignes){\n ArrayList<String> res= new ArrayList<>();\n\n // La recherche dans le pdf\n for(String ligne : lignes){\n for(String mot : ligne.split(\" |/|-|\\\\(|\\\\)|,\")){\n\n try{\n if(mot.toLowerCase(Locale.ENGLISH).equals(\"c#\".toLowerCase(Locale.ENGLISH)))\n res.add(\"csharp\");\n else\n if(mot.toLowerCase(Locale.ENGLISH).equals(\"c++\".toLowerCase(Locale.ENGLISH)))\n res.add(\"cpp\");\n else\n if(!mot.toLowerCase(Locale.ENGLISH).matches(\"| |à|de|je|un|et|une|en|d'un|d'une|le|la|avec|:|\\\\|\"))\n res.add(mot.toLowerCase(Locale.ENGLISH));\n }catch (IllegalArgumentException e){\n //System.out.println(e.getMessage());\n continue;\n }\n }\n //System.out.println(\"line: \"+s);\n }\n return (ArrayList) res.stream().distinct().collect(Collectors.toList());\n }", "public String[] list(String text, String von, String bis) throws RemoteException;", "public ArrayList<String> runQuery_getListOfStrings(String query) throws SQLException{\n\t\tArrayList<String> res = new ArrayList<>();\n\t\tConnection conn = null;\n\t\tStatement stmt = null;\n\t\tResultSet rs = null;\n\t\ttry\n\t\t{\n\t\t\tconn = setUpConnection();\t\t\n\t\t\tstmt = conn.createStatement();\t\t\n\t\t\trs = stmt.executeQuery(query);\t\n\t\t\twhile(rs.next())\n\t\t\t{\t\t\t\n\t\t\t\tres.add(rs.getString(1));\n\t\t\t}\n\t\t\tconn.commit();\n\t\t}\n\t\tfinally\n\t\t{\n\t\t\tcloseJDBCResources(conn, stmt, rs);\n\t\t}\n\t\t\t\t\n\t\treturn res;\t\t\n\t}", "public static ArrayList<String> separatePhrases(String userInput) {\n\t\tif (userInput == null)\n\t\t\treturn null;\n\t\telse if( userInput.length() == 0 )\n\t\t\treturn new ArrayList<String>();\n\t\telse\n\t\t{\n\t\t\tArrayList<String> result = new ArrayList<String>();\n\t\t\tuserInput = userInput.toLowerCase();\n\t\t\t\n\t\t\t//replace invalid characters\n\t\t\tfor( int i = 0 ; i < userInput.length() ; i++ )\n\t\t\t\tif( !( (userInput.charAt(i) >= 'a' && userInput.charAt(i) <= 'z') || (userInput.charAt(i) >= '0' && userInput.charAt(i) <= '9') ) )\n\t\t\t\t\tif( !( userInput.charAt(i) == '?' || userInput.charAt(i) == '!' || userInput.charAt(i) == ',' || userInput.charAt(i) == '.' || userInput.charAt(i) == '\\'' ) )\n\t\t\t\t\t\tuserInput = userInput.replace( userInput.charAt(i) , ' ' );\n\t\t\t\t\t\t\n\t\t\t//remove extra whitespace\n\t\t\tuserInput = userInput.trim().replaceAll( \" +\" , \" \" );\n\t\t\t\n\t\t\t//add phrases\n\t\t\tString temp = \"\";\n\t\t\tfor( int i = 0 ; i < userInput.length() ; i++ )\n\t\t\t{\n\t\t\t\tif( userInput.charAt(i) == '?' || userInput.charAt(i) == '!' || userInput.charAt(i) == ',' || userInput.charAt(i) == '.' )\n\t\t\t\t{\n\t\t\t\t\ttemp = temp.trim().replaceAll( \" +\" , \" \" );\n\t\t\t\t\tif( temp.length() != 0 )\n\t\t\t\t\t\tresult.add(temp);\n\t\t\t\t\ttemp = \"\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\ttemp = temp + userInput.charAt(i);\n\t\t\t}\n\t\t\tif( temp.length() != 0 )\n\t\t\t\tresult.add(temp);\n\t\t\t\n\t\t\treturn result;\n\t\t}\n }", "public static ArrayList<String> procesarEntrada(String input)\n {\n ArrayList<String> parse = new ArrayList<String>();\n String word = \"\";\n\n for (int i = 0; i < input.length(); i++)\n {\n if (input.charAt(i) != '&')\n word += input.charAt(i);\n\n if (input.charAt(i) == '&' || i == input.length() - 1)\n {\n parse.add(word);\n word = \"\";\n } \n }\n\n return parse;\n }", "public static ArrayList<String> getResultatNoms() throws IOException{\n return ctrl_Persistencia.llistaFitxers(\"@../../Dades\",\"resultats\");\n }", "private static ArrayList<Result> bagOfWords(Query query, DataManager myVocab) {\n\t\tString queryname = query.getQuery();\n\t\t// split on space and punctuation\n\t\tString[] termList = queryname.split(\" \");\n\t\tArrayList<Result> bagResults = new ArrayList<Result>();\n\t\tfor (int i=0; i<termList.length; i++){\n\t\t\tQuery newQuery = new Query(termList[i], query.getLimit(), query.getType(), query.getTypeStrict(), query.properties()) ;\n\t\t\tArrayList<Result> tempResults = new ArrayList<Result>(findMatches(newQuery, myVocab));\n\t\t\tfor(int j=0; j<tempResults.size(); j++){\n\n\t\t\t\ttempResults.get(j).setMatch(false);\n\t\t\t\ttempResults.get(j).decreaseScore(termList.length);\n\t\t\t\tif(tempResults.get(j).getScore()>100){\n\t\t\t\t\ttempResults.get(j).setScore(99.0);\n\t\t\t\t}else if (tempResults.get(j).getScore()<1){\n\t\t\t\t\ttempResults.get(j).setScore(tempResults.get(j).getScore()*10);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbagResults.addAll(tempResults);\n\t\t}\n\t\treturn bagResults;\n\t}", "public ArrayList<String> consultar(){\n PreparedStatement ps = null;\n ResultSet rs = null;\n Connection con = getConexion();\n PlanDeEstudio plan = new PlanDeEstudio();\n ArrayList<String> planes = new ArrayList<>();\n \n String sql = \"SELECT * FROM plan_estudio\";\n \n try{\n ps = con.prepareStatement(sql);\n rs = ps.executeQuery();\n \n while (rs.next()) {\n plan.setiD(Integer.parseInt((rs.getString(\"id_plan_estudio\"))));\n planes.add(Integer.toString((plan.getiD())));\n }\n return planes;\n \n }catch (SQLException e){\n System.err.println(e);\n return planes;\n \n } finally {\n try {\n con.close();\n } catch (SQLException e){\n System.err.println(e);\n }\n }\n }", "private Collection<Record> getResults(SimpleSurnameAndPostcodeQuery query) {\n\t\treturn search(query);\n\t}", "private ArrayList<Character> retornarListaCaracteres() {\n ArrayList<Character> validaciones = new ArrayList<Character>();\n validaciones.add('.');\n validaciones.add('/');\n validaciones.add('|');\n validaciones.add('=');\n validaciones.add('?');\n validaciones.add('¿');\n validaciones.add('´');\n validaciones.add('¨');\n validaciones.add('{');\n validaciones.add('}');\n validaciones.add(';');\n validaciones.add(':');\n validaciones.add('_');\n validaciones.add('^');\n validaciones.add('-');\n validaciones.add('!');\n validaciones.add('\"');\n validaciones.add('#');\n validaciones.add('$');\n validaciones.add('%');\n validaciones.add('&');\n validaciones.add('(');\n validaciones.add(')');\n validaciones.add('¡');\n validaciones.add(']');\n validaciones.add('*');\n validaciones.add('[');\n validaciones.add(',');\n validaciones.add('°');\n\n return validaciones;\n }", "public static List<String> separarInstrucoesSql(String script) {\n\n\t\tList<String> retorno = new ArrayList<String>();\n\n\t\tInteger posCaractereInicio = 0;\n\t\tInteger posCaractereFim = 0;\n\t\tString terminador = \";\";\n\t\tboolean terminouScript = false;\n\n\t\tscript = script.trim();\n\n\t\twhile (!terminouScript) {\n\n\t\t\tscript = script.trim();\n\n\t\t\tif (script.length() < 3) {\n\t\t\t\tterminouScript = true;\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\t// verifica se inicia com set term\n\t\t\tString caractereAvaliado = script.substring(posCaractereInicio, 10).toUpperCase();\n\t\t\tcaractereAvaliado = script.replaceAll(\" \", \"\");\n\n\t\t\tif (caractereAvaliado.startsWith(\"SETTERM\")) {\n\t\t\t\tterminador = caractereAvaliado.substring(7, 8);\n\t\t\t\tposCaractereInicio = devolvePosicaoCaractere(script, terminador) + 2;\n\n\t\t\t\tscript = script.substring(posCaractereInicio);\n\t\t\t\tposCaractereInicio = 0;\n\t\t\t}\n\n\t\t\t// comentarios fora da instrução SQL\n\t\t\tif (caractereAvaliado.substring(0, 2).equals(\"/*\")) {\n\t\t\t\tposCaractereFim = devolveUltimaPosicaoScript(script, \"*/\", true);\n\t\t\t\tscript = script.substring(posCaractereFim + 2);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tposCaractereInicio = posicaoDoPrimeiroCaracterValido(script);\n\n\t\t\tif (posCaractereInicio > 0) {\n\t\t\t\tscript = script.substring(posCaractereInicio);\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// percorrer a string até encontrar o terminador\n\t\t\tposCaractereFim = devolveUltimaPosicaoScript(script, terminador);\n\n\t\t\tif (script.length() < 3) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t// adicionado na lista de scripts\n\t\t\t// System.out.println(\"-----------------------------------\");\n\t\t\t// System.out.println(script.substring(posCaractereInicio,\n\t\t\t// posCaractereFim));\n\n\t\t\tretorno.add(script.substring(posCaractereInicio, posCaractereFim));\n\n\t\t\tif (script.length() > posCaractereFim + 1)\n\t\t\t\tscript = script.substring(posCaractereFim + 1);\n\n\t\t\t// terminou os scripts\n\t\t\tscript = script.trim();\n\t\t\tif (script.length() < 10)\n\t\t\t\tterminouScript = true;\n\n\t\t\tposCaractereInicio = 0;\n\n\t\t}\n\n\t\treturn retorno;\n\t}", "private List<String> getEmptyRoomsFromResultSet(ResultSet emptyQueryResults) {\n ArrayList<String> rooms = new ArrayList<String>();\n boolean hasNext = emptyQueryResults.next();\n while(hasNext) {\n String room = emptyQueryResults.getString(\"r1.roomid\");\n rooms.add(room);\n hasNext = emptyQueryResults.next();\n }\n return rooms;\n}", "static ArrayList splitDate(String date){\n Locale locale = Locale.getDefault();\n\n String[] tabDate = localDate(date).split(\" \");\n if(String.valueOf(locale).contains(\"en\")){\n return arrayDate(tabDate[0], tabDate[2], tabDate[1], tabDate[3]);\n }\n else{\n return arrayDate(tabDate[0], tabDate[1], tabDate[2], tabDate[3]);\n }\n }", "public static ArrayList<Result> findMatches(Query query, DataManager myVocab){\n\n\t\t//Uncomment this for logging in this class\t\n//\t\tmyLogger.setLevel(Level.INFO); \n\n\t\t// get the term we're going to search for and\n\t\t// take out any leading or trailing whitespaces\n\t\tString querystr = query.getQuery();\n\t\tquerystr = querystr.trim();\n\t\tString uncleaned = querystr;\n\t\t\n\t\t// This is in case of numeric entries. Google Refine doesn't seem\n\t\t// to have int cell types, instead it adds an invisible .0 to all\n\t\t// numbers. This fixes that issue, as it sometimes causes false negatives.\n\t\tif (querystr.endsWith(\".0\")){\n\t\t Pattern p = Pattern.compile(\"[^0-9\\\\.]+\");\n\t\t Matcher m = p.matcher(querystr);\n\t\t boolean result = m.find();\n\t\t if (!result){\n\t\t \t querystr = querystr.substring(0, querystr.length()-2);\n\t\t }\n\t\t}\n\t\t// see if it's in the synonyms map, if it is\n\t\t// replace it with the appropriate term, if it's\n\t\t// not, don't do anything. \n\n\t\tif (myVocab.subMap.get(querystr)!=null){\n\t\t\tquerystr = myVocab.subMap.get(querystr);\n\t\t\tquery.setQuery(querystr);\n\t\t}\n\t\t\n\t\t// Clean up the query string if it isn't case/punctuation sensitive\n\t\tif (!myVocab.capsSensitive()){\t\t\n\t\t\tquerystr = querystr.toLowerCase();\n\t\t}\n\t\tif (! myVocab.punctSensitive()){\t\t\n\t\t\tquerystr = querystr.replaceAll(\"[\\\\W_]\", \"\");\n\t\t}\n\t\t\n\t\t// see if it's in the synonyms map, if it is\n\t\t// replace it with the appropriate term, if it's\n\t\t// not, don't do anything. \n\t\tif(myVocab.subMap.get(querystr)!=null){\n\t\t\tquerystr = myVocab.subMap.get(querystr);\n\t\t\tquery.setQuery(querystr);\n\t\t}\n\n\t\tString type = query.getType();\n\n\t\t// This ArrayList is the results that are going to be returned. \n\t\tArrayList<Result> results = getDirectMatches(myVocab, querystr, uncleaned, type);\n\t\t\n\t\t// If there's a perfect match return it.\n\t\tif (results.size() == 1 && results.get(0).match){\n\t\t\treturn results;\n\t\t}else{\n\t\t\t// Otherwise, add the initial ones and try matching\n\t\t\t// based on distance to vocabulary terms.\n\t\t\tresults.addAll(distanceMatching(query, myVocab));\n\t\t\t\n\t\t\t// Split the original query term by space and non-alphanumeric characters \n\t\t\t// to find how many words there are.\n\t\t\t//querystr = query.getQuery().replaceAll(\"[\\\\W_]\", \" \");\n\t\t\tString [] termList = querystr.split(\" \");\n\t\t\t\n\t\t\t// if there's more than one, run bagOfWords\n\t\t\t// which tries to find a match for each of the words.\n\t\t\tif (termList.length > 1){\n\t\t\t\tresults.addAll(bagOfWords(query, myVocab));\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Clean the results: no duplicates\n\t\t// no extra results to return, and sorted\n\t\t// them by score before returning them\n\t\tresults = removeDuplicates(results);\n\t\t\n\t\t// They do not need to be reduced in \n\t\t// number if there are fewer than \n\t\t// the max results.\n\t\t// The pruneResults sorts them\n\t\t// by score already.\n\t\tif(query.getLimit()!=null){\n\t\t\tresults = pruneResults(results,Integer.parseInt(query.getLimit()));\n\t\t}else{\n\t\t\tresults = pruneResults(results,MAX_RESULTS);\n\t\t}\n\t\t\t\n\t\tresults = sortByScore(results);\n\t\tfor (int i = 0; i< results.size(); i++){\n//\t\t\tmyLogger.log(Level.SEVERE,results.get(i).getScore()+ \" is bigger than 100?\");\n\t\t\tif(results.get(i).getScore() > (double)100){\n\t\t\t\tresults.get(i).setScore((double)100 - (results.get(i).getScore()-(double)100));\n//\t\t\t\tmyLogger.log(Level.SEVERE,results.get(i).getScore()+\" is bigger than 100! and was set to \"+\n//\t\t\t\t\t\t((double)100 - (results.get(i).getScore()-(double)100)));\n\t\t\t}\n\t\t}\n\t\treturn results;\n\t}", "public List<String> GetAssegnamentiInCorso() {\n String str = \"Guillizzoni-Coca Cola Spa1-DRYSZO,Rossi-Coca Cola Spa2-DRYSZ2\";\n StringaAssegnamenti = str;\n StringaAssegnamenti = \"\";\n \n\tList<String> items = Arrays.asList(str.split(\"\\\\s*,\\\\s*\"));\n return items;\n }", "public ArrayList<String> AnalyzeResult(String data) {\n\t\tString tmpFilePath = \"C:\\\\Users\\\\AILab08\\\\git\\\\MyGRR\\\\Prototype\\\\kep\\\\tmp.txt\";\r\n\t\tArrayList <String> result = new ArrayList<String>();\r\n\t\ttry {\r\n\t\t\t// 一時保存用ファイルの作成\r\n\t\t\tFile filetmp = new File(tmpFilePath);\r\n\t\t\t// 一時保存ファイルに書き出し\r\n\t\t\tBufferedWriter bw = new BufferedWriter(new FileWriter(filetmp));\r\n\t\t\tbw.write(data);\r\n\t\t\tbw.close();\r\n\t\t} catch (IOException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\t File recordsFile = new File(tmpFilePath);\r\n\t FileReader fr = null;\r\n\t\ttry {\r\n\t\t\tfr = new FileReader(recordsFile);\r\n\t\t} catch (FileNotFoundException e) {\r\n\t\t\t// TODO 自動生成された catch ブロック\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t BufferedReader br = new BufferedReader(fr);\r\n\r\n\t\t String cmp = \"\";\r\n\t\ttry {\r\n\t\t\twhile((cmp = br.readLine()) != null) {\r\n\t\t\t\tif(cmp.contains(\"literal\")) {\r\n\t\t\t\t\tresult.add(this.formatData(cmp));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t} catch (IOException e) {\r\n\t\t\t// TODO 自動生成された catch ブロック\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t\t//for(String s:result) {\r\n\t\t//\tSystem.out.println(s);\r\n\t\t//}\r\n\r\n\t\treturn result;\r\n\r\n\t}", "public static Collection getListeValeurs(String p_chaine){\n\n Collection liste= new ArrayList();\n\n\t\tif (!Controleur.isVide(p_chaine)){\n\t\t\tint separ = -1;\n\t\t\tdo {\n\t\t\t\tint curIndex = separ+1;\n\t\t\t\tsepar = p_chaine.indexOf(\";\",curIndex);\n\t\t\t\tif (separ >0)\n\t\t\t\t\tliste.add(p_chaine.substring(curIndex,separ).trim());\n\t\t\t\telse\n\t\t\t\t\tliste.add(p_chaine.substring(curIndex).trim());\n\t\n\t\t\t}while (separ>0);\n\t\t}\n\t\t\n\t\treturn liste;\n\t}", "private static ArrayList<String> splitString(String line) {\n String[] splits = line.split(DELIMITER);\n return new ArrayList<>(Arrays.asList(splits));\n }", "public ArrayList getCaroserie(String denumire) {\n c = db.rawQuery(\"select firma, ute_id, cpi_id, concediu, sex_id, exp_id, principala from caroserii where denumire='\" + denumire + \"'\", new String[]{});\n ArrayList lista = new ArrayList();\n while (c.moveToNext()) {\n int firma = c.getInt(0);\n String utilizare = c.getString(1);\n int familie = c.getInt(2);\n int concediu = c.getInt(3);\n String sex = c.getString(4);\n String experienta = c.getString(5);\n int principala = c.getInt(6);\n lista.add(firma);\n lista.add(utilizare);\n lista.add(familie);\n lista.add(concediu);\n lista.add(sex);\n lista.add(experienta);\n lista.add(principala);\n }\n return lista;\n }", "public List<String> recogniseAccountNumber(AccountNumber accountNumber) {\n String accountNumberStr = accountNumber.getAccountNumber();\n Map<Integer, String> illegibleSymbolMap = accountNumber.getIllegibleSymbolMap();\n List<String> accountNumberList = Lists.newArrayList();\n\n Integer index = illegibleSymbolMap.keySet().iterator().next();\n List<String> legibleSymbolList = recogniseSymbol(illegibleSymbolMap.get(index));\n for (String legibleSymbol : legibleSymbolList){\n accountNumberList.add(StringUtils.overlay(accountNumberStr, legibleSymbol, index, index + 1));\n }\n return accountNumberList;\n }", "public ArrayList<String> mostraResultats(){\n ArrayList<String> tauleta = new ArrayList<>();\n for (int j=0; j<res.getClients().size(); j++) {\n for (int k=0; k<res.getClients().get(j).getAssigs().size(); k++) {\n String aux = \"\";\n for (int i = 0; i < res.getClients().get(j).getAssigs().get(k).getAntecedents().getRangs().size(); i++) {\n aux += res.getClients().get(j).getAssigs().get(k).getAntecedents().getRangs().get(i).getNom() + \"\\t\";\n }\n aux += \" -> \" + res.getClients().get(j).getAssigs().get(k).getConsequent().getNom();\n tauleta.add(aux);\n }\n }\n return tauleta;\n }", "public List<String> getMarci() {\n List<String> denumiri = new ArrayList<String>();\n String selectQuery = \"SELECT denumire FROM marci\";\n Cursor cursor = db.rawQuery(selectQuery, new String[]{});\n if (cursor.moveToFirst()) {\n do {\n String s = cursor.getString(0);\n denumiri.add(s);\n } while (cursor.moveToNext());\n }\n return denumiri;\n }", "public static ArrayList<String> adverbs() {\n ArrayList<String> temp = new ArrayList<String>();\n Scanner adverber;\n try {\n adverber = new Scanner(new File(\"Adverbs.txt\"));\n adverber.useDelimiter(\", *\");\n while (adverber.hasNext()){\n temp.add(\" \"+adverber.next()+\" \");\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n return temp;\n }", "public ArrayList consultarPLU(String string) {\n String string2 = \"SELECT des_invfisico_tmp._id, des_invfisico_tmp.cod_ubicacion,des_invfisico_tmp.cod_referencia,des_invfisico_tmp.cod_plu,plu.descripcion FROM des_invfisico_tmp LEFT OUTER JOIN plu ON plu.cod_plu = des_invfisico_tmp.cod_plu WHERE des_invfisico_tmp.cod_plu = '\" + string + \"'\" + \"\";\n Cursor cursor = this.myDataBase.rawQuery(string2, null);\n ArrayList arrayList = new ArrayList();\n new ArrayList();\n if (cursor.moveToFirst()) {\n do {\n for (int i = 0; i <= 4; ++i) {\n if (cursor.isNull(i)) {\n arrayList.add(\"\");\n continue;\n }\n arrayList.add(cursor.getString(i));\n }\n } while (cursor.moveToNext());\n }\n return arrayList;\n }", "public ArrayList<String> listarProgramas();", "private List<String> getList(String digits) {\n\t\tif(digits.length() == 0) \n\t\t\treturn new LinkedList<String>();\n\t\t\n\t\n\t\treturn Arrays.asList(getCrossProduct(digits));\n\n\t\t\n\t}", "public ArrayList<PeriodoAcademicos> listarParciales(long codQuimestre) {\n try {\n Conexion conexion = new Conexion();\n ResultSet rs = conexion.Consulta(\"SELECT * FROM siacc_periodoacademico WHERE estado_paca LIKE 'A' AND codigopadre_paca='\"+codQuimestre+\"'\");\n\n ArrayList listar = new ArrayList();\n while (rs.next()) {\n listar.add(Crear(rs));\n }\n return listar;\n } catch (Exception ex) {\n throw new RuntimeException(\"Error al Obtener Parciales en ArrayList\");\n }\n }", "private ArrayList<String> parseBalanceSheetYears() {\n // Bilanz Jahresangaben\n\n Pattern bilanzJahresPattern = Pattern.compile(\"<table><thead><tr><th>\\\\s*Bilanz\\\\s*((?!</tr>).)*</tr></thead><tbody>\");\n matcher = bilanzJahresPattern.matcher(html);\n ArrayList<String> balanceSheetArray = new ArrayList<>();\n\n while (matcher.find()) {\n log.info(\"Matches gefunden!\");\n\n log.info(matcher.group(0));\n String bilanzJahresOut = matcher.group(0);\n bilanzJahresPattern = Pattern.compile(\"(\\\\s*<th class=\\\"ZAHL\\\">(((?!</).)*)</th>\\\\s*)\");\n matcher = bilanzJahresPattern.matcher(bilanzJahresOut);\n while (matcher.find()) {\n log.debug(matcher.group(2));\n balanceSheetArray.add(matcher.group(2).trim());\n }\n }\n\n log.info(balanceSheetArray.toString());\n return balanceSheetArray;\n }", "public void tokenizeAndParse(){\n StringTokenizer st1 = new StringTokenizer(Strinput, \" \");\n while (st1.hasMoreTokens()){\n String temp = st1.nextToken();\n if(!temp.equals(\"Rs\")&&!temp.equals(\"Ri\")){\n melody.add(Integer.decode(temp.substring(0,2)));\n }\n\n }\n\n }", "public ArrayList<String> extractProcessIDs() throws SQLException {\n\t\t\n\t\tResultSet dataSet;\n\t\tArrayList<String> result = new ArrayList<String>();\n\t\t\n\t\t/* Estraiamo dal database le processID di nostro interesse */\n\t\tString query = \"SELECT distinct processID FROM workflow\";\n\t\tdataSet = this.extractQuery(query);\n\t\t\n\t\t/* Riempiamo una lista partendo dalle tuple ottenute con la query */\n\n\t\twhile (dataSet.next()) {\n\t\t\t/* Istanziamo un nuovo oggetto e settiamo i suoi campi */\n\t\t\t\n\t\t\tresult.add(dataSet.getString(\"processID\"));\n\n\t\t}\n\t\t/* Restituiamo la lista */\n\t\treturn result;\n\t}", "public static ArrayList<String> getTerms(String comment){\n\n\t\tString[] terms = comment.split(\"[^a-zA-Z]+\");\n\t\t//if(terms.length == 0) System.out.println(\"error: \" + comment);\n\t\tArrayList<String> termsarray = new ArrayList<String>();\n\t\tfor(int i=0;i<terms.length;i++){\n\t\t\t\n\t\t\tString iterm = terms[i].toLowerCase();\n\t\t\tboolean isStopWord = false;\n\t\t\tfor(String s : stopWord){\n\t\t\t\tif(iterm.equals(s)){\n\t\t\t\t\tisStopWord = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(isStopWord == true)\n\t\t\t\tcontinue;\n\t\t\t\n\t\t\tStemmer stemmer = new Stemmer();\n\t\t\tstemmer.add(iterm.toCharArray(), iterm.length());\n\t\t\tstemmer.stem();\n\t\t\titerm = stemmer.toString();\n\t\t\t\n\t\t\t//System.out.println(iterm);\n\t\t\tif(iterm.length() >=2 && !termsarray.contains(iterm))termsarray.add(iterm);\n\t\t}\n\t\n\t\treturn termsarray;\n\t}", "String[] splitSentenceWords() {\n\t\t\tint i=0;\n\t\t\tint j=0;\n\t\t\tArrayList<String> words = new ArrayList<String>();\n\t\t\t\n\t\t\t\tString[] allWords = wordPattern.split(purePattern.matcher(sentence).replaceAll(\" \"));//.split(\"(?=\\\\p{Lu})|(\\\\_|\\\\,|\\\\.|\\\\s|\\\\n|\\\\#|\\\\\\\"|\\\\{|\\\\}|\\\\@|\\\\(|\\\\)|\\\\;|\\\\-|\\\\:|\\\\*|\\\\\\\\|\\\\/)+\");\n\t\t\tfor(String word : allWords) {\n\t\t\t\tif(word.length()>2) {\n\t\t\t\t\twords.add(word.toLowerCase());\n\t\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t\treturn (String[])words.toArray(new String[words.size()]);\n\t\t\n\t\t}", "private ArrayList parseStringToList(String data){\n ArrayList<String> result = new ArrayList<String>();\n String[] splitResult = data.split(\",\");\n for(String substring : splitResult){\n result.add(substring);\n }\n return result;\n }", "public static ArrayList<String> verbs() {\n ArrayList<String> temp = new ArrayList<String>();\n Scanner verber;\n try {\n verber = new Scanner(new File(\"Verbs.txt\"));\n verber.useDelimiter(\", *\");\n while (verber.hasNext()){\n temp.add(\" \"+verber.next()+\" \");\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n return temp;\n }", "public String[] processString(String sMath){\n String s1 = \"\", elementMath[];\r\n sMath = sMath.trim();\r\n sMath = sMath.replaceAll(\"\\\\s+\",\" \"); // chuan hoa sMath\r\n for (int i=0; i<sMath.length(); i++){\r\n char c = sMath.charAt(i);\r\n if (!isOperator(c)) s1 = s1 + c;\r\n else s1 = s1 + \" \" + c + \" \";\r\n }\r\n s1 = s1.trim();\r\n s1 = s1.replaceAll(\"\\\\s+\",\" \"); // chuan hoa s1\r\n elementMath = s1.split(\" \"); //tach s1 thanh cac phan tu\r\n return elementMath;\r\n }", "public static List<String> splitByLogicOperators(String str){\n Matcher matcher = logicOperatorPattern.matcher(str);\n List<String> result = new ArrayList<>();\n int start = 0;\n while (matcher.find()) {\n result.add(str.substring(start, matcher.start()).trim());\n result.add(str.substring(matcher.start(), matcher.end()).trim());\n start = matcher.end();\n }\n result.add(str.substring(start, str.length()).trim());\n return result;\n }", "private static ArrayList<String> sanatizeDataInstr(String lineInput){\n\t\tString line = lineInput;\n\t\tline = line.trim();\n\t\t//System.out.println(\"Line starts out as:(\"+line+\")\");\n\t\tArrayList<String> toReturn = new ArrayList<String>();\n\t\t\n\t\twhile(line.length()>0){\n\t\t\tif(line.indexOf(\" \") != -1){\n\t\t\t\ttoReturn.add(line.trim().substring(0, line.indexOf(\" \")).trim().toLowerCase());\n\t\t\t\tline = line.substring(line.indexOf(\" \"), line.length()).trim();\n\t\t\t} else {\n\t\t\t\ttoReturn.add(line.trim().toLowerCase());\n\t\t\t\tline = \"\";\n\t\t\t}\n\t\t\t//System.out.println(\"Line now equals:(\" + line +\")\");\n\t\t}\n\t\t\n\t\treturn toReturn;\n\t}", "public abstract List createQuery(String query);", "private List<String> retrieveValues(String color, String regex) {\r\n\t\tList<String> split = Arrays.asList(color.split(regex));\r\n\t\tsplit = split.subList(1, split.size());\r\n\t\treturn split;\r\n\t}", "public List<String> getAnswersAsList() {\n\t\tString[] data = _answer.split(Question.answerDelimiter);\n\t\tList<String> output = new ArrayList<String>();\n\t\tfor (String answer : data) {\n\t\t\toutput.add(answer);\n\t\t}\n\t\treturn output;\n\t}", "public ArrayList<String> processWord(String wordProcessing, String separator) {\n ArrayList<String> arrayListResult = new ArrayList<String> ();\n int underscorePos;\n\n while (wordProcessing.contains(separator)){\n underscorePos = wordProcessing.indexOf(separator);\n arrayListResult.add(wordProcessing.substring(0, underscorePos));\n wordProcessing = wordProcessing.substring(underscorePos+1);\n }\n\n arrayListResult.add(wordProcessing); \n\n return arrayListResult;\n }", "private ArrayList limpiar() {//quita espacios en blanco y saltos de linea\n String codigoFuente = ta_source.getText();\n ArrayList retorno = new ArrayList();\n try {\n codigoFuente = codigoFuente.replaceAll(\" \", \"\");\n String aux = \"\";\n byte guardaLinea = 1, guardaBloque = 1;\n for (int i = 0; i < codigoFuente.length(); i++) {\n if (codigoFuente.length() > (i + 1) && codigoFuente.charAt(i) == '/' && codigoFuente.charAt(i + 1) == '/' && guardaBloque == 1) {\n guardaLinea = 0;//0: no guarda\n }\n if (codigoFuente.length() > (i + 1) && codigoFuente.charAt(i) == '/' && codigoFuente.charAt(i + 1) == '*' && guardaLinea == 1) {\n guardaBloque = 0;//0: no guarda\n }\n if (i > 0 && codigoFuente.charAt(i) == '/' && codigoFuente.charAt(i - 1) == '*') {\n guardaBloque = 2;//1: si guarda\n }\n if (codigoFuente.charAt(i) == '\\n' && guardaBloque == 1) {\n guardaLinea = 1;//1: si guarda\n if (aux.length() > 0) {\n retorno.add(aux);\n aux = \"\";\n }\n } else {\n if (i == codigoFuente.length() - 1) {\n aux += codigoFuente.charAt(i);\n retorno.add(aux);\n }\n }\n if (guardaBloque == 1 && guardaLinea == 1 && codigoFuente.charAt(i) != '\\n') {\n aux += codigoFuente.charAt(i);\n }\n if (guardaBloque == 2) {\n guardaBloque--;\n }\n }\n } catch (Exception e) {\n System.out.println(\"errror \" + e.getClass());\n } finally {\n return retorno;\n }\n }", "public ArrayList recuperString_to_Array(String lestring){\n int i;\n char restemp;\n String sretemp=\"\";\n Iterator it;\n ArrayList<String>ListTextString=new ArrayList<String>();\n for(i=0;i<lestring.length();i++){\n restemp=lestring.charAt(i);\n sretemp+=restemp;\n switch (lestring.charAt(i)) {\n case '\\n':\n ListTextString.add(sretemp);\n sretemp=\"\";\n break;\n case '\\t':\n sretemp=\"\";\n break;\n }\n }\n it=ListTextString.iterator();\n while (it.hasNext()){\n System.out.println(it.next().toString());\n\n }\n return ListTextString;\n }", "private static ArrayList<String> getPlayerNames(Scanner inScanner)\n\t{\n\t\tArrayList<String> names = new ArrayList<String>();\n\t\t\n\t\tString coerce = inScanner.nextLine();\n\t\t\n\t\twhile (inScanner.hasNext())\n\t\t{\n\t\t\tif (!(coerce.charAt(0)=='0') && !(coerce.charAt(0)=='1') && !(coerce.charAt(0)=='2') &&\n\t\t\t\t\t!(coerce.charAt(0)=='3') && !(coerce.charAt(0)=='4') && !(coerce.charAt(0)=='5')\n\t\t\t\t\t&& !(coerce.charAt(0)=='6') && !(coerce.charAt(0)=='7') && !(coerce.charAt(0)=='8')\n\t\t\t\t\t&& !(coerce.charAt(0)=='9') && !(coerce.charAt(0)=='-'))\n\t\t\t{\n\t\t\t\tnames.add(coerce);\n\t\t\t\tinScanner.nextLine();\n\t\t\t}\n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\tinScanner.nextLine();\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn names;\n\t\t\n\t}", "static List<Intervall> handleInput(String input) {\n\t\tList<Intervall> listIntervall = new ArrayList<>();\n\t\tif (input.length() > 0) {\n\t\t\tString[] inputArray = input.split(\" \");\n\n\t\t\tfor (String s : inputArray) {\n\t\t\t\tString sTrimmed = s.substring(1, s.length() - 1);\n\t\t\t\tString[] inputValues = sTrimmed.split(\",\");\n\t\t\t\tlistIntervall.add(new Intervall(Integer.parseInt(inputValues[0]), Integer.parseInt(inputValues[1])));\n\t\t\t}\n\t\t}\n\t\treturn listIntervall;\n\t}", "private List<String> splitEquation(String equation) {\n List<String> result = new ArrayList<>();\n StringBuilder sb = new StringBuilder();\n int i = 0;\n while (i < equation.length()) {\n char c = equation.charAt(i);\n if (c == '+' || c == '-') {\n if (sb.length() > 0) {\n result.add(sb.toString());\n sb = new StringBuilder();\n }\n sb.append(c);\n } else {\n sb.append(c);\n }\n ++ i;\n }\n result.add(sb.toString());\n return result;\n }", "List<String> getRecipeByIngredients(CharSequence query);", "public static List<String> formPossibleValues(String enumeraion){\n\t\tList<String> ret = new ArrayList<String>();\n\t\tfor (String value : enumeraion.split(\";\"))\n\t\t\tret.add(value);\n\t\t\n\t\treturn ret;\n\t}", "public List<Page> getCharactersFromDatabase() throws SQLException {\n\t\tDbConnector db = null;\n\t\ttry {\n\t\t\tdb = new DbConnector();\n\t\t} catch (ClassNotFoundException | SQLException e1) {\n\t\t\te1.printStackTrace();\n\t\t}\n\t\tResultSet pageResult = db.executeQuery(SqlConstants.SELECT_CHARACTERS);\n\n\t\tList<Page> pageList = new ArrayList<>();\n\t\twhile (pageResult.next()) {\n\t\t\tint pageId = pageResult.getInt(\"pageId\");\n\t\t\tString title = pageResult.getString(\"title\");\n\t\t\tPage page = new Page(pageId, title);\n\t\t\tpageList.add(page);\n\t\t}\n\t\tpageResult.close();\n\t\treturn pageList;\n\t}", "public List < SelectItem > getListSearchFieldLocale() {\r\n SearchFieldEnum[] enums = SearchFieldEnum.values();\r\n\r\n List < SelectItem > selectItems = new ArrayList < SelectItem >();\r\n\r\n for (SearchFieldEnum searchFieldEnum : enums) {\r\n selectItems\r\n .add(new SelectItem(searchFieldEnum.getLabel(), this.getString(searchFieldEnum.getLabel())));\r\n }\r\n\r\n return selectItems;\r\n }", "public ArrayList<String> getAlphabeticTags() {\n\n\t\tif (m_db == null)\n\t\t\treturn null;\n\n\t\tCursor cursor = m_db.query(TAG_TABLE_NAME,\n\t\t\t\tnew String[] { TAG_FIELD_NAME }, null, null, null, null,\n\t\t\t\tTAG_FIELD_NAME + \" ASC\");\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// process result\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// return result list\n\t\t//\n\t\treturn list;\n\t}", "public ArrayList<PeriodoAcademicos> listarQuimestres() {\n try {\n Conexion conexion = new Conexion();\n ResultSet rs = conexion.Consulta(\"SELECT * FROM siacc_periodoacademico WHERE estado_paca LIKE 'A' AND codigopadre_paca IS NULL\");\n\n ArrayList listar = new ArrayList();\n while (rs.next()) {\n listar.add(Crear(rs));\n }\n return listar;\n } catch (Exception ex) {\n throw new RuntimeException(\"Error al Obtener Quimestres en ArrayList\");\n }\n }", "public List<PrimeNr> getAllPrimeNrs(){\n Cursor cursor = database.query(PrimeNrBaseHelper.TABLE,null, null, null, null\n , null, PrimeNrBaseHelper.PRIME_NR);\n\n List<PrimeNr> primeNrList = new ArrayList<>();\n\n try {\n cursor.moveToFirst();\n while(!cursor.isAfterLast()){\n Long pnr = cursor.getLong(cursor.getColumnIndex(PrimeNrBaseHelper.PRIME_NR));\n String foundOn = cursor.getString(cursor.getColumnIndex(PrimeNrBaseHelper.FOUND_ON));\n primeNrList.add(new PrimeNr(pnr, foundOn));\n cursor.moveToNext();\n }\n } finally {\n cursor.close();\n }\n\n return primeNrList;\n }", "public static ArrayList<String> negations() {\n ArrayList<String> temp = new ArrayList<String>();\n Scanner negationer;\n try {\n negationer = new Scanner(new File(\"Negations.txt\"));\n negationer.useDelimiter(\", *\");\n while (negationer.hasNext()){\n temp.add(\" \"+negationer.next()+\" \");\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n return temp;\n }", "private Vector pparse(){\n Vector<Object> ret = new Vector<Object>();\n clearWhitespace();\n while (c != -1){\n ret.add(parseSingle());\n clearWhitespace();\n }\n return ret;\n }", "private ArrayList<String> stringToArrayList(String group, String splitter) {\n\t\t\n\t\t// Temp variables for splitting the string\n\t\tString[] splitString = TextUtils.split(group, splitter);\n\t\tArrayList<String> al = new ArrayList<String>();\n\t\t\n\t\t\n\t\tfor(int i=0; i<splitString.length; i++){\n\t\t\tLog.v(TAG, \"Read group \" + splitString[i]);\n\t\t\tal.add(splitString[i]);\n\t\t}\n\t\t\n\t\treturn al;\n\t}", "private ArrayList<String> convertChar() {\r\n \tArrayList<String> patterns = new ArrayList<String>();\r\n \tfor (int i = 0; i < this.patterns.size(); i++) {\r\n \t\tString s = \"\";\r\n \t\tfor (int j = 0; j < this.patterns.get(i).length; j++) {\r\n \t\t\ts += this.patterns.get(i)[j];\r\n \t\t}\r\n \t\tpatterns.add(s);\r\n \t}\r\n \treturn patterns;\r\n }", "ArrayList<String> getLines();", "private Vector<String> separateLineup(){\n Vector<String> lineup = new Vector<String>();\n StringTokenizer st = new StringTokenizer(masterLineup, \",\");\n\n while(st.hasMoreTokens()){\n lineup.add(st.nextToken().toLowerCase());\n }\n\n return lineup;\n\t\t\n\t}", "public List getList(String where_condtion, String namedQuery) {\r\n\r\n\t\tList list;\r\n\r\n\t\tlist = employeeAppointmentDao.getComboList(where_condtion, namedQuery);\r\n\r\n\t\treturn list;\r\n\r\n\t}", "private static CharSequence[] splitOnSpaceRuns(CharSequence read) {\n int lastStart = 0;\n ArrayList<CharSequence> segs = new ArrayList<CharSequence>(5);\n int i;\n for(i=0;i<read.length();i++) {\n if (read.charAt(i)==' ') {\n segs.add(read.subSequence(lastStart,i));\n i++;\n while(i < read.length() && read.charAt(i)==' ') {\n // skip any space runs\n i++;\n }\n lastStart = i;\n }\n }\n if(lastStart<read.length()) {\n segs.add(read.subSequence(lastStart,i));\n }\n return (CharSequence[]) segs.toArray(new CharSequence[segs.size()]); \n }", "public ArrayList<Mathang> getMathang(){\n\t\tArrayList<Mathang> kq = null;\n\t\tString sql = \"select * from tblMathang\";\n\n\t\ttry {\n\t\t\tCallableStatement cs = con.prepareCall(sql);\n\t\t\tResultSet rs = cs.executeQuery();\n\t\t\t\n\t\t\twhile(rs.next()) {\n\t\t\t\tif(kq == null) {\n\t\t\t\t\tkq = new ArrayList<Mathang>();\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tMathang mh = new Mathang();\n\t\t\t\tmh.setId(rs.getInt(\"tblMathangID\"));\n\t\t\t\tmh.setTenmathang(rs.getString(\"tenmathang\"));\n\t\t\t\tmh.setMa(rs.getString(\"ma\"));\n\t\t\t\tmh.setGianban(rs.getFloat(\"giaban\"));\n\t\t\t\tmh.setGianhap(rs.getFloat(\"gianhap\"));\n\t\t\t\tmh.setNhanhieu(rs.getString(\"nhanhieu\"));\n\t\t\t\tmh.setNhacungcap(rs.getString(\"nhacungcap\"));\n\t\t\t\tkq.add(mh);\n\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn kq;\n\t}", "static String[] SplitText(String input, String regex) {\n ArrayList<String> res = new ArrayList<String>();\n Pattern p = Pattern.compile(regex);\n Matcher m = p.matcher(input);\n int pos = 0;\n while (m.find()) {\n res.add(input.substring(pos, m.start()));\n res.add(input.substring(m.start()+1, m.end()-1));\n pos = m.end();\n }\n if(pos < input.length()) res.add(input.substring(pos));\n return res.toArray(new String[res.size()]);\n }", "public static List<String> getSearchedResultList(String loggedInId) {\n\t\tAppLog.begin();\n\t\tConnection conn = null;\n\t\tPreparedStatement ps = null;\n\t\tResultSet rs = null;\n\t\tint i = 0;\n\t\tList<String> searchedResultList = new ArrayList<String>();\n\n\t\ttry {\n\t\t\tString query = QueryContants.getSearchedResultListQuery();\n\t\t\tAppLog.info(\"getSearchedResultListQuery::\" + query);\n\t\t\tconn = DBConnector.getConnection();\n\t\t\tps = conn.prepareStatement(query);\n\t\t\tif (null != loggedInId && !\"\".equalsIgnoreCase(loggedInId)) {\n\t\t\t\tAppLog.info(\"Setting loggedInId in Query : \" + loggedInId);\n\t\t\t\tps.setString(++i, loggedInId);\n\t\t\t}\n\t\t\trs = ps.executeQuery();\n\t\t\twhile (rs.next()) {\n\t\t\t\tString result = \"{\";\n\t\t\t\tif (null != rs.getString(\"KNO\")) {\n\t\t\t\t\tresult += \"[KNO:\" + rs.getString(\"KNO\") + \"]\";\n\t\t\t\t}\n\t\t\t\tif (null != rs.getString(\"BILL_ROUND\")) {\n\t\t\t\t\tresult += \"[BILL_ROUND:\" + rs.getString(\"BILL_ROUND\") + \"]\";\n\t\t\t\t}\n\t\t\t\tif (null != rs.getString(\"ZRO_LOCATION\")) {\n\t\t\t\t\tresult += \"[ZRO:\" + rs.getString(\"ZRO_LOCATION\") + \"]\";\n\t\t\t\t}\n\t\t\t\tif (null != rs.getString(\"PER_VARIATION_AVG_CNSUMPTN\")) {\n\t\t\t\t\tresult += \"[AVG_CONSUMPTION:\"\n\t\t\t\t\t\t\t+ rs.getString(\"PER_VARIATION_AVG_CNSUMPTN\") + \"]\";\n\t\t\t\t}\n\t\t\t\tif (null != rs.getString(\"PER_VARIATION_PREVUS_READNG\")) {\n\t\t\t\t\tresult += \"[VARIATION_PREVIOUS_ROUND:\"\n\t\t\t\t\t\t\t+ rs.getString(\"PER_VARIATION_PREVUS_READNG\") + \"]\";\n\t\t\t\t}\n\t\t\t\tif (null != rs.getString(\"LAST_AUDIT_DATE\")) {\n\t\t\t\t\tresult += \"[LAST_AUDITED:\"\n\t\t\t\t\t\t\t+ rs.getString(\"LAST_AUDIT_DATE\") + \"]\";\n\t\t\t\t}\n\t\t\t\tif (null != rs.getString(\"AUDIT_STATUS\")) {\n\t\t\t\t\tresult += \"[AUDIT_STATUS:\" + rs.getString(\"AUDIT_STATUS\")\n\t\t\t\t\t\t\t+ \"]\";\n\t\t\t\t}\n\t\t\t\tresult += \"}\";\n\t\t\t\tAppLog.info(result);\n\t\t\t\tsearchedResultList.add(result);\n\t\t\t}\n\n\t\t} catch (SQLException e) {\n\t\t\tAppLog.error(e);\n\t\t} catch (IOException e) {\n\t\t\tAppLog.error(e);\n\t\t} catch (Exception e) {\n\t\t\tAppLog.error(e);\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tif (null != ps) {\n\t\t\t\t\tps.close();\n\t\t\t\t}\n\t\t\t\tif (null != rs) {\n\t\t\t\t\trs.close();\n\t\t\t\t}\n\t\t\t\tif (null != conn) {\n\t\t\t\t\tconn.close();\n\t\t\t\t}\n\t\t\t} catch (Exception e) {\n\t\t\t\tAppLog.error(e);\n\t\t\t}\n\t\t}\n\t\tAppLog.end();\n\t\treturn searchedResultList;\n\t}", "public ArrayList<Book> getListBooklanguage(String laguage);", "public ArrayList consultarUbic(String string) {\n String string2 = \"SELECT des_invfisico_tmp._id, des_invfisico_tmp.cod_ubicacion,des_invfisico_tmp.cod_referencia,des_invfisico_tmp.cod_plu,plu.descripcion FROM des_invfisico_tmp LEFT OUTER JOIN plu ON plu.cod_plu = des_invfisico_tmp.cod_plu WHERE des_invfisico_tmp.cod_ubicacion = '\" + string + \"'\" + \"\";\n Cursor cursor = this.myDataBase.rawQuery(string2, null);\n ArrayList arrayList = new ArrayList();\n new ArrayList();\n if (cursor.moveToFirst()) {\n do {\n for (int i = 0; i <= 4; ++i) {\n if (cursor.isNull(i)) {\n arrayList.add(\"\");\n continue;\n }\n arrayList.add(cursor.getString(i));\n }\n } while (cursor.moveToNext());\n }\n return arrayList;\n }", "private static Set<String> parseQueryChromsToWarp(String toWarp) {\n if (toWarp == null) return null;\n\n Set<String> retval = new HashSet<>();\n for (String token : toWarp.split(\",\")) {\n retval.add(token.trim());\n }\n return retval;\n }", "public void Mini_Parser(){\n Lista_ER Nuevo=null;\n String Nombre=\"\";\n String Contenido=\"\";\n ArrayList<String> tem = new ArrayList<String>();\n //este boleano sirve para concatenar la expresion regular\n int Estado=0;\n for (int x = 0; x < L_Tokens.size(); x++) {\n switch(Estado){\n //ESTADO 0\n case 0:\n //Conjuntos\n if(L_Tokens.get(x).getLexema().equals(\"CONJ\")){\n if(L_Tokens.get(x+1).getLexema().equals(\":\")){\n if(L_Tokens.get(x+2).getDescripcion().equals(\"Identificador\")){\n //Son conjuntos \n Nombre=L_Tokens.get(x+2).getLexema();\n Estado=1;\n x=x+4;\n }\n }\n }\n if(L_Tokens.get(x).getDescripcion().equals(\"Identificador\")){\n //pasaa estado de expresion regular\n Nombre=L_Tokens.get(x).getLexema();\n Estado=2;\n }\n break;\n \n case 1:\n //ESTADO 1\n //Concatena los conjuntos\n if(L_Tokens.get(x).getDescripcion().equals(\"Identificador\")){\n if(L_Tokens.get(x+1).getDescripcion().equals(\"Tilde\")){\n Contenido=L_Tokens.get(x).getLexema()+L_Tokens.get(x+1).getLexema()+L_Tokens.get(x+2).getLexema();\n L_Tokens_Conj.add(new Lista_Conjuntos(Nombre, Contenido));\n x=x+2;\n Estado=0;\n }\n \n }\n if(L_Tokens.get(x).getDescripcion().equals(\"Digito\")){\n if(L_Tokens.get(x+1).getDescripcion().equals(\"Tilde\")){\n Contenido=L_Tokens.get(x).getLexema()+L_Tokens.get(x+1).getLexema()+L_Tokens.get(x+2).getLexema();\n L_Tokens_Conj.add(new Lista_Conjuntos(Nombre, Contenido));\n x=x+2;\n Estado=0;\n }\n \n }\n for(int i=6;i<=37;i++){\n if(L_Tokens.get(x).getID()==i){\n if(L_Tokens.get(x+1).getDescripcion().equals(\"Tilde\")){\n Contenido=L_Tokens.get(x).getLexema()+L_Tokens.get(x+1).getLexema()+L_Tokens.get(x+2).getLexema();\n L_Tokens_Conj.add(new Lista_Conjuntos(Nombre, Contenido));\n x=x+2;\n Estado=0;\n }\n \n }\n }\n //conjunto sin llaves\n if(L_Tokens.get(x).getLexema().equals(\";\")){\n if(L_Tokens.get(x-1).getLexema().equals(\",\")){\n }else{\n L_Tokens_Conj.add(new Lista_Conjuntos(Nombre, Contenido));\n Estado=0;\n Contenido=\"\";\n\n }\n }else{\n Contenido+=L_Tokens.get(x).getLexema();\n }\n \n\n break;\n case 2:\n //ESTADO 2\n if(L_Tokens.get(x).getLexema().equals(\"-\")){\n if(L_Tokens.get(x+1).getLexema().equals(\">\")){\n //se mira que es expresion regular\n \n Lista_ER nuevo=new Lista_ER(L_Tokens.get(x-1).getLexema());\n Nuevo=nuevo;\n L_Tokens_ER.add(nuevo);\n x++;\n Estado=3;\n }\n }\n if(L_Tokens.get(x).getLexema().equals(\":\")){\n //se mira que es lexema\n Estado=4;\n }\n break;\n case 3: \n //ESTADO 3\n //Concatenacion de Expresion Regular\n \n //System.out.println(\"---------------------------------\"+ L_Tokens.get(x).getLexema());\n if(L_Tokens.get(x).getDescripcion().equals(\"Punto\")){\n Nuevo.setER(L_Tokens.get(x).getLexema());\n }\n if(L_Tokens.get(x).getDescripcion().equals(\"Barra Vetical\")){\n Nuevo.setER(L_Tokens.get(x).getLexema());\n }\n if(L_Tokens.get(x).getDescripcion().equals(\"Interrogacion\")){\n Nuevo.setER(L_Tokens.get(x).getLexema());\n }\n if(L_Tokens.get(x).getDescripcion().equals(\"Asterisco\")){\n Nuevo.setER(L_Tokens.get(x).getLexema());\n }\n if(L_Tokens.get(x).getDescripcion().equals(\"Signo Mas\")){\n Nuevo.setER(L_Tokens.get(x).getLexema());\n }\n if(L_Tokens.get(x).getDescripcion().equals(\"Lexema de Entrada\")){ \n String tem1='\"'+L_Tokens.get(x).getLexema()+'\"';\n Nuevo.setER(tem1);\n \n }\n if(L_Tokens.get(x).getLexema().equals(\"{\")){ \n String tem1=\"\";\n if(L_Tokens.get(x+2).getLexema().equals(\"}\")){\n tem1=L_Tokens.get(x).getLexema()+L_Tokens.get(x+1).getLexema()+L_Tokens.get(x+2).getLexema();\n Nuevo.setER(tem1);\n }\n }\n if(L_Tokens.get(x).getLexema().equals(\";\")){\n Estado=0;\n }\n break;\n case 4:\n// System.out.println(L_Tokens.get(x).getLexema());\n Contenido=L_Tokens.get(x+1).getLexema();\n L_Tokens_Lex.add(new Lista_LexemasE(L_Tokens.get(x-2).getLexema(), Contenido));\n Estado=0;\n \n break;\n }//fin switch\n }//Fin for\n }", "private List<moneda> filter(List<moneda> p1, String query)\n {\n query = query.toLowerCase();\n final List<moneda> filteredModeList = new ArrayList<>();\n for (moneda model:p1)\n {\n final String text = model.getNombre().toLowerCase();\n if(text.startsWith(query))\n {\n filteredModeList.add(model);\n }\n }\n return filteredModeList;\n }", "public ArrayList<String> prefixList(String pre) {\n\t\tArrayList<String> list = new ArrayList<>();\n\t\t\t\n\t\tif (pre == \"\") {\n\t\t}\n\t\telse {\n\t\t\tfor (int i = 1; i < table.size() + 1; i++) {\n\t\t\t\tif (table.get(i).length() >= pre.length() && table.get(i).substring(0, pre.length()).equals(pre)) {\n\t\t\t\t\tlist.add(table.get(i).substring(pre.length()));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn list;\n\t\t}", "private java.util.ArrayList<String> textSplit(String splitted) {\n java.util.ArrayList<String> returned = new java.util.ArrayList<String>();\n String relatedSeparator = this.getLineSeparator(splitted);\n String[] pieces = splitted.split(relatedSeparator + relatedSeparator);\n String rstr = \"\";\n for (int cpiece = 0; cpiece < pieces.length; cpiece++) {\n String cstr = pieces[cpiece];\n if (rstr.length() + cstr.length() > maxLength) {\n if (!rstr.isEmpty()) {\n returned.add(rstr);\n rstr = cstr;\n }\n else {\n returned.add(cstr);\n }\n }\n else {\n if (rstr.equals(\"\")) {\n rstr = cstr;\n }\n else {\n rstr = rstr + lineSeparator + lineSeparator + cstr;\n }\n }\n if (cpiece == pieces.length - 1) {\n returned.add(rstr);\n }\n }\n return returned;\n }", "static ArrayList<String[]> parseDataToArray(Scanner data){\n\t\tArrayList<String[]> toParse = new ArrayList<String[]>();\n\n\t\twhile(data.hasNext()){ //read everything from data into a String ArrayList, fixing it as we go.\n\t\t\ttoParse.add(fixInputLine(data.nextLine()).split(\"%\"));\n\t\t}\n\n\t\treturn toParse;\n\n\t}", "public List<String> toList() {\n ArrayList<String> selection = new ArrayList<String>(mSelection);\n selection.addAll(mProvisionalSelection);\n return selection;\n }", "private void filterRecyvlerView() {\n String query = etSearch.getText().toString();\n String[] querySplited = query.split(\" \");\n\n if(query.equals(\"\")){\n rvPostalCodes.removeAllViews();\n adapter.setRealmResults(Realm.getDefaultInstance().where(Locations.class).findAll());\n }else{rvPostalCodes.removeAllViews();\n if(querySplited.length == 1) {\n adapter = new LocationsAdapter(fragment, Realm.getDefaultInstance(), Realm.getDefaultInstance().where(Locations.class)\n .contains(\"postalCode\", querySplited[0], Case.INSENSITIVE).or()\n .contains(\"name\", querySplited[0], Case.INSENSITIVE).findAll());\n rvPostalCodes.setAdapter(adapter);\n\n\n }else if(querySplited.length == 2){\n adapter = new LocationsAdapter(fragment, Realm.getDefaultInstance(), Realm.getDefaultInstance().where(Locations.class)\n .contains(\"postalCode\", querySplited[0], Case.INSENSITIVE).or()\n .contains(\"name\", querySplited[0],Case.INSENSITIVE)\n .contains(\"postalCode\", querySplited[1],Case.INSENSITIVE).or()\n .contains(\"name\", querySplited[1],Case.INSENSITIVE).or()\n .findAll());\n rvPostalCodes.setAdapter(adapter);\n }else if(querySplited.length == 3){\n adapter = new LocationsAdapter(getTargetFragment(), Realm.getDefaultInstance(), Realm.getDefaultInstance().where(Locations.class)\n .contains(\"postalCode\", querySplited[0], Case.INSENSITIVE).or()\n .contains(\"name\", querySplited[0],Case.INSENSITIVE)\n .contains(\"postalCode\", querySplited[1],Case.INSENSITIVE).or()\n .contains(\"name\", querySplited[1],Case.INSENSITIVE)\n .contains(\"postalCode\", querySplited[2],Case.INSENSITIVE).or()\n .contains(\"name\", querySplited[2],Case.INSENSITIVE).or()\n .findAll());\n rvPostalCodes.setAdapter(adapter);\n }\n }\n\n }", "static void separarString(String s){\n\t\tString[] palabras = s.split(\"[ ]\");\n\t\tfor(int i = 0; i < palabras.length; i++){\n\t\t\tpalabras[i] = limpia(palabras[i]);\n\t\t\tSystem.out.println(palabras[i]);\n\t\t}\n\t}", "protected ArrayList<String> tokenize(String text)\r\n\t{\r\n\t\ttext = text.replaceAll(\"\\\\p{Punct}\", \"\");\r\n\t\tArrayList<String> tokens = new ArrayList<>();\r\n\t\tStringTokenizer tokenizer = new StringTokenizer(text);\r\n\r\n\t\t// P2\r\n\t\twhile (tokenizer.hasMoreTokens()) {\r\n\t\t\ttokens.add(tokenizer.nextToken());\r\n\t\t}\r\n\t\treturn tokens;\r\n\t}", "public ReactorResult<java.lang.String> getAllInternationalStandardRecordingCode_as() {\r\n\t\treturn Base.getAll_as(this.model, this.getResource(), INTERNATIONALSTANDARDRECORDINGCODE, java.lang.String.class);\r\n\t}", "public static ArrayList<String> allSeasons(){\n PremierLeagueManager.loadingData();\n\n // sort the seasons using the comparator\n Comparator<String> comparator = (season1, season2) -> {\n\n if(Integer.parseInt(season1.split(\"-\")[0]) > Integer.parseInt(season2.split(\"-\")[0])){\n return 1;\n }\n return -1;\n\n };\n\n // setting the seasons with distinct seasons only\n PremierLeagueManager.setAllSeasonAdded((ArrayList<String>)\n PremierLeagueManager.getAllSeasonAdded().stream().distinct().collect(Collectors.toList()));\n\n // sorting the seasons\n PremierLeagueManager.getAllSeasonAdded().sort(comparator);\n\n // getting the seasons and return them\n return PremierLeagueManager.getAllSeasonAdded();\n }", "public List<String> getResults(){\r\n\t\tList<String> results = new ArrayList<String>();\r\n\t\t\r\n\t\tfor(int i = 0; i < getExcel_file().size(); i++) {\r\n\t\t\tString s = getExcel_file().get(i).toString();\r\n\t\t\tfor(int j = 0; j < columns.size(); j++) {\r\n\t\t\t\ts += \" \" + columns.get(j).getArray().get(i).toString();\r\n\t\t\t}\r\n\t\t\tresults.add(s);\r\n\t\t}\r\n\t\t\r\n\t\treturn results;\r\n\t}", "public ArrayList llenar_lv(){\n ArrayList<String> lista = new ArrayList<>();\n SQLiteDatabase database = this.getWritableDatabase();\n String q = \"SELECT * FROM \" + TABLE_NAME;\n Cursor registros = database.rawQuery(q,null);\n if(registros.moveToFirst()){\n do{\n lista.add(\"\\t**********\\nNombre: \" + registros.getString(0) +\n \"\\nDirección: \"+ registros.getString(1) + \"\\n\" +\n \"Servicio(s): \"+ registros.getString(2) +\n \"\\nEdad: \"+ registros.getString(3) + \" años\\n\" +\n \"Telefono: \"+ registros.getString(4) +\n \"\\nIdioma(s): \"+ registros.getString(5) + \"\\n\");\n }while(registros.moveToNext());\n }\n return lista;\n\n }", "private String[] adaptPDFFormat() {\n String[] searchText = new String[pdfBoxDocuments.size()];\n for (int i = 0; i < pdfBoxDocuments.size(); i++) {\n PDFDocument pdf = pdfBoxDocuments.get(i);\n searchText[i] = \"\";\n for (int j = 0; j < pdf.getText().length; j++) {\n searchText[i] += pdf.getText()[j]+ \" \";\n }\n }\n return searchText;\n\n\n }", "public static String getPoiRegExpList(String lang){\n\t\tif (lang.equals(LANGUAGES.DE)){\n\t\t\treturn pois_de;\n\t\t}else if (lang.equals(LANGUAGES.EN)){\n\t\t\treturn pois_en;\n\t\t}else{\n\t\t\tDebugger.println(\"Place.java - getPoiRegExpList() has no support for language '\" + lang + \"'\", 1);\n\t\t\treturn \"\";\n\t\t}\n\t}", "public ArrayList<String> extractAR(String paragraph){\r\n\t\tArrayList<String> attributerelationList=new ArrayList<String>();\r\n\t\t\r\n\t\treturn attributerelationList;\r\n\t\r\n\t}", "private static Stream<String> getTokensFromRawText(String rawText) {\n return Stream.of(rawText.split(\"\\\\s\"));\n }", "public String[] getAllNameMonthStrings() {\n String[] columns = {\n COLUMN_NAMEMONTH_ID,\n COLUMN_NAMEMONTH_DESC\n };\n // sorting orders\n String sortOrder =\n COLUMN_NAMEMONTH_ID + \" ASC\";\n \n // query the user table\n /**\n * Here query function is used to fetch records from user table this function works like we use sql query.\n * SQL query equivalent to this query function is\n * SELECT user_id,user_name,user_email,user_password FROM user ORDER BY user_name;\n */\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor cursor = db.query(\n TABLE_NAMEMONTH, //Table to query\n columns, //columns to return\n null, //columns for the WHERE clause\n null, //The values for the WHERE clause\n null, //group the rows\n null, //filter by row groups\n sortOrder); //The sort order\n String[] cats = new String[cursor.getCount()];\n // Traversing through all rows and adding to list\n int i;\n if (cursor.moveToFirst()) {\n for( i = 0; i < cursor.getCount() ; i++){\n cats[i] = cursor.getString(cursor.getColumnIndex(COLUMN_NAMEMONTH_DESC));\n cursor.moveToNext();\n }\n }\n\n cursor.close();\n db.close();\n // return user list\n return cats;\n }", "public void buildTokenIdentifierArrayList() {\n\t\t/**\n\t\t * Maintain the order while adding. Give it in a greedy way. The most specific to most common. Eg: DECIMAL Should \n\t\t * be added first then INTEGER else INTEGER will be matched first and '.' will be matched as a TOKEN and then\n\t\t * the succeeding number will be parsed as an INTEGER\n\t\t */\n\t\tlistTokenIdentifier.add(new TokenIdentifier(Pattern.compile(RegularExpression.DECIMAL), TokenType.DECIMAL_LITERAL));\n\t\tlistTokenIdentifier.add(new TokenIdentifier(Pattern.compile(RegularExpression.IDENTIFIER), TokenType.IDENTIFIER));\n\t\tlistTokenIdentifier.add(new TokenIdentifier(Pattern.compile(RegularExpression.INTEGER), TokenType.INTEGER_LITERAL));\n\t\tlistTokenIdentifier.add(new TokenIdentifier(Pattern.compile(RegularExpression.STRING), TokenType.STRING_LITERAL));\n\n\t\tfor (String t: new String[] {\"=\", \"\\\\(\",\"\\\\)\", \"\\\\.\",\"\\\\,\"}) {\n\t\t\tlistTokenIdentifier.add(new TokenIdentifier(Pattern.compile(\"^(\" + t + \")\"), TokenType.TOKEN));\t\n\t\t}\n\t}", "private List<String> getCombo(boolean isCustomer){\n List<String> isi = new ArrayList<>();\n String[] daftar = new String[datas.size()];\n for (String data : datas) {\n daftar = data.split(\";\");\n if (isCustomer) isi.add(daftar[1]);\n else isi.add(daftar[0]);\n }\n return isi;\n}", "public static ArrayList<String> pronouns() {\n ArrayList<String> temp = new ArrayList<String>();\n Scanner pronouner;\n try {\n pronouner = new Scanner(new File(\"pronouns.txt\"));\n pronouner.useDelimiter(\", *\");\n while (pronouner.hasNext()){\n temp.add(\" \"+pronouner.next()+\" \");\n }\n } catch (FileNotFoundException e) {\n e.printStackTrace();\n }\n return temp;\n }", "private static ArrayList<String> split(String str) {\n String[] splits = str.split(DELIMITER);\n return new ArrayList<>(Arrays.asList(splits));\n }", "private static ArrayList<String> extractPagerIds(String pagerIds){\n ArrayList<String> descriptions = new ArrayList<>();\n String[] ids = pagerIds.split(\"\\\\|\");\n\n for (String id : ids){\n Pattern pattern = Pattern.compile(REGEX_PAGER_ID);\n Matcher matcher = pattern.matcher(id);\n if (matcher.find()){\n String order = matcher.group(2);\n descriptions.add(matcher.group(1) + \" : PAGER \" + (descriptions.size() + 1));\n }\n }\n return descriptions;\n }", "private static String[] tokenizeInput(String input) {\r\n\t\tArrayList<String> tokens = new ArrayList<String>(8);\r\n\t\t\r\n\t\tScanner inputScanner = new Scanner(input);\r\n\t\twhile (inputScanner.hasNext()) {\r\n\t\t\ttokens.add(inputScanner.next());\r\n\t\t}\r\n\t\treturn tokens.toArray(new String[tokens.size()]);\r\n\t}", "public List<String > getNames(){\n List<String> names = new ArrayList<>();\n String fNameQuery = \"SELECT \" + _IDP + \",\" + COL_F_NAME + \",\" + COL_L_NAME + \" FROM \" + TPYTHONISTAS + \" ;\";\n SQLiteDatabase db = this.getReadableDatabase();\n Cursor c = db.rawQuery(fNameQuery, null);\n String name;\n if (c.moveToFirst()) {\n do {\n // put together NameID#, period, Lastname, Firstname\n name = c.getString(0) + \". \" + c.getString(2) + \", \" + c.getString(1);\n names.add(name);\n } while (c.moveToNext());\n }\n c.close();\n db.close();\n return names;\n }" ]
[ "0.5919523", "0.578325", "0.574752", "0.5706735", "0.5534275", "0.5315872", "0.5273251", "0.51787937", "0.5089135", "0.50606513", "0.5053324", "0.5024917", "0.49831706", "0.48840663", "0.48818558", "0.4863853", "0.4856856", "0.48549438", "0.48392856", "0.48387134", "0.48275858", "0.4819976", "0.48158658", "0.48128664", "0.48097563", "0.47843662", "0.47831693", "0.47815943", "0.47806534", "0.47704938", "0.47662097", "0.47638977", "0.4758027", "0.47553244", "0.47481546", "0.47395337", "0.47369394", "0.47330037", "0.47269705", "0.4712926", "0.47092924", "0.47075918", "0.47069836", "0.47049984", "0.47043878", "0.4701896", "0.4701029", "0.46491978", "0.4645631", "0.46450007", "0.46434394", "0.46353278", "0.46284363", "0.46084628", "0.46039152", "0.45954195", "0.45884213", "0.45774925", "0.4575831", "0.45703048", "0.4562806", "0.4560714", "0.45336226", "0.4532308", "0.4532305", "0.45311025", "0.4530144", "0.45292845", "0.45175716", "0.45174313", "0.45126322", "0.45100087", "0.45053583", "0.44965404", "0.4495309", "0.44909078", "0.44827163", "0.44790673", "0.44692215", "0.4464232", "0.44590598", "0.4458132", "0.44575575", "0.4454028", "0.44522536", "0.44502312", "0.44491938", "0.44468358", "0.44463453", "0.44451606", "0.44407427", "0.44405788", "0.44399258", "0.44389233", "0.44339925", "0.44303003", "0.4429846", "0.4427618", "0.4427037", "0.44259194" ]
0.6009802
0
Formats the response to a query and displays it in readable format
public static String outputFormatter(ArrayList<String> output){ return output.toString().replace(",", "").replace("[", "").replace("]", ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String answerQuery(Query query) {\r\n\t\tString reply = null;\r\n\t\tif(query != null){\r\n\t\t\tif(query.elements != null){\r\n\t\t\t\tArrayList<String> queryReply = query.elements;\r\n\t\t\t\tqueryReply.add(is);\r\n\t\t\t\tqueryReply.add(Float.toString(query.price));\r\n\t\t\t\t\r\n\t\t\t\tif(query.isCredit){\r\n\t\t\t\t\tqueryReply.add(credit);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treply = GalaxyUtil.outputFormatter(queryReply);\r\n\t\t\t}else{\r\n\t\t\t\treply = badQuery;\r\n\t\t\t}\r\n\t\t\treply = query.query+\" \"+reply;\r\n\t\t\t\r\n\t\t\t//System.out.println(query.query+\" \"+reply);\r\n\t\t}\r\n\t\treturn reply;\r\n\t}", "public String generateResponse() {\n\t\tif (lastQuery instanceof QueryInfo) {\n\t\t\tQueryInfo itineraryQuery = (QueryInfo) lastQuery;\n\t\t\tif (itineraryId < 0 || itineraryId > itineraryQuery.getItineraries().size()) {\n\t\t\t\treturn cid + \",error,invalid id\";\n\t\t\t}\n\t\t\treserving = itineraryQuery.getItinerary(itineraryId);\n\t\t\tList<Reservation> check = reservationDB.retrieveReservations(name, reserving.getOrigin(), reserving.getDestination());\n\t\t\tif (check.size() > 0) {\n\t\t\t\treturn cid + \",error,duplicate reservation\";\n\t\t\t} else {\n\t\t\t\treservationDB.bookReservation(reserving, name);\n\t\t\t\treturn cid + \",reserve,successful\";\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "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}", "@GET\r\n @Produces(\"application/xml\")\r\n public String getHtml() {\r\n // TODO return proper representation object\r\n \tString sql = \"SELECT GENDER, COUNT( PATIENT_ID ) AS NUMBEROFPATIENTS \" +\r\n \t\t\t\"FROM clinicaldetection, patient \" +\r\n \t\t\t\"WHERE clinicaldetection.PATIENT_ID = patient.PID \" +\r\n \t\t\t\"AND TIMES =1 \" +\r\n \t\t\t\"AND HBSAG =0 \" +\r\n \t\t\t\"AND PATIENT_ID \" +\r\n \t\t\t\"IN ( \" +\r\n \t\t\t\"SELECT PATIENT_ID \" +\r\n \t\t\t\"FROM CLINICALDETECTION \" + \r\n \t\t\t\"WHERE TIMES =3 \" +\r\n \t\t\t\"AND ANTIHBS =0 \" +\r\n \t\t\t\") \" +\r\n \t\t\t\"GROUP BY GENDER \";\r\n\r\n \t\r\n \treturn bean.query(sql);\r\n }", "public QueryResponse(Query q) {\n this.q = q;\n this.docIDs = new HashSet<>();\n }", "@GET\n\t@Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON, MediaType.TEXT_HTML, TEXT_CSV})\n\n\tpublic Response constructResponse(@QueryParam(\"PGName\") String pgName, @QueryParam(\"format\") String format) {\n\t\tUserDao dao = (UserDao) SpringApplicationContext.getBean(\"userDao\");\n\t\tList<String> userNames= dao.getAllUsersFromPG(pgName);\n\n\t\treturn formatResponse(format, userNames, column);\n\t}", "@Override\n\tpublic ZsPkgSearchReply respFormat(String result) throws Exception {\n\t\tZsPkgSearchReply resp = null;\n\t\ttry {\n\t\t\tif (StringUtils.isNotEmpty(result)) {\n\t\t\t\tresult=\"{\"+\"\\\"\"+\"list\"+\"\\\"\"+\":\"+result+\"}\";\n\t\t\t\tresp = JsonUtils.toBean(result, ZsPkgSearchReply.class);\n\t\t\t}\n\t\t} catch (Throwable e) {\n\t\t\tLOGGER.error(\"{} {} parse response data error(Exception),msg:{}\",\n\t\t\t\t\tthis.getClass().getName(), this.getHashCode(),\n\t\t\t\t\te.getMessage(), e);\n\t\t} finally {\n\t\t\tthis.setResponse(resp);\n\t\t}\n\t\treturn this.getResponse();\n\t}", "public static JSONObject getAnswerAsJson(String query, String format) {\n try {\n JSONObject obj = new JSONObject();\n\n obj.put(\"source\", \"external\");\n\n // ==== Question Analysis Step ====\n QuestionAnalysis q_analysis = new QuestionAnalysis();\n q_analysis.analyzeQuestion(query);\n\n String question = q_analysis.getQuestion();\n\n obj.put(\"question\", question);\n\n JSONObject q_aErrorHandling = ModulesErrorHandling.questionAnalysisErrorHandling(q_analysis);\n\n if (q_aErrorHandling.getString(\"status\").equalsIgnoreCase(\"error\")) {\n return constructErrorJson(obj, q_aErrorHandling, \"questionAnalysis\");\n }\n\n String question_type = q_analysis.getQuestionType();\n\n\n // ==== Entities Detection Step ====\n EntitiesDetection entities_detection = new EntitiesDetection();\n String NEtool = \"both\";\n\n // identify NamedEntities in the question using SCNLP and Spotlight\n entities_detection.identifyNamedEntities(question, NEtool);\n\n HashMap<String, String> entity_URI = entities_detection.extractEntitiesWithUris(question, NEtool);\n\n JSONObject e_dErrorHandling = ModulesErrorHandling.entitiesDetectionErrorHandling(entities_detection);\n\n if (e_dErrorHandling.getString(\"status\").equalsIgnoreCase(\"error\")) {\n obj.put(\"question_type\", question_type);\n return constructErrorJson(obj, e_dErrorHandling, \"entitiesDetection\");\n }\n\n obj.put(\"question_entities\", entity_URI.keySet());\n obj.put(\"retrievedEntities\", entity_URI);\n\n // ==== Answer Extraction Step ====\n AnswerExtraction answer_extraction = new AnswerExtraction();\n\n ArrayList<String> expansionResources = new ArrayList<>();\n expansionResources.add(\"lemma\");\n expansionResources.add(\"verb\");\n expansionResources.add(\"noun\");\n\n HashSet<String> usef_words = answer_extraction.extractUsefulWordsWithoutEntityWords(question, entity_URI.keySet());\n\n if (usef_words.isEmpty() && question.toLowerCase().startsWith(\"what is\")) {\n question_type = \"definition\";\n }\n obj.put(\"question_type\", question_type);\n\n // Store the useful words of the question\n Set<String> useful_words = answer_extraction.extractUsefulWords(question, question_type, entity_URI.keySet(), expansionResources);\n\n answer_extraction.setUsefulWords(useful_words);\n\n String fact = answer_extraction.extractFact(useful_words);\n\n answer_extraction.retrieveCandidateTriplesOptimized(question_type, entity_URI, fact, useful_words.size(), \"min\");\n\n JSONObject a_eErrorHandling = ModulesErrorHandling.answerExtractionErrorHandling(answer_extraction, question_type, entity_URI);\n\n if (a_eErrorHandling.getString(\"status\").equalsIgnoreCase(\"error\")) {\n return constructErrorJson(obj, a_eErrorHandling, \"answerExtraction\");\n }\n\n obj.put(\"useful_words\", useful_words);\n\n JSONObject answer_triple = answer_extraction.extractAnswer(useful_words, fact, entity_URI, question_type);\n\n Logger.getLogger(ExternalKnowledgeDemoMain.class.getName()).log(Level.INFO, \"===== Answer: {0}\", answer_triple);\n\n String answer = answer_triple.getString(\"answer\");\n obj.put(\"plain_answer\", AnswerExtraction.getSuffixOfURI(answer));\n obj.put(\"answer\", answer_triple.get(\"answer\"));\n answer_triple.remove(\"answer\");\n obj.put(\"triple\", answer_triple);\n\n return obj;\n\n } catch (JSONException ex) {\n Logger.getLogger(ExternalKnowledgeDemoMain.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n return null;\n }", "private String convertResponseToString(BatchAnnotateImagesResponse response) {\n\n AnnotateImageResponse imageResponses = response.getResponses().get(0);\n\n List<EntityAnnotation> entity;\n\n String message = \"\";\n switch (api) {\n case \"LANDMARK_DETECTION\":\n entity = imageResponses.getLandmarkAnnotations();\n message = formatText(entity);\n break;\n\n case \"LOGO_DETECTION\":\n entity = imageResponses.getLogoAnnotations();\n message = formatText(entity);\n break;\n\n case \"SAFE_SEARCH_DETECTION\":\n SafeSearchAnnotation annotation = imageResponses.getSafeSearchAnnotation();\n message = formatImageText(annotation);\n break;\n\n case \"IMAGE_PROPERTIES\":\n ImageProperties imageProperties = imageResponses.getImagePropertiesAnnotation();\n message = formatImageProp(imageProperties);\n break;\n\n case \"LABEL_DETECTION\":\n entity = imageResponses.getLabelAnnotations();\n message = formatText(entity);\n break;\n\n }\n\n return message;\n }", "private QueryResponse query(Query query) throws ElasticSearchException{\r\n\t\tQueryResponse response = executor.executeQuery(query);\r\n\t\tresponse.setObjectMapper(mapper);\r\n\t\treturn response;\t\t\r\n\t}", "@Override\n public String toString() {\n return \"Query: QueryID=\" +this.getQueryID()+ \" ReqPosts=\" + this.getRequestedPosts();\n }", "public String getResponse(String query) throws RmesException {\n\t\treturn repositoryUtils.getResponse(query, repositoryUtils.initRepository(config.getRdfServerPublication(), config.getRepositoryIdPublication()));\n\t}", "public void query()\n\t{\n\t\tJSONObject queryInfo = new JSONObject();\n\t\t\n\t\ttry\n\t\t{\n\t\t\tqueryInfo.put(\"type\", \"query\");\n\t\t\t\n\t\t\tos.println(queryInfo.toString());\n\t\t\tos.flush();\n\t\t\t\n\t\t\tSystem.out.println(\"send query request : \" + queryInfo.toString());\n\t\t}\n\t\tcatch (JSONException e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void queryResult(HttpServletRequest request,\n\t\t\tHttpServletResponse response) {\n\t\ttry {\n\t\t\tresponse.setContentType(\"text/html;charset=UTF-8\");\n\t\t\tString dealNo = request.getParameter(\"dealNo\");\n\t\t\tString bankNo = request.getParameter(\"bankNo\");\n\t\t\tString result = \"\";\n\t\t\tGZHQueryService gzhQueryService = new GZHQueryService();\n\t\t\tSystem.out.println(\"银行号:\" + bankNo);\n\t\t\tlogger.info(\"银行号:\" + bankNo);\n\t\t\tif (\"0\".equals(bankNo)) {\n\t\t\t\tif (dealNo != null && dealNo.trim().length() > 0) {\n\t\t\t\t\tdealNo = dealNo.replaceAll(\" \", \"\");\n\t\t\t\t\tList<MoneyDataInfo> moneyDataList = null;\n\n\t\t\t\t\tif (dealNo.indexOf(\"*\") > -1) {\n\t\t\t\t\t\tdealNo = dealNo.replace(\"*\", \"_\");\n\t\t\t\t\t\tmoneyDataList = gzhQueryService\n\t\t\t\t\t\t\t\t.getMoneyDataListByLike(dealNo);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tmoneyDataList = gzhQueryService\n\t\t\t\t\t\t\t\t.getMoneyDataList(dealNo);\n\t\t\t\t\t}\n\t\t\t\t\tif (moneyDataList != null && moneyDataList.size() > 0) {\n\t\t\t\t\t\tGson gson = new Gson();\n\t\t\t\t\t\tString jsonMonList = gson.toJson(moneyDataList);\n\t\t\t\t\t\tresponse.getWriter().write(jsonMonList);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tBankInfo bank = gzhQueryService.getBankInfo(bankNo).get(0);\n\t\t\t\tCxfUtil cxfUtil = new CxfUtil();\n\t\t\t\tif (bank != null) {\n\t\t\t\t\tIgzhQuery service = cxfUtil\n\t\t\t\t\t\t\t.getCxfClient(\n\t\t\t\t\t\t\t\t\tIgzhQuery.class,\n\t\t\t\t\t\t\t\t\tcxfUtil.getUrl(bank.getIpAddr(),\n\t\t\t\t\t\t\t\t\t\t\tcxfUtil.getPort()));\n\t\t\t\t\tcxfUtil.recieveTimeOutWrapper(service);\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tresult = service.gzhQueryList(dealNo);\n\t\t\t\t\t} catch (Exception ex) {\n\t\t\t\t\t\tlogger.info(\"连接服务器失败!\");\n\t\t\t\t\t\tresponse.setContentType(\"text/html;charset=UTF-8\");\n\t\t\t\t\t\tresponse.getWriter().write(\"notfound\");\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tif (!\"\".equals(result)) {\n\t\t\t\t\t\tresponse.getWriter().write(result);\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tresponse.setContentType(\"text/html;charset=UTF-8\");\n\t\t\tresponse.getWriter().write(\"notfound\");\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private static List<MapValue> display(NoSQLHandle handle,String query) throws Exception {\n \n \n \n QueryRequest queryRequest = new QueryRequest().setStatement(query);\n queryRequest.setLimit(1000);\n //q=q+String.valueOf(queryRequest.getLimit())+\"\\\\\\\\\\\\\"+String.valueOf(queryRequest.getMaxReadKB());\n String results1=null;\n List<MapValue> results=new ArrayList<>();\n QueryResult queryResult=null;\n do{\n queryResult = handle.query(queryRequest);\n results = queryResult.getResults();\n results1=results1+results.toString();\n }while (!queryRequest.isDone());\n \n return results;\n \n\n }", "public QueryResponse query(PqlQuery query) {\n return query(query, QueryOptions.defaultOptions());\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}", "String responseToString(MovilizerResponse response);", "private void printResponseDetails(\n MutateGoogleAdsRequest request, MutateGoogleAdsResponse response) {\n // Parse the Mutate response to print details about the entities that were removed and/or\n // created in the request.\n for (int i = 0; i < response.getMutateOperationResponsesCount(); i++) {\n MutateOperation operationRequest = request.getMutateOperations(i);\n MutateOperationResponse operationResponse = response.getMutateOperationResponses(i);\n\n if (operationResponse.getResponseCase()\n != ResponseCase.ASSET_GROUP_LISTING_GROUP_FILTER_RESULT) {\n String entityName = operationResponse.getResponseCase().toString();\n // Trim the substring \"_RESULT\" from the end of the entity name.\n entityName = entityName.substring(0, entityName.lastIndexOf(\"_RESULT\"));\n System.out.printf(\"Unsupported entity type: %s%n\", entityName);\n }\n\n String resourceName =\n operationResponse.getAssetGroupListingGroupFilterResult().getResourceName();\n AssetGroupListingGroupFilterOperation assetOperation =\n operationRequest.getAssetGroupListingGroupFilterOperation();\n\n String operationType =\n StringUtils.capitalize(assetOperation.getOperationCase().toString().toLowerCase());\n System.out.printf(\n \"%sd a(n) AssetGroupListingGroupFilter with resource name: '%s'%n\",\n operationType, resourceName);\n }\n }", "private static String print(final ResultSet res) throws Exception {\n final StringBuilder sb = new StringBuilder();\n final ResultSetMetaData md = res.getMetaData();\n for(int i = 0; i < md.getColumnCount(); ++i) {\n sb.append(' ');\n sb.append(md.getColumnName(i + 1));\n sb.append(\" |\");\n }\n sb.append('\\n');\n while(res.next()) {\n for(int i = 0; i < md.getColumnCount(); ++i) {\n sb.append(' ');\n sb.append(res.getString(i + 1));\n sb.append(\" |\");\n }\n sb.append('\\n');\n }\n return sb.toString();\n }", "@Get\n\tpublic Representation represent() throws JSONException {\n\n\t\tString Message = \"\";\n\t\tint Status = 0;\n\t\tJSONObject jBody = new JSONObject();\n\t\t\n\t\tString ServerKey = \"\";\n\t\tif (getRequest().getAttributes().get(\"ServerKey\") != null ) ServerKey = (String) getRequest().getAttributes().get(\"ServerKey\");\n\t\tServerAuth serverAuth = new ServerAuth();\n\t\tboolean Authenticated = serverAuth.authenticate(ServerKey);\n\n\t\tif (Authenticated){\n\t\t\tString LookupType = \"\";\n\t\t\tif (getRequest().getAttributes().get(\"lookuptype\") != null ) LookupType = (String) getRequest().getAttributes().get(\"lookuptype\");\n\t\t\tString Partial = \"\";\n\t\t\tif (getRequest().getAttributes().get(\"partial\") != null ) Partial = (String) getRequest().getAttributes().get(\"partial\");\n\t\n\t\t\t\n\t\t\tString dbType = \"\";\n\t\t\tString sqlStatement = \"\";\n\t\t\t\n\t\t\tPartial = Partial.replace(\"%20\",\" \"); //unencode space character\n\t\t\tif (LookupType.equals(\"reactions\")){\n\t\t\t\tsqlStatement = \"select reaction from reactions \";\n\t\t\t\tif (!Partial.equals(\"\")){\n\t\t\t\t\tsqlStatement += \"where reaction like '%\" + Partial + \"%' \";\n\t\t\t\t}\n\t\t\t\tsqlStatement += \"order by reaction\";\n\t\t\t}\n\t\t\tif (LookupType.equals(\"drugs\")){\n\t\t\t\tsqlStatement = \"select drugname from drugs \";\n\t\t\t\tif (!Partial.equals(\"\")){\n\t\t\t\t\tsqlStatement += \"where drugname like '%\" + Partial + \"%' \";\n\t\t\t\t}\n\t\t\t\tsqlStatement += \"order by drugname\";\n\t\t\t}\n\t\n\t\t\t\tif (logger.isDebugEnabled()){\n\t\t\t\t\tlogger.debug(\"sqlStatement: \" + sqlStatement);\n\t\t\t\t}\n\n\t\t\tDBTableJNDI dbTable = new DBTableJNDI();\n\t\t\tdbTable = dbTable.getDBTableResults(sqlStatement, dbType);\n\t\t\tOutputFormatter formatter = new OutputFormatter();\n\t\t\tJSONArray jResults = formatter.getJsonArray(dbTable);\n\t\t\t\n\t\t\tMessage = \"\";\n\t\t\tStatus = 0;\n\t\t\tjBody.put(\"results\", jResults);\n\t\t} else {\n\t\t\tStatus = 1;\n\t\t\tMessage = \"invalid authentication token\";\n\t\t}\n\t\tResponseJson jResponse = new ResponseJson();\n\t\tRepresentation rep = null;\n\t\tjResponse.setStatusCode(Status);\n\t\tjResponse.setStatusMessage(Message);\n\t\tjResponse.setBody(jBody);\n\t\trep = new JsonRepresentation(jResponse.getResponse(jResponse));\n\t\treturn rep;\n\t}", "private static void printResponse(GetReportsResponse response) {\n\n for (Report report: response.getReports()) {\n ColumnHeader header = report.getColumnHeader();\n List<String> dimensionHeaders = header.getDimensions();\n List<MetricHeaderEntry> metricHeaders = header.getMetricHeader().getMetricHeaderEntries();\n List<ReportRow> rows = report.getData().getRows();\n\n if (rows == null) {\n System.out.println(\"No data found for \" + VIEW_ID);\n return;\n }\n\n for (ReportRow row: rows) {\n List<String> dimensions = row.getDimensions();\n List<DateRangeValues> metrics = row.getMetrics();\n for (int i = 0; i < dimensionHeaders.size() && i < dimensions.size(); i++) {\n System.out.println(dimensionHeaders.get(i) + \": \" + dimensions.get(i));\n }\n\n for (int j = 0; j < metrics.size(); j++) {\n System.out.print(\"Date Range (\" + j + \"): \");\n DateRangeValues values = metrics.get(j);\n for (int k = 0; k < values.getValues().size() && k < metricHeaders.size(); k++) {\n System.out.println(metricHeaders.get(k).getName() + \": \" + values.getValues().get(k));\n }\n }\n }\n }\n }", "public static void printQuery(JcQuery query, QueryToObserve toObserve, Format format) {\n\t\tboolean titlePrinted = false;\n\t\tContentToObserve tob = QueriesPrintObserver.contentToObserve(toObserve);\n\t\tif (tob == ContentToObserve.CYPHER || tob == ContentToObserve.CYPHER_JSON) {\n\t\t\ttitlePrinted = true;\n\t\t\tQueriesPrintObserver.printStream.println(\"#QUERY: \" + toObserve.getTitle() + \" --------------------\");\n\t\t\t// map to Cypher\n\t\t\tQueriesPrintObserver.printStream.println(\"#CYPHER --------------------\");\n\t\t\tString cypher = iot.jcypher.util.Util.toCypher(query, format);\n\t\t\tQueriesPrintObserver.printStream.println(\"#--------------------\");\n\t\t\tQueriesPrintObserver.printStream.println(cypher);\n\t\t\tQueriesPrintObserver.printStream.println(\"\");\n\t\t}\n\t\tif (tob == ContentToObserve.JSON || tob == ContentToObserve.CYPHER_JSON) {\n\t\t\t// map to JSON\n\t\t\tif (!titlePrinted)\n\t\t\t\tQueriesPrintObserver.printStream.println(\"#QUERY: \" + toObserve.getTitle() + \" --------------------\");\n\t\t\tString json = iot.jcypher.util.Util.toJSON(query, format);\n\t\t\tQueriesPrintObserver.printStream.println(\"#JSON --------------------\");\n\t\t\tQueriesPrintObserver.printStream.println(json);\n\t\t\t\n\t\t\tQueriesPrintObserver.printStream.println(\"\");\n\t\t}\n\t}", "public String query() {\n return this.query;\n }", "@JsonIgnore\n public String getQuery() {\n return _query;\n }", "public synchronized String querySearch(String query) {\n Set<Restaurant> matching;\n try {\n matching = getMatches(query);\n } catch (IllegalArgumentException e) {\n return \"ERR: INVALID_QUERY\";\n }\n if (matching.isEmpty()) {\n return \"ERR: NO_MATCH\";\n } else {\n return gson.toJson(matching);\n }\n }", "String responseErrorsToString(MovilizerResponse response);", "@POST\n public String SendQueryResult(String data) throws JsonProcessingException {\n ObjectMapper objectMapper = new ObjectMapper();\n InputQueryData inputQueryData = new ObjectMapper().readValue(data, InputQueryData.class);\n// System.out.println(inputQueryData.getTableName());\n// System.out.println(inputQueryData.getSelectedColumns());\n// System.out.println(inputQueryData.getWhereConditionSelectedColumns());\n// System.out.println(inputQueryData.getWhereConditionSelectedValues());\n\n\n ManageFact manageFact = new ManageFact();\n\n String resultQuery = manageFact.QueryGenerator(inputQueryData.getTableName(), inputQueryData.getSelectedColumns(), inputQueryData.getWhereConditionSelectedColumns(), inputQueryData.getWhereConditionSelectedValues(),inputQueryData.getGroupByColumns());\n\n\n\n\n return objectMapper.writeValueAsString(resultQuery);\n }", "private synchronized String processGet(String query) {\r\n\t\tString[] valuesCommand = query.split(\" \");\r\n\t\tif ( valuesCommand.length != 2 )\r\n\t\t\treturn \"ERROR Bad syntaxe command GET - Usage : GET id\";\r\n\t\tString id = valuesCommand[1];\r\n\t\tif ( !this.bank.existAccount(id) ) {\r\n\t\t\treturn \"ERROR Account doesn't exist\";\r\n\t\t}\r\n\t\tdouble solde = this.bank.getSolde(id);\r\n\t\treturn \"SOLDE \" + solde + \" \" + this.bank.getLastOperation(id);\r\n\t}", "@Override\r\n public void onShowQueryResult() {\n }", "public static void printQueries(List<JcQuery> queries, QueryToObserve toObserve, Format format) {\n\t\tboolean titlePrinted = false;\n\t\tContentToObserve tob = QueriesPrintObserver.contentToObserve(toObserve);\n\t\tif (tob == ContentToObserve.CYPHER || tob == ContentToObserve.CYPHER_JSON) {\n\t\t\ttitlePrinted = true;\n\t\t\tQueriesPrintObserver.printStream.println(\"#QUERIES: \" + toObserve.getTitle() + \" --------------------\");\n\t\t\t// map to Cypher\n\t\t\tQueriesPrintObserver.printStream.println(\"#CYPHER --------------------\");\n\t\t\tfor(int i = 0; i < queries.size(); i++) {\n\t\t\t\tString cypher = iot.jcypher.util.Util.toCypher(queries.get(i), format);\n\t\t\t\tQueriesPrintObserver.printStream.println(\"#--------------------\");\n\t\t\t\tQueriesPrintObserver.printStream.println(cypher);\n\t\t\t}\n\t\t\tQueriesPrintObserver.printStream.println(\"\");\n\t\t}\n\t\tif (tob == ContentToObserve.JSON || tob == ContentToObserve.CYPHER_JSON) {\n\t\t\t// map to JSON\n\t\t\tif (!titlePrinted)\n\t\t\t\tQueriesPrintObserver.printStream.println(\"#QUERIES: \" + toObserve.getTitle() + \" --------------------\");\n\t\t\tString json = iot.jcypher.util.Util.toJSON(queries, format);\n\t\t\tQueriesPrintObserver.printStream.println(\"#JSON --------------------\");\n\t\t\tQueriesPrintObserver.printStream.println(json);\n\t\t\t\n\t\t\tQueriesPrintObserver.printStream.println(\"\");\n\t\t}\n\t}", "public String create(ResultSet results,String msg,ResponseFormat format){\n\t\tSystem.out.println(\"create [format:\"+format+\"]\");\n\t\tif(format.equals(ResponseFormat.XML)){\n\t\t\tSystem.out.println(\"FORMAT is XML\");\n\t\t\treturn createXMLresult(results, msg);\n\t\t}else { // DEFAULT TO JSON\n\t\t\tSystem.out.println(\"DEFAULTING FORMAT to JSON\");\n\t\t\treturn createJSONresult(results, msg);\n\t\t}\n\t}", "@Override\r\n\tpublic String showResult() {\n\t\treturn rps.toString();\r\n\t}", "public QueryResponse query(PqlQuery query, QueryOptions options) {\n Span span = this.tracer.buildSpan(\"Client.Query\").start();\n try {\n QueryRequest request = QueryRequest.withQuery(query);\n request.setRetrieveColumnAttributes(options.isColumns());\n request.setExcludeRowAttributes(options.isExcludeAttributes());\n request.setExcludeColumns(options.isExcludeColumns());\n request.setShards(options.getShards());\n return queryPath(request);\n } finally {\n span.finish();\n }\n }", "public String toQuery() {\n // determine ordering\n String ordering = \"\";\n if (ratingFirst) {\n ordering += \"ORDER BY rating\" + (ratingDescend ? \" DESC, \" : \", \") +\n (nameDescend ? \"make DESC, model DESC, year DESC\" : \"make, model, year\");\n } else {\n ordering += \"ORDER BY \" + (nameDescend ? \"make DESC, model DESC, year DESC\" : \"make, model, year\")\n + \", rating\" + (ratingDescend ? \" DESC\" : \"\");\n }\n\n // determine pagination offsets\n String pagination = \"\";\n if (pageNumber > 1) {\n pagination += \"\\nLIMIT 100\\nOFFSET \" + (convertToBase() - 1) * 100 + \";\";\n }\n\n return query + ordering + pagination;\n }", "@Get\n\tpublic Representation represent() throws JSONException {\n\n\t\tJSONObject jBody = new JSONObject();\n\t\tJSONObject ReportOutput = new JSONObject();\n\t\tString Message = \"\";\n\t\tint Status = 0;\n\t\ttry {\n\n\t\t\tString ServerKey = \"\";\n\t\t\tif (getRequest().getAttributes().get(\"ServerKey\") != null) ServerKey = (String) getRequest().getAttributes().get(\"ServerKey\");\n\t\t\tServerAuth serverAuth = new ServerAuth();\n\t\t\tboolean Authenticated = serverAuth.authenticate(ServerKey);\n\n\t\t\tif (Authenticated) {\n\t\t\t\tString ReactionList = \"\";\n\t\t\t\tif (getRequest().getAttributes().get(\"reactionlist\") != null) ReactionList = (String) getRequest().getAttributes().get(\"reactionlist\");\n\t\t\t\tReactionList = ReactionList.replace(\"%7E\",\"~\"); //unencode tilda character\n\t\t\t\tString[] reactions = ReactionList.split(\"~\");\n\t\t\t\tString Reaction = \"\";\n\t\t\t\tfor (int r = 0; r < reactions.length; r++) {\n\t\t\t\t\tReaction += \"patient.reaction.reactionmeddrapt:\\\"\" + reactions[r] + \"\\\"\";\n\t\t\t\t\tif (r < reactions.length - 1) {\n\t\t\t\t\t\tReaction += \"+AND+\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tString ServiceURI = \"/event.json?search=\" + Reaction + \"&count=patient.drug.openfda.substance_name.exact\";\n\t\t\t\tif (logger.isDebugEnabled()){\n\t\t\t\t\tlogger.debug(\"ServiceURI: \" + ServiceURI);\n\t\t\t\t}\n\n\t\t\t\tJSONArray cols = new JSONArray();\n\t\t\t\tJSONArray rows = new JSONArray();\n\t\t\t\tOpenFDAClient restClient = new OpenFDAClient();\n\t\t\t\tJSONObject json = restClient.getService(ServiceURI);\n\t\t\t\tif (!json.isNull(\"results\")){\n\t\t\t\t\tJSONArray results = json.getJSONArray(\"results\");\n\t\t\t\t\tcols.put(\"Drug Name\");\n\t\t\t\t\tcols.put(\"Occurrences\");\n\t\t\t\t\tfor (int i = 0; i < results.length(); i++) {\n\t\t\t\t\t\tJSONArray row = new JSONArray();\n\t\t\t\t\t\tJSONObject result = results.getJSONObject(i);\n\t\t\t\t\t\tString Drug = result.getString(\"term\");\n\t\t\t\t\t\tint Occurrences = result.getInt(\"count\");\n\t\t\t\t\t\trow.put(Drug);\n\t\t\t\t\t\trow.put(Occurrences);\n\t\t\t\t\t\trows.put(row);\n\t\t\t\t\t}\n\t\t\t\t\tReportOutput.put(\"cols\", cols);\n\t\t\t\t\tReportOutput.put(\"rows\", rows);\n\t\t\t\t} else {\n\t\t\t\t\tReportOutput.put(\"cols\", cols);\n\t\t\t\t\tReportOutput.put(\"rows\", rows);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tStatus = 1;\n\t\t\t\tMessage = \"invalid authentication token\";\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\tStatus = 1;\n\t\t\tMessage = \"an error has occurred: \" + e;\n\t\t}\n\n\t\tjBody.put(\"ReportOutput\", ReportOutput);\n\t\tResponseJson jResponse = new ResponseJson();\n\t\tRepresentation rep = null;\n\t\tjResponse.setStatusCode(Status);\n\t\tjResponse.setStatusMessage(Message);\n\t\tjResponse.setBody(jBody);\n\t\trep = new JsonRepresentation(jResponse.getResponse(jResponse));\n\t\treturn rep;\n\t}", "public String printResult() {\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tsb.append(printStartNumberAndName() + \"; \");\n\t\tsb.append(printInfo());\n\n\t\tsb.append(printTotalTime() + \"; \");\n\n\t\tsb.append(getStartTime() + \"; \");\n\t\tsb.append(getFinishTime());\n\t\n\t\tsb.append(errorHandler.print());\n\t\t\n\t\treturn sb.toString();\n\t}", "@Override\n\tpublic ZsPkgSearchReply respFormat(byte[] result) {\n\t\treturn null;\n\t}", "public String getResponseInternalPublication(String query) throws RmesException {\n\t\treturn repositoryUtils.getResponse(query, repositoryUtils.initRepository(config.getRdfServerPublicationInterne(), config.getRepositoryIdPublicationInterne()));\n\t}", "String query();", "private void printResultSet(ResultSet rs) {\n\t\twhile(rs.hasNext()) {\t\n\t\t\tQuerySolution qs = rs.next();\n\t\t\tSystem.out.println(qs.toString());\n\t\t}\n\t\tSystem.out.println(\"------\");\n\t}", "java.lang.String getResponse();", "public String idLookupResponse(String id, String fieldList) throws Exception {\n SolrQuery solrQuery = new SolrQuery();\n solrQuery.set(\"rows\", \"1\");\n solrQuery.set(\"q\", \"id:\\\"\" + id + \"\\\"\");\n solrQuery.set(\"wt\", \"json\");\n solrQuery.set(\"q.op\", \"AND\");\n solrQuery.set(\"indent\", \"true\");\n solrQuery.set(\"facet\", \"false\");\n \n if (fieldList!= null) {\n solrQuery.set(\"fl\",fieldList); \n }\n \n NoOpResponseParser rawJsonResponseParser = new NoOpResponseParser();\n rawJsonResponseParser.setWriterType(\"json\");\n\n QueryRequest req = new QueryRequest(solrQuery);\n req.setResponseParser(rawJsonResponseParser);\n SolrUtils.setSolrParams(solrQuery);\n NamedList<Object> resp = solrServer.request(req);\n String jsonResponse = (String) resp.get(\"response\");\n return jsonResponse;\n }", "public final String toString() {\n String myReturn = \"Report \\\"\" + this.name + \"\\\" with query \\\"\"\n + this.query + \"\\\".\";\n return myReturn;\n }", "private String queryDatabase() {\n\t\t\t\n\t\t\tString result = \"\";\t\t\t\t\t\t\t\t\t\t// will hold the json string to be returned\n\t \tInputStream isr = null;\t\t\t\t\t\t\t\t\t// used when converting the response to a string\n\t \t\n\t \ttry{\t// set up the http POST\n\t HttpClient httpclient = new DefaultHttpClient();\n\t HttpPost httppost = new HttpPost(\"http://www.christmasgiftideas.eu/widgetQuery.php\"); //YOUR PHP SCRIPT ADDRESS \n\n\t HttpResponse response = httpclient.execute(httppost);\t\t\t\t\t// execute the request and store response\n\t HttpEntity entity = response.getEntity();\n\t isr = entity.getContent();\n\t }\n\t catch(Exception e){\n\t Log.e(\"log_tag\", \"Error in http connection \"+e.toString());\n\t }\n\t \t\n\t // convert response to string\n\t try{\n\t \tBufferedReader reader = new BufferedReader(new InputStreamReader(isr,\"iso-8859-1\"),8);\n\t \tStringBuilder sb = new StringBuilder();\n\t \tString line = null;\n\t \twhile ((line = reader.readLine()) != null) {\n\t \t\tsb.append(line + \"\\n\");\n\t }\n\t \tisr.close();\n\t result=sb.toString();\n\t \t}\n\t \tcatch(Exception e){\n\t \t\tLog.e(\"log_tag\", \"Error converting result \"+e.toString());\n\t \t}\n\t \n\t \treturn result;\t\t// return the json string\n\t}", "public String getQuery(){\n return this.query;\n }", "@GetMapping(\"/query\")\n public String query(String query)\n {\n String returnVal;\n return returnVal;\n }", "public static void showResultPerson( Result<Record> result){\n \t for (Record r : result) {\n// Integer id = r.getValue(PERSON.PERSO_ID);\n String firstName = r.getValue(PERSON.PERSO_FIRSTNAME);\n String lastName = r.getValue(PERSON.PERSO_LASTNAME);\n\n System.out.println(\"Name : \" + firstName + \" \" + lastName);\n }\n }", "private String getResponse()\n {\n System.out.println();\n System.out.println(\"Enter id number to look up, 'd' to display list, 'q' to quit\");\n System.out.print(\"Your choice: \");\n return scanner.nextLine();\n }", "private String doQueryById(HttpServletRequest request,\n HttpServletResponse response) {\n return null;\n }", "Query query();", "private QueryResult performMappedQuery() throws VizException {\n\n if (database == null) {\n throw new VizException(\"Database not specified for query\");\n }\n if (query == null) {\n throw new VizException(\"Cannot execute null query\");\n }\n\n QlServerRequest request = new QlServerRequest(query);\n request.setDatabase(database);\n request.setType(QueryType.QUERY);\n request.setParamMap(paramMap);\n\n // set the mode so the handler knows what to do\n if (queryLanguage == null) {\n throw new VizException(\"Query language not specified\");\n } else if (queryLanguage.equals(QueryLanguage.HQL)) {\n request.setLang(QlServerRequest.QueryLanguage.HQL);\n } else {\n request.setLang(QlServerRequest.QueryLanguage.SQL);\n }\n\n // create request object\n QueryResult retVal = null;\n // get result\n AbstractResponseMessage response = (AbstractResponseMessage) ThriftClient\n .sendRequest(request);\n\n if (response instanceof ResponseMessageGeneric) {\n retVal = (QueryResult) ((ResponseMessageGeneric) response)\n .getContents();\n\n } else if (response instanceof ResponseMessageError) {\n ResponseMessageError rme = (ResponseMessageError) response;\n VizServerSideException innerException = new VizServerSideException(\n rme.toString());\n throw new VizServerSideException(rme.getErrorMsg(), innerException);\n }\n\n return retVal;\n }", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public String consultarSolicitudes()\n {\n Object objeto = sdao.consultaGeneral();\n return gson.toJson(objeto);\n }", "protected void doQuery(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\n\r\n\t\tPrintWriter out = response.getWriter();\r\n\r\n\t\tint orderNo = 1;\r\n\t\t// System.out.println(\"jinlaile\");\r\n\t\t// System.out.println(request.getParameter(\"orderNo\"));\r\n\t\tString orderNoStr = request.getParameter(\"orderNo\");\r\n\r\n\t\tif (null == orderNoStr || \"\".equals(orderNoStr)) {\r\n\t\t} else {\r\n\t\t\torderNo = Integer.parseInt(orderNoStr);\r\n\t\t}\r\n\r\n\t\tList<LogisticsBean> list = ls.queryTruckRoutingByOrderNo(orderNo);\r\n\t\tfor (LogisticsBean logisticsBean : list) {\r\n\t\t\tSystem.out.println(logisticsBean);\r\n\t\t}\r\n\r\n\t\tGson gson = new Gson();\r\n\t\tString jsonString = gson.toJson(list);\r\n\r\n\t\tout.println(jsonString);\r\n\t\tout.close();\r\n\r\n\t\t// 将查询的关键字也存储起来 传递到jsp\r\n\t\t// request.setAttribute(\"logistics\", list);\r\n\r\n\t\t// 转发到页面\r\n\t\t// request.getRequestDispatcher(\"follow.jsp\").forward(request, response);\r\n\t}", "public String toString() {\n return weight + \"\\t\" + query;\n }", "<Q, R> CompletableFuture<QueryResponseMessage<R>> query( QueryMessage<Q, R> query );", "public abstract String createQuery();", "void displayData(SchoolDetailResponse schoolDetailResponse);", "public String getResponce() {\r\n\t\t// raw version of qry string\r\n\t\tString qry = \"https://slack.com/api/users.info?token=\" + this.Token + \"&user=\" + this.ID + \"&pretty=1\";\r\n\t\tURL obj;\r\n\t\ttry {\r\n\t\t\tobj = new URL(qry);\r\n\t\t\tHttpURLConnection con;\r\n\t\t\ttry {\r\n\t\t\t\tcon = (HttpURLConnection) obj.openConnection();\r\n\t\t\t\tcon.setRequestMethod(\"GET\");\r\n\t\t\t\t// add request header\r\n\t\t\t\tcon.setRequestProperty(\"User-Agent\", \"Mozilla/5.0\");\r\n\t\t\t\tint responseCode = con.getResponseCode();\r\n\t\t\t\t// System.out.println(\"\\nSending 'GET' request to URL : \" + qry);\r\n\t\t\t\t// System.out.println(\"Response Code : \" + responseCode);\r\n\t\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\r\n\t\t\t\tString inputLine;\r\n\t\t\t\tStringBuffer response = new StringBuffer();\r\n\t\t\t\twhile ((inputLine = in.readLine()) != null) {\r\n\t\t\t\t\tresponse.append(inputLine);\r\n\t\t\t\t}\r\n\t\t\t\tin.close();\r\n\t\t\t\t// print in String\r\n\t\t\t\t// System.out.println(response.toString());\r\n\t\t\t\treturn response.toString();\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\r\n\t\t} catch (MalformedURLException 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 \"FAILED!\";\r\n\r\n\t}", "@Override\n\tpublic String toString() {\n\t\treturn weight + \"\\t\" + query;\n\t}", "@RequestMapping(value = \"/queryrdf\", method = {RequestMethod.GET, RequestMethod.POST})\n public void queryRdf(@RequestParam(\"query\") final String query,\n @RequestParam(value = RdfCloudTripleStoreConfiguration.CONF_QUERY_AUTH, required = false) String auth,\n @RequestParam(value = RdfCloudTripleStoreConfiguration.CONF_CV, required = false) final String vis,\n @RequestParam(value = RdfCloudTripleStoreConfiguration.CONF_INFER, required = false) final String infer,\n @RequestParam(value = \"nullout\", required = false) final String nullout,\n @RequestParam(value = RdfCloudTripleStoreConfiguration.CONF_RESULT_FORMAT, required = false) final String emit,\n @RequestParam(value = \"padding\", required = false) final String padding,\n @RequestParam(value = \"callback\", required = false) final String callback,\n final HttpServletRequest request,\n final HttpServletResponse response) {\n SailRepositoryConnection conn = null;\n final Thread queryThread = Thread.currentThread();\n auth = StringUtils.arrayToCommaDelimitedString(provider.getUserAuths(request));\n final Timer timer = new Timer();\n timer.schedule(new TimerTask() {\n\n @Override\n public void run() {\n log.debug(\"interrupting\");\n queryThread.interrupt();\n\n }\n }, QUERY_TIME_OUT_SECONDS * 1000);\n\n try {\n final ServletOutputStream os = response.getOutputStream();\n conn = repository.getConnection();\n\n final Boolean isBlankQuery = StringUtils.isEmpty(query);\n final ParsedOperation operation = QueryParserUtil.parseOperation(QueryLanguage.SPARQL, query, null);\n\n final Boolean requestedCallback = !StringUtils.isEmpty(callback);\n final Boolean requestedFormat = !StringUtils.isEmpty(emit);\n\n if (!isBlankQuery) {\n if (operation instanceof ParsedGraphQuery) {\n // Perform Graph Query\n final RDFHandler handler = new RDFXMLWriter(os);\n response.setContentType(\"text/xml\");\n performGraphQuery(query, conn, auth, infer, nullout, handler);\n } else if (operation instanceof ParsedTupleQuery) {\n // Perform Tuple Query\n TupleQueryResultHandler handler;\n\n if (requestedFormat && emit.equalsIgnoreCase(\"json\")) {\n handler = new SPARQLResultsJSONWriter(os);\n response.setContentType(\"application/json\");\n } else {\n handler = new SPARQLResultsXMLWriter(os);\n response.setContentType(\"text/xml\");\n }\n\n performQuery(query, conn, auth, infer, nullout, handler);\n } else if (operation instanceof ParsedUpdate) {\n // Perform Update Query\n performUpdate(query, conn, os, infer, vis);\n } else {\n throw new MalformedQueryException(\"Cannot process query. Query type not supported.\");\n }\n }\n\n if (requestedCallback) {\n os.print(\")\");\n }\n } catch (final Exception e) {\n log.error(\"Error running query\", e);\n throw new RuntimeException(e);\n } finally {\n if (conn != null) {\n try {\n conn.close();\n } catch (final RepositoryException e) {\n log.error(\"Error closing connection\", e);\n }\n }\n }\n\n timer.cancel();\n }", "private void sampleQuery(final SQLManager sqlManager, final HttpServletResponse resp)\n throws IOException {\n try (Connection sql = sqlManager.getConnection()) {\n\n // Execute the query.\n final String query = \"SELECT 'Hello, world'\";\n try (PreparedStatement statement = sql.prepareStatement(query)) {\n \n // Gather results.\n try (ResultSet result = statement.executeQuery()) {\n if (result.next()) {\n resp.getWriter().println(result.getString(1));\n }\n }\n }\n \n } catch (SQLException e) {\n LOG.log(Level.SEVERE, \"SQLException\", e);\n resp.getWriter().println(\"Failed to execute database query.\");\n }\n }", "private LogQueryResult\n\tconvertQueryResult( final AttributeList queryResult )\n\t{\n\t final AttributeList fieldAttrs = (AttributeList)((Attribute)queryResult.get( 0 )).getValue();\n\t final String[] fieldHeaders = new String[ fieldAttrs.size() ];\n\t assert( fieldHeaders.length == LogRecordFields.NUM_FIELDS );\n\t for( int i = 0; i < fieldHeaders.length; ++i )\n\t {\n\t final Attribute attr = (Attribute)fieldAttrs.get( i );\n\t fieldHeaders[ i ] = (String)attr.getValue();\n\t //System.out.println( fieldHeaders[ i ] );\n\t }\n\t \n\t // extract every record\n\t final List<List<Serializable>> records =\n\t TypeCast.asList( ((Attribute)queryResult.get( 1 )).getValue() );\n\t final LogQueryEntry[] entries = new LogQueryEntry[ records.size() ];\n\t for( int recordIdx = 0; recordIdx < records.size(); ++recordIdx )\n\t {\n\t final List<Serializable> record = records.get( recordIdx );\n\t TypeCast.checkList( record, Serializable.class );\n\t \n\t assert( record.size() == fieldHeaders.length );\n\t final Serializable[] fieldValues = new Serializable[ fieldHeaders.length ];\n\t for( int fieldIdx = 0; fieldIdx < fieldValues.length; ++fieldIdx )\n\t {\n\t fieldValues[ fieldIdx ] = record.get( fieldIdx );\n\t }\n\t \n\t entries[ recordIdx ] = new LogQueryEntryImpl( fieldValues );\n\t }\n\t \n\t return new LogQueryResultImpl( fieldHeaders, entries );\n\t}", "public String retrieveRecordedRequestsAndResponses(RequestDefinition requestDefinition, Format format) {\n HttpResponse httpResponse = sendRequest(\n request()\n .withMethod(\"PUT\")\n .withContentType(APPLICATION_JSON_UTF_8)\n .withPath(calculatePath(\"retrieve\"))\n .withQueryStringParameter(\"type\", RetrieveType.REQUEST_RESPONSES.name())\n .withQueryStringParameter(\"format\", format.name())\n .withBody(requestDefinition != null ? requestDefinitionSerializer.serialize(requestDefinition) : \"\", StandardCharsets.UTF_8),\n true\n );\n return httpResponse.getBodyAsString();\n }", "private void showJSON(String response){\n String fname=\"\";\n String lname=\"\";\n String rollno = \"\";\n String id = \"\";\n String emailid = \"\";\n String password = \"\";\n String phno = \"\";\n String year = \"\";\n String semester = \"\";\n String stream = \"\";\n\n\n try {\n\n // The Below Code Uses JSON to Fetch\n // Responce of the url we searched for and assigns\n // Index while fetching the inputs in the database\n JSONObject jsonObject = new JSONObject(response);\n JSONArray result = jsonObject.getJSONArray(Config.JSON_ARRAY);\n JSONObject collegeData = result.getJSONObject(0);\n fname = collegeData.getString(Config.KEY_fname);\n lname = collegeData.getString(Config.KEY_lname);\n rollno = collegeData.getString(Config.KEY_rollno);\n id = collegeData.getString(Config.KEY_id);\n emailid = collegeData.getString(Config.KEY_emailid);\n password = collegeData.getString(Config.KEY_password);\n phno = collegeData.getString(Config.KEY_phno);\n year = collegeData.getString(Config.KEY_year);\n semester = collegeData.getString(Config.KEY_semester);\n stream = collegeData.getString(Config.KEY_stream);\n\n } catch (JSONException e) {\n e.printStackTrace();\n }\n\n textViewResult.setText(\"First Name :\\t\"+fname+\"\\nLast Name :\\t\" +lname+ \"\\nRoll Number :\\t\"+ rollno+\"\\nSystem ID :\\t\"+id+\"\\nEmail ID :\\t\"+emailid+\n \"\\nPassword :\\t\"+password+\"\\nPhone Number :\\t\"+phno+\"\\nYear :\\t\"+year+\"\\nSemester :\\t\"+semester+\"\\nStream :\\t\"+stream);\n }", "public static JSONObject getAnswerAsJson(String query) {\n try {\n JSONObject obj = new JSONObject();\n\n obj.put(\"source\", \"external\");\n\n // ==== Question Analysis Step ====\n QuestionAnalysis q_analysis = new QuestionAnalysis();\n q_analysis.analyzeQuestion(query);\n\n String question = q_analysis.getQuestion();\n\n obj.put(\"question\", question);\n\n JSONObject q_aErrorHandling = ModulesErrorHandling.questionAnalysisErrorHandling(q_analysis);\n\n if (q_aErrorHandling.getString(\"status\").equalsIgnoreCase(\"error\")) {\n return constructErrorJson(obj, q_aErrorHandling, \"questionAnalysis\");\n }\n\n String question_type = q_analysis.getQuestionType();\n\n obj.put(\"question_type\", question_type);\n\n // ==== Entities Detection Step ====\n EntitiesDetection entities_detection = new EntitiesDetection();\n String NEtool = \"both\";\n //String NEtool = \"scnlp\";\n //String NEtool = \"dbpedia\";\n // identify NamedEntities in the question using SCNLP and Spotlight\n entities_detection.identifyNamedEntities(question, NEtool);\n\n HashMap<String, String> entity_URI = entities_detection.extractEntitiesWithUris(question, NEtool);\n\n JSONObject e_dErrorHandling = ModulesErrorHandling.entitiesDetectionErrorHandling(entities_detection);\n\n if (e_dErrorHandling.getString(\"status\").equalsIgnoreCase(\"error\")) {\n return constructErrorJson(obj, e_dErrorHandling, \"entitiesDetection\");\n }\n\n obj.put(\"question_entities\", entity_URI.keySet());\n obj.put(\"retrievedEntities\", entity_URI);\n\n // ==== Answer Extraction Step ====\n AnswerExtraction answer_extraction = new AnswerExtraction();\n\n ArrayList<String> expansionResources = new ArrayList<>();\n expansionResources.add(\"lemma\");\n expansionResources.add(\"verb\");\n expansionResources.add(\"noun\");\n\n // Store the useful words of the question\n Set<String> useful_words = answer_extraction.extractUsefulWords(question, question_type, entity_URI.keySet(), expansionResources);\n\n answer_extraction.setUsefulWords(useful_words);\n\n String fact = answer_extraction.extractFact(useful_words);\n\n answer_extraction.retrieveCandidateTriplesOptimized(question_type, entity_URI, fact, useful_words.size(), \"max\");\n\n JSONObject a_eErrorHandling = ModulesErrorHandling.answerExtractionErrorHandling(answer_extraction, question_type, entity_URI);\n\n if (a_eErrorHandling.getString(\"status\").equalsIgnoreCase(\"error\")) {\n return constructErrorJson(obj, a_eErrorHandling, \"answerExtraction\");\n }\n\n obj.put(\"useful_words\", useful_words);\n\n JSONObject answer_triple = answer_extraction.extractAnswer(useful_words, fact, entity_URI, question_type);\n\n Logger.getLogger(ExternalKnowledgeDemoMain.class.getName()).log(Level.INFO, \"===== Answer: {0}\", answer_triple);\n\n obj.put(\"answer\", answer_triple.get(\"answer\"));\n answer_triple.remove(\"answer\");\n obj.put(\"triple\", answer_triple);\n\n return obj;\n\n } catch (JSONException ex) {\n Logger.getLogger(ExternalKnowledgeDemoMain.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n return null;\n }", "public String reformatDBObject(DBObject record);", "public String process(String query) {\r\n\t\tString command = query.split(\" \")[0].trim().toUpperCase();\r\n\t\tString response;\r\n\t\t\r\n\t\tswitch ( command ) {\r\n\t\t\tcase \"CREATE\":\r\n\t\t\t\tresponse = this.processCreate(query);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"GET\":\r\n\t\t\t\tresponse = this.processGet(query);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"ADD\":\r\n\t\t\t\tresponse = this.processAdd(query);\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"REMOVE\":\r\n\t\t\t\tresponse = this.processRemove(query);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tresponse = \"ERROR Unknow command - Available command CREATE, GET, ADD, REMOVE\\n\";\r\n\t\t}\r\n\t\t\r\n\t\treturn response;\r\n\t}", "public String toString() {\n return HTTP_VERSION + SP + code + SP + responseString;\n }", "public JSONObject getResponseAsObject(String query) throws RmesException {\n\t\treturn repositoryUtils.getResponseAsObject(query, repositoryUtils.initRepository(config.getRdfServerPublication(), config.getRepositoryIdPublication()));\n\t}", "public String getFullInfo(String id){\n\t\tString command = \"\";\r\n\t\t\r\n\t\tString Return = \"\";\r\n\t\tString TypeOfReturn = \"FullMovie>\\n\";\r\n\t\ttry{\r\n\t\t\t\r\n\t\t\tStatement dbStatement = conn.createStatement( ResultSet.TYPE_SCROLL_INSENSITIVE,\r\n\t\t\t\tResultSet.CONCUR_READ_ONLY );\r\n\r\n\t\t\tResultSet dbResults = dbStatement.executeQuery( command );\r\n\t\t\t\r\n\t\t\t// TODO: Add whatever data comes out of query\r\n\r\n\t\t\twhile( dbResults.next()){\r\n\t\t\t\tReturn += \"\\t<movieid></movieid>\\n\";\r\n\t\t\t\tReturn += \"\\t<title></title>\\n\";\r\n\t\t\t\tReturn += \"\\t<movieid></movieid>\\n\";\r\n\t\t\t\tReturn += \"\\t<movieid></movieid>\\n\";\r\n\t\t\t\tReturn += \"\\t<movieid></movieid>\\n\";\r\n\t\t\t\tReturn += \"\\t<movieid></movieid>\\n\";\r\n\t\t\t\tReturn += \"\\t<movieid></movieid>\\n\";\r\n\t\t\t\t// very simple results processing...\r\n\t\t\t}\r\n\t\t}catch( Exception x ){\r\n\t\t\tReturn = x.toString();\r\n\t\t\tError = x.toString();\r\n\t\t\tTypeOfReturn = \"Error>\";\r\n\t\t}\r\n\t\treturn \"<\" + TypeOfReturn + Return + \"</\" + TypeOfReturn + \"\\0\";\r\n\t\t\r\n\t}", "private DBObject queryMeta(String query,\n\t\t\tCollection<Entry<String, String>> tableDefs, boolean debug)\n\t\t\tthrows IOException, DeserializationException {\n\t\tListenableFuture<Response> response = asyncClient.preparePost(yqlBaseURI).setParameters(toParameterMap(query, tableDefs, debug)).execute();\n\t\t\n\t\tInputStream in = null;\n\t\ttry {\n\t\t\tin = response.get().getResponseBodyAsStream();\n\t\t\treturn parse(in);\n\t\t} catch (InterruptedException | ExecutionException e) {\n\t\t\tthrow new IOException(\"Unable to fetch date from YQL endpoint!\" ,e);\n\t\t} finally {\n\t\t\tif(in!=null) {\n\t\t\t\tin.close();\n\t\t\t}\n\t\t}\n\t}", "public String viewResponse(Response response) {\r\n this.currentResponse = response;\r\n return \"viewResponse\";\r\n }", "@Override\n public String toString(){\n String s;\n \n s = \"\\tparseOK: \" + parseOK + Constants.NL +\n \"\\trequest_uri: \" + request_uri + Constants.NL +\n \"\\tquery_string: \" + query_string + Constants.NL +\n \"\\trestAPIkeys: \" + restAPIkeys + Constants.NL +\n \"\\ttraceMsgQ: \" + traceMsgQ + Constants.NL;\n \n return s;\n }", "com.rpg.framework.database.Protocol.ResponseCode getResult();", "com.rpg.framework.database.Protocol.ResponseCode getResult();", "com.rpg.framework.database.Protocol.ResponseCode getResult();", "com.rpg.framework.database.Protocol.ResponseCode getResult();", "com.rpg.framework.database.Protocol.ResponseCode getResult();", "String getBarcharDataQuery();", "public String toString(){\n\t\tStringBuilder sb = new StringBuilder();\n\t\tString results = new String();\n\t\tsb.append(\"\\nUser information: \"+user.toString()+\"Guests Coming: \"+guests+\"\\nAttending Result: \"+result);\n\t\tsb.append(\"\\nInformation Meeting :\"+meeting.toString());\n\t\treturn sb.toString();\n\t}", "@SuppressWarnings(\"finally\")\n\t@Override\n\tpublic Response showName() {\n\t\tBaseResponse<NotifyTemplate> br = new BaseResponse<NotifyTemplate>();\n\t\ttry\n\t\t{\n\t\tList<NotifyTemplate> nameList;\n\t\tjdbcTemplate.setDataSource(dataSourceProvider.getDataSource(FiinfraConstants.BU_DEFAULT));\n\t\tnameList=jdbcTemplate.query(FiinfraConstants.SP_GET_NAME,new Object[]{} ,new BeanPropertyRowMapper<NotifyTemplate>(NotifyTemplate.class));\n\t\tbr.setResponseListObject(nameList);\n\t\tresponse=FiinfraResponseBuilder.getSuccessResponse(br, null);\n\t\t} \n\t\tcatch (DataAccessException e) {\n\t\t\tresponse = FiinfraResponseBuilder.getErrorResponse(e.getMessage().toString());\n\t\t} \n\t\tfinally\n\t\t{ \n\t\t\treturn response;\n\t\t\t\t} \n\t}", "public String susi(String query) throws Exception {\n\n \t\tthis.query = query;\n \t\tif (this.query != \"\") {\n \t\t\tString url = this.susiUrl + \"?q=\" +this.query;\n\n \t\t\tURL urlObj = new URL(url);\n HttpURLConnection con = (HttpURLConnection) urlObj.openConnection();\n\n con.setRequestMethod(\"GET\");\n\n con.setRequestProperty(\"User-Agent\", USER_AGENT);\n\n int responseCode = con.getResponseCode();\n String response = \"\";\n\t\t\tif (responseCode == 200) {\n response = buildReponse(con);\n\t\t\t} else {\n\t\t response = \"{'error': 'Looks like there is a problem in susi replying.'}\";\n\t\t\t}\n\n\t\t\treturn response;\n \t\t} else {\n \t\t\treturn \"{'error': 'Please ask susi something.'}\";\n \t\t}\n \t}", "private static String responseHandle(HttpResponse response)\n\t\t\tthrows IllegalStateException, IOException {\n\t\tHttpEntity entity = response.getEntity();\n\t\tif (entity != null) {\n\n\t\t\tInputStream inputStream = entity.getContent();\n\t\t\treturn ServerCommunicationREST.convertStreamToString(inputStream);\n\t\t} else\n\t\t\treturn \"\";\n\t}", "protected abstract String format();", "private void processLoupe(final HttpServletRequest request,\n final HttpServletResponse response) throws IOException {\n\n if (request.getSession() == null || request.getSession().isNew()) {\n return;\n }\n\n String dictionaryId = request.getParameter(\"dictionaryId\");\n String metadata = request.getParameter(\"metadata\");\n String searchColumn = request.getParameter(\"column\");\n String value = request.getParameter(\"value\");\n //ECG-323 non-latin chars don't work with GET method\n //getCharacterEncoding is UTF-8 but chars are encoded in\n //default ISO-8859-1\n if (value != null) {\n value = new String(value.getBytes(\"8859_1\"), \"UTF-8\");\n }\n String sDate = request.getParameter(\"date\");\n String languageCode = request.getParameter(\"languageCode\");\n String columns = \"null\".equalsIgnoreCase(request.getParameter(\"columns\")) ? null : request.getParameter(\"columns\");\n String sItemsStart = request.getParameter(\"itemsStart\");\n String sItemsOnPage = request.getParameter(\"itemsOnPage\");\n String sDisplayOnly = request.getParameter(\"displayOnly\");\n boolean strictValue = Boolean.valueOf(request.getParameter(\"strictValue\"));\n\n // It allows to take country code form pattern \"xx_XX\" e.g. \"en_EN\"\n String[] languageCodeArray = languageCode.split(\"_\");\n if (languageCodeArray.length == 2) {\n languageCode = languageCodeArray[1].toUpperCase();\n } else {\n languageCode = languageCodeArray[0].toUpperCase();\n }\n\n StringBuilder sb = new StringBuilder(\n \"Reference servlet query: dictionaryId=\");\n sb.append(dictionaryId);\n sb.append(\", column=\");\n sb.append(searchColumn);\n sb.append(\", metadata\");\n sb.append(metadata);\n sb.append(\", value=\");\n sb.append(value);\n sb.append(\", date=\");\n sb.append(sDate);\n sb.append(\", languageCode=\");\n sb.append(languageCode);\n sb.append(\", columns=\");\n sb.append(columns);\n sb.append(\", searchColumns=\");\n sb.append(searchColumn);\n sb.append(\", itemsStart=\");\n sb.append(sItemsStart);\n sb.append(\", itemsOnPage=\");\n sb.append(sItemsOnPage);\n sb.append(\", displayOnly=\");\n sb.append(sDisplayOnly);\n logger.finer(sb.toString());\n\n // parse date\n Date date;\n try {\n date = sDate != null ? new Date(Long.parseLong(sDate)) : null;\n } catch (Exception e) {\n logger.info(\"Cannot parse reference data date. \" + e.getMessage());\n generateDivInfo(response.getOutputStream(), request, \"error_taglib\");\n return;\n }\n\n // parse start index\n int itemsStart;\n try {\n itemsStart = sItemsStart != null ? Integer.parseInt(sItemsStart)\n : 0;\n } catch (Exception e) {\n logger.info(\"Cannot parse reference data start index. \"\n + e.getMessage());\n generateDivInfo(response.getOutputStream(), request, \"error_taglib\");\n return;\n }\n\n // parse items count\n int itemsOnPage;\n try {\n itemsOnPage = sItemsOnPage != null ? Integer.parseInt(sItemsOnPage)\n : 0;\n } catch (Exception e) {\n logger.info(\"Cannot parse reference data page size. \"\n + e.getMessage());\n generateDivInfo(response.getOutputStream(), request, \"error_taglib\");\n return;\n }\n\n // parse if display mode\n boolean displayOnly;\n try {\n displayOnly = sDisplayOnly != null ? Boolean\n .parseBoolean(sDisplayOnly) : false;\n } catch (Exception e) {\n logger.info(\"Cannot parse reference data display mode. \"\n + e.getMessage());\n generateDivInfo(response.getOutputStream(), request, \"error_taglib\");\n return;\n }\n\n if (itemsStart < 0) {\n itemsStart = 0;\n }\n\n QueryResult queryResult;\n try {\n\n referenceDataSource = RefDataHolder.getReferenceDataSource();\n\n queryResult = referenceDataSource.getItemsList(dictionaryId,\n searchColumn, value, date, languageCode, itemsStart,\n itemsOnPage, metadata, strictValue);\n\n if (queryResult == null) {\n logger.warning(\"Query Result for dictionary id: \"\n + dictionaryId + \" is null\");\n throw new ReferenceDataSourceInternalException(\n \"Null result returned\");\n }\n\n logger.info(\"Query result, totalCount=\"\n + queryResult.getTotalCount() + \", items.size=\"\n + queryResult.getItems().size() + \", itemsStart=\"\n + queryResult.getItemsStart());\n\n /**\n * Set columns names to be displayed in a table\n */\n String[] columnsList;\n // if columns are not set in taglib - use defult settings from\n // query results\n if (GenericValidator.isBlankOrNull(columns)) {\n // override columns list\n logger\n .finest(\"No columns defined in tag, using defaults from queryResult: \"\n + Arrays.toString(queryResult.getValidColumns()));\n columnsList = queryResult.getValidColumns();\n if (columnsList != null) {\n if (Arrays.asList(columnsList).contains(\"invalidForUE\") || Arrays.asList(columnsList).contains(\"invalidForCountries\")) {\n columnsList = new String[]{\"type\", \"grn\", \"number\", \"accessCode\"};\n }\n }\n } else {\n // by default columns in taglib are concatenated with ','\n columnsList = columns.split(\",\");\n }\n if (itemsOnPage <= 0) {\n itemsOnPage = queryResult.getItemsOnPage();\n }\n /**\n * render output\n */\n outputGenerator.generate(new RefDataPageContext(this,\n getServletContext(), request, response), response.getOutputStream(),\n queryResult, searchColumn, columnsList, itemsOnPage,\n displayOnly);\n\n } catch (ReferenceDataSourceInternalException e) {\n logger\n .log(Level.SEVERE, \"Internal exception: \" + e.getMessage(),\n e);\n generateDivInfo(response.getOutputStream(), request, \"internal_error\",\n languageCodeArray);\n response.setStatus(HttpServletResponse.SC_OK);\n return;\n } catch (NoSuchDictionaryException e) {\n logger.severe(\"Cannot find dictionary for id: \" + dictionaryId);\n if (dictionaryId != null && dictionaryId.startsWith(\"grn\")) {\n //no dictionary with grn defined\n generateDivInfo(response.getOutputStream(), request, \"error_dictionary_grn\",\n dictionaryId);\n } else if (dictionaryId != null && dictionaryId.startsWith(\"materials\")) {\n //no dictionary with materials defined\n generateDivInfo(response.getOutputStream(), request, \"error_dictionary_materials\",\n dictionaryId);\n } else if (dictionaryId != null && dictionaryId.startsWith(\"trader\")) {\n //no dictionary with trader defined\n generateDivInfo(response.getOutputStream(), request, \"error_dictionary_trader\",\n dictionaryId);\n } else {\n generateDivInfo(response.getOutputStream(), request, \"error_dictionary\",\n dictionaryId);\n }\n response.setStatus(HttpServletResponse.SC_OK);\n return;\n }\n\n }", "@Override\n\tpublic String ResponseToString() throws APIException \n\t{\n\t\tfor (Listener listen : listeners1)\n\t\t\tlisten.beforeResponseToString();\n\t\tString ResponseToString = \"\";\n\t\ttry\n\t\t{\n\t\t\tResponseToString=api.ResponseToString();\n\t\t}\n\t\tcatch(APIException e)\n\t\t{\n\t\t\tfor (Listener listen : listeners1)\n\t\t\t\tlisten.onError(e);\n\t\t\tthrow new APIException(e);\n\t\t}\n\t\tfor (Listener listen : listeners1)\n\t\t\tlisten.afterResponseToString();\n\t\treturn ResponseToString;\n\t}", "@Override\n\t\t\t\t\tpublic void handleResponse(String jsonResult, EHttpError error) {\n\t\t\t\t\t\tif(jsonResult!=null&&error == EHttpError.KErrorNone){\n\t\t\t\t\t\t\tSystem.out.println(\"发布书单\"+jsonResult);\n\t\t\t\t\t\t\tthis.completeListener.onQueryComplete(new QueryId(), jsonResult, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\tthis.completeListener.onQueryComplete(new QueryId(), null, error);\n\t\t\t\t\t\t}\n\t\t\t\t\t}", "public String aggregations(String query, String since, String until, String fields, String limit, String count)\n \t throws Exception {\n \t\tString apiUrl = \"api/search.json?\";\n\n \t\tthis.query = query;\n \t\tthis.since = since;\n \t\tthis.until = until;\n \t\tthis.fields = fields;\n \t\tthis.limit = limit == \"\" ? \"6\" : limit;\n \t\tthis.count = count == \"\" ? \"0\" : count;\n\n \t\tif (query != \"\") {\n \t\t\tapiUrl = apiUrl + \"query=\" + this.query;\n if (since != \"\") {\n \tapiUrl = apiUrl + \" since:\" + this.since;\n }\n if (until != \"\") {\n \tapiUrl = apiUrl + \" until:\" + this.until;\n }\n apiUrl = apiUrl + \"&source=cache\";\n apiUrl = apiUrl + \"&count=\" + this.count;\n if (fields != \"\") {\n \tapiUrl = apiUrl + \"&fields=\" + this.fields;\n }\n apiUrl = apiUrl + \"&limit=\" + this.limit;\n\n String url = this.baseUrl + apiUrl;\n\n URL urlObj = new URL(url);\n HttpURLConnection con = (HttpURLConnection) urlObj.openConnection();\n\n con.setRequestMethod(\"GET\");\n\n con.setRequestProperty(\"User-Agent\", USER_AGENT);\n\n int responseCode = con.getResponseCode();\n String response = \"\";\n\t\t\tif (responseCode == 200) {\n response = buildReponse(con);\n\t\t\t} else {\n\t\t response = \"{'error': 'Something went wrong, looks like the server is down.'}\";\n\t\t\t}\n\n\t\t\treturn response;\n \t\t} else {\n\t\t\treturn \"{'error': 'No Query string has been sent to query for an account'}\";\n\t\t}\n \t}", "<K, R extends IResponse> R query(IQueryRequest<K> queryRequest);", "public String printSortedResult() {\n\t\tStringBuilder sb = new StringBuilder();\n\n\t\tsb.append(printStartNumberAndName() + \"; \");\n\t\tsb.append(printInfo());\n\t\t\n\t\tsb.append(printTotalTime());\n\t\t\n\t\tsb.append(errorHandler.print());\n\t\t\n\t\treturn sb.toString();\n\t}", "public String reponse() {\n return reponseUtil.toLowerCase()\n .replace(\"[àâä]\", \"a\")\n .replace(\"[éèêë]\", \"e\")\n .replace(\"[îï]\", \"i\")\n .replace(\"[ôö]\", \"o\")\n .replace(\"[ùûü]\", \"u\")\n .replace(\"[ŷÿ]\", \"y\")\n .replace(\"[ç]\", \"c\");\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n String queryString = request.getParameter(\"queryString\");\n String returnTable = null;\n String error = null;\n\n SesameClient rdfClient = new SesameClient(sesameServerURl, repositoryID);\n try {\n rdfClient.Connect();\n TupleQueryResult result = rdfClient.executeQuery(queryString);\n List<String> bindingNames = result.getBindingNames();\n\n returnTable = \"<table border=1>\";\n returnTable = returnTable + \"<tr>\";\n for (int i = 0; i < bindingNames.size(); i++) {\n returnTable = returnTable + \"<td>\" + bindingNames.get(i) + \"</td>\";\n }\n returnTable = returnTable + \"</tr>\";\n int j=0;\n while (result.hasNext()) {\n BindingSet bindingSet = result.next();\n returnTable = returnTable + \"<tr>\";\n for (int i = 0; i < bindingNames.size(); i++) {\n if (bindingSet.getValue(bindingNames.get(i)) == null) {\n returnTable = returnTable + \"<td> </td>\";\n } else {\n String name= bindingNames.get(i);\n String bindValue = bindingSet.getValue(name).stringValue();\n returnTable = returnTable + \"<td>\" + bindValue + \"</td>\";\n }\n }\n returnTable = returnTable + \"</tr>\";\n j++;\n }\n result.close();\n returnTable = returnTable +j+\"Results found</table>\";\n } catch (OpenRDFException ex) {\n Logger.getLogger(MusicServlet.class.getName()).log(Level.SEVERE, null, ex);\n error = ex.getLocalizedMessage();\n } \n queryString = queryString.substring(queryString.lastIndexOf(\"#>\") + 2);\n\n request.setAttribute(\"queryString\", queryString);\n request.setAttribute(\"result\", returnTable);\n request.setAttribute(\"error\", error);\n\n\n RequestDispatcher rd = request.getRequestDispatcher(\"/index.jsp\");\n rd.forward(request, response);\n }", "private void handleQueryCommand(SlackMessageSender messageSender, String[] args) throws Exception {\n if (args != null && args.length > 0 && args[0].charAt(0) != '-') {\n args = new String[]{\"-tag\", args[0]};\n }\n\n LinkEntityCommand linkEntityCommand = parseLinkEntityCommand(args);\n if (logger.isDebugEnabled()) {\n logger.debug(\"## [Link query command] \" + linkEntityCommand);\n }\n\n String tagName = CollectionUtils.isEmpty(linkEntityCommand.getTagValues())\n ? null : linkEntityCommand.getTagValues().get(0);\n\n List<LinkEntity> links = linkService.queryByTagName(tagName);\n\n final int entityStringLength = 50;\n final String delimiter = \" \";\n StringBuilder message = new StringBuilder(entityStringLength * links.size());\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyy-MM-dd HH:mm:ss\");\n for (LinkEntity linkEntity : links) {\n message.append(\"[Id.title] : \")\n .append(linkEntity.getId()).append(\".\").append(linkEntity.getTitle()).append(delimiter)\n .append(\"[Description] : \").append(linkEntity.getDescription()).append(delimiter)\n .append(\"[Link] : \").append(linkEntity.getHref()).append(delimiter)\n .append(\"[Reg time] : \").append(linkEntity.getRegisterDateTime().format(formatter)).append(delimiter);\n\n message.append(\"[Tags] : \");\n for (TagEntity tagEntity : linkEntity.getTags()) {\n message.append(\"#\").append(tagEntity.getName()).append(\" \");\n }\n message.append(\"\\n\\n\");\n }\n /*for (LinkEntity linkEntity : links) {\n message.append(\"[\").append(linkEntity.getId()).append(\". \")\n .append(linkEntity.getTitle()).append(\"]\").append(delimiter)\n .append(\"[\").append(linkEntity.getDescription()).append(\"]\").append(delimiter)\n .append(\"[\").append(linkEntity.getHref()).append(\"]\").append(delimiter)\n .append(\"[\").append(linkEntity.getRegisterDateTime().format(formatter)).append(\"]\").append(delimiter);\n\n message.append(\"[ \");\n for (TagEntity tagEntity : linkEntity.getTags()) {\n message.append(\"#\").append(tagEntity.getName()).append(\" \");\n }\n message.append(\"]\\n\\n\");\n }*/\n\n messageSender.send(message.toString());\n }", "void contactQueryResult(String queryId, Contact contact);", "@Override\n public String toString() {\n StringBuilder sb = new StringBuilder();\n sb.append(\"{\");\n if (getStatus() != null)\n sb.append(\"Status: \").append(getStatus()).append(\",\");\n if (getHits() != null)\n sb.append(\"Hits: \").append(getHits()).append(\",\");\n if (getFacets() != null)\n sb.append(\"Facets: \").append(getFacets()).append(\",\");\n if (getStats() != null)\n sb.append(\"Stats: \").append(getStats());\n sb.append(\"}\");\n return sb.toString();\n }", "public String toString(){\n \treturn (weight + \"\t\" + query);\n }", "Future<Map<String, Object>> computeQueryResult(Request request) {\n String query = request.getParam(\"q\");\n Map<String, String> results = new HashMap<String, String>();\n results.put(\"a\", \"1\");\n results.put(\"b\", \"2\");\n results.put(\"c\", \"3\");\n results.put(\"d\", \"4\");\n results.put(\"e\", \"5\");\n\n Map<String, Object> result = new HashMap<String, Object>();\n result.put(\"query\", query);\n result.put(\"numResults\", \"5\");\n result.put(\"results\", results);\n result.put(\"user\", \"Bob\");\n result.put(\"timestamp\", \"Thu, 19 May 2016 00:00:00 +00:00\");\n return Future.value(result);\n }", "public void PrintResult() {\n try {\n res.beforeFirst();\n int columnsNumber = res.getMetaData().getColumnCount();\n while (res.next()) {\n for (int i = 1; i <= columnsNumber; i++) {\n if (i > 1) System.out.print(\", \");\n Object columnValue = res.getObject(i);\n System.out.print(res.getMetaData().getColumnName(i) + \" \" + columnValue);\n }\n System.out.println();\n }\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "public void showResults(String query) {\n\t\t//For prototype will replace with db operations\n\t\tString[] str = { \"Artowrk1\", \"Some other piece\", \"This art\", \"Mona Lisa\" };\n\t\tArrayAdapter<String> aa = new ArrayAdapter<String>(this,android.R.layout.simple_dropdown_item_1line, str);\n\t\tmListView.setAdapter(aa);\n\t\t\n\t\tmListView.setOnItemClickListener(new OnItemClickListener() {\n\n\t\t\t@Override\n\t\t\tpublic void onItemClick(AdapterView<?> arg0, View arg1, int arg2,\n\t\t\t\t\tlong arg3) {\n\t\t\t\t// TODO Auto-generated method stub\n\t\t\t\t\n\t\t\t}\n\n }\n });\n\t\t\n\t}", "public static void querying(String constructQuery2) {\n\t\t//construct the new query\n\t\t//String constructQuery2 = prefix+\" \"+select+\" \"+selectValues+\" \"+where+openBracket+openBracket+\" \"+local+\" \"+service+\" \"+openBracket+\" \"+remote+\" \"+closeBracket+closeBracket;\n\t\t//constructQuery2 = constructQuery2+\" UNION \"+\" \"+openBracket+\" \"+local+\" \"+service+\" \"+openBracket+\" \"+remote+\" \"+closeBracket+closeBracket+closeBracket;\n\t\t\n\t\tSystem.out.println(constructQuery2);\n\t\tQuery query2 = QueryFactory.create(constructQuery2);\n\t\tQueryExecution qe2 = QueryExecutionFactory.sparqlService(\n\t\t\t\t\"http://localhost:3030/USNA/query\", query2);\n\t\t\n\t\tResultSet results1 = qe2.execSelect();\n\t\tif(constantOutput == \"\") {\n\t\t\tResultSetFormatter.out(System.out, results1);\n\t\t}else {\n\t\t\tString NS = \"http://www.usna.org/ns#\";\n\t\t\tModel rdfssExample = ModelFactory.createDefaultModel();\n\t\t\tString [] constant = constantOutput.trim().split(\" \");\n\t\t\t\n\t\t\tString [] headers = selectValues.split(\" \");\n\t\t System.out.println(\"--------------------------------------------------------------------------------------------------------------------------------------------\");\n\t\t\tfor(int i = 0; i< headers.length; i++) {\n\t\t\t\t//System.out.print(headers[i].substring(1,headers[i].length()).trim()+\"\\t\\t\\t\\t\\t\\t\");\n\t\t\t\tSystem.out.print(headers[i].substring(1,headers[i].length()).trim()+\"\\t\\t\\t\\t\\t\\t\");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t\tSystem.out.println(\"----------------------------------------------------------------------------------------------------------------------------------------------\");\n\t\t\tSystem.out.println();\n\t\t\t\n\t\t\ttry {\n\t\t\t\t int count = 0;\n\t\t while ( results1.hasNext() ) {\n\t\t \t //Resource Response = rdfssExample.createResource(NS+constant[count]);\n\t\t \t \n\t\t QuerySolution soln = results1.nextSolution();\n\t\t Resource first = soln.getResource(headers[0].substring(1,headers[0].length()).trim());\n\t\t //Resource second = soln.getResource(headers[1].substring(1,headers[1].length()).trim());\n\t\t //Resource third = soln.getResource(headers[2].substring(1,headers[2].length()).trim());\n\t\t //Resource fourth = soln.getResource(headers[3].substring(1,headers[3].length()).trim());\n\t\t for(int i=0; i< constant.length; i++) {\n\t\t \t Resource Response = rdfssExample.createResource(NS+constant[i]);\n\t\t \t System.out.format(\"%10s %50s\",first, Response);\n\t\t \t System.out.println();\n\t\t\t\t\t //count++;\n\t\t }\n\t\t //System.out.format(\"%10s %50s\",first, Response);\n\t\t //System.out.format(\"%10s\",first);\n\t\t\t\t System.out.println();\n\t\t\t\t //count++;\n\t\t\t\t \n\t\t\t\t //System.out.println(count);\n\t\t \n\t\t }\n\t\t } finally {\n\t\t \t qe2.close();\n\t\t}\n\t\t\t \n\t\t}\t\t \n\t}" ]
[ "0.62613827", "0.55853355", "0.54873604", "0.5460785", "0.5460785", "0.54381484", "0.542633", "0.5359296", "0.5332751", "0.5315104", "0.5313741", "0.52890927", "0.52786", "0.5264329", "0.5251827", "0.5250201", "0.524712", "0.5219545", "0.52096725", "0.51691073", "0.5153547", "0.5112042", "0.51096416", "0.50850075", "0.50827837", "0.50740135", "0.5063303", "0.5055505", "0.5054367", "0.5051933", "0.50467557", "0.5013311", "0.5009089", "0.500885", "0.4999212", "0.4994224", "0.4979567", "0.49655893", "0.494592", "0.49429795", "0.49359602", "0.49316937", "0.49281523", "0.4926382", "0.492073", "0.4917757", "0.49159402", "0.49107632", "0.49063027", "0.49038574", "0.48988324", "0.4878362", "0.4868026", "0.48503152", "0.48481888", "0.4845365", "0.48390883", "0.48325357", "0.4815962", "0.48143938", "0.48116317", "0.48028514", "0.48007962", "0.47945294", "0.4789342", "0.47892338", "0.47844887", "0.4783809", "0.47796342", "0.4758689", "0.47499713", "0.47487992", "0.47479668", "0.47433347", "0.47306654", "0.47303042", "0.47303042", "0.47294983", "0.47294983", "0.47261298", "0.47229087", "0.47148263", "0.4714762", "0.47139406", "0.47108507", "0.4707675", "0.47060025", "0.47023615", "0.46999216", "0.46939814", "0.46939152", "0.46872765", "0.468702", "0.4685882", "0.4674815", "0.46715745", "0.46656576", "0.46575975", "0.46499383", "0.46488956", "0.4647845" ]
0.0
-1
Creating a new transaction, testing if it's visible, if the value is correct and logging the result to the report
@Test(groups = "Transactions Tests", description = "Create new transaction") public void createNewTransaction() { MainScreen.clickAccountItem("Income"); SubAccountScreen.clickSubAccountItem("Salary"); TransactionsScreen.clickAddTransactionBtn(); TransactionsScreen.typeTransactionDescription("Extra income"); TransactionsScreen.typeTransactionAmount("300"); TransactionsScreen.clickTransactionType(); TransactionsScreen.typeTransactionNote("Extra income from this month"); TransactionsScreen.clickSaveBtn(); TransactionsScreen.transactionItem("Extra income").shouldBe(visible); TransactionsScreen.transactionAmout().shouldHave(text("$300")); test.log(Status.PASS, "Sub-account created successfully and the value is correct"); //Testing if the transaction was created in the 'Double Entry' account, if the value is correct and logging the result to the report returnToHomeScreen(); MainScreen.clickAccountItem("Assets"); SubAccountScreen.clickSubAccountItem("Current Assets"); SubAccountScreen.clickSubAccountItem("Cash in Wallet"); TransactionsScreen.transactionItem("Extra income").shouldBe(visible); TransactionsScreen.transactionAmout().shouldHave(text("$300")); test.log(Status.PASS, "'Double Entry' account also have the transaction and the value is correct"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n\tpublic void testAddTransaction(){\n setDoubleEntryEnabled(true);\n\t\tsetDefaultTransactionType(TransactionType.DEBIT);\n validateTransactionListDisplayed();\n\n\t\tonView(withId(R.id.fab_create_transaction)).perform(click());\n\n\t\tonView(withId(R.id.input_transaction_name)).perform(typeText(\"Lunch\"));\n\t\tonView(withId(R.id.input_transaction_amount)).perform(typeText(\"899\"));\n\t\tonView(withId(R.id.input_transaction_type))\n\t\t\t\t.check(matches(allOf(isDisplayed(), withText(R.string.label_receive))))\n\t\t\t\t.perform(click())\n\t\t\t\t.check(matches(withText(R.string.label_spend)));\n\n\t\tString expectedValue = NumberFormat.getInstance().format(-899);\n\t\tonView(withId(R.id.input_transaction_amount)).check(matches(withText(expectedValue)));\n\n int transactionsCount = getTransactionCount();\n\t\tonView(withId(R.id.menu_save)).perform(click());\n\n validateTransactionListDisplayed();\n\n List<Transaction> transactions = mTransactionsDbAdapter.getAllTransactionsForAccount(DUMMY_ACCOUNT_UID);\n assertThat(transactions).hasSize(2);\n Transaction transaction = transactions.get(0);\n\t\tassertThat(transaction.getSplits()).hasSize(2);\n\n assertThat(getTransactionCount()).isEqualTo(transactionsCount + 1);\n }", "private void createTransaction() {\n\n String inputtedAmount = etAmount.getText().toString().trim().replaceAll(\",\", \"\");\n\n if (inputtedAmount.equals(\"\") || Double.parseDouble(inputtedAmount) == 0) {\n etAmount.setError(getResources().getString(R.string.Input_Error_Amount_Empty));\n return;\n }\n\n if (mAccount == null) {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.Input_Error_Account_Empty));\n return;\n }\n\n if(mCategory == null) {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.Input_Error_Category_Income_Empty));\n return;\n }\n\n Double amount = Double.parseDouble(etAmount.getText().toString().replaceAll(\",\", \"\"));\n if(amount < 0) {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.Input_Error_Amount_Invalid));\n return;\n }\n\n int CategoryId = mCategory != null ? mCategory.getId() : 0;\n String Description = tvDescription.getText().toString();\n int accountId = mAccount.getId();\n String strEvent = tvEvent.getText().toString();\n Event event = null;\n\n if (!strEvent.equals(\"\")) {\n event = mDbHelper.getEventByName(strEvent);\n if (event == null) {\n long eventId = mDbHelper.createEvent(new Event(0, strEvent, mCal, null));\n if (eventId != -1) {\n event = mDbHelper.getEvent(eventId);\n }\n }\n }\n\n boolean isDebtValid = true;\n // Less: DebtCollect, More: Borrow\n if(mCategory.getDebtType() == Category.EnumDebt.LESS) { // Income -> Debt Collecting\n List<Debt> debts = mDbHelper.getAllDebtByPeople(tvPeople.getText().toString());\n\n Double lend = 0.0, debtCollect = 0.0;\n for(Debt debt : debts) {\n if(mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.MORE) {\n lend += debt.getAmount();\n }\n\n if(!mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.LESS) {\n debtCollect += debt.getAmount();\n }\n }\n\n if(debtCollect + amount > lend) {\n isDebtValid = false;\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_debt_collect_invalid));\n }\n }\n\n if(isDebtValid) {\n Transaction transaction = new Transaction(0,\n TransactionEnum.Income.getValue(),\n amount,\n CategoryId,\n Description,\n 0,\n accountId,\n mCal,\n 0.0,\n \"\",\n event);\n\n long newTransactionId = mDbHelper.createTransaction(transaction);\n\n if (newTransactionId != -1) {\n\n if(mCategory.getDebtType() == Category.EnumDebt.LESS || mCategory.getDebtType() == Category.EnumDebt.MORE) {\n Debt newDebt = new Debt();\n newDebt.setCategoryId(mCategory.getId());\n newDebt.setTransactionId((int) newTransactionId);\n newDebt.setAmount(amount);\n newDebt.setPeople(tvPeople.getText().toString());\n\n long debtId = mDbHelper.createDebt(newDebt);\n if(debtId != -1) {\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_create_successful));\n cleanup();\n\n if(getFragmentManager().getBackStackEntryCount() > 0) {\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n }\n } else {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_transaction_create_fail));\n mDbHelper.deleteTransaction(newTransactionId);\n }\n } else {\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_create_successful));\n cleanup();\n\n if(getFragmentManager().getBackStackEntryCount() > 0) {\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n }\n }\n\n } else {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_transaction_create_fail));\n }\n }\n\n }", "@Test\n\tpublic void testValidTransaction() {\n\t\t\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\tdatabase.addCustomer(customer);\n\t\tdatabase.addCustomer(merchant);\n\t\tdatabase.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tString transJMSMessage = transHandle.generateTransactionJMSRequest();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\n\t\tassertEquals(\"Transaction participants are valid\",verifyParticipants);\n\t\tassertEquals(transJMSMessage,customer.getBankId()+\" \"+ merchant.getBankId()+ \" \" + amount + \" \" + \"comment\");\n\t}", "public void createNewAccountWithOpeningBalanceHelper() {\n\t\tparseDateTextFieldHelper();\n\t\tBalance balance = data.createNewAccountWithOpeningBalance();\n\t\tLocalDate date = LocalDate.of(year, month, dayOfMonth);\n\t\tbalance.setDate(date);\n\t\tJTextField amount = data.getTextFieldBalance();\n\t\t// this before was not being set, i thought i set it in expectedResult but\n\t\t// that's a different object!\n\t\tbalance.setAmount(Float.parseFloat(amount.getText()));\n\t\t// I think you can actually just insert the values here instead if using get()\n\t\tBalance resultExpected = new Balance(bankTest, accountTest,\n\t\t\t\tdate.getYear(), date.getMonthValue(), date.getDayOfMonth(),\n\t\t\t\tFloat.parseFloat(amount.getText()), TEST_TXTR_EXTRA_NOTES);\n\t\tassertEquals(resultExpected, balance);\n\t}", "public boolean createTransaction() {\n\t\t\treturn false;\n\t\t}", "@Test\n public void processTestC()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n //failed transaction\n trans = new Transaction(acc_db,acc.get_Account_Number(),5,10);\n\n Assert.assertEquals(false,trans.process());\n }", "public boolean requestTransaction(String name,String reason,double amount){\n Transaction t1 = new Transaction(name,reason,amount);\n boolean done=t1.registertransaction();\n \n return done; \n \n}", "public void createTransaction(Transaction trans);", "public boolean AddTransactionToAccount(Double transaction)\n {\n\n if(this.transactions.add(transaction)){\n System.out.println(\"Failed to add transaction: \" + transaction);\n return false;\n }\n System.out.println(\"Successfully added Transaction: \" + transaction);\n return true;\n }", "@Test(groups = \"Transactions Tests\", description = \"Duplicate transaction\")\n\tpublic void duplicateTransaction() {\n\t\tMainScreen.clickAccountItem(\"Income\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Salary\");\n\t\tTransactionsScreen.clickOptionsBtnFromTransactionItem(\"Bonus\");\n\t\tTransactionsScreen.clickDuplicateTransactionOption();\n\t\tTransactionsScreen.transactionItens(\"Bonus\").shouldHave(size(2));\n\t\ttest.log(Status.PASS, \"Transaction successfully duplicated\");\n\n\t\t//Testing if there is two identical transactions in the 'Double Entry' account and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickAccountItem(\"Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Current Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Cash in Wallet\");\n\t\tTransactionsScreen.transactionItens(\"Bonus\").shouldHave(size(2));\n\t\ttest.log(Status.PASS, \"Transaction successfully duplicated in the 'Double Entry' account\");\n\n\t}", "@Test(dataProvider=\"newPayment\")\n\tpublic void createPaymentTest(Long creditCardNumber, int secureCode, int zipcode, boolean expected) throws ClassNotFoundException, IOException, RegistrationException, SQLException {\n\t\tthePayment = new Payment(creditCardNumber, secureCode, zipcode);\n\t\tpaymentId = paymentDAO.createPayment(thePayment);\n\t\t// equivalent to isCreated = (actual != 0) ? true : false\n\t\tisCreated = (paymentId != 0);\n\t\tassertThat(isCreated , equalTo(expected));\n\t\t\n\t}", "@Test\n public void testPayTransactionSuccessfully() throws Exception {\n\n // login with sufficient rights\n shop.login(admin.getUsername(), admin.getPassword());\n\n // verify receive correct change when paying for sale\n double change = 3;\n assertEquals(change, shop.receiveCashPayment(saleId, toBePaid+change), 0.001);\n totalBalance += toBePaid;\n\n // verify sale is in state PAID/COMPLETED\n assertTrue(isTransactionInAccountBook(saleId));\n\n // verify system's balance did update correctly\n assertEquals(totalBalance, shop.computeBalance(), 0.001);\n }", "@Test(groups = \"Transactions Tests\", description = \"Transaction Calculation\")\n\tpublic void transactionCalculation() {\n\t\tMainScreen.clickAccountItem(\"Income\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Salary\");\n\t\tTransactionsScreen.clickAddTransactionBtn();\n\t\tTransactionsScreen.typeTransactionDescription(\"Extra income\");\n\t\tTransactionsScreen.typeTransactionAmount(\"100\");\n\t\tTransactionsScreen.clickTransactionType();\n\t\tTransactionsScreen.clickSaveBtn();\n\t\tTransactionsScreen.transactionItem(\"Extra income\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$100\"));\n\t\ttest.log(Status.PASS, \"Transaction created successfully and the value is correct\");\n\n\t\t//Creating another transaction, testing if its visible, if the value is correct and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickAccountItem(\"Expenses\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Books\");\n\t\tTransactionsScreen.clickAddTransactionBtn();\n\t\tTransactionsScreen.typeTransactionDescription(\"How to become a good QA Engineer book\");\n\t\tTransactionsScreen.typeTransactionAmount(\"50\");\n\t\tTransactionsScreen.clickSaveBtn();\n\t\tTransactionsScreen.transactionItem(\"How to become a good QA Engineer book\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$50\"));\n\t\ttest.log(Status.PASS, \"Second transaction created successfully and the value is correct\");\n\n\t\t//Testing if the calculation is correct and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickAccountItem(\"Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Current Assets\");\n\t\tSubAccountScreen.transactionAmoutFromSubAccountItem(\"Cash in Wallet\").shouldHave(text(\"$50\"));\n\t\ttest.log(Status.PASS, \"Calculation is correct\");\n\n\t\t//Deleting both transactions for app cleanup and logging the result to the report\n\t\tSubAccountScreen.clickSubAccountItem(\"Cash in Wallet\");\n\t\tTransactionsScreen.clickOptionsBtnFromTransactionItem(\"Extra income\");\n\t\tTransactionsScreen.clickDeleteTransactionOption();\n\t\tTransactionsScreen.clickOptionsBtnFromTransactionItem(\"How to become a good QA Engineer book\");\n\t\tTransactionsScreen.clickDeleteTransactionOption();\n\t\ttest.log(Status.PASS, \"Transactions deleted successfully\");\n\t\t\n\t\t//Testing if both transactions were deleted from the 'Double Entry' account and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickAccountItem(\"Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Current Assets\");\n\t\tSubAccountScreen.transactionAmoutFromSubAccountItem(\"Cash in Wallet\").shouldHave(text(\"$0\"));\n\t\ttest.log(Status.PASS, \"Transactions from the 'Double Entry' account deleted successfully\");\n\n\t}", "public boolean ADDCHEDTransact(CHEDTransact trans) {\n query = \"INSERT INTO transact(NumberO)\";\n try {\n ps = con.prepareStatement(query);\n\n java.util.Date dateP = trans.getiTDate();\n\n Date dateSigned = new Date(dateP.getYear(), dateP.getMonth(), dateP.getDay());\n\n ps.setInt(1, trans.getNumberOFTrees());\n ps.setString(2, trans.getLotNumber());\n ps.setString(3, trans.getiTvoucher());\n ps.setString(4, trans.gettRvoucher());\n ps.setDate(5, dateSigned);\n ps.setFloat(6, trans.getAmountPayable());\n\n if (ps.executeUpdate() != 0) {\n status = true;\n }\n\n } catch (SQLException ex) {\n Logger.getLogger(FarmerManager.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n return status;\n }", "@Transactional\n\tpublic String addTransaction(int toAccNo, int fromAccNo, Transaction tran) {\n\t\t\tEntityManager entityManager = getEntityManager();\n\t\t\tAccountdetail acc = (Accountdetail) entityManager.createQuery(\"select a from Accountdetail a where a.accountnumber =: toaccNo\").setParameter(\"toaccNo\", toAccNo ).getSingleResult();\n\t\t\tAccountdetail acc1 = (Accountdetail) entityManager.createQuery(\"select ac from Accountdetail ac where ac.accountnumber =: fromAccNo\").setParameter(\"fromAccNo\", fromAccNo ).getSingleResult();\n\t\t\t\n\t\t\t//Validation -----> The Balance amount should be greater than the Amount Transfered \n\t\t\tif(acc1.getCurrentbalance()>=tran.getAmounttransferred()) {\n\t\t\t\t\ttran.setAccountto(acc);\n\t\t\t\t\ttran.setAccountfrom(acc1);\n\t\t\t\t\tentityManager.merge(tran);\n\t\t\t\t\t\n\t\t\t\t\t//Taking the amount transfered\n\t\t\t\t\tint amt = tran.getAmounttransferred();\n\t\t\t\t\tSystem.out.println(toAccNo);\n\t\t\t\t\t\n\t\t\t\t\t//Also crediting and debiting the amount from the accounts \n\t\t\t\t\tacc.setCurrentbalance(acc.getCurrentbalance()+amt);\n\t\t\t\t\tacc1.setCurrentbalance(acc1.getCurrentbalance()-amt);\n\t\t\t\t\t\n\t\t\t\t\t//Mailing the details of the transaction to the Respective Account Numbers\n\t\t\t\t\tString info_deb = \"Amount debited from your account.\\nAmount -->\"+amt+\"\\nTo Account -->\"+acc.getAccountnumber();\n String info_rec = \"Amount credited to your account.\\nAmount -->\"+amt+\"\\nFrom Account -->\"+acc1.getAccountnumber();\n mailService.sendMail(info_deb, acc1.getCustomerdetail().getEmail());\n mailService.sendMail(info_rec, acc.getCustomerdetail().getEmail());\n \n\t\t\t\t\treturn \"Transaction Inserted\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//If Balance is less than the Amount Transfered \n\t\t\t\telse if(acc1.getCurrentbalance()<tran.getAmounttransferred()) {\n\t\t\t\t\treturn \"insufficient funds\";\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//If the Details is wrong\n\t\t\t\telse {\n\t\t\t\t\treturn \"Wrong details. Please try again\";\n\t\t\t\t}\n\t }", "@Test\n public void processTestA()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n //pass transaction\n trans = new Transaction(acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),300);\n\n Assert.assertEquals(true,trans.process());\n }", "@Override\n\tpublic int createTransaction(BankTransaction transaction) throws BusinessException {\n\t\tint tran = 0;\n\t\t\n\t\ttry {\n\t\t\tConnection connection = PostgresqlConnection.getConnection();\n\t\t\tString sql = \"insert into dutybank.transactions (account_id, transaction_type, amount, transaction_date) values(?,?,?,?)\";\n\t\t\t\n\t\t\tPreparedStatement preparedStatement = connection.prepareStatement(sql);\n\t\t\t\n\t\t\tpreparedStatement.setInt(1, transaction.getAccountid());\n\t\t\tpreparedStatement.setString(2, transaction.getTransactiontype());\n\t\t\tpreparedStatement.setDouble(3, transaction.getTransactionamount());\n\t\t\tpreparedStatement.setDate(4, new java.sql.Date(transaction.getTransactiondate().getTime()));\n\n\t\t\t\n\t\t\ttran = preparedStatement.executeUpdate();\n\t\t\t\n\t\t} catch (ClassNotFoundException | SQLException e) {\n\t\t\tthrow new BusinessException(\"Some internal error has occurred while inserting data\");\n\t\t}\n\t\t\n\n\t\treturn tran;\n\t}", "@Test\n public void checkingAccount2() {\n Bank bank = new Bank();\n Customer bill = new Customer(\"Bill\");\n Account checkingAccount = new CheckingAccount(bill, Account.CHECKING);\n bank.addCustomer(new Customer(\"Bill\").openAccount(checkingAccount));\n Transaction t = new CreditTransaction(1000.0);\n t.setTransactionDate(getTestDate(-5));\n checkingAccount.addTransaction(t);\n\n assertEquals(Math.pow(1 + 0.001 / 365.0, 5) * 1000 - 1000, bank.totalInterestPaid(), DOUBLE_DELTA);\n }", "@Test\n public void testTransaction_1()\n throws Exception {\n Transaction result = new Transaction();\n assertNotNull(result);\n }", "@Test\n @Transactional\n public void checkAmtIsRequired() throws Exception {\n assertThat(reportRepository.findAll()).hasSize(0);\n // set the field null\n report.setAmt(null);\n\n // Create the Report, which fails.\n restReportMockMvc.perform(post(\"/api/reports\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(report)))\n .andExpect(status().isBadRequest());\n\n // Validate the database is still empty\n List<Report> reports = reportRepository.findAll();\n assertThat(reports).hasSize(0);\n }", "private boolean prepareTransaction() {\n\n // Ensure Bitcoin network service is started\n BitcoinNetworkService bitcoinNetworkService = CoreServices.getOrCreateBitcoinNetworkService();\n Preconditions.checkState(bitcoinNetworkService.isStartedOk(), \"'bitcoinNetworkService' should be started\");\n\n Address changeAddress = bitcoinNetworkService.getNextChangeAddress();\n\n // Determine if this came from a BIP70 payment request\n if (paymentRequestData.isPresent()) {\n Optional<FiatPayment> fiatPayment = paymentRequestData.get().getFiatPayment();\n PaymentSession paymentSession;\n try {\n if (paymentRequestData.get().getPaymentRequest().isPresent()) {\n paymentSession = new PaymentSession(paymentRequestData.get().getPaymentRequest().get(), false);\n } else {\n log.error(\"No PaymentRequest in PaymentRequestData - cannot create a paymentSession\");\n return false;\n }\n } catch (PaymentProtocolException e) {\n log.error(\"Could not create PaymentSession from payment request {}, error was {}\", paymentRequestData.get().getPaymentRequest().get(), e);\n return false;\n }\n\n // Build the send request summary from the payment request\n Wallet.SendRequest sendRequest = paymentSession.getSendRequest();\n log.debug(\"SendRequest from BIP70 paymentSession: {}\", sendRequest);\n\n Optional<FeeState> feeState = WalletManager.INSTANCE.calculateBRITFeeState(true);\n\n // Prepare the transaction i.e work out the fee sizes (not empty wallet)\n sendRequestSummary = new SendRequestSummary(\n sendRequest,\n fiatPayment,\n FeeService.normaliseRawFeePerKB(Configurations.currentConfiguration.getWallet().getFeePerKB()),\n null,\n feeState\n );\n\n // Ensure we keep track of the change address (used when calculating fiat equivalent)\n sendRequestSummary.setChangeAddress(changeAddress);\n sendRequest.changeAddress = changeAddress;\n } else {\n Preconditions.checkNotNull(enterAmountPanelModel);\n Preconditions.checkNotNull(confirmPanelModel);\n\n // Check a recipient has been set\n if (!enterAmountPanelModel\n .getEnterRecipientModel()\n .getRecipient().isPresent()) {\n return false;\n }\n\n // Build the send request summary from the user data\n Coin coin = enterAmountPanelModel.getEnterAmountModel().getCoinAmount().or(Coin.ZERO);\n Address bitcoinAddress = enterAmountPanelModel\n .getEnterRecipientModel()\n .getRecipient()\n .get()\n .getBitcoinAddress();\n\n Optional<FeeState> feeState = WalletManager.INSTANCE.calculateBRITFeeState(true);\n\n // Create the fiat payment - note that the fiat amount is not populated, only the exchange rate data.\n // This is because the client and transaction fee is only worked out at point of sending, and the fiat equivalent is computed from that\n Optional<FiatPayment> fiatPayment;\n Optional<ExchangeRateChangedEvent> exchangeRateChangedEvent = CoreServices.getApplicationEventService().getLatestExchangeRateChangedEvent();\n if (exchangeRateChangedEvent.isPresent()) {\n fiatPayment = Optional.of(new FiatPayment());\n fiatPayment.get().setRate(Optional.of(exchangeRateChangedEvent.get().getRate().toString()));\n // A send is denoted with a negative fiat amount\n fiatPayment.get().setAmount(Optional.<BigDecimal>absent());\n fiatPayment.get().setCurrency(Optional.of(exchangeRateChangedEvent.get().getCurrency()));\n fiatPayment.get().setExchangeName(Optional.of(ExchangeKey.current().getExchangeName()));\n } else {\n fiatPayment = Optional.absent();\n }\n\n // Prepare the transaction i.e work out the fee sizes (not empty wallet)\n sendRequestSummary = new SendRequestSummary(\n bitcoinAddress,\n coin,\n fiatPayment,\n changeAddress,\n FeeService.normaliseRawFeePerKB(Configurations.currentConfiguration.getWallet().getFeePerKB()),\n null,\n feeState,\n false);\n }\n\n log.debug(\"Just about to prepare transaction for sendRequestSummary: {}\", sendRequestSummary);\n return bitcoinNetworkService.prepareTransaction(sendRequestSummary);\n }", "public boolean addTransaction(Transaction transaction) throws SQLException {\n\t\t\n\t\ttry (PreparedStatement statement = conn.prepareStatement(\"INSERT INTO transaction(Date, Type, Category, Amount) VALUES (?, ?, ?, ?)\")) {\n\t\t\tstatement.setDate(1, transaction.date());\n\t\t\tstatement.setString(2, transaction.type());\n\t\t\tstatement.setString(3, transaction.category());\n\t\t\tstatement.setDouble(4, transaction.amount());\n\t\t\treturn statement.executeUpdate() != 0;\n\t\t}\n\t}", "@Test\n\tpublic void addTransaction() {\n\t\tTransaction transaction = createTransaction();\n\t\tint size = transactionService.getTransactions().size();\n\t\ttransactionService.addTransaction(transaction);\n\t\tassertTrue(\"No transaction was added.\", size < transactionService.getTransactions().size());\n\t}", "boolean startTransaction(Klant klant, String IBAN1, String IBAN2, double value, String description) throws SessionExpiredException, IllegalArgumentException, LimitReachedException, RemoteException;", "public void transaction() throws DBException {\n\t\tUsersTransaction transaction = new UsersTransaction();\n\t\tScanner scan = new Scanner(System.in);\n\t\tLogger.info(\"================TRANSACTION DETAILS TO DONATE======================\");\n\t\tLogger.info(\"Enter the transaction ID\");\n\t\ttransactionId = scan.nextInt();\n\t\tLogger.info(\"Enter the donor ID\");\n\t\tdonorId = scan.nextInt();\n\t\tLogger.info(\"Enter the fund Id\");\n\t\tfundRequestId = scan.nextInt();\n\t\tLogger.info(\"Enter the amount to be funded\");\n\t\ttargetAmount = scan.nextInt();\n\t\ttransaction.setTransactionId(transactionId);\n\t\ttransaction.setDonorId(donorId);\n\t\ttransaction.setFundRequestId(fundRequestId);\n\t\ttransaction.setTargetAmount(targetAmount);\n\t\tinsert(transaction);\n\t\tdonorFundRequest(reqType);\n\t}", "@Override\n public boolean withdrawAmount(TransactionDTO transaction) {\n CustomerDetails customerDetails=this.viewAccount(transaction.getUserName()); \n if(customerDetails.getAccountBalance()>=transaction.getAmount()){\n customerDetails.setAccountBalance(customerDetails.getAccountBalance()-transaction.getAmount());\n customerRepository.save(customerDetails);\n return true;\n }\n else{\n return false;\n }\n }", "private Tx createTransaction(BitCoinResponseDTO btcDTO, SellerBitcoinInfo sbi) {\n\t\t\n\t\tTx tx = new Tx();\n\t\t\n\t\t\n\t\ttx.setDate(new Date());\n\t\ttx.setAmountOfMoney(btcDTO.getPrice_amount());\n\t\ttx.setStatus(TxStatus.PENDING);\n\t\ttx.setRecieverAddress(btcDTO.getPayment_url());\n\t\ttx.setorder_id(btcDTO.getId()); //ovaj id je na coin gate-u i moram ga cuvati u transakciji\n\t\ttx.setTxDescription(\"Porudzbina je kreirana od strane korisnika\");\n\t\ttx.setSbi(sbi);\n\t\t\n\t\t//trebace ovde jos da se setuje id korisnika koji je kreirao porudzbinu kako bi kasnije mogao da getuje sve\n\t\t//njegove transakcije\n\t\t\n\t\t\n\t\treturn tx;\n\t\t\n\t}", "private void reportTransactionStatus(boolean success){\n if(success){\n sendMessage(\"<st>\");\n }else{\n sendMessage(\"<f>\");\n }\n }", "@Test\n\tpublic void testInvalidCustomerTransaction() {\n\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\t\n\t\t//database.addCustomer(customer); not registered\n\t\tdatabase.addCustomer(merchant);\n\t\tdatabase.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\t\t\n\t\tassertEquals(\"This barcode does not belong to any of DTUPay users\",verifyParticipants);\n\t}", "protected final Transaction createTransaction(TransactionTypeKeys type) {\n\t\tTransaction trans = null;\n\t\tString payee = getForm().getPayFrom();\n\t\tdouble amount = parseAmount();\n\n\t\t// Put amount in proper form.\n\t\tif ((type == INCOME && amount < 0.0)\n\t\t\t\t|| (type == EXPENSE && amount >= 0.0)) {\n\t\t\tamount = -amount;\n\t\t}\n\n\t\t// Put payee in proper form.\n\t\tpayee = purgeIdentifier(payee);\n\n\t\ttrans = new Transaction(getForm().getField(CHECK_NUMBER).getText(),\n\t\t\t\tparseDate(), payee, Money.of(amount,\n\t\t\t\t\t\tUI_CURRENCY_SYMBOL.getCurrency()), getCategory(),\n\t\t\t\tgetForm().getField(NOTES).getText());\n\n\t\t// Set attributes not applicable in the constructor.\n\t\ttrans.setIsReconciled(getForm().getButton(PENDING).isSelected() == false);\n\n\t\tif (isInEditMode() == true) {\n\t\t\ttrans.setLabel(getEditModeTransaction().getLabel());\n\t\t}\n\n\t\treturn trans;\n\t}", "@Override\n public boolean depositAmount(TransactionDTO transaction) {\n if(transaction.getAmount()>0){\n CustomerDetails customerDetails=this.viewAccount(transaction.getUserName()); \n customerDetails.setAccountBalance(customerDetails.getAccountBalance()+transaction.getAmount());\n customerRepository.save(customerDetails);\n return true;\n }else{\n return false;\n }\n }", "@Test\n public void processTestB()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n //failed transaction\n trans = new Transaction(acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),2000);\n\n Assert.assertEquals(false,trans.process());\n }", "@Test\n\tpublic void testInvalidMerchantTransaction() {\n\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\tdatabase.addCustomer(customer);\n\t\t//database.addCustomer(merchant); Merchant not in database\n\t\tdatabase.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\t\t\n\t\tassertEquals(\"This merchant is not a DTUPay user\",verifyParticipants);\n\t}", "private Transaction creatTransaction(Bill bill, boolean b) {\n Transaction transaction = new Transaction();\n transaction.setDateOfTransaction(new Date());\n transaction.setCostOfTransaction(String.valueOf(bill.getCostOfBill()));\n transaction.setSerialOfTransaction(new TransactionSerialProducer().serialProducer());\n transaction.setFinished(b);\n transaction.setTypeOfTransaction(\"پرداخت قبض\");\n transaction.setBillingId(bill.getBillingId());\n transaction.setPaymentCode(bill.getPaymentCode());\n dbHelper = new DBHelper();\n dbHelper.insertTransaction(transaction);\n return transaction;\n }", "public void testCanCreateInvoiceAccuracy() throws Exception {\n assertEquals(\"The result is not as expected\", true, invoiceSessionBean.canCreateInvoice(5));\n\n }", "public void createTransaction(TransactionType type, double value, int id, int customerVat) throws ApplicationException {\n\t\ttry{\n\t\t\tTransaction t = new Transaction(type, value, id, customerVat);\n\t\t\tem.persist(t);\n\t\t}\n\t\tcatch (Exception e){\n\t\t\tthrow new ApplicationException(\"Something Shady happened: Error creating Transaction\", e);\n\t\t}\n\t\t\n\t}", "@Test\n\tpublic void moneyTrnasferSucess() {\n\t\t\n\t\tString accountNumberFrom = createAccount(\"krishna\",4000);\n\t\tString accountNumberTo = createAccount(\"ram\",2000);\n\t\tdouble amountToBeTranfered = 500.0;\n\t\tMoneyTransfer moneyTransfer = new MoneyTransfer();\n\t\tmoneyTransfer.setAccountNumberFrom(Integer.parseInt(accountNumberFrom));\n\t\tmoneyTransfer.setAccountNumberTo(Integer.parseInt(accountNumberTo));\n\t\tmoneyTransfer.setAmount(amountToBeTranfered);\n\t\t\n\t\tString requestBody = gson.toJson(moneyTransfer);\n\t\t\n\t\tRequestSpecification request = RestAssured.given();\n\t\trequest.body(requestBody);\n\t\tResponse response = request.put(\"/transfer\");\n\t\t\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - START\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(amountToBeTranfered);\n\t\tsb.append(\" has been transferred to : \");\n\t\tsb.append(accountNumberTo);\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - END\n\t\t\n\t\tAssertions.assertEquals(sb.toString(), response.asString());\n\t\t\n\t}", "@Test\n public void existingTransaction() {\n Transaction t1 = startTransaction();\n IntRef intValue = new IntRef(10);\n t1.commit();\n\n Transaction t2 = startTransaction();\n assertEquals(10, intValue.get());\n\n intValue.inc();\n assertEquals(11, intValue.get());\n t2.commit();\n }", "@Override\n public TransactionModel createTransaction(String custId, LocalDateTime transactionTime, String accountNumber, TransactionType type, BigDecimal amount,String description)\n {\n return transactionDao.createTransaction(custId,accountNumber,transactionTime,type,amount,description);\n }", "@Test\n\tpublic void createAccountCashTest() {\n\t\tsetChequingRadioDefaultOff();\n\t\trdbtnCash.setSelected(true);\n\t\tdata.setRdbtnCash(rdbtnCash);\n\t\tAccount account = data.createNewAccount();\n\t\taccountTest = new Account(TEST_ACCOUNT_NAME, bankTest,\n\t\t\t\tAccount.Types.CASH.getAccountType());\n\t\tassertEquals(accountTest, account);\n\n\t}", "int insert(Transaction record);", "@Test\r\n public void testCreate() throws Exception {\r\n System.out.println(\"create\");\r\n Bureau obj = new Bureau(0,\"Test\",\"000000000\",\"\");\r\n BureauDAO instance = new BureauDAO();\r\n instance.setConnection(dbConnect);\r\n Bureau expResult = new Bureau(0,\"Test\",\"000000000\",\"\");\r\n Bureau result = instance.create(obj);\r\n \r\n assertEquals(\"sigles différents\",expResult.getSigle(), result.getSigle());\r\n assertEquals(\"tel différents\",expResult.getTel(), result.getTel());\r\n //etc\r\n assertNotEquals(\"id non généré\",expResult.getIdbur(),result.getIdbur());\r\n int idclient=result.getIdbur();\r\n obj=new Bureau(0,\"Test\",\"000000000\",\"\");\r\n try{\r\n Bureau result2 = instance.create(obj);\r\n fail(\"exception de doublon non déclenchée\");\r\n instance.delete(result2);\r\n }\r\n catch(SQLException e){}\r\n instance.delete(result);\r\n \r\n obj=new Bureau(0,\"Test2\",\"000000001\",\"\");\r\n try{\r\n Bureau result3 = instance.create(obj);\r\n fail(\"exception de code postal non déclenchée\");\r\n instance.delete(result3);\r\n }\r\n catch(SQLException e){}\r\n \r\n }", "@Test\n\tpublic void testInvalidBarcodeTransaction() {\n\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\tdatabase.addCustomer(merchant); //Merchant not in database\n\t\t//database.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\t\t\n\t\tassertEquals(\"This barcode does not exist\",verifyParticipants);\n\t}", "public Transaction getDummyTransaction(String action) {\n\n\t\t// Long payerAccountNum = 111l;\n\t\tLong payerRealmNum = 0l;\n\t\tLong payerShardNum = 0l;\n\t\t// Long nodeAccountNum=123l;\n\t\tLong nodeRealmNum = 0l;\n\t\tLong nodeShardNum = 0l;\n\t\tlong transactionFee = 0l;\n\t\tTimestamp startTime =\n\t\t\t\tRequestBuilder.getTimestamp(Instant.now(Clock.systemUTC()).minusSeconds(13));\n\t\tDuration transactionDuration = RequestBuilder.getDuration(100);\n\t\tboolean generateRecord = false;\n\t\tString memo = \"UnitTesting\";\n\t\tint thresholdValue = 10;\n\t\tList<Key> keyList = new ArrayList<>();\n\t\tKeyPair pair = new KeyPairGenerator().generateKeyPair();\n\t\tbyte[] pubKey = ((EdDSAPublicKey) pair.getPublic()).getAbyte();\n\t\tKey akey =\n\t\t\t\tKey.newBuilder().setEd25519(ByteString.copyFromUtf8((MiscUtils.commonsBytesToHex(pubKey)))).build();\n\t\tPrivateKey priv = pair.getPrivate();\n\t\tkeyList.add(akey);\n\t\tlong initBal = 100;\n\t\tlong sendRecordThreshold = 5;\n\t\tlong receiveRecordThreshold = 5;\n\t\tboolean receiverSign = false;\n\t\tDuration autoRenew = RequestBuilder.getDuration(100);\n\t\t;\n\t\tlong proxyAccountNum = 12345l;\n\t\tlong proxyRealmNum = 0l;\n\t\tlong proxyShardNum = 0l;\n\t\tint proxyFraction = 10;\n\t\tint maxReceiveProxyFraction = 10;\n\t\tlong shardID = 0l;\n\t\tlong realmID = 0l;\n\n\t\tTransaction trx = null;\n\t\tSignatureList sigList = SignatureList.getDefaultInstance();\n\t\tTimestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\n\t\t/**\n\t\t * SignatureList sigList = SignatureList.getDefaultInstance(); Transaction transferTx =\n\t\t * RequestBuilder.getCryptoTransferRequest( payer.getAccountNum(), payer.getRealmNum(),\n\t\t * payer.getShardNum(), nodeAccount.getAccountNum(), nodeAccount.getRealmNum(),\n\t\t * nodeAccount.getShardNum(), 800, timestamp, transactionDuration, false, \"test\", sigList,\n\t\t * payer.getAccountNum(), -100l, nodeAccount.getAccountNum(), 100l); transferTx =\n\t\t * TransactionSigner.signTransaction(transferTx, accountKeys.get(payer));\n\t\t */\n\n\t\tif (\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t\ttrx = RequestBuilder.getCryptoTransferRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 800, timestamp,\n\t\t\t\t\ttransactionDuration, false, \"test\", sigList, payerAccountId.getAccountNum(), -100l,\n\t\t\t\t\tnodeAccountId.getAccountNum(), 100l);\n\t\t\t// trx = TransactionSigner.signTransaction(trx, account2keyMap.get(payerAccountId));\n\t\t}\n\n\t\tif (\"createContract\".equalsIgnoreCase(action)) {\n\t\t\tFileID fileID = FileID.newBuilder().setFileNum(9999l).setRealmNum(1l).setShardNum(2l).build();\n\n\t\t\ttrx = RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 50000000000l, timestamp,\n\t\t\t\t\ttransactionDuration, true, \"createContract\", DEFAULT_CONTRACT_OP_GAS, fileID,\n\t\t\t\t\tByteString.EMPTY, 0, transactionDuration,\n\t\t\t\t\tSignatureList.newBuilder().addSigs(\n\t\t\t\t\t\t\tSignature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t\t\t\t\t\t.build(),\n\t\t\t\t\t\"\");\n\t\t}\n\n\t\t// if(\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t// long durationInSeconds = DAY_SEC * 30;\n\t\t// * Duration contractAutoRenew = Duration.newBuilder().setSeconds(durationInSeconds).build();\n\t\t// * Timestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\t\t// * Duration transactionDuration = RequestBuilder.getDuration(30, 0);\n\t\t// * Transaction createContractRequest =\n\t\t// RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t// * payerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t// * nodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 100l, timestamp,\n\t\t// transactionDuration, true, \"createContract\",\n\t\t// * DEFAULT_CONTRACT_OP_GAS, contractFile, ByteString.EMPTY, 0, contractAutoRenew,\n\t\t// * SignatureList.newBuilder()\n\t\t// *\n\t\t// .addSigs(Signature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t// * .build());\n\t\t// }\n\n\t\treturn trx;\n\n\t}", "boolean hasTxnrequest();", "private void createTx() throws Exception {\n PublicKey recipient = Seed.getRandomAddress();\n Transaction tx = new Transaction(wallet.pb, recipient, wallet.pr);\n//\t\tSystem.out.println(\"Created a tx\");\n txPool.add(tx);\n//\t\tcache.put(tx.txId, null);\n sendTx(tx);\n }", "@Test(groups = \"Transactions Tests\", description = \"Delete account with Transaction\")\n\tpublic void deleteAccountWithTransaction() {\n\t\tMainScreen.clickAddAccountBtn();\n\t\tNewAccountScreen.typeAccountName(\"Freelance jobs\");\n\t\tNewAccountScreen.clickAccountColor();\n\t\tNewAccountScreen.clickColorOption();\n\t\tNewAccountScreen.typeAccountDescription(\"Account to control my freelance jobs money\");\n\t\tNewAccountScreen.clickPlaceholderAccountOption();\n\t\tNewAccountScreen.clickSaveBtn();\n\t\tMainScreen.accountItem(\"Freelance jobs\").shouldBe(visible);\n\t\ttest.log(Status.PASS, \"Account created successfully\");\n\n\t\t//Creating a new sub-account, testing if it's visible and logging the result to the report\n\t\tMainScreen.clickAccountItem(\"Freelance jobs\");\n\t\tSubAccountScreen.clickAddSubAccountBtn();\n\t\tNewAccountScreen.typeAccountName(\"Test Automation jobs\");\n\t\tNewAccountScreen.clickAccountColor();\n\t\tNewAccountScreen.clickColorOption();\n\t\tNewAccountScreen.typeAccountDescription(\"Sub-account to control meu Test Automation freelance jobs\");\n\t\tNewAccountScreen.clickSaveBtn();\n\t\tSubAccountScreen.subAccountItem(\"Test Automation jobs\").shouldBe(visible);\n\t\ttest.log(Status.PASS, \"Sub-account created successfully\");\n\n\t\t//Creating a new transaction, testing if it's visible, if the value is correct and logging the result to the report\n\t\tSubAccountScreen.clickSubAccountItem(\"Test Automation jobs\");\n\t\tTransactionsScreen.clickAddTransactionBtn();\n\t\tTransactionsScreen.typeTransactionDescription(\"N26 Home Task\");\n\t\tTransactionsScreen.typeTransactionAmount(\"250\");\n\t\tTransactionsScreen.clickSaveBtn();\n\t\tTransactionsScreen.transactionItem(\"N26 Home Task\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$250\"));\n\t\ttest.log(Status.PASS, \"Transaction created and the value is correct\");\n\n\t\t//Testing if the transaction was created in the 'Double Entry' account and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickAccountItem(\"Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Current Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Cash in Wallet\");\n\t\tTransactionsScreen.transactionItem(\"N26 Home Task\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$250\"));\n\t\ttest.log(Status.PASS, \"Transaction in the 'Double Entry' account created and the value is correct\");\n\n\t\t//Deleting the account with the transaction, testing if it's not listed and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickOptionsBtnFromAccountItem(\"Freelance jobs\");\n\t\tMainScreen.clickDeleteAccountOption();\n\t\tMainScreen.clickDeleteTransactionRadioOption();\n\t\tMainScreen.clickDeleteBtn();\n\t\tMainScreen.accountItem(\"Freelance jobs\").shouldNotBe(visible);\n\t\ttest.log(Status.PASS, \"Account and Transaction deleted successfully\");\n\n\t\t//Testing if the transaction were deleted from the 'Double Entry' account and logging the result to the report\n\t\tMainScreen.clickAccountItem(\"Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Current Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Cash in Wallet\");\n\t\tTransactionsScreen.transactionItem(\"N26 Home Task\").shouldNotBe(visible);\n\t\ttest.log(Status.PASS, \"Transaction deleted successfully from the 'Double Entry' account\");\n\n\t}", "@Test\n public void proveraTransfera() {\n Account ivana = mobi.openAccount(\"Ivana\");\n Account pera = mobi.openAccount(\"Pera\");\n\n mobi.payInMoney(ivana.getNumber(), 5000.0);\n mobi.transferMoney(ivana.getNumber(), pera.getNumber(), 2000.0);\n //ocekujemo da nakon ovoga ivana ima 3000, a pera 2000\n\n SoftAssert sa = new SoftAssert();\n sa.assertEquals(ivana.getAmount(), 3000.0);\n sa.assertEquals(pera.getAmount(), 2000.0);\n\n sa.assertAll();\n }", "@Test\n\tpublic void depositTest(){\n\t\tCustomer cus = new Customer(\"wgl\", myDate, \"Beijing\");\n\t\tAccount cAcc = new CurrentAccount(cus);\n\t\tbc.deposit(cAcc, 500, true);\n\t\tboolean flag = false;\n\t\tif(cAcc.getBalance() == 500.0){\n\t\t\tflag = true;\n\t\t}\n\t\tassertTrue(flag);\n\t}", "@GetMapping(\"test\")\n\t@Timed\n\t@ResponseStatus(HttpStatus.CREATED)\n\tpublic void saveTransaction() throws ClientProtocolException, IOException {\n\n\t\ttry {\n\t\t\tContext context = new Context();\n\t\t\tcontext.setVariable(\"order\", \"fsdf\");\n\t\t\tcontext.setVariable(\"email\", \"fsdf\");\n\t\t\tcontext.setVariable(\"hash\", \"https://\" + CAN_NETWORK + \"etherscan.io/tx/\");\n\t\t\tcontext.setVariable(\"can\", \"https://\" + CAN_NETWORK + \"etherscan.io/tx/\");\n\t\t\tcontext.setVariable(\"amount\", \"CAN\");\n\t\t\tcontext.setVariable(BASE_URL, jHipsterProperties.getMail().getBaseUrl());\n\t\t\tString content = templateEngine.process(\"mail/transactionConfirm\", context);\n\n\t\t\tsendEmail(\"[email protected]\", \"Transaction Successful\", content, false, true);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public void base_ok(Transaction t) {\n verify_transaction(t);\n make_transaction(t);\n }", "boolean hasTxnresponse();", "public final void testValidTransaction() {\n assertTrue(testTransaction1.isValidTransaction());\n assertFalse(testTransaction2.isValidTransaction());\n }", "public boolean registerPayment(Payment transfer) {\n boolean done = false;\n String sql = \"INSERT INTO payment(description, total, member_id) VALUES(?,?,?)\";//pay_date: en la base de datos poner por defecto el valor del tiempo actual con el metodo now()\n try ( Connection con = connect(); PreparedStatement pstmt = con.prepareStatement(sql)) {\n pstmt.setString(1, transfer.getDescription());\n pstmt.setInt(2, (int) transfer.getTotal());\n\n pstmt.setInt(3, transfer.getMember_id());\n pstmt.executeUpdate();\n done = true;\n\n System.out.println(\"Payment transfered\");\n } catch (SQLException e) {\n System.out.println(\"Error in the transaction\");\n System.out.println(e.getMessage());\n }\n\n return done;\n }", "private void submitTransaction() {\n String amountGiven = amount.getText().toString();\n double decimalAmount = Double.parseDouble(amountGiven);\n amountGiven = String.format(\"%.2f\", decimalAmount);\n String sourceGiven = source.getText().toString();\n String descriptionGiven = description.getText().toString();\n String clientId = mAuth.getCurrentUser().getUid();\n String earnedOrSpent = \"\";\n\n if(amountGiven.isEmpty()){\n amount.setError(\"Please provide the amount\");\n amount.requestFocus();\n return;\n }\n\n if(sourceGiven.isEmpty()){\n source.setError(\"Please provide the source\");\n source.requestFocus();\n return;\n }\n\n if(descriptionGiven.isEmpty()){\n descriptionGiven = \"\";\n }\n\n int selectedRadioButton = radioGroup.getCheckedRadioButtonId();\n\n if(selectedRadioButton == R.id.radioSpending){\n Log.d(\"NewTransactionActivity\", \"Clicked on Spending\");\n earnedOrSpent = \"Spent\";\n }\n else{\n Log.d(\"NewTransactionActivity\", \"Clicked on Earning\");\n earnedOrSpent = \"Earned\";\n }\n\n storeTransactionToDatabase(clientId, earnedOrSpent, amountGiven, sourceGiven, descriptionGiven);\n\n }", "@Test\n void bankListIsAccountExistToTransfer_accountExistWithSufficientMoneyToTransfer_success() {\n ByteArrayOutputStream outContent = new ByteArrayOutputStream();\n System.setOut(new PrintStream(outContent));\n BankList bankList = new BankList(storage);\n Ui uiTest = new Ui();\n Bank newSavingAccount = new Saving(\"Test Saving Account\", 1000, 2000);\n Bank newInvestmentAccount = new Investment(\"Test Investment Account\", 1000);\n String expectedReturnType = \"investment\";\n\n try {\n bankList.bankListAddBank(newSavingAccount, uiTest);\n bankList.bankListAddBank(newInvestmentAccount, uiTest);\n outContent.reset();\n String returnType = bankList.getTransferBankType(\"Test Investment Account\",\n 500);\n assertEquals(expectedReturnType, returnType);\n\n\n } catch (BankException error) {\n System.out.println(\"Expected no throw, but error thrown\");\n }\n\n assertEquals(2, bankList.getBankListSize());\n\n }", "Purchase create(Purchase purchase) throws SQLException, DAOException;", "@Test\n public void savings_account2() {\n Bank bank = new Bank();\n Customer bill = new Customer(\"Bill\");\n Account savingsAccount = new SavingsAccount(bill, Account.SAVINGS);\n bank.addCustomer(new Customer(\"Bill\").openAccount(savingsAccount));\n Transaction t = new CreditTransaction(500.0);\n t.setTransactionDate(getTestDate(-15));\n savingsAccount.addTransaction(t);\n\n assertEquals(Math.pow(1 + 0.001 / 365, 15) * 500.0 - 500, bank.totalInterestPaid(), DOUBLE_DELTA);\n }", "protected abstract Transaction createAndAdd();", "@Override\n public boolean insert(Transaksi transaksi) {\n try {\n String query = \"INSERT INTO transaksi (id, tgl_transaksi) VALUES (?, ?)\";\n\n PreparedStatement ps = Koneksi().prepareStatement(query);\n ps.setString(1, transaksi.getId());\n ps.setString(2, transaksi.getTglTransaksi());\n\n if (ps.executeUpdate() > 0) {\n return true;\n }\n } catch (SQLException se) {\n se.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return false;\n }", "public boolean recordTrade(Trade trade) throws Exception;", "Transaction createTransaction();", "if (charge == adhocTicket.getCharge()) {\n System.out.println(\"Charge is passed\");\n }", "@Test\n\tpublic void testAdminCreate() {\n\t\tAccount acc1 = new Account(00000, \"ADMIN\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"ADMIN\", 00000, 0, \"A\"));\n\t\ttransactions.add(1, new Transaction(05, \"new acc\", 00001, 100.00, \"A\"));\n\t\ttransactions.add(2, new Transaction(00, \"ADMIN\", 00000, 0, \"A\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tif (outContent.toString().contains(\"Account Created\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"unable to create account as admin\", testResult);\n\t}", "private Transaction setUpTransaction(double amount, Transaction.Operation operation, String username){\n Transaction transaction = new Transaction();\n transaction.setDate(Date.valueOf(LocalDate.now()));\n transaction.setAmount(amount);\n transaction.setOperation(operation);\n transaction.setUserId(userRepository.getByUsername(username).getId());\n return transaction;\n }", "@Test\n\tpublic void createAccountChequingTest() {\n\t\trdbtnChequing.setSelected(true); // by default AddAccountDialog will\n\t\t\t\t\t\t\t\t\t\t\t// select this to be true, for\n\t\t\t\t\t\t\t\t\t\t\t// testing reset to fault\n\t\tdata.setRdbtnChequing(rdbtnChequing);\n\t\tAccount account = data.createNewAccount();\n\t\taccountTest = new Account(TEST_ACCOUNT_NAME, bankTest,\n\t\t\t\tAccount.Types.CHEQUING.getAccountType());\n\t\tassertEquals(accountTest, account);\n\t}", "@Test\n public void testImpossible1TransferMoney() {\n Bank bank = new Bank();\n User user = new User(\"Petr\", \"0000 000000\");\n AccountOfUser acc = new AccountOfUser(0, \"0000 0000 0000 0000\");\n AccountOfUser acc2 = new AccountOfUser(0, \"0000 0000 0000 0001\");\n bank.addUser(user);\n bank.addAccountToUser(user.getPassport(), acc);\n bank.addAccountToUser(user.getPassport(), acc2);\n assertThat(bank.transferMoney(user.getPassport(), acc.getRequisites(), user.getPassport(), acc2.getRequisites(), 100), is(false));\n }", "public static void createTransaction() throws IOException {\n\t\t\n\t\tDate date = new Date((long) random(100000000));\n\t\tString date2 = \"'19\" + date.getYear() + \"-\" + (random(12)+1) + \"-\" + (random(28)+1) + \"'\";\n\t\tint amount = random(10000);\n\t\tint cid = random(SSNmap.size()) + 1;\n\t\tint vid = random(venders.size()) + 1;\n\t\t\n\t\twhile(ownership.get(cid) == null)\n\t\t\tcid = random(SSNmap.size()) + 1;\n\t\tString cc = ownership.get(cid).get(random(ownership.get(cid).size()));\n\t\t\n\t\twriter.write(\"INSERT INTO Transaction (Id, Date, vid, cid, CCNum, amount) Values (\" + tid++ +\", \" \n\t\t\t\t+ date2 + \", \" + vid + \", \" + cid + \", '\" + cc + \"', \" + amount + line);\n\t\twriter.flush();\n\t}", "int insert(PurchasePayment record);", "@Test\n public void testValidBalance() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 100 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(100, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "public Transaction createTransaction(Credentials user, TransactionType tt) throws RelationException;", "@Override\n\tpublic void createItem(Object result) {\n\t\t\n\t\tunloadform();\n\t\tif (result != null) {\n\t\t\tIOTransactionLogic tr = (IOTransactionLogic) result;\n\t\t\tint year = Calendar.getInstance().get(Calendar.YEAR);\n\t\t\tint month = Calendar.getInstance().get(Calendar.MONTH);\n\t\t\t\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tcal.setTime(tr.getDate());\n\t\t\tint trYear = cal.get(Calendar.YEAR);\n\t\t\tint trMonth = cal.get(Calendar.MONTH);\n\t\t\t\n\t\t\tif ((year == trYear) && (month == trMonth)\n\t\t\t\t\t&& tr.getBankAccountID() == bal.getId()) {\n\t\t\t\ttransactionDisplayer trDisplayer = new transactionDisplayer(tr);\n\t\t\t\tsetDataLineChart();\n\t\t\t\tsetDataPieChart();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "@Test\n public void testCreatePurchaseOrder() throws Exception {\n System.out.println(\"createPurchaseOrder\");\n Long factoryId = 1L;\n Long contractId = 2L;\n Double purchaseAmount = 4D;\n Long storeId = 2L;\n String destination = \"store\";\n Calendar deliveryDate = Calendar.getInstance();\n deliveryDate.set(2015, 0, 13);\n Boolean isManual = false;\n Boolean isToStore = true;\n PurchaseOrderEntity result = PurchaseOrderManagementModule.createPurchaseOrder(factoryId, contractId, purchaseAmount, storeId, destination, deliveryDate, isManual, isToStore);\n assertNotNull(result);\n }", "public void addTrans(View v)\r\n {\r\n Log.d(TAG, \"Add transaction button clicked!\");\r\n\r\n EditText editLabel = (EditText) findViewById(R.id.edit_label);\r\n String label = (editLabel == null)? \"\" : editLabel.getText().toString();\r\n\r\n EditText editAmount = (EditText) findViewById(R.id.edit_amount);\r\n double amount = ((editAmount == null) || (editAmount.getText().toString().equals(\"\")))? 0 :\r\n Double.valueOf(editAmount.getText().toString());\r\n\r\n CheckBox chkBill = (CheckBox) findViewById(R.id.chk_bill);\r\n CheckBox chkLoan = (CheckBox) findViewById(R.id.chk_loan);\r\n String special = \"\";\r\n special = (chkBill == null || !chkBill.isChecked())? special : \"Bill\";\r\n special = (chkLoan == null || !chkLoan.isChecked())? special : \"Loan\";\r\n\r\n\r\n EditText editTag = (EditText) findViewById(R.id.edit_tag);\r\n String tag = (editTag == null)? \"\" : editTag.getText().toString();\r\n\r\n Transaction t = new Transaction(false, amount, label, special, tag);\r\n\r\n Week weekAddedTo = BasicFinancialMainActivity.weeks\r\n .get(BasicFinancialMainActivity.currentWeekIndex);\r\n weekAddedTo.addTrans(t);\r\n BasicFinancialMainActivity.weeks.set(BasicFinancialMainActivity.currentWeekIndex, weekAddedTo);\r\n BasicFinancialMainActivity.saveWeeksData();\r\n\r\n startActivity(new Intent(this, BasicFinancialMainActivity.class));\r\n }", "@Test\n public void transferCheckingtoSavingsTest(){\n assertTrue(userC.transfer(150.00, userS));\n }", "public void testAutoBalanceTransactions(){\n\t\tsetDoubleEntryEnabled(false);\n\t\tmTransactionsDbAdapter.deleteAllRecords();\n\n\t\tassertThat(mTransactionsDbAdapter.getRecordsCount()).isEqualTo(0);\n\t\tString imbalanceAcctUID = mAccountsDbAdapter.getImbalanceAccountUID(Currency.getInstance(CURRENCY_CODE));\n\t\tassertThat(imbalanceAcctUID).isNull();\n\n\t\tvalidateTransactionListDisplayed();\n\t\tonView(withId(R.id.fab_create_transaction)).perform(click());\n\t\tonView(withId(R.id.fragment_transaction_form)).check(matches(isDisplayed()));\n\n\t\tonView(withId(R.id.input_transaction_name)).perform(typeText(\"Autobalance\"));\n\t\tonView(withId(R.id.input_transaction_amount)).perform(typeText(\"499\"));\n\n\t\t//no double entry so no split editor\n\t\t//TODO: check that the split drawable is not displayed\n\t\tonView(withId(R.id.menu_save)).perform(click());\n\n\t\tassertThat(mTransactionsDbAdapter.getRecordsCount()).isEqualTo(1);\n\t\tTransaction transaction = mTransactionsDbAdapter.getAllTransactions().get(0);\n\t\tassertThat(transaction.getSplits()).hasSize(2);\n\t\timbalanceAcctUID = mAccountsDbAdapter.getImbalanceAccountUID(Currency.getInstance(CURRENCY_CODE));\n\t\tassertThat(imbalanceAcctUID).isNotNull();\n\t\tassertThat(imbalanceAcctUID).isNotEmpty();\n\t\tassertTrue(mAccountsDbAdapter.isHiddenAccount(imbalanceAcctUID)); //imbalance account should be hidden in single entry mode\n\n\t\tassertThat(transaction.getSplits()).extracting(\"mAccountUID\").contains(imbalanceAcctUID);\n\n\t}", "public void other_statements_ok(Transaction t) {\n System.out.println(\"about to verify\");\n verify_transaction(t);\n System.out.println(\"verified\");\n make_transaction(t);\n System.out.println(\"success!\");\n }", "void setTransactionSuccessful();", "@Test\n\tpublic void createAccountDebtsTest() {\n\t\tsetChequingRadioDefaultOff();\n\t\trdbtnDebt.setSelected(true);\n\t\tdata.setRdbtnDebt(rdbtnDebt);\n\t\tAccount account = data.createNewAccount();\n\t\taccountTest = new Account(TEST_ACCOUNT_NAME, bankTest,\n\t\t\t\tAccount.Types.DEBITS.getAccountType());\n\t\tassertEquals(accountTest, account);\n\t}", "protected abstract Txn createTxn(Txn parent, IsolationLevel level) throws Exception;", "@Test\r\n\tpublic void testInsertMoney() {\r\n\t\tvendMachine.insertMoney(10.0);\r\n\t\tassertEquals(10.0, vendMachine.getBalance(), 0.001);\r\n\t}", "@Test\n\tpublic void withdrawTest(){\n\t\tCustomer cus = new Customer(\"wgl\", myDate, \"Beijing\");\n\t\tAccount cAcc = new CurrentAccount(cus);\n\t\tbc.withdraw(cAcc, 300);\n\t\tboolean flag = false;\n\t\tif(cAcc.getBalance() == -300.0){\n\t\t\tflag = true;\n\t\t}\n\t\tassertTrue(flag);\n\t}", "public boolean insertMethod(Scanner scanner,Connection connection,Logger logger) {\n\t\tTransaction trxn = new Transaction();\n\t\tMySQLAccess create_Query=new MySQLAccess();\n\t\tboolean r = false;\n\t\ttry {\n\n\t\t\tSystem.out.println(\"-------Creating a Transaction-------\");\n\t\t\tSystem.out.println(\"Enter ID\");\n\t\t\ttrxn.setID(scanner.next());\n\t\t\tSystem.out.println(\"Enter Name_on_card\");\n\t\t\ttrxn.setNameOnCard(scanner.next()); \n\t\t\t//trxn.setCardNumber(CardNumber);\n\t\t\tSystem.out.println(\"CardNumber\");\n\t\t\tString CardNumber = scanner.next();\n\t\t\ttrxn.setCardNumber(CardNumber);\n\t\t\tSystem.out.println(\"UnitPrice\");\n\t\t\t//String up = scanner.next();\n\t\t\t\n\t\t\ttrxn.setUnitPrice(Integer.parseInt(scanner.next()) );\n\t\t\tSystem.out.println(\"Quantity\");\n\t\t\ttrxn.setQuantity(Integer.parseInt(scanner.next()));\n\t\t\tSystem.out.println(\"TotalPrice\");\n\t\t\ttrxn.setTotalPrice(Float.parseFloat(scanner.next()));\n\t\t\tSystem.out.println(\"ExpDate\");\n\t\t\tString ExpDate = scanner.next();\n\t\t\t\n\t\t\t//System.out.println(ExpDate.length());\n\t\t\t//System.out.println(ExpDate.lastIndexOf(\"/\"));\n\t\t\tint flag =0;\n\t\t\tif (ExpDate.length()== 7 && ExpDate.lastIndexOf(\"/\")==2)\n\t\t\t{\n\t\t\t\tint MM = Integer.parseInt(ExpDate.substring(0, ExpDate.lastIndexOf(\"/\")));\n\t\t\t\tint YYYY = Integer.parseInt(ExpDate.substring(ExpDate.lastIndexOf(\"/\")+1,ExpDate.length() ));\n\t\t\t\tSystem.out.println(MM);\n\t\t\t\tSystem.out.println(YYYY);\n\t\t\t\tif (MM>0 && YYYY>2015 && YYYY<2032 && MM<13)\n\t\t\t\t{\n\t\t\t\t\t//System.out.println(\"correct\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Incorrect Date Format\");\n\t\t\t\t\tflag = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"Incorrect Date Format\");\n\t\t\t\tflag = 1;\n\t\t\t}\n\t\t\ttrxn.setExpDate(ExpDate);\t\n\t\t\t//System.out.println(\"CreatedOn\");\n\t\t\tString CreatedOn = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\").format(Calendar.getInstance().getTime());\n\t\t\ttrxn.setCreatedOn(CreatedOn);\n\t\t\t//System.out.println(\"CreatedBy\");\n\t\t\t//statement.setString(9, System.getProperty(\"user.name\"));\n\t\t\ttrxn.setCreatedBy(System.getProperty(\"user.name\"));\n\t\t\t//System.out.println(\"Credit card type(1.Visa/2.American Express/3.Mastercard)\");\n\t\t\t// String cardtype = scanner.next();\n\t\t\t//\n\t\t\tString cardtype = \"Unknown\";\n\t\t\tif (CardNumber.length() == 16) {\n\t\t\t\tif (CardNumber.startsWith(\"51\") || CardNumber.startsWith(\"52\") || CardNumber.startsWith(\"53\")\n\t\t\t\t\t\t|| CardNumber.startsWith(\"54\") || CardNumber.startsWith(\"55\")) {\n\t\t\t\t\tcardtype = \"Mastercard\";\n\n\t\t\t\t}\n\t\t\t\tif (CardNumber.startsWith(\"4\")) {\n\t\t\t\t\tcardtype = \"Visa\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (CardNumber.length() == 15 && (CardNumber.startsWith(\"34\") || (CardNumber.startsWith(\"37\")))) {\n\t\t\t\t\tcardtype = \"American Express\";\n\t\t\t\t}\n\n\t\t\t}\n\t\t\ttrxn.setCardtype(cardtype);\n\t\t\t//System.out.println(trxn);\n\n\t\t\t\n\t\t\t//statement.setString(10, cardtype);\n\t\t\t\n/*\t\t\tString DisplaysqlID = \"select * from transaction where ID =\"+ID;\n\t\t\tConnection con1 = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/tutorial1\", \"root\", \"root\");\n\t\t\tPreparedStatement stmt1 = con1.prepareStatement(DisplaysqlID);\t\n\t\t\tSystem.out.println(DisplaysqlID);\n\t\t\tResultSet resultSet = stmt1.executeQuery(DisplaysqlID);\n\t\t\tif(resultSet.next())\n\t\t\t\tflag = 2;\n\t\t\t\n\t\t\t// the validation of fields if empty is taken care by using Scanner.next()\n\t\t\tif (flag == 0)\n\t\t\t{\n\t\t\tint rowsInserted = statement.executeUpdate();\n\t\t\tif (rowsInserted == 1) {\n\t\t\t\tSystem.out.println(\"Your data has been inserted\");\n\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(flag==2)\n\t\t\t\t\tSystem.out.println(\"User already exists\");\n\t\t\t\telse\n\t\t\t\t\tSystem.out.println(\"Please once again check your data\");\n\t\t\t}\n\t\t\t//scanner.close();\n\t\t\tcon.close();*/\n\t\t\t r = create_Query.createTransaction(trxn,connection,logger);\n\t\t} catch (InputMismatchException e) {\n\t\t\tSystem.out.println(\"Enter Valid Input\");\n\t\t\tlogger.severe(e.getMessage());\n\t\t}\n\t\t//System.out.println(trxn);\n\t\treturn r;\n\n\t}", "public Receipt recordTransaction(Transaction t) throws RemoteException;", "private synchronized String processCreate(String query) {\r\n\t\tString[] valuesCommand = query.split(\" \");\r\n\t\tif ( valuesCommand.length != 3 )\r\n\t\t\treturn \"ERROR Bad syntaxe command CREATE - Usage : CREATE id initial_solde\";\r\n\t\tString id = valuesCommand[1];\r\n\t\tif ( this.bank.existAccount(id) ) {\r\n\t\t\treturn \"ERROR Account alwready exist\";\r\n\t\t}\r\n\t\tdouble number = Double.valueOf(valuesCommand[2]);\r\n\t\tthis.bank.createAccount(id, number);\r\n\t\treturn \"OK \" + this.bank.getLastOperation(id);\r\n\t}", "@Override\n public void beforeValidate(Transaction transaction) {\n transaction = transaction;\n Toast.makeText(getActivity(), transaction.getReference(), Toast.LENGTH_LONG).show();\n\n }", "@Test\n\tpublic void createAccTest() {\n\t\tCustomer cus = new Customer(\"wgl\", myDate, \"Beijing\");\n\t\tbc.createAccount(cus, 1);\n\t\tassertEquals(1, cus.getAccList().size());\n\t}", "@Override\n public void onSuccess(Transaction transaction) {\n\n transaction = transaction;\n dialog.setMessage(\"Trying to Verify Your Transaction... please wait\");\n Log.d(\"REFERENCE\", transaction.getReference());\n Toast.makeText(getActivity(), transaction.getReference(), Toast.LENGTH_LONG).show();\n\n\n verifyOnServer(transaction.getReference());\n }", "public long createTransaction(Credentials c, TransactionType tt) throws RelationException;", "public boolean addTransaction(double amount) {\n if ((this.balance+amount)>=0) {\r\n this.transactions.add(amount);\r\n balance+=amount;\r\n return true;\r\n }else{\r\n System.out.println(\"Balance Insufficient\");\r\n return false;\r\n }\r\n }", "public boolean addTransaction(Transaction trans) {\n if (trans == null) {\n return false;\n }\n if (!previousHash.equals(\"0\")) {\n if (!trans.processTransaction()) {\n System.out.println(\"Transaction failed to process. Transaction discarded!\");\n return false;\n }\n }\n transactions.add(trans);\n System.out.println(\"Transaction successfully added to the block\");\n return true;\n }", "@Override\n\tpublic int newTransaction(String username, long amount, String type, String message) {\n\t\ttry {\n\t\t\tdb.getTransaction().begin();\n\t\t\tTransaction trans = new Transaction(username, amount, type, message);\n\t\t\tdb.persist(trans);\n\t\t\tdb.getTransaction().commit();\n\t\t\treturn trans.getId();\n\t\t} catch (Exception e) {\n\t\t\tSystem.out.println(\"Upps, Something happened in the database\");\n\t\t\treturn -1;\n\t\t}\n\t}", "public void makeTransaction(Transaction transaction)\n throws BalanceNotAvailableException, TransactionIdNotUniqueException, TransactionTypeInCorrectException {\n\n if (checkTransactionId(transaction.getTransactionId())) {\n throw new TransactionIdNotUniqueException(\"Transaction Id should be unique\");\n } else if (transaction.getTransactionType().equalsIgnoreCase(\"debit\")) {\n if (checkAvailableBalance(transaction.getAccountId(), transaction.getAmount())) {\n throw new BalanceNotAvailableException(\"Balance Not Available\");\n }\n updateAccountBalance(transaction.getAccountId(),\n getAccountBalance(transaction.getAccountId()) - transaction.getAmount());\n transactionRepository.save(transaction);\n } else if (transaction.getTransactionType().equalsIgnoreCase(\"credit\")) {\n updateAccountBalance(transaction.getAccountId(),\n getAccountBalance(transaction.getAccountId()) + transaction.getAmount());\n transactionRepository.save(transaction);\n } else {\n throw new TransactionTypeInCorrectException(\"Transaction type should be debit or credit\");\n }\n }", "@Test\n public void testRecordInboundMovement1() throws Exception {\n System.out.println(\"recordInboundMovement\");\n Long factoryId = 1L;\n Long goodsReceiptId = 1L;\n Long toBinId = 500L;\n String status = \"unrestricted\";\n Double quantity = 40D;\n Calendar creationDate = Calendar.getInstance();\n creationDate.set(2014, 9, 30, 15, 0, 0);\n Long expResult = -3L;\n Long result = FactoryInventoryManagementModule.recordInboundMovement(factoryId, goodsReceiptId, toBinId, status, quantity, creationDate);\n assertEquals(expResult, result);\n }", "private void storeTransactionToDatabase(final String clientId, final String earnedOrSpent, final String amountGiven, String sourceGiven, String descriptionGiven) {\n Transaction transaction = new Transaction(clientId, earnedOrSpent, amountGiven, sourceGiven, descriptionGiven, String.valueOf(date.getTime()));\n try {\n String transactionId = UUID.randomUUID().toString();\n DatabaseReference database = FirebaseDatabase.getInstance().getReference(\"Transactions/\" + transactionId);\n database.setValue(transaction).addOnCompleteListener(new OnCompleteListener<Void>() {\n @Override\n public void onComplete(@NonNull Task<Void> task) {\n if (task.isSuccessful()) {\n updateCurrentBalance(earnedOrSpent, clientId, amountGiven);\n Log.d(\"NewTransactionActivity\", \"Successfully added Transaction to Database\");\n } else {\n Log.d(\"NewTransactionActivity\", \"Failed to add Transaction to Database\");\n }\n }\n });\n }catch(Exception e){\n Log.d(\"NewTransactionActivity\", e.toString());\n }\n }", "public boolean makeTransfer(String fromAccountNumber,\r\n\t\t\tString toAccountNumber, double amount, String memo) {\r\n\t\tif (DaoUtility.isAccountNumberValid(fromAccountNumber)\r\n\t\t\t\t&& DaoUtility.isAccountNumberValid(toAccountNumber)) {\r\n\t\t} else\r\n\t\t\treturn false;\r\n\r\n\t\t// do transaction\r\n\t\tConnection conn = dbConnector.getConnection();\r\n\t\tif (conn==null)\r\n\t\t\treturn false;\r\n\t\t\r\n\t\tPreparedStatement st;\r\n\t\tString sql;\r\n\t\tResultSet rs;\r\n\r\n\t\ttry {\r\n\t\t\tconn.setAutoCommit(false);\r\n\t\t\tSavepoint savepnt = conn.setSavepoint();\r\n\r\n\t\t\ttry {\r\n\t\t\t\tint fromAccountId=0;\r\n\t\t\t\tint toAccountId=0;\r\n\t\t\t\tString fromName=\"SECRET USER\";\r\n\t\t\t\tString toName=\"SECRET USER\";\r\n\t\t\t\tString fname,mname,lname;\r\n\t\t\t\t\r\n\t\t\t\tst = conn.prepareStatement(\"select tbAccount.aid,balance,isactive,\"\r\n\t\t\t\t\t\t+ \"fname,mname,lname from tbAccount, tbClient \"\r\n\t\t\t\t\t\t+ \" where acnumber= ? and tbAccount.cid=tbClient.cid\");\r\n\t\t\t\tst.setString(1, fromAccountNumber);\r\n\t\t\t\trs = st.executeQuery();\r\n\t\t\t\tif (rs.next()){\r\n\t\t\t\t\tfromAccountId = rs.getInt(\"aid\");\r\n\t\t\t\t\tdouble balance = rs.getDouble(\"balance\");\r\n\t\t\t\t\tboolean isactive = rs.getBoolean(\"isactive\");\r\n\t\t\t\t\tfname = rs.getString(\"fname\");\r\n\t\t\t\t\tmname = rs.getString(\"mname\");\r\n\t\t\t\t\tlname = rs.getString(\"lname\");\r\n\t\t\t\t\tfromName = fname + \" \" + (mname==null?\"\":mname) + \" \" +lname;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (balance<amount || !isactive) { //not enough money or frozen\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tst = conn.prepareStatement(\"select aid,isactive,\"\r\n\t\t\t\t\t\t+ \" fname,mname,lname from tbAccount,tbClient \"\r\n\t\t\t\t\t\t+ \" where acnumber= ? and tbAccount.cid=tbClient.cid\");\r\n\t\t\t\tst.setString(1, toAccountNumber);\r\n\t\t\t\trs = st.executeQuery();\r\n\t\t\t\tif (rs.next()){\r\n\t\t\t\t\ttoAccountId = rs.getInt(\"aid\");\r\n\t\t\t\t\tboolean isactive = rs.getBoolean(\"isactive\");\r\n\t\t\t\t\tfname = rs.getString(\"fname\");\r\n\t\t\t\t\tmname = rs.getString(\"mname\");\r\n\t\t\t\t\tlname = rs.getString(\"lname\");\r\n\t\t\t\t\ttoName = fname + \" \" + (mname==null?\"\":mname) + \" \" +lname;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!isactive) { //frozen\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// substract balance of fromAccount\r\n\t\t\t\tst = conn.prepareStatement(\r\n\t\t\t\t\t\t\"update tbAccount set balance = balance - ? \"\r\n\t\t\t\t\t\t\t\t+ \" where balance >= ? \"\r\n\t\t\t\t\t\t\t\t+ \" and acnumber = ? \"\r\n\t\t\t\t\t\t\t\t+ \" and isactive=TRUE \");\r\n\t\t\t\tst.setDouble(1, amount);\r\n\t\t\t\tst.setDouble(2, amount);\r\n\t\t\t\tst.setString(3, fromAccountNumber);\r\n\t\t\t\tint nRs = st.executeUpdate();\r\n\t\t\t\tif (nRs <= 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tconn.rollback(savepnt);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// add balance of toAccount\r\n\t\t\t\tst = conn.prepareStatement(\r\n\t\t\t\t\t\t\"update tbAccount set balance = balance + ? \"\r\n\t\t\t\t\t\t\t\t+ \" where acnumber = ? \"\r\n\t\t\t\t\t\t\t\t+ \" and isactive=TRUE \");\r\n\t\t\t\tst.setDouble(1, amount);\r\n\t\t\t\tst.setString(2, toAccountNumber);\r\n\t\t\t\tnRs = st.executeUpdate();\r\n\t\t\t\tif (nRs <= 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tconn.rollback(savepnt);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// insert 2 transaction record\r\n\t\t\t\t// insert into tbTransaction(aid, trtype, amount, description)\r\n\t\t\t\t// values( select aid from tbAccount where acnumber='acnumber',\r\n\t\t\t\t// DEPOSIT_TRANSACTION_TYPE_ID,\r\n\t\t\t\t// amount, 'transfer 123.4 dollars to 3333343 on 2014-09-19')\r\n\t\t\t\t//\r\n\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n\t\t\t\tjava.util.Date date = new java.util.Date();\r\n\t\t\t\tString currentDate = dateFormat.format(date); // 2014-08-06\r\n\r\n\t\t\t\tsql = String.format(\r\n\t\t\t\t\t\t\"insert into tbTransaction(aid,trtype,amount,description) \"\r\n\t\t\t\t\t\t\t\t+ \" values( %d, \" + \"\t\t\t%d, \"\r\n\t\t\t\t\t\t\t\t+ \"\t\t\t%f, 'Transfer out %.2f dollars to %s(%s) on %s. MEMO: %s' ) \", \r\n\t\t\t\t\t\t\t\tfromAccountId,\r\n\t\t\t\t\tTRANSFER_OUT_TRANSACTION_TYPE_ID, amount, amount,\r\n\t\t\t\t\ttoAccountNumber, toName, currentDate,memo);\r\n\t\t\t\tnRs = st.executeUpdate(sql);\r\n\t\t\t\tif (nRs<=0)\r\n\t\t\t\t{\r\n\t\t\t\t\tconn.rollback(savepnt);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsql = String.format(\r\n\t\t\t\t\t\t\"insert into tbTransaction(aid,trtype,amount,description) \"\r\n\t\t\t\t\t\t\t\t+ \" values( %d, \" + \" %d, \"\r\n\t\t\t\t\t\t\t\t+ \"\t%f, 'Transfer in %.2f dollars from %s(%s) on %s. MEMO: %s' ) \", \r\n\t\t\t\t\t\t\t\ttoAccountId,\r\n\t\t\t\t\tTRANSFER_IN_TRANSACTION_TYPE_ID, amount, amount,\r\n\t\t\t\t\tfromAccountNumber, fromName, currentDate,memo);\r\n\t\t\t\tnRs = st.executeUpdate(sql);\r\n\t\t\t\tif (nRs<=0)\r\n\t\t\t\t{\r\n\t\t\t\t\tconn.rollback(savepnt);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t\t\t\r\n\t\t\t} catch (Exception ex) {\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t\tconn.rollback(savepnt);\r\n\t\t\t} finally {\r\n\t\t\t\tconn.setAutoCommit(true);\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tif (conn != null)\r\n\t\t\t\t\tconn.close();\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "@Test\n public void processTransactionManagerCaseA()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n Assert.assertEquals(false,trans_mang.processTransaction(acc.get_Account_Number(),acc2.get_Account_Number(),2000));\n }", "@Test\r\n\tpublic void testMakePurchase_not_enough_money() {\r\n\t\tassertEquals(false, vendMachine.makePurchase(\"A\"));\r\n\t}", "boolean createInvoice(int id, String title, LocalDate effecitvedate, float amount) throws PreconditionException, PostconditionException, ThirdPartyServiceException;", "public static boolean saveTransaction(Transaction transaction, TransactionType transactionType) {\r\n\t\tdbConnect();\r\n\t\tPreparedStatement stmt = null;\r\n\t\tboolean isTransactionOk = true;\r\n\r\n\t\t// Format Transaction Date for mysql\r\n\t\tDate date = new Date();\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n\t\t// Could also use java.sql.Date\r\n\t\t// java.sql.Date dat = new java.sql.Date(date.getTime());\r\n\r\n\t\t// Get purchase ClientId if existing and insert if client is new\r\n\t\tint purchaseClientId = getClientId(transaction.getNameOfClient(), transactionType);\r\n\t\tif (purchaseClientId == 0) {\r\n\t\t\tClient newClient = createNewClient(new Client(0, \"'\" + transaction.getNameOfClient() + \"'\", null, null),\r\n\t\t\t\t\ttransactionType);\r\n\t\t\tpurchaseClientId = newClient.getClientId();\r\n\t\t}\r\n\r\n\t\tfinal String INSERT_NEW_TRANSACTION;\r\n\t\t// Insert to purchase table\r\n\t\tif (transactionType == TransactionType.PURCHASE) {\r\n\t\t\tINSERT_NEW_TRANSACTION = \"INSERT INTO purchase (purchase_id, purchase_date, purchase_client_id, purchase_payment)\"\r\n\t\t\t\t\t+ \" VALUES (\" + transaction.getTransactionNumber() + \",'\" + sdf.format(date) + \"',\"\r\n\t\t\t\t\t+ purchaseClientId + \",\" + transaction.getTotalAmount() + \")\";\r\n\t\t} else {\r\n\t\t\tINSERT_NEW_TRANSACTION = \"INSERT INTO sales (sales_id, sales_date, sales_client_id, sales_payment)\"\r\n\t\t\t\t\t+ \" VALUES (\" + transaction.getTransactionNumber() + \",'\" + sdf.format(date) + \"',\"\r\n\t\t\t\t\t+ purchaseClientId + \",\" + transaction.getTotalAmount() + \")\";\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tstmt = conn.prepareStatement(INSERT_NEW_TRANSACTION);\r\n\t\t\tstmt.execute();\r\n\t\t\tstmt.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tisTransactionOk = false;\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// Insert to product_transaction table\r\n\t\tboolean isProductTransactionOk = saveProductTransactions(\r\n\t\t\t\t(transactionType == TransactionType.PURCHASE ? transaction.getTransactionNumber() : 0),\r\n\t\t\t\ttransaction.getProductList(),\r\n\t\t\t\t(transactionType == TransactionType.RETAIL ? transaction.getTransactionNumber() : 0));\r\n\r\n\t\t// Update Product Stock Quantity in product table\r\n\t\tboolean isInventoryStockOk = updateInventoryStock(transaction.getProductList(), transactionType);\r\n\r\n\t\treturn isTransactionOk && isProductTransactionOk && isInventoryStockOk;\r\n\t}" ]
[ "0.6536693", "0.62100655", "0.60498476", "0.60071486", "0.5922749", "0.57999444", "0.57973224", "0.5789302", "0.5786915", "0.5722957", "0.5706464", "0.56923556", "0.5666513", "0.56641597", "0.5657025", "0.563548", "0.56064916", "0.5592608", "0.5573065", "0.55642", "0.55638427", "0.55578923", "0.5556888", "0.5547789", "0.5547293", "0.55296016", "0.552625", "0.5520324", "0.5509573", "0.5505441", "0.5493034", "0.54921854", "0.5491462", "0.5485768", "0.5483569", "0.54643404", "0.5456188", "0.54435915", "0.54418355", "0.54368377", "0.5428668", "0.54267985", "0.5426494", "0.542146", "0.5414503", "0.5397784", "0.53938645", "0.53857595", "0.53845704", "0.5377174", "0.5375853", "0.5374102", "0.53625613", "0.5359908", "0.53594637", "0.53592026", "0.5357218", "0.53548676", "0.5344231", "0.5344211", "0.5337913", "0.5322273", "0.53150773", "0.53065526", "0.5306302", "0.53059065", "0.52937996", "0.5285502", "0.52821636", "0.5281475", "0.5278039", "0.5270606", "0.52662617", "0.5264744", "0.5256037", "0.52504534", "0.524896", "0.5248233", "0.52443445", "0.52382666", "0.52379173", "0.5236369", "0.5232835", "0.52309066", "0.5220646", "0.52179575", "0.521601", "0.5215135", "0.5207342", "0.5206326", "0.5205522", "0.52051747", "0.5198528", "0.5197784", "0.5196182", "0.5194278", "0.5190354", "0.51857674", "0.51847386", "0.5184096" ]
0.7106467
0
Editing an transaction, testing if it's visible with the new value and logging the result to the report
@Test(groups = "Transactions Tests", description = "Edit transaction") public void editTransaction() { MainScreen.clickAccountItem("Income"); SubAccountScreen.clickSubAccountItem("Salary"); TransactionsScreen.clickEditBtnFromTransactionItem("Extra income"); TransactionsScreen.typeTransactionDescription("Bonus"); TransactionsScreen.typeTransactionAmount("600"); TransactionsScreen.clickSaveBtn(); TransactionsScreen.transactionItem("Bonus").shouldBe(visible); TransactionsScreen.transactionAmout().shouldHave(text("$600")); test.log(Status.PASS, "Sub-account edited successfully and the value is correct"); //Testing if the edited transaction was edited in the 'Double Entry' account, if the value is correct and logging the result to the report returnToHomeScreen(); MainScreen.clickAccountItem("Assets"); SubAccountScreen.clickSubAccountItem("Current Assets"); SubAccountScreen.clickSubAccountItem("Cash in Wallet"); TransactionsScreen.transactionItem("Bonus").shouldBe(visible); TransactionsScreen.transactionAmout().shouldHave(text("$600")); test.log(Status.PASS, "Transaction in the 'Double Entry' account was edited too and the value is correct"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onEditTransaction(Transaction transaction) {\n\t}", "@Override\n\t\tpublic boolean update(AccountTransaction t) {\n\t\t\treturn false;\n\t\t}", "void editTransaction(ITransaction trans, ItemInterface tradeItem, String time, String place\n , String tradeType, IUserAccount user);", "private void updateTransactionFields() {\n if (transaction == null) {\n descriptionText.setText(\"\");\n executionDateButton.setText(dateFormat.format(new Date()));\n executionTimeButton.setText(timeFormat.format(new Date()));\n valueText.setText(\"\");\n valueSignToggle.setNegative();\n addButton.setText(R.string.add);\n // If we are editing a node, fill fields with current information\n } else {\n try {\n transaction.load();\n descriptionText.setText(transaction.getDescription());\n executionDateButton.setText(dateFormat.format(\n transaction.getExecutionDate()));\n executionTimeButton.setText(timeFormat.format(\n transaction.getExecutionDate()));\n BigDecimal value = transaction.getValue();\n valueText.setText(value.abs().toString());\n valueSignToggle.setToNumberSign(value);\n addButton.setText(R.string.edit);\n } catch (DatabaseException e) {\n Log.e(\"TMM\", \"Error loading transaction\", e);\n }\n }\n \n if (currentMoneyNode != null) {\n currencyTextView.setText(currentMoneyNode.getCurrency());\n }\n \n updateCategoryFields();\n updateTransferFields();\n }", "public void updateTransaction(Transaction trans);", "private void updateTransaction() {\n LogUtils.logEnterFunction(Tag);\n\n String inputtedAmount = etAmount.getText().toString().trim().replaceAll(\",\", \"\");\n if (inputtedAmount.equals(\"\") || Double.parseDouble(inputtedAmount) == 0) {\n etAmount.setError(getResources().getString(R.string.Input_Error_Amount_Empty));\n return;\n }\n\n if (mAccount == null) {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.Input_Error_Account_Empty));\n return;\n }\n\n Double amount = Double.parseDouble(inputtedAmount);\n int categoryId = mCategory != null ? mCategory.getId() : 0;\n String description = tvDescription.getText().toString();\n int accountId = mAccount.getId();\n String strEvent = tvEvent.getText().toString();\n Event event = null;\n\n if (!strEvent.equals(\"\")) {\n event = mDbHelper.getEventByName(strEvent);\n if (event == null) {\n long eventId = mDbHelper.createEvent(new Event(0, strEvent, mCal, null));\n if (eventId != -1) {\n event = mDbHelper.getEvent(eventId);\n }\n }\n }\n\n // Less: Repayment, More: Lend\n if(mCategory.getDebtType() == Category.EnumDebt.LESS || mCategory.getDebtType() == Category.EnumDebt.MORE) {\n\n boolean isDebtValid = true;\n if(mCategory.getDebtType() == Category.EnumDebt.LESS) { // Income -> Debt Collecting\n List<Debt> debts = mDbHelper.getAllDebtByPeople(tvPeople.getText().toString());\n\n Double lend = 0.0, debtCollect = 0.0;\n for(Debt debt : debts) {\n if(mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.MORE) {\n lend += debt.getAmount();\n }\n\n if(!mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.LESS) {\n debtCollect += debt.getAmount();\n }\n }\n\n if(debtCollect + amount > lend) {\n isDebtValid = false;\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_debt_collect_invalid));\n }\n\n } // End DebtType() == Category.EnumDebt.LESS\n if(isDebtValid) {\n Transaction transaction = new Transaction(mTransaction.getId(),\n TransactionEnum.Income.getValue(),\n amount,\n categoryId,\n description,\n 0,\n accountId,\n mCal,\n 0.0,\n \"\",\n event);\n\n int row = mDbHelper.updateTransaction(transaction);\n if (row == 1) { // Update transaction OK\n\n if(mDbHelper.getDebtByTransactionId(mTransaction.getId()) != null) {\n Debt debt = mDbHelper.getDebtByTransactionId(mTransaction.getId());\n debt.setCategoryId(mCategory.getId());\n debt.setAmount(amount);\n debt.setPeople(tvPeople.getText().toString());\n\n int debtRow = mDbHelper.updateDebt(debt);\n if(debtRow == 1) {\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_update_successful));\n cleanup();\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n } else {\n // Revert update\n mDbHelper.updateTransaction(mTransaction);\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_update_fail));\n }\n } else {\n Debt newDebt = new Debt();\n newDebt.setCategoryId(mCategory.getId());\n newDebt.setTransactionId((int) mTransaction.getId());\n newDebt.setAmount(amount);\n newDebt.setPeople(tvPeople.getText().toString());\n\n long debtId = mDbHelper.createDebt(newDebt);\n if(debtId != -1) {\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_create_successful));\n cleanup();\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n } else {\n // Revert update\n mDbHelper.updateTransaction(mTransaction);\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_update_fail));\n }\n } // End create new Debt\n\n } // End Update transaction OK\n } // End isDebtValid\n\n } else { // CATEGORY NORMAL\n Transaction transaction = new Transaction(mTransaction.getId(),\n TransactionEnum.Income.getValue(),\n amount,\n categoryId,\n description,\n 0,\n accountId,\n mCal,\n 0.0,\n \"\",\n event);\n\n int row = mDbHelper.updateTransaction(transaction);\n if (row == 1) { // Update transaction OK\n if(mDbHelper.getDebtByTransactionId(mTransaction.getId()) != null) {\n mDbHelper.deleteDebt(mDbHelper.getDebtByTransactionId(mTransaction.getId()).getId());\n }\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n }\n }\n\n LogUtils.logLeaveFunction(Tag);\n }", "@Override\n public boolean withdrawAmount(TransactionDTO transaction) {\n CustomerDetails customerDetails=this.viewAccount(transaction.getUserName()); \n if(customerDetails.getAccountBalance()>=transaction.getAmount()){\n customerDetails.setAccountBalance(customerDetails.getAccountBalance()-transaction.getAmount());\n customerRepository.save(customerDetails);\n return true;\n }\n else{\n return false;\n }\n }", "@LogMethod\r\n private void editResults()\r\n {\n navigateToFolder(getProjectName(), TEST_ASSAY_FLDR_LAB1);\r\n clickAndWait(Locator.linkWithText(TEST_ASSAY));\r\n waitAndClickAndWait(Locator.linkWithText(\"view results\"));\r\n DataRegionTable table = new DataRegionTable(\"Data\", getDriver());\r\n assertEquals(\"No rows should be editable\", 0, DataRegionTable.updateLinkLocator().findElements(table.getComponentElement()).size());\r\n assertElementNotPresent(Locator.button(\"Delete\"));\r\n\r\n // Edit the design to make them editable\r\n ReactAssayDesignerPage assayDesignerPage = _assayHelper.clickEditAssayDesign(true);\r\n assayDesignerPage.setEditableResults(true);\r\n assayDesignerPage.clickFinish();\r\n\r\n // Try an edit\r\n navigateToFolder(getProjectName(), TEST_ASSAY_FLDR_LAB1);\r\n clickAndWait(Locator.linkWithText(TEST_ASSAY));\r\n clickAndWait(Locator.linkWithText(\"view results\"));\r\n DataRegionTable dataTable = new DataRegionTable(\"Data\", getDriver());\r\n assertEquals(\"Incorrect number of results shown.\", 10, table.getDataRowCount());\r\n doAndWaitForPageToLoad(() -> dataTable.updateLink(dataTable.getRowIndex(\"Specimen ID\", \"AAA07XK5-05\")).click());\r\n setFormElement(Locator.name(\"quf_SpecimenID\"), \"EditedSpecimenID\");\r\n setFormElement(Locator.name(\"quf_VisitID\"), \"601.5\");\r\n setFormElement(Locator.name(\"quf_testAssayDataProp5\"), \"notAnumber\");\r\n clickButton(\"Submit\");\r\n assertTextPresent(\"Could not convert value: \" + \"notAnumber\");\r\n setFormElement(Locator.name(\"quf_testAssayDataProp5\"), \"514801\");\r\n setFormElement(Locator.name(\"quf_Flags\"), \"This Flag Has Been Edited\");\r\n clickButton(\"Submit\");\r\n assertTextPresent(\"EditedSpecimenID\", \"601.5\", \"514801\");\r\n assertElementPresent(Locator.xpath(\"//img[@src='/labkey/Experiment/flagDefault.gif'][@title='This Flag Has Been Edited']\"), 1);\r\n assertElementPresent(Locator.xpath(\"//img[@src='/labkey/Experiment/unflagDefault.gif'][@title='Flag for review']\"), 9);\r\n\r\n // Try a delete\r\n dataTable.checkCheckbox(table.getRowIndex(\"Specimen ID\", \"EditedSpecimenID\"));\r\n doAndWaitForPageToLoad(() ->\r\n {\r\n dataTable.clickHeaderButton(\"Delete\");\r\n assertAlert(\"Are you sure you want to delete the selected row?\");\r\n });\r\n\r\n // Verify that the edit was audited\r\n goToSchemaBrowser();\r\n viewQueryData(\"auditLog\", \"ExperimentAuditEvent\");\r\n assertTextPresent(\r\n \"Data row, id \",\r\n \", edited in \" + TEST_ASSAY + \".\",\r\n \"Specimen ID changed from 'AAA07XK5-05' to 'EditedSpecimenID'\",\r\n \"Visit ID changed from '601.0' to '601.5\",\r\n \"testAssayDataProp5 changed from blank to '514801'\",\r\n \"Deleted data row.\");\r\n }", "public void UpdateTransaction() {\n\t\tgetUsername();\n\t\tcol_transactionID.setCellValueFactory(new PropertyValueFactory<Account, Integer>(\"transactionID\"));\n\t\tcol_date.setCellValueFactory(new PropertyValueFactory<Account, Date>(\"date\"));\n\t\tcol_description.setCellValueFactory(new PropertyValueFactory<Account, String>(\"description\"));\n\t\tcol_category.setCellValueFactory(new PropertyValueFactory<Account, String>(\"category\"));\n\t\tcol_amount.setCellValueFactory(new PropertyValueFactory<Account, Double>(\"amount\"));\n\t\tmySqlCon.setUsername(username);\n\t\tlists = mySqlCon.getAccountData();\n\t\ttableTransactions.setItems(lists);\n\t}", "void fillEditTransactionForm(Transaction transaction);", "@Override\n public boolean depositAmount(TransactionDTO transaction) {\n if(transaction.getAmount()>0){\n CustomerDetails customerDetails=this.viewAccount(transaction.getUserName()); \n customerDetails.setAccountBalance(customerDetails.getAccountBalance()+transaction.getAmount());\n customerRepository.save(customerDetails);\n return true;\n }else{\n return false;\n }\n }", "Trade editTrade(String tradeId, Trade editedTrade) throws \n OrderBookTradeException;", "@Audit(transName=\"editUnitConfirmation\", transType=\"editUnit\", beforeLog=TRUE, afterLog=TRUE)\r\n\tpublic void editUnitConfirmation(){\r\n\t\t\r\n\t\twsrdModel.setErrorMsg(\"\");\r\n\t\twsrdModel.setDuplicateErrorMsg(\"\");\r\n\t\tif(checkMultipleUnitEdit()){\r\n\t\t\twsrdModel.setErrorMsg(WsrdConstants.UNSAVED);\r\n\t\t}\r\n\t\telse{\r\n\r\n\t\t\tif(checkUnitUnavaialble()){\r\n\t\t\t\twsrdModel.setErrorMsg(WsrdConstants.UNAVAILABLE);\r\n\t\t\t}\r\n\t\t\telse{\r\n\r\n\t\t\t\tString str=checkForUnitAssociation();\r\n\t\t\t\tif(\"Selected item is linked with with attribute.\".equalsIgnoreCase(str.trim())){\r\n\t\t\t\t\twsrdModel.setDuplicateErrorMsg(str);\r\n\t\t\t\t\twsrdModel.setErrorMsg(WsrdConstants.UNIT_CONFLICT);\r\n\t\t\t\t\t\r\n\t\t\t }\r\n\t\t\t\r\n\t\t\t\telse{\r\n\t\t\t\t\teditUnit();\t\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t\t\r\n\t\t}\r\n\r\n\t}", "public void editTransactionAgent(Agent agent);", "@Test\n\tpublic void editBillTo(){\n\t\tQuotePage quotePage = homePage.goToDocumentsPage().switchToTab(DocumentTabs.QUOTES).setFilterByModifiedBy(\"All\").goToQuote(1);\n\n\t\tquotePage.clickBillTo();\n\t}", "@Override\n\tpublic int updateInventory(int tranNo, int amount) throws Exception {\n\t\treturn 0;\n\t}", "public Boolean editRecord(String recordID, String fieldName, String newValue, String managerID);", "void editTakingPrice() throws PresentationException {\n\t\tTakingPrice tp = null;\n\t\tint codebar_item;\n\t\tint code_supermarket;\n\t\tint newCodeItem;\n\n\t\tprinter.printMsg(\"Digite o código do item a ser alterado? \");\n\t\tcodebar_item = reader.readNumber();\n\n\t\tprinter.printMsg(\"Digite o código do supermercado a ser alterado? \");\n\t\tcode_supermarket = reader.readNumber();\n\n\t\tprinter.printMsg(\n\t\t\t\t\" Digite a data da tomada de preço do item: (Ex.Formato: '2017-12-16 10:55:53' para 16 de dezembro de 2017, 10 horas 55 min e 53 seg)\");\n\t\tString dateTP = reader.readText();\n\t\tdateTP = reader.readText();\n\n\t\tString pattern = \"yyyy-mm-dd hh:mm:ss\";\n\t\tSimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\t\tDate dateTPF = null;\n\t\ttry {\n\t\t\tdateTPF = simpleDateFormat.parse(dateTP);\n\t\t} catch (ParseException e) {\n\t\t\tthrow new PresentationException(\"Não foi possível executar a formatação da data no padrão definido\", e);\n\t\t\t// e.printStackTrace();\n\t\t}\n\t\t// pensando em cadastrar o novo preço sem editar o preço antigo. Senão terei que\n\t\t// controlar por muitos atributos.\n\n\t\tif (tpm.checksExistence(codebar_item, code_supermarket, dateTPF)) {\n\t\t\ttp = tpm.getTakingPrice(codebar_item, code_supermarket, dateTPF);\n\t\t\tint codeSupermarket = tp.getCodeSupermarket();\n\t\t\tdouble priceItem = tp.getPrice();\n\t\t\tDate dateTPE = tp.getDate();\n\t\t\tint respEdit = 0;\n\n\t\t\ttpm.deleteTakingPrice(codebar_item, code_supermarket, dateTPE);\n\n\t\t\tdo {\n\t\t\t\ttry {\n\t\t\t\t\trespEdit = this.askWhatEdit(tp);\n\n\t\t\t\t} catch (NumeroInvalidoException e) {\n\t\t\t\t\tthrow new PresentationException(\"A opção digitada não é uma opção válida\", e);\n\t\t\t\t}\n\n\t\t\t\tif (respEdit == 1) {\n\t\t\t\t\tprinter.printMsg(\" Digite o novo código do item: \");\n\t\t\t\t\tnewCodeItem = reader.readNumber();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.saveTakingPrice(newCodeItem, priceItem, codeSupermarket, dateTPE);\n\t\t\t\t\t} catch (PresentationException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t} else if (respEdit == 2) {\n\t\t\t\t\tprinter.printMsg(\" Digite o novo código do supermercado: \");\n\t\t\t\t\tint newCodeSupermarket = 0;\n\t\t\t\t\tnewCodeSupermarket = reader.readNumber();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.saveTakingPrice(codebar_item, priceItem, newCodeSupermarket, dateTPE);\n\t\t\t\t\t} catch (PresentationException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t} else if (respEdit == 3) {\n\t\t\t\t\tprinter.printMsg(\" Digite o novo preço do item: \");\n\t\t\t\t\tdouble newPriceItem = 0;\n\t\t\t\t\tnewPriceItem = reader.readNumberDouble();\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.saveTakingPrice(codebar_item, newPriceItem, codeSupermarket, dateTPE);\n\t\t\t\t\t} catch (PresentationException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t} else if (respEdit == 4) {\n\t\t\t\t\tprinter.printMsg(\n\t\t\t\t\t\t\t\" Digite a nova data da tomada de preço do item: (Ex.Formato: '2017-12-16 10:55:53' para 16 de dezembro de 2017, 10 horas 55 min e 53 seg)\");\n\t\t\t\t\tString date = reader.readText();\n\t\t\t\t\tdate = reader.readText();\n\n\t\t\t\t\t// String pattern = \"yyyy-mm-dd hh:mm:ss\";\n\t\t\t\t\t// SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);\n\t\t\t\t\tDate newDateTP = null;\n\t\t\t\t\ttry {\n\t\t\t\t\t\tnewDateTP = simpleDateFormat.parse(date);\n\t\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\t\tthrow new PresentationException(\"A opção digitada não é uma opção válida\", e);\n\t\t\t\t\t\t// e.printStackTrace();\n\t\t\t\t\t}\n\t\t\t\t\tSystem.out.println(\"Date:\" + date);\n\n\t\t\t\t\ttry {\n\t\t\t\t\t\tthis.saveTakingPrice(codebar_item, priceItem, codeSupermarket, newDateTP);\n\t\t\t\t\t} catch (PresentationException e) {\n\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t} while (respEdit != 1 & respEdit != 2 & respEdit != 3 & respEdit != 4);\n\n\t\t} else\n\n\t\t{\n\t\t\tprinter.printMsg(\"Não existe tomada de preço com estes códigos cadastrados.\");\n\t\t}\n\n\t}", "public void editOperation() {\n\t\t\r\n\t}", "private void commitEdit (int validValue)\r\n\t{\r\n\t\tm_value = validValue;\r\n\t}", "@Override\n\tpublic void updateTransaction(Transaction transaction) {\n\t\t\n\t}", "boolean edit(InvoiceDTO invoiceDTO);", "public void editTransaction(Transaction transaction) {\n\n\t\tIntent intent = new Intent(AllTransactionsActivity.this, BuildTransactionActivity.class);\n\n\t\tintent.putExtra(\"transaction\", transaction);\n\t\tstartActivity(intent);\n\t}", "public boolean changeAmountBy(Money Other);", "public void editBalance() {\n\t\tAccount account = getAccountForEditBalance();\n\n\t\tif (adminDao.editBalance(account))\n\t\t\tSystem.out.println(\"Balance edited!\");\n\t\telse\n\t\t\tSystem.out.println(\"Something went wrong!\");\n\n\t\tAdminMenu.getAdminMenu();\n\t}", "public void tryEdit() throws SQLException, DataStoreException, Exception {\r\n\t\tif (isDataModified()) {\r\n\t\t\tscrollToMe();\r\n if (getValidator().getUseAlertsForErrors()) {\r\n addConfirmScript(_okToEditQuestion, _okToEditValue);\r\n }\r\n else {\r\n _validator.setErrorMessage(_okToEditQuestion, null, -1, _okToEdit);\r\n }\r\n\t\t}\r\n else {\r\n\t\t\tdoEdit();\r\n }\r\n\t}", "void setTransactionSuccessful();", "public void updateMoney()\n\t\t{\n\t\t\t\n\t\t\tFPlayer p1 = this.viewer;\n\t\t\tFPlayer p2 = (p1.equals(this.t.p1)) ? this.t.p2 : this.t.p1;\n\t\t\t\n\t\t\tItemStack om = new ItemStack(Material.GREEN_WOOL,1);\n\t\t\tItemMeta it = om.getItemMeta();\n\t\t\tit.setDisplayName(ChatColor.DARK_GREEN+ChatColor.BOLD.toString()+\"Money in trade:\");\n\t\t\tit.setLore(Arrays.asList(new String[] {\"\",Util.getMoney(this.t.getMoneyTraded(p1)),\"\",\"Click to add/remove money from trade\"}));\n\t\t\tom.setItemMeta(it);\n\t\t\t\n\t\t\tif (this.canAdd()) super.contents.put(0,new ItemSwapMenu(this,om,new MenuMoney(super.viewer,this.t)));\n\t\t\telse super.contents.put(0,new ItemDummy(this,om));\n\t\t\t\n\t\t\t// Trader money in trade\n\t\t\tItemStack tm = new ItemStack(Material.GREEN_WOOL,1);\n\t\t\tit = tm.getItemMeta();\n\t\t\tit.setDisplayName(ChatColor.DARK_GREEN+ChatColor.BOLD.toString()+\"Money in trade:\");\n\t\t\tit.setLore(Arrays.asList(new String[] {\"\",Util.getMoney(this.t.getMoneyTraded(p2))}));\n\t\t\ttm.setItemMeta(it);\n\t\t\tsuper.contents.put(8,new ItemDummy(this,tm));\n\t\t\tthis.composeInv();\n\t\t}", "@Test\n\tpublic void testFuncionamentoUpdateVersionLockOtimista(){\n \n\t\tdoInTransaction( session -> {\n\t\t\tArtista roberto = session.get(Artista.class, 3L);\n\t\t\troberto.getDetalhes().setBiografia(\"Biografia alterada...\");\n\t\t\tsession.update(roberto);\n\t\t});\n\t\t \n\t}", "public boolean canDedit(double amount);", "public boolean display(Display disp)\r\n\t{\r\n\t\tEditTradeoff ar = new EditTradeoff(disp, this, false);\r\n\t\tString msg = \"Edited tradeoff \" + this.getName() + \" \" + ar.getCanceled();\r\n\t\tDataLog d = DataLog.getHandle();\r\n\t\td.writeData(msg);\r\n\t\treturn ar.getCanceled(); //can I do this?\r\n\t\t\r\n\t}", "@Override\n\tpublic void updateTransaction(Transaction transaction) {\n\n\t}", "private void btnEditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditActionPerformed\n boolean flag = this.cutiController.save(txtCutiID.getText(), (txtTglAwal.getText()), (txtTglAkhir.getText()),\n txtKet.getText(), cmbCutiKhususID.getSelectedIndex());\n String message = \"Failed to edit data\";\n if (flag){\n message = \"Success to edit data\";\n }\n JOptionPane.showMessageDialog(this, message, \"Notification\", JOptionPane.INFORMATION_MESSAGE);\n bindingTable();\n reset();\n }", "void edit(Price Price);", "private void pushEditedReport() throws JSONException {\n Cursor cursor = getEditedReportCursor();\n\n if(cursor.getCount() != 0) {\n cursor.moveToFirst();\n\n\n\n int updatedRows;\n\n do {\n final Long reportBaseId = cursor.getLong(\n cursor.getColumnIndex(ReportEntry._ID));\n final ExpenseReport expenseReport = Utility\n .createExpenseReportFromCursor(cursor);\n\n ERTRestApi.apiEditReport(\n expenseReport,\n new ERTRestApi.ERTRestApiListener<JSONObject>() {\n\n @Override\n public void onResponse(JSONObject response) {\n\n pushSavedExpenseLineItem();\n\n int updatedRows = updateReportSyncStatus\n (reportBaseId,\n SyncStatus.SYNCED\n );\n Log.d(LOG_TAG, \"SyncStatus after test \" +\n getReportSyncStatus(getContext(),\n reportBaseId));\n Log.d(LOG_TAG, \"Report ID: \" + expenseReport.getId());\n\n }\n },\n new ERTRestApi.ERTRestApiErrorListener() {\n @Override\n public void onErrorResponse(ERTRestApi\n .ERTRestApiError error) {\n\n int updatedRows = updateReportSyncStatus\n (reportBaseId, SyncStatus.EDITED_REPORT);\n Log.d(LOG_TAG, \"updated rows edit report error:\" + updatedRows);\n Log.e(LOG_TAG, error.getMessage());\n\n }\n });\n\n updatedRows = updateReportSyncStatus(reportBaseId,\n SyncStatus.SYNC_IN_PROGRESS\n );\n\n Log.d(LOG_TAG, \"updated rows edit report complete:\" + updatedRows);\n\n } while (cursor.moveToNext());\n }\n cursor.close();\n }", "public boolean editTaskProgSetting(){\r\n\t\tboolean result = false;\r\n\t\tint txtBxValue = 0;\r\n\t\ttry{\r\n\t\t\tfindElement(By.xpath(\"//div[@class='actionBtnHolderPopup']//input[@value='Edit']\")).click();\r\n\t\t\tif(driver.findElement(By.id(\"afterEdit\")).getAttribute(\"style\").contains(\"block\")){\r\n\t\t\t\tfor(String iSrcString : iSourceStatusString){\r\n\t\t\t\t\tiSourceStatus = (iSrcString.split(\";\"))[0];\r\n\t\t\t\t\tRFI = Integer.parseInt((iSrcString.split(\";\"))[1]);\r\n\t\t\t\t\tRFP = Integer.parseInt((iSrcString.split(\";\"))[2]);\r\n\t\t\t\t\tRFQ = Integer.parseInt((iSrcString.split(\";\"))[3]);\r\n\t\t\t\t\tAuction = Integer.parseInt((iSrcString.split(\";\"))[4]);\r\n\t\t\t\t\tfor(int itr = 1; itr<5; itr++){\r\n\t\t\t\t\t\tif(itr==1)\r\n\t\t\t\t\t\t\ttxtBxValue = RFI; \r\n\t\t\t\t\t\telse if(itr==2)\r\n\t\t\t\t\t\t\ttxtBxValue = RFP;\r\n\t\t\t\t\t\telse if(itr==3)\r\n\t\t\t\t\t\t\ttxtBxValue = RFQ;\r\n\t\t\t\t\t\telse if(itr==4)\r\n\t\t\t\t\t\t\ttxtBxValue = Auction;\r\n\t\t\t\t\t\tWebElement txtBx = driver.findElement(By.xpath(\"//table/tbody/tr[td[text()='\"+iSourceStatus+\"']]/td[\"+itr+1+\"]/input\"));\r\n\t\t\t\t\t\ttxtBx.clear();\r\n\t\t\t\t\t\ttxtBx.sendKeys(String.valueOf(txtBxValue));\r\n\t\t\t\t\t}\r\n\t\t\t\t\tfindElement(By.name(\"savenapply\")).click();\r\n\t\t\t\t\tif(driver.findElement(ConfirmationDialog.getDialogTitle()).isDisplayed()){\r\n\t\t\t\t\t\tif(driver.findElement(ConfirmationDialog.getPopupMsg()).getText().contains(\"You are changing % progress for iSource status\")){\r\n\t\t\t\t\t\t\tfindElement(ConfirmationDialog.getDialogYesBtn()).click();\r\n\t\t\t\t\t\t\tresult = true;\r\n\t\t\t\t\t\t}else\r\n\t\t\t\t\t\t\tlogger.log(LogStatus.INFO, \"Incorrect Confirmation Dialog message displayed\");\r\n\t\t\t\t\t}else\r\n\t\t\t\t\t\tlogger.log(LogStatus.INFO, \"Confirmation Dialog not displayed\");\r\n\t\t\t\t}\r\n\t\t\t}else\r\n\t\t\t\tlogger.log(LogStatus.INFO, \"Edit button not working\");\r\n\t\t}catch(Exception e){\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\treturn result;\r\n\t}", "@Test\r\n\tpublic void testEditAlert() throws DuplicateRecordException, RecordNotFoundException {\r\n\t\tSecurityAlert alert = addAlert();\r\n\t\talert.setAlertMessage(\"emergency in 6th floor\");\r\n\t\talert.setAlertType(\"less urgent\");\r\n\t\talertService.updateSecurityAlert(alert);\r\n\t\tassertNotEquals(\"LOL\",alertService.findByPk(alert.getId()).getAlertMessage());\r\n\t\tassertNotEquals(\"Emergency\",alertService.findByPk(alert.getId()).getAlertType());\r\n\t}", "public synchronized void writeChange(Transaction t, String item\n\t\t\t\t\t\t\t\t\t\t\t, String oldVal, String newVal) {\n\t\tpw.println(t.transactionId() + \"\" + (char)30 + item + (char)30 + oldVal \n\t\t\t\t\t\t+ (char)30 + newVal);\n\t}", "@Override\n public void edit(ReporteAccidente rep) {\n repr.save(rep);\n }", "@Test\n public void updateTest2() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setBar(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isBar() ,\"Should return true if update Servizio\");\n }", "@Test\r\n\tpublic void testUpdateQuantity() throws IdNotContainedException { \r\n\t\tint initialQuantity = menu.findItemId(\"DES006\").getQuantity();\r\n\t int expectedQuantity = 2;\r\n\t processOrder.updateItemQuantity(currentOrder);\r\n\t int actualQuantity = menu.findItemId(\"DES006\").getQuantity();\r\n\t String message =\"Value updated succesfully\";\r\n\t\tassertEquals(message, actualQuantity, expectedQuantity ); \r\n assertTrue(actualQuantity > initialQuantity); //make sure that when updating the value has increased\r\n\r\n\t}", "public\n void\n displayTransactions(Transaction trans)\n {\n getRegisterPanel().updateView(getFilter(), trans);\n }", "public void testUpdateAccount(){\n\t\tint id = 10 ;\n\t\tAccount acc = this.bean.findAccountById(id ) ;\n\t\tacc.setDatetime(CommUtil.getNowDate()) ;\n\t\tint r = this.bean.updateAccount(acc) ;\n\t\tAssert.assertEquals(r, 1) ;\n\t}", "public void actionSetAudit_actionPerformed(ActionEvent e) throws Exception {\n\t\t\tsuper.actionSetAudit_actionPerformed(e);\n\t\t\tif(KDTableUtil.getSelectedRow(tblMain) == null){\n\t\t\t\tMsgBox.showWarning(this, \"请先选中行!\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t int currRow = -1;\n\t\t\t String chcek = null;\n\t\t\t int[] selectRows = KDTableUtil.getSelectedRows(this.tblMain);\n\t\t\t for (int i = 0; i < selectRows.length; i++) {\n\t\t\t currRow = selectRows[i];\n\t\t\t String ObjectPK = this.tblMain.getRow(currRow).getCell(\"id\").getValue().toString();\n\t\t\t if (!ObjectPK.equals(chcek)) {\n\t\t\t \t FeesWarrantInfo fwinfo= FeesWarrantFactory.getRemoteInstance().getFeesWarrantInfo(new ObjectUuidPK(ObjectPK));\n\t\t\t if (FDCBillStateEnum.SUBMITTED.equals(fwinfo.getState()))\n\t\t\t {\n\t\t\t \tfwinfo.setState(FDCBillStateEnum.AUDITTED);\n\t\t\t \tFeesWarrantFactory.getRemoteInstance().update(new ObjectUuidPK(ObjectPK),fwinfo);\n\t\t\t }else{\n\t\t\t \t MsgBox.showError(\" 第\" + (selectRows[i] + 1) + \"行 单据状态已提交,不能审批!\");\n\t\t\t }\n\t\t\t chcek = ObjectPK;\n\t\t\t }\n\t\t\t }\n\t\t\t actionRefresh_actionPerformed(e);\n\t\t\t if (chcek == null) {\n\t\t\t MsgBox.showInfo(\" 请选中一行!\");\n\t\t\t SysUtil.abort();\n\t\t\t }\n\t\t}", "@Test\n public void isDirty_freshObject() {\n AlphaTransaction t = startTransaction();\n IntRef value = new IntRef(0);\n IntRefTranlocal tranlocal = (IntRefTranlocal) t.openForWrite(value);\n assertTrue(tranlocal.isDirty());\n }", "@Override\n public boolean update(Transaksi transaksi) {\n try {\n String query = \"UPDATE transaksi SET tgl_transaksi=? WHERE id=?\";\n\n PreparedStatement ps = Koneksi().prepareStatement(query);\n ps.setString(1, transaksi.getTglTransaksi());\n ps.setString(2, transaksi.getId());\n\n if (ps.executeUpdate() > 0) {\n return true;\n }\n } catch (SQLException se) {\n se.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return false;\n }", "void confirmTrans(ITransaction trans);", "@Test(groups = \"Transactions Tests\", description = \"Duplicate transaction\")\n\tpublic void duplicateTransaction() {\n\t\tMainScreen.clickAccountItem(\"Income\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Salary\");\n\t\tTransactionsScreen.clickOptionsBtnFromTransactionItem(\"Bonus\");\n\t\tTransactionsScreen.clickDuplicateTransactionOption();\n\t\tTransactionsScreen.transactionItens(\"Bonus\").shouldHave(size(2));\n\t\ttest.log(Status.PASS, \"Transaction successfully duplicated\");\n\n\t\t//Testing if there is two identical transactions in the 'Double Entry' account and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickAccountItem(\"Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Current Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Cash in Wallet\");\n\t\tTransactionsScreen.transactionItens(\"Bonus\").shouldHave(size(2));\n\t\ttest.log(Status.PASS, \"Transaction successfully duplicated in the 'Double Entry' account\");\n\n\t}", "void setShowReportAmount(String amount);", "public void printTransaction() {\n\t\tdao.printTransaction();\r\n\t\t\r\n\t}", "void readOnlyTransaction();", "private void btnEditActionPerformed(java.awt.event.ActionEvent evt) {\n PAK_ISSUE_SALE_DB data= new PAK_ISSUE_SALE_DB();\n if(data.chech_qty(connAA,invNo.getText())){\n// if(data.chech_order_or_sale(connAA,invNo.getText())){// invno present in Customer leger or not\n forBackBtnEnable(false); recEditBtnEnable(false);textFieldsEditable(true);saveUpdateBtnVisible(\"update\", true);sellers1=(String)suppName.getSelectedItem();refNo1=refNo.getText();remarks1=remarks.getText();\n// }else{\n// JFrame j=new JFrame();j.setAlwaysOnTop(true);\n// JOptionPane.showMessageDialog(j,\n// \"You can not edit the delivered stock because it is generated from Sales Order\",\n// \"InfoBox: \", JOptionPane.INFORMATION_MESSAGE);\n }else{\n JFrame j=new JFrame();j.setAlwaysOnTop(true);\n JOptionPane.showMessageDialog(j,\n \"You can't Edit or Delete this invoice Due to Entry Of Sales Return.\"\n + \"\\nFor Edit or Delete First Go to the Return Page & Set text '0' in Issue Adjustment\",\n \"InfoBox: \", JOptionPane.INFORMATION_MESSAGE);\n }\n }", "void editAssetValue(int newVal);", "private void performDirectEdit() {\n\t}", "@Test\n public void updateTest4() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setAnimazione(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isAnimazione() ,\"Should return true if update Servizio\");\n }", "@Test\n public void updateTest10() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setBar(true);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(true, servizio.isBar() ,\"Should return true if update Servizio\");\n }", "@Test \n\tpublic void edit() \n\t{\n\t\tassertTrue(true);\n\t}", "private void reportTransactionStatus(boolean success){\n if(success){\n sendMessage(\"<st>\");\n }else{\n sendMessage(\"<f>\");\n }\n }", "@Test\n public void updateTest3() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setRistorante(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isRistorante() ,\"Should return true if update Servizio\");\n }", "@Test\r\n\tpublic void testPortfolioValueUpdate1() {\n\t\tassertTrue(\"Portfolio value must reflect current data\", false);\r\n\t}", "public void testSumAtSelectionOnOthersAccount() {\r\n addAccount();\r\n addAccount2();\r\n solo.pressSpinnerItem(0, 1);\r\n addOp();\r\n tools.printCurrentTextViews();\r\n assertTrue(solo.getText(FIRST_SUM_AT_SEL_IDX).getText().toString().contains(Formater.getSumFormater().format(2000.50 - 10.50)));\r\n }", "public void beforeEdit(Librerias.ZafTblUti.ZafTblEvt.ZafTableEvent evt) {\n// strEstCncDia=tblDat.getValueAt(tblDat.getSelectedRow(), INT_TBL_DAT_EST_CON)==null?\"\":tblDat.getValueAt(tblDat.getSelectedRow(), INT_TBL_DAT_EST_CON).toString();\n// if(strEstCncDia.equals(\"S\")){\n// mostrarMsgInf(\"<HTML>La cuenta ya fue conciliada.<BR>Desconcilie la cuenta en el documento a modificar y vuelva a intentarlo.</HTML>\");\n//// fireAsiDiaListener(new ZafAsiDiaEvent(this), INT_BEF_EDI_CEL);\n// objTblCelEdiTxtVcoCta.setCancelarEdicion(true);\n// }\n// else if(strEstCncDia.equals(\"B\")){\n// mostrarMsgInf(\"<HTML>No se puede cambiar el valor de la cuenta<BR>Este valor proviene de la transferencia ingresada.</HTML>\");\n// objTblCelEdiTxtVcoCta.setCancelarEdicion(true);\n// }\n// else{\n// //Permitir de manera predeterminada la operaci�n.\n// blnCanOpe=false;\n// //Generar evento \"beforeEditarCelda()\".\n// fireAsiDiaListener(new ZafAsiDiaEvent(this), INT_BEF_EDI_CEL);\n// //Permitir/Cancelar la edici�n de acuerdo a \"cancelarOperacion\".\n// if (blnCanOpe)\n// {\n// objTblCelEdiTxtVcoCta.setCancelarEdicion(true);\n// }\n// }\n }", "@Test\n public void updateTest12() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setAnimazione(true);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(true, servizio.isAnimazione() ,\"Should return true if update Servizio\");\n }", "@Test\n\tpublic void testAddTransaction(){\n setDoubleEntryEnabled(true);\n\t\tsetDefaultTransactionType(TransactionType.DEBIT);\n validateTransactionListDisplayed();\n\n\t\tonView(withId(R.id.fab_create_transaction)).perform(click());\n\n\t\tonView(withId(R.id.input_transaction_name)).perform(typeText(\"Lunch\"));\n\t\tonView(withId(R.id.input_transaction_amount)).perform(typeText(\"899\"));\n\t\tonView(withId(R.id.input_transaction_type))\n\t\t\t\t.check(matches(allOf(isDisplayed(), withText(R.string.label_receive))))\n\t\t\t\t.perform(click())\n\t\t\t\t.check(matches(withText(R.string.label_spend)));\n\n\t\tString expectedValue = NumberFormat.getInstance().format(-899);\n\t\tonView(withId(R.id.input_transaction_amount)).check(matches(withText(expectedValue)));\n\n int transactionsCount = getTransactionCount();\n\t\tonView(withId(R.id.menu_save)).perform(click());\n\n validateTransactionListDisplayed();\n\n List<Transaction> transactions = mTransactionsDbAdapter.getAllTransactionsForAccount(DUMMY_ACCOUNT_UID);\n assertThat(transactions).hasSize(2);\n Transaction transaction = transactions.get(0);\n\t\tassertThat(transaction.getSplits()).hasSize(2);\n\n assertThat(getTransactionCount()).isEqualTo(transactionsCount + 1);\n }", "public void updateAccountingSystem(Sale sale)\n {\n \n }", "@Test\r\n\tpublic void testReturnChange() {\r\n\t\tvendMachine.insertMoney(5.0);\r\n\t\tassertEquals(5.0, vendMachine.returnChange(), 0.001);\r\n\t}", "@Test(groups = \"Transactions Tests\", description = \"Transaction Calculation\")\n\tpublic void transactionCalculation() {\n\t\tMainScreen.clickAccountItem(\"Income\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Salary\");\n\t\tTransactionsScreen.clickAddTransactionBtn();\n\t\tTransactionsScreen.typeTransactionDescription(\"Extra income\");\n\t\tTransactionsScreen.typeTransactionAmount(\"100\");\n\t\tTransactionsScreen.clickTransactionType();\n\t\tTransactionsScreen.clickSaveBtn();\n\t\tTransactionsScreen.transactionItem(\"Extra income\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$100\"));\n\t\ttest.log(Status.PASS, \"Transaction created successfully and the value is correct\");\n\n\t\t//Creating another transaction, testing if its visible, if the value is correct and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickAccountItem(\"Expenses\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Books\");\n\t\tTransactionsScreen.clickAddTransactionBtn();\n\t\tTransactionsScreen.typeTransactionDescription(\"How to become a good QA Engineer book\");\n\t\tTransactionsScreen.typeTransactionAmount(\"50\");\n\t\tTransactionsScreen.clickSaveBtn();\n\t\tTransactionsScreen.transactionItem(\"How to become a good QA Engineer book\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$50\"));\n\t\ttest.log(Status.PASS, \"Second transaction created successfully and the value is correct\");\n\n\t\t//Testing if the calculation is correct and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickAccountItem(\"Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Current Assets\");\n\t\tSubAccountScreen.transactionAmoutFromSubAccountItem(\"Cash in Wallet\").shouldHave(text(\"$50\"));\n\t\ttest.log(Status.PASS, \"Calculation is correct\");\n\n\t\t//Deleting both transactions for app cleanup and logging the result to the report\n\t\tSubAccountScreen.clickSubAccountItem(\"Cash in Wallet\");\n\t\tTransactionsScreen.clickOptionsBtnFromTransactionItem(\"Extra income\");\n\t\tTransactionsScreen.clickDeleteTransactionOption();\n\t\tTransactionsScreen.clickOptionsBtnFromTransactionItem(\"How to become a good QA Engineer book\");\n\t\tTransactionsScreen.clickDeleteTransactionOption();\n\t\ttest.log(Status.PASS, \"Transactions deleted successfully\");\n\t\t\n\t\t//Testing if both transactions were deleted from the 'Double Entry' account and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickAccountItem(\"Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Current Assets\");\n\t\tSubAccountScreen.transactionAmoutFromSubAccountItem(\"Cash in Wallet\").shouldHave(text(\"$0\"));\n\t\ttest.log(Status.PASS, \"Transactions from the 'Double Entry' account deleted successfully\");\n\n\t}", "private int modifyByTrans(HttpServletRequest request, LineCodeMapper entityMapper, PrmVersionMapper pvMapper, LineCode po) throws Exception {\n TransactionStatus status = null;\r\n int n = 0;\r\n try {\r\n\r\n// txMgr = DBUtil.getDataSourceTransactionManager(request);\r\n// status = txMgr.getTransaction(DBUtil.getTransactionDefinition(request));\r\n status = txMgr.getTransaction(this.def);\r\n n = entityMapper.modifyLineCode(po);\r\n pvMapper.modifyPrmVersionForDraft(po);\r\n\r\n txMgr.commit(status);\r\n } catch (Exception e) {\r\n if (txMgr != null) {\r\n txMgr.rollback(status);\r\n }\r\n throw e;\r\n }\r\n return n;\r\n }", "public void testEditValue() throws Exception, Throwable {\n System.out.println(\"editValue\");\n Builder builder = new Builder();\n Document document = builder.build(this.doc, \"\");\n String issueId = \"http://linkedgov.org/data/dwp-electricity-use/1/issue/1\";\n Document out = (Document) PrivateAccessor.invoke(TaskUpdater.class,\n \"editValue\",\n new Class[] {Document.class, String.class, String.class, String.class},\n new Object[] {(Document) document.copy(), issueId, \"99.50\", null});\n \n Model main = (Model) PrivateAccessor.invoke(TaskUpdater.class,\n \"getMainGraphFromDocument\",\n new Class[] {Document.class},\n new Object[] {out});\n assertEquals(2, main.size());\n }", "public void setTransaction(Double transaction) {\r\n this.transaction = transaction;\r\n }", "@Test\n public void updateTest1() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setCabina(false);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(false, servizio.isCabina() ,\"Should return true if update Servizio\");\n }", "@Override\r\n\tpublic void updateTranCode(Purchase Purchase) throws Exception {\n\t\t\r\n\t}", "public void modifier(){\r\n try {\r\n //affectation des valeur \r\n echeance_etudiant.setIdEcheanceEtu(getViewEtudiantInscripEcheance().getIdEcheanceEtu()); \r\n \r\n echeance_etudiant.setAnneeaca(getViewEtudiantInscripEcheance().getAnneeaca());\r\n echeance_etudiant.setNumetu(getViewEtudiantInscripEcheance().getNumetu());\r\n echeance_etudiant.setMatricule(getViewEtudiantInscripEcheance().getMatricule());\r\n echeance_etudiant.setCodeCycle(getViewEtudiantInscripEcheance().getCodeCycle());\r\n echeance_etudiant.setCodeNiveau(getViewEtudiantInscripEcheance().getCodeNiveau());\r\n echeance_etudiant.setCodeClasse(getViewEtudiantInscripEcheance().getCodeClasse());\r\n echeance_etudiant.setCodeRegime(getViewEtudiantInscripEcheance().getCodeRegime());\r\n echeance_etudiant.setDrtinscri(getViewEtudiantInscripEcheance().getInscriptionAPaye());\r\n echeance_etudiant.setDrtforma(getViewEtudiantInscripEcheance().getFormationAPaye()); \r\n \r\n echeance_etudiant.setVers1(getViewEtudiantInscripEcheance().getVers1());\r\n echeance_etudiant.setVers2(getViewEtudiantInscripEcheance().getVers2());\r\n echeance_etudiant.setVers3(getViewEtudiantInscripEcheance().getVers3());\r\n echeance_etudiant.setVers4(getViewEtudiantInscripEcheance().getVers4());\r\n echeance_etudiant.setVers5(getViewEtudiantInscripEcheance().getVers5());\r\n echeance_etudiant.setVers6(getViewEtudiantInscripEcheance().getVers6()); \r\n \r\n //modification de l'utilisateur\r\n echeance_etudiantFacadeL.edit(echeance_etudiant); \r\n } catch (Exception e) {\r\n System.err.println(\"Erreur de modification capturée : \"+e);\r\n } \r\n }", "@Test(groups = \"Transactions Tests\", description = \"Create new transaction\")\n\tpublic void createNewTransaction() {\n\t\tMainScreen.clickAccountItem(\"Income\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Salary\");\n\t\tTransactionsScreen.clickAddTransactionBtn();\n\t\tTransactionsScreen.typeTransactionDescription(\"Extra income\");\n\t\tTransactionsScreen.typeTransactionAmount(\"300\");\n\t\tTransactionsScreen.clickTransactionType();\n\t\tTransactionsScreen.typeTransactionNote(\"Extra income from this month\");\n\t\tTransactionsScreen.clickSaveBtn();\n\t\tTransactionsScreen.transactionItem(\"Extra income\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$300\"));\n\t\ttest.log(Status.PASS, \"Sub-account created successfully and the value is correct\");\n\n\t\t//Testing if the transaction was created in the 'Double Entry' account, if the value is correct and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickAccountItem(\"Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Current Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Cash in Wallet\");\n\t\tTransactionsScreen.transactionItem(\"Extra income\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$300\"));\n\t\ttest.log(Status.PASS, \"'Double Entry' account also have the transaction and the value is correct\");\n\n\t}", "int updateByPrimaryKeySelective(CGcontractCredit record);", "public boolean editarV2(){\n\t\tDate hoy = new Date();\n\t\tint transcurridos = 0;\n\t\tif(estatus.equals(EEstatusRequerimiento.EMITIDO) || estatus.equals(EEstatusRequerimiento.RECIBIDO_EDITADO)){\n\t\t\tif(fechaUltimaModificacion != null){\n\t\t\t\ttranscurridos = obtener_dias_entre_2_fechas(fechaUltimaModificacion, hoy);\n\t\t\t\tif(transcurridos == 0 || transcurridos == 1)\n\t\t\t\t\treturn true;\n\t\t\t\telse \n\t\t\t\t\treturn false;\n\t\t\t}else if(fechaCreacion != null){\n\t\t\t\ttranscurridos = obtener_dias_entre_2_fechas(fechaCreacion, hoy);\n\t\t\t\tif(transcurridos == 0 || transcurridos == 1)\n\t\t\t\t\treturn true;\n\t\t\t\telse \n\t\t\t\t\treturn false;\n\t\t\t} \n\t\t}\n\t\treturn false;\t\n\t}", "private static synchronized void writeTransaction( StmTransaction transaction ) {\n\n // Check for conflicts.\n for ( AbstractVersionedItem versionedItem : transaction.versionedItemsRead ) {\n versionedItem.ensureNotWrittenByOtherTransaction();\n }\n\n // Set the revision number to a committed value.\n transaction.targetRevisionNumber.set( lastCommittedRevisionNumber.incrementAndGet() );\n\n }", "@LogMethod\r\n private void editAssay()\r\n {\r\n log(\"Testing edit and delete and assay definition\");\r\n clickProject(getProjectName());\r\n waitAndClickAndWait(Locator.linkWithText(TEST_ASSAY));\r\n\r\n // change a field name and label and remove a field\r\n ReactAssayDesignerPage designerPage = _assayHelper.clickEditAssayDesign();\r\n DomainFormPanel domainFormPanel = designerPage.expandFieldsPanel(\"Results\");\r\n domainFormPanel.getField(5).setName(TEST_ASSAY_DATA_PROP_NAME + \"edit\");\r\n domainFormPanel.getField(5).setLabel(TEST_ASSAY_DATA_PROP_NAME + \"edit\");\r\n domainFormPanel.removeField(domainFormPanel.getField(4).getName(), true);\r\n designerPage.clickFinish();\r\n\r\n //ensure that label has changed in run data in Lab 1 folder\r\n navigateToFolder(getProjectName(), TEST_ASSAY_FLDR_LAB1);\r\n clickAndWait(Locator.linkWithText(TEST_ASSAY));\r\n clickAndWait(Locator.linkWithText(TEST_RUN1));\r\n assertTextPresent(TEST_ASSAY_DATA_PROP_NAME + \"edit\");\r\n assertTextNotPresent(TEST_ASSAY_DATA_PROP_NAME + 4);\r\n\r\n AuditLogTest.verifyAuditEvent(this, AuditLogTest.ASSAY_AUDIT_EVENT, AuditLogTest.COMMENT_COLUMN, \"were copied to a study from the assay: \" + TEST_ASSAY, 5);\r\n }", "void editExpenditureDetails(\n int expenditureIndex, String description, String amount, String date, String category, Ui ui)\n throws TransactionException, BankException {\n logger.warning(\"This account does not support this feature\");\n throw new BankException(\"This account does not support this feature\");\n }", "public int modificar(TratamientoVO tratamiento) {\n\t\treturn 0;\n\t}", "public boolean updateMaxTransaction(java.math.BigDecimal transactionID) throws java.rmi.RemoteException;", "boolean isEdit();", "@FXML\n\tprivate void logSerialNumberIncrement() {\n\t\tcheckFieldEditOrNot = true;\n\t\tSX3Manager.getInstance().addLog(\"Serial Number Increment : \" + serialNumberIncrement.getValue() + \".<br>\");\n\t\tlogDetails1.getEngine().setUserStyleSheetLocation(\"data:,body{font: 12px Arial;}\");\n\n\t}", "public void clickAssertionEdit() {\r\n\t\tString Expected2 = \"Assessment edited\";\r\n\t\tString Actualtext2 = driver.findElement(By.xpath(\"//*[@id=\\\"content-section\\\"]/div/div[2]\")).getText();\r\n\t\tAssert.assertEquals(Actualtext2, Expected2);\r\n\t\tSystem.out.println(Actualtext2);\r\n\t}", "@Test\n public void updateTest11() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setRistorante(true);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(true, servizio.isRistorante() ,\"Should return true if update Servizio\");\n }", "private void edit() {\n\n\t}", "int edit(final PaymentAccountScope scope);", "private void editButtonMouseClicked(java.awt.event.MouseEvent evt) {\n if(storeStock.size() == 0){\n JOptionPane.showMessageDialog(this, \"No Stock Present To Edit\", \"\", JOptionPane.ERROR_MESSAGE);\n return;\n }\n //End Bug Fix : Nothing Shown In \"EDIT EXISTING STOCK\" If Store Does Not Have Any Stock\n current = 0;\n medicineIdField.setEditable(false);\n addButton.setVisible(false);\n editButton.setVisible(false);\n displayCurrentStock();\n showFields(true);\n updateInventorySaveButton.setText(\"Done Editing\");\n updateInventorySaveButton.setVisible(true);\n previousButton.setVisible(true);\n nextButton.setVisible(true);\n }", "@Test\n public void updateTest9() throws SQLException {\n manager = new TableServizioManager(mockDb);\n Servizio servizio = manager.retriveById(2);\n servizio.setCabina(true);\n manager.update(servizio);\n servizio = manager.retriveById(2);\n assertEquals(true, servizio.isCabina() ,\"Should return true if update Servizio\");\n }", "public void editar(ParadaUtil paradaUtil) {\n\t\tiniciarTransacao();\r\n\t\ttry {\r\n\t\t\ts.update(paradaUtil);\r\n\t\t\ttx.commit();\r\n\t\t} catch (Exception e) {\r\n\t\t} finally {\r\n\t\t\ts.close();\r\n\t\t}\r\n\t}", "@Override\n public void executeTransaction() {\n System.out.println(\"Please make a selection first\");\n }", "@Override\n\tpublic boolean update(ClubInternalTransaction transaction) {\n\t\treturn false;\n\t}", "@Override\r\n\tpublic boolean update(Temi record) {\n\t\treturn temiMapper.update(record)>0?true:false;\r\n\t}", "public void recordPurchase(double amount)\n {\n balance = balance - amount;\n // your code here\n \n }", "@Test\r\n\tpublic void testPortfolioValueUpdate2() {\n\t\tassertTrue(\"Portfolio value must reflect current data\", false);\r\n\t}", "void editDepositDetails(int depositIndex, String description, String amount, String date, Ui ui)\n throws TransactionException, BankException {\n logger.warning(\"This account does not support this feature\");\n throw new BankException(\"This account does not support this feature\");\n }", "boolean hasTransactionChangesPending() {\n// System.out.println(transaction_mod_list);\n return transaction_mod_list.size() > 0;\n }", "@FXML\n private void editSelected() {\n if (selectedAccount == null) {\n // Warn user if no account was selected.\n noAccountSelectedAlert(\"Edit DonorReceiver\");\n } else {\n EditPaneController.setAccount(selectedAccount);\n PageNav.loadNewPage(PageNav.EDIT);\n }\n }", "protected void edit(HttpServletRequest request, HttpServletResponse response, EcAnonymousPaymentInfoForm _EcAnonymousPaymentInfoForm, EcAnonymousPaymentInfo _EcAnonymousPaymentInfo) throws Exception{\n\r\n _EcAnonymousPaymentInfo.setAnonymousUserId(WebParamUtil.getLongValue(_EcAnonymousPaymentInfoForm.getAnonymousUserId()));\r\n _EcAnonymousPaymentInfo.setFirstName(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getFirstName()));\r\n _EcAnonymousPaymentInfo.setMiddleInitial(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getMiddleInitial()));\r\n _EcAnonymousPaymentInfo.setLastName(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getLastName()));\r\n _EcAnonymousPaymentInfo.setAddress1(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getAddress1()));\r\n _EcAnonymousPaymentInfo.setAddress2(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getAddress2()));\r\n _EcAnonymousPaymentInfo.setCity(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getCity()));\r\n _EcAnonymousPaymentInfo.setState(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getState()));\r\n _EcAnonymousPaymentInfo.setZip(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getZip()));\r\n _EcAnonymousPaymentInfo.setCountry(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getCountry()));\r\n _EcAnonymousPaymentInfo.setPaymentType(WebParamUtil.getIntValue(_EcAnonymousPaymentInfoForm.getPaymentType()));\r\n _EcAnonymousPaymentInfo.setPaymentNum(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getPaymentNum()));\r\n _EcAnonymousPaymentInfo.setPaymentExpireMonth(WebParamUtil.getIntValue(_EcAnonymousPaymentInfoForm.getPaymentExpireMonth()));\r\n _EcAnonymousPaymentInfo.setPaymentExpireYear(WebParamUtil.getIntValue(_EcAnonymousPaymentInfoForm.getPaymentExpireYear()));\r\n _EcAnonymousPaymentInfo.setPaymentExtraNum(WebParamUtil.getStringValue(_EcAnonymousPaymentInfoForm.getPaymentExtraNum()));\r\n _EcAnonymousPaymentInfo.setTimeCreated(WebParamUtil.getDateValue(_EcAnonymousPaymentInfoForm.getTimeCreated()));\r\n\r\n m_actionExtent.beforeUpdate(request, response, _EcAnonymousPaymentInfo);\r\n m_ds.update(_EcAnonymousPaymentInfo);\r\n m_actionExtent.afterUpdate(request, response, _EcAnonymousPaymentInfo);\r\n }", "@Override\n public void actionPerformed(ActionEvent e) {\n payment = Float.parseFloat(txtPayment.getText());\n cashChange = String.valueOf(String.format(\"%.02f\", payment - finalTotal) );\n lblChange.setVisible(true);\n lblChange.setText(\"Change \" + \"£ \" + cashChange);\n btnPrint.setVisible(true);\n\n }" ]
[ "0.6417807", "0.6114119", "0.61056644", "0.60342664", "0.5980264", "0.58972555", "0.5755415", "0.57468027", "0.5733633", "0.5728225", "0.5623526", "0.55984074", "0.55520594", "0.552433", "0.55224323", "0.5502259", "0.547705", "0.5461646", "0.54261196", "0.5414276", "0.54077387", "0.53890496", "0.5388733", "0.5387667", "0.53821623", "0.53747237", "0.5374391", "0.5355625", "0.53530926", "0.53470814", "0.53331286", "0.53132254", "0.5311195", "0.5302029", "0.52985007", "0.52944326", "0.52575636", "0.52555496", "0.5251212", "0.52422184", "0.52295995", "0.52295905", "0.5210494", "0.52027476", "0.51969635", "0.5196763", "0.5196512", "0.5196439", "0.5184951", "0.5184325", "0.5181342", "0.51740664", "0.5170882", "0.51605445", "0.515316", "0.51516813", "0.5147037", "0.51453644", "0.51450396", "0.51437473", "0.51287323", "0.5126573", "0.5125297", "0.5124664", "0.512443", "0.51237065", "0.5123524", "0.51207113", "0.51034653", "0.5101068", "0.5098014", "0.5095476", "0.5095284", "0.50949097", "0.5093151", "0.5088918", "0.5084585", "0.5083892", "0.5083448", "0.5081159", "0.50744474", "0.50733227", "0.506517", "0.50625974", "0.50605065", "0.5058456", "0.50578046", "0.50572246", "0.50503165", "0.5050107", "0.5049001", "0.50488055", "0.5048208", "0.5047469", "0.5039176", "0.5037122", "0.5033389", "0.5033143", "0.50316024", "0.5028594" ]
0.73645914
0
Duplicating an transaction, testing if there is two identical transactions and logging the result to the report
@Test(groups = "Transactions Tests", description = "Duplicate transaction") public void duplicateTransaction() { MainScreen.clickAccountItem("Income"); SubAccountScreen.clickSubAccountItem("Salary"); TransactionsScreen.clickOptionsBtnFromTransactionItem("Bonus"); TransactionsScreen.clickDuplicateTransactionOption(); TransactionsScreen.transactionItens("Bonus").shouldHave(size(2)); test.log(Status.PASS, "Transaction successfully duplicated"); //Testing if there is two identical transactions in the 'Double Entry' account and logging the result to the report returnToHomeScreen(); MainScreen.clickAccountItem("Assets"); SubAccountScreen.clickSubAccountItem("Current Assets"); SubAccountScreen.clickSubAccountItem("Cash in Wallet"); TransactionsScreen.transactionItens("Bonus").shouldHave(size(2)); test.log(Status.PASS, "Transaction successfully duplicated in the 'Double Entry' account"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public final void testSameObjectEquals() {\n final Transaction copy = testTransaction1;\n assertTrue(testTransaction1.equals(copy)); // pmd doesn't like either\n // way\n\n }", "@Test\n public void processTestA()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n //pass transaction\n trans = new Transaction(acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),300);\n\n Assert.assertEquals(true,trans.process());\n }", "@Test\n public void processTestB()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n //failed transaction\n trans = new Transaction(acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),2000);\n\n Assert.assertEquals(false,trans.process());\n }", "@Test\n public void processTestC()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n //failed transaction\n trans = new Transaction(acc_db,acc.get_Account_Number(),5,10);\n\n Assert.assertEquals(false,trans.process());\n }", "public boolean insertTransactionsAndCreateAccounts(List<Transaction> transactions) {\n\t\ttry (final AutoCommittingHandle handle = new AutoCommittingHandle(dbi)) {\n\t\t\ttry {\n\t\t\t\t// fetch all existing accounts, initializing a map entry for each that contains an empty set of\n\t\t\t\t// transactions as its value\n\t\t\t\tfinal Map<Account, List<Transaction>> existingAccounts = new HashMap<>();\n\t\t\t\tfor (final Account existingAccount : getAccountsWithTransactions(handle)) {\n\t\t\t\t\texistingAccounts.put(existingAccount, new ArrayList<>());\n\t\t\t\t}\n\n\t\t\t\t// a map of new accounts to add\n\t\t\t\tfinal Map<Account, List<Transaction>> newAccounts = new HashMap<>();\n\n\t\t\t\t// sort new transactions into the map of accounts\n\t\t\t\tfor (final Transaction transaction : transactions) {\n\t\t\t\t\tfinal Optional<Account> existingAccount = existingAccounts.keySet()\n\t\t\t\t\t .stream()\n\t\t\t\t\t .filter(a -> a.getAccountNumber()\n\t\t\t\t\t .equals(transaction.getAccountNumber()))\n\t\t\t\t\t .findFirst();\n\t\t\t\t\tfinal Optional<Account> newAccount = newAccounts.keySet()\n\t\t\t\t\t .stream()\n\t\t\t\t\t .filter(a -> a.getAccountNumber()\n\t\t\t\t\t .equals(transaction.getAccountNumber()))\n\t\t\t\t\t .findFirst();\n\n\t\t\t\t\tif (!existingAccount.isPresent() && newAccount.isPresent()) {\n\t\t\t\t\t\tnewAccounts.get(newAccount.get()).add(transaction);\n\t\t\t\t\t} else if (existingAccount.isPresent() && !newAccount.isPresent()) {\n\t\t\t\t\t\texistingAccounts.get(existingAccount.get()).add(transaction);\n\t\t\t\t\t} else if (!existingAccount.isPresent() && !newAccount.isPresent()) {\n\t\t\t\t\t\tfinal List<Transaction> newTransactions = Arrays.asList(transaction);\n\t\t\t\t\t\t// TODO: can we assume account type and balance/currency? - instead, prompt user for details?\n\t\t\t\t\t\tfinal Account account = Account.newBuilder(transaction.getAccountNumber())\n\t\t\t\t\t\t .setType(AccountType.CHECKING)\n\t\t\t\t\t\t .setBalance(Money.zero(CurrencyUnit.CAD))\n\t\t\t\t\t\t .addTransactions(newTransactions)\n\t\t\t\t\t\t .build();\n\t\t\t\t\t\tnewAccounts.put(account, newTransactions);\n\t\t\t\t\t} else if (existingAccount.isPresent() && newAccount.isPresent()) {\n\t\t\t\t\t\tthrow new IllegalStateException(\"Account can't exist in new and existing maps\");\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tfor (final Entry<Account, List<Transaction>> entry : newAccounts.entrySet()) {\n\t\t\t\t\t// sum the transactions to compute an updated balance for the account\n\t\t\t\t\tfinal List<Money> transactionAmounts = entry.getValue()\n\t\t\t\t\t .stream()\n\t\t\t\t\t .map(Transaction::getAmount)\n\t\t\t\t\t .collect(Collectors.toList());\n\t\t\t\t\tfinal Money balance = Money.zero(entry.getKey().getBalance().getCurrencyUnit())\n\t\t\t\t\t .plus(transactionAmounts);\n\n\t\t\t\t\t// insert a copy of the account with the correct balance and list of transactions\n\t\t\t\t\tfinal Account updatedAccount = Account.newBuilder(entry.getKey())\n\t\t\t\t\t .setBalance(balance)\n\t\t\t\t\t .addTransactions(entry.getValue())\n\t\t\t\t\t .build();\n\n\t\t\t\t\tinsertAccountWithTransactions(handle, updatedAccount);\n\t\t\t\t}\n\n\t\t\t\tfor (final Entry<Account, List<Transaction>> entry : existingAccounts.entrySet()) {\n\t\t\t\t\t// sum the transactions to compute an updated balance for the account\n\t\t\t\t\tfinal List<Money> transactionAmounts = entry.getValue()\n\t\t\t\t\t .stream()\n\t\t\t\t\t .map(Transaction::getAmount)\n\t\t\t\t\t .collect(Collectors.toList());\n\t\t\t\t\tfinal Money balance = entry.getKey()\n\t\t\t\t\t .getBalance()\n\t\t\t\t\t .plus(transactionAmounts);\n\n\t\t\t\t\t// update the account with the correct balance and set of transactions\n\t\t\t\t\t// this adds the new transactions to the set of transactions already in the account\n\t\t\t\t\tfinal Account updatedAccount = Account.newBuilder(entry.getKey())\n\t\t\t\t\t .setBalance(balance)\n\t\t\t\t\t .addTransactions(entry.getValue())\n\t\t\t\t\t .build();\n\n\t\t\t\t\taccountDao.updateAccount(handle, updatedAccount);\n\t\t\t\t\ttransactionDao.insertTransactions(handle, entry.getValue());\n\t\t\t\t}\n\t\t\t} catch (final Exception ex) {\n\t\t\t\tlog.error(\"Failed to insert tranactions\", ex);\n\t\t\t\thandle.rollback();\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\n\t\treturn true;\n\t}", "public boolean addTransaction(Transaction trans) {\n if (trans == null) {\n return false;\n }\n if (!previousHash.equals(\"0\")) {\n if (!trans.processTransaction()) {\n System.out.println(\"Transaction failed to process. Transaction discarded!\");\n return false;\n }\n }\n transactions.add(trans);\n System.out.println(\"Transaction successfully added to the block\");\n return true;\n }", "@Test\n public void processTransactionManagerCaseA()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n Assert.assertEquals(false,trans_mang.processTransaction(acc.get_Account_Number(),acc2.get_Account_Number(),2000));\n }", "public boolean AddTransactionToAccount(Double transaction)\n {\n\n if(this.transactions.add(transaction)){\n System.out.println(\"Failed to add transaction: \" + transaction);\n return false;\n }\n System.out.println(\"Successfully added Transaction: \" + transaction);\n return true;\n }", "@Test\n public void testDuplicate() throws Exception {\n\n UploadRequest uploadRequest = createRequest();\n\n // create upload - We still care about study ID and requestedOn for reporting, as well as dupe attributes.\n DynamoUpload2 upload = (DynamoUpload2) dao.createUpload(uploadRequest, TEST_STUDY, TEST_HEALTH_CODE,\n ORIGINAL_UPLOAD_ID);\n uploadIds.add(upload.getUploadId());\n assertEquals(ORIGINAL_UPLOAD_ID, upload.getDuplicateUploadId());\n assertEquals(UploadStatus.DUPLICATE, upload.getStatus());\n assertEquals(TEST_STUDY_IDENTIFIER, upload.getStudyId());\n assertEquals(MOCK_NOW.getMillis(), upload.getRequestedOn());\n\n // We don't call Upload Complete in this scenario.\n }", "@Test\n public void testValidateDuplicateAccountsDifferentAccount() {\n // Same account\n Long accountId = 123l;\n BankAccount bankAccountRequest = new BankAccountImpl();\n bankAccountRequest.setAccountId(accountId);\n Locale locale = Locale.getDefault();\n ErrorMessageResponse errorMessageResponse = new ErrorMessageResponse();\n List<BankAccount> bankAccountList = new ArrayList<>();\n\n // ACCOUNT HELD BY DIFFERENT CUSTOMER\n BankAccount bankAccount = new BankAccountImpl();\n bankAccount.setAccountId(accountId);\n bankAccount.setActivatedDate(new Date());\n bankAccountList.add(bankAccount);\n\n // Older activation means it will not be first in the list\n bankAccount = new BankAccountImpl();\n bankAccount.setAccountId(12345l);\n bankAccount.setActivatedDate(new Date(new Date().getTime() - 1000));\n bankAccountList.add(bankAccount);\n\n BankHelper\n .validateDuplicateAccounts(bankAccountRequest, locale, errorMessageResponse, bankAccountList, account);\n assertTrue(errorMessageResponse.hasErrors());\n }", "@Test\n public void testValidateDuplicateAccounts() {\n // Same account\n Long accountId = 123l;\n BankAccount bankAccountRequest = new BankAccountImpl();\n bankAccountRequest.setAccountId(accountId);\n Locale locale = Locale.getDefault();\n ErrorMessageResponse errorMessageResponse = new ErrorMessageResponse();\n List<BankAccount> bankAccountList = new ArrayList<>();\n // EMPTY LIST no duplicate accounts held\n BankHelper\n .validateDuplicateAccounts(bankAccountRequest, locale, errorMessageResponse, bankAccountList, account);\n assertFalse(errorMessageResponse.hasErrors());\n\n // ACCOUNT ONLY HELD BY CUSTOMER\n BankAccount bankAccount = new BankAccountImpl();\n bankAccount.setAccountId(accountId);\n bankAccount.setActivatedDate(new Date(new Date().getTime() - 1000));\n bankAccountList.add(bankAccount);\n\n bankAccount = new BankAccountImpl();\n bankAccount.setAccountId(accountId);\n bankAccount.setActivatedDate(new Date());\n bankAccountList.add(bankAccount);\n\n BankHelper\n .validateDuplicateAccounts(bankAccountRequest, locale, errorMessageResponse, bankAccountList, account);\n assertFalse(errorMessageResponse.hasErrors());\n\n }", "@Test\n public void testCommitterWithDuplicatedCommit() throws Exception {\n describe(\"Call a task then job commit twice;\" +\n \"expect the second task commit to fail.\");\n JobData jobData = startJob(true);\n JobContext jContext = jobData.jContext;\n TaskAttemptContext tContext = jobData.tContext;\n ManifestCommitter committer = jobData.committer;\n\n // do commit\n describe(\"committing task\");\n committer.commitTask(tContext);\n\n // repeated commit while TA dir exists fine/idempotent\n committer.commitTask(tContext);\n\n describe(\"committing job\");\n committer.commitJob(jContext);\n describe(\"commit complete\\n\");\n\n describe(\"cleanup\");\n committer.cleanupJob(jContext);\n // validate output\n validateContent(outputDir, shouldExpectSuccessMarker(),\n committer.getJobUniqueId());\n\n // commit task to fail on retry as task attempt dir doesn't exist\n describe(\"Attempting commit of the same task after job commit -expecting failure\");\n expectFNFEonTaskCommit(committer, tContext);\n }", "@Test\n public void testNoDoubleSpending() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Alice wants double spending: transfers 10 coins to Bob, 20 to Cal again\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(20, kpCal.getPublic());\n\n // Sign for tx1: input 0\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n\n // Sign for tx1: input 1\n byte[] sig2 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig2 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(1).addSignature(sig2);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "int insertSelective(Transaction record);", "public void saveTransaction(Transaction transaction) {\r\n Session session = HibernateUtil.getSessionFactory().getCurrentSession();\r\n try {\r\n org.hibernate.Transaction hbtransaction = session.beginTransaction();\r\n // don't save \"duplicate\" transactions\r\n Query q = session.createQuery (\"from finance.entity.Transaction trans WHERE trans.transdate = :transdate AND trans.amount = :amount AND trans.vendor = :vendor AND trans.account.uid = :accountuid\");\r\n q.setParameter(\"transdate\", transaction.getTransdate());\r\n q.setParameter(\"amount\", transaction.getAmount());\r\n q.setParameter(\"vendor\", transaction.getVendor());\r\n Account acct = transaction.getAccount();\r\n q.setParameter(\"accountuid\", acct.getUid());\r\n List<Transaction> transactionList = (List<Transaction>) q.list();\r\n if (transactionList.isEmpty()) {\r\n session.save(transaction);\r\n }\r\n hbtransaction.commit();\r\n } catch (Exception e) {\r\n throw e;\r\n }\r\n }", "@Test\n public void CompoundTransaction_AddTransactionTest()\n {\n ct = new CompoundTransaction(\"compound\");\n\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n ct.addTransaction(new Transaction(\"atomic1\", acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),10));\n\n ct.addTransaction(new Transaction(\"atomic2\",acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),40));\n\n Assert.assertEquals(2, ct.getTransaction_list().size());\n }", "@Test(groups = \"Transactions Tests\", description = \"Create new transaction\")\n\tpublic void createNewTransaction() {\n\t\tMainScreen.clickAccountItem(\"Income\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Salary\");\n\t\tTransactionsScreen.clickAddTransactionBtn();\n\t\tTransactionsScreen.typeTransactionDescription(\"Extra income\");\n\t\tTransactionsScreen.typeTransactionAmount(\"300\");\n\t\tTransactionsScreen.clickTransactionType();\n\t\tTransactionsScreen.typeTransactionNote(\"Extra income from this month\");\n\t\tTransactionsScreen.clickSaveBtn();\n\t\tTransactionsScreen.transactionItem(\"Extra income\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$300\"));\n\t\ttest.log(Status.PASS, \"Sub-account created successfully and the value is correct\");\n\n\t\t//Testing if the transaction was created in the 'Double Entry' account, if the value is correct and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickAccountItem(\"Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Current Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Cash in Wallet\");\n\t\tTransactionsScreen.transactionItem(\"Extra income\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$300\"));\n\t\ttest.log(Status.PASS, \"'Double Entry' account also have the transaction and the value is correct\");\n\n\t}", "public void testXmlInsert() {\r\n \r\n GrouperSession.startRootSession();\r\n \r\n AuditType auditTypeOriginal = exampleAuditTypeDb(\"exampleInsert\", \"exampleInsertAction\");\r\n \r\n //not sure why I need to sleep, but the last membership update gets messed up...\r\n GrouperUtil.sleep(1000);\r\n \r\n //do this because last membership update isnt there, only in db\r\n auditTypeOriginal = exampleRetrieveAuditTypeDb(\"exampleInsert\", \"exampleInsertAction\", true);\r\n AuditType auditTypeCopy = exampleRetrieveAuditTypeDb(\"exampleInsert\", \"exampleInsertAction\", true);\r\n AuditType auditTypeCopy2 = exampleRetrieveAuditTypeDb(\"exampleInsert\", \"exampleInsertAction\", true);\r\n HibernateSession.byObjectStatic().delete(auditTypeCopy);\r\n \r\n //lets insert the original\r\n auditTypeCopy2.xmlSaveBusinessProperties(null);\r\n auditTypeCopy2.xmlSaveUpdateProperties();\r\n\r\n //refresh from DB\r\n auditTypeCopy = exampleRetrieveAuditTypeDb(\"exampleInsert\", \"exampleInsertAction\", true);\r\n \r\n assertFalse(auditTypeCopy == auditTypeOriginal);\r\n assertFalse(auditTypeCopy.xmlDifferentBusinessProperties(auditTypeOriginal));\r\n assertFalse(auditTypeCopy.xmlDifferentUpdateProperties(auditTypeOriginal));\r\n \r\n }", "private boolean isTransactionAlreadySeen(Transaction tx){\n return allTransactions.contains(tx);\n }", "@Test\n public void processTransactionManagerCaseB()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n Assert.assertEquals(true,trans_mang.processTransaction(acc.get_Account_Number(),acc2.get_Account_Number(),30));\n }", "@Test\n public void addExactDupItemTest() {\n List<Item> items = itemSrv.getAllItems();\n Assert.assertNotNull(\"List of items is null\", items);\n\n Assert.assertEquals(\"Wrong initial size of the list, should be 0\", 0, items.size());\n\n final Item item = new Item(\"item1\", \"item1 description\");\n Assert.assertEquals(\"Item adding failure\", ErrCode.ADD_SUCCESS, itemSrv.addItem(item));\n\n items = itemSrv.getAllItems();\n Assert.assertEquals(\"Total item count should be 1\", 1, items.size());\n\n // Add same exact/original/duplicate item\n Assert.assertEquals(\"Duplicate item protection fails\", ErrCode.ADD_DUPLICATE_ITEM, itemSrv.addItem(item));\n Assert.assertEquals(\"Total item count should still be 1 after adding duplicate item\", 1, itemSrv.getAllItems().size());\n Assert.assertEquals(\"Retrieved item is not the same as original\", item, items.get(0));\n }", "@Test\n public void testTariffTransaction ()\n {\n initializeService();\n accountingService.addTariffTransaction(TariffTransaction.Type.SIGNUP,\n tariffB1, customerInfo1, 2, 0.0, 42.1);\n accountingService.addTariffTransaction(TariffTransaction.Type.CONSUME,\n tariffB1, customerInfo2, 7, -77.0, 7.7);\n accountingService.addRegulationTransaction(tariffB1, customerInfo1,\n 2, 10.0, -2.5);\n accountingService.addRegulationTransaction(tariffB1, customerInfo2,\n 7, -10.0, 2.0);\n assertEquals(4, accountingService.getPendingTransactions().size(), \"correct number in list\");\n assertEquals(4, accountingService.getPendingTariffTransactions().size(), \"correct number in ttx list\");\n List<BrokerTransaction> pending = accountingService.getPendingTransactions();\n List<BrokerTransaction> signups = filter(pending,\n new Predicate<BrokerTransaction>() {\n public boolean apply (BrokerTransaction tx) {\n return (tx instanceof TariffTransaction &&\n ((TariffTransaction)tx).getTxType() == TariffTransaction.Type.SIGNUP);\n }\n });\n assertEquals(1, signups.size(), \"one signup\");\n TariffTransaction ttx = (TariffTransaction)signups.get(0);\n assertNotNull(ttx, \"first ttx not null\");\n assertEquals(42.1, ttx.getCharge(), 1e-6, \"correct charge id 0\");\n Broker b1 = ttx.getBroker();\n Broker b2 = brokerRepo.findById(bob.getId());\n assertEquals(b1, b2, \"same broker\");\n List<BrokerTransaction> consumes = filter(pending,\n new Predicate<BrokerTransaction>() {\n public boolean apply (BrokerTransaction tx) {\n return (tx instanceof TariffTransaction &&\n ((TariffTransaction)tx).getTxType() == TariffTransaction.Type.CONSUME);\n }\n });\n assertEquals(2, consumes.size(), \"two consumes\");\n ttx = (TariffTransaction)consumes.get(0);\n assertNotNull(ttx, \"second ttx not null\");\n TariffTransaction ttx1 = (TariffTransaction)consumes.get(1);\n assertNotNull(ttx1, \"third ttx not null\");\n if (ttx.isRegulation()) {\n // swap\n ttx = ttx1;\n ttx1 = (TariffTransaction)consumes.get(0);\n }\n assertEquals(-77.0, ttx.getKWh(), 1e-6, \"correct amount 1\");\n assertFalse(ttx.isRegulation(), \"not regulation\");\n assertEquals(-10.0, ttx1.getKWh(), 1e-6, \"correct amount 2\");\n assertTrue(ttx1.isRegulation(), \"regulation\");\n List<BrokerTransaction> produces = filter(pending,\n new Predicate<BrokerTransaction>() {\n public boolean apply (BrokerTransaction tx) {\n return (tx instanceof TariffTransaction &&\n ((TariffTransaction)tx).getTxType() == TariffTransaction.Type.PRODUCE);\n }\n });\n assertEquals(1, produces.size(), \"one produce\");\n ttx = (TariffTransaction)produces.get(0);\n assertEquals(10.0, ttx.getKWh(), 1e-6, \"correct amount 3\");\n assertTrue(ttx.isRegulation(), \"regulation\");\n }", "protected abstract Transaction createAndAdd();", "@Test\n public void existingTransaction() {\n Transaction t1 = startTransaction();\n IntRef intValue = new IntRef(10);\n t1.commit();\n\n Transaction t2 = startTransaction();\n assertEquals(10, intValue.get());\n\n intValue.inc();\n assertEquals(11, intValue.get());\n t2.commit();\n }", "@Test\n\tpublic void addTransaction() {\n\t\tTransaction transaction = createTransaction();\n\t\tint size = transactionService.getTransactions().size();\n\t\ttransactionService.addTransaction(transaction);\n\t\tassertTrue(\"No transaction was added.\", size < transactionService.getTransactions().size());\n\t}", "@Test\n public void processTransactionManagerCaseD()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n acc3 = new Account(3,\"Jacob&Leon3\",2000);\n acc_db.addAccount(acc3);\n\n trans_mang.processTransaction(acc.get_Account_Number(), acc2.get_Account_Number(), 30);\n\n Assert.assertEquals(false,trans_mang.processTransaction(acc.get_Account_Number(),acc3.get_Account_Number(),30));\n }", "@Override\n\tpublic void test00400Add_DuplicateRecord() throws Exception\n\t{\n\t\t// This method will not fail with Generate card numbers set to Y\n\t}", "@Test\n public void processTransactionManagerCaseC()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n acc3 = new Account(3,\"Jacob&Leon3\",2000);\n acc_db.addAccount(acc3);\n\n\n trans_mang.processTransaction(acc.get_Account_Number(), acc2.get_Account_Number(), 30);\n\n Assert.assertEquals(false,trans_mang.processTransaction(acc3.get_Account_Number(),acc2.get_Account_Number(),30));\n }", "int insert(Transaction record);", "public void testAddPaymentTerm_Duplicate() throws Exception {\r\n try {\r\n //Note: we have set next_block_start = -1 in previous method and IDGenerator generate -1.\r\n IDGeneratorFactory.getIDGenerator(\"PaymentTermGenerator\").getNextID(); //Will generate 0\r\n this.getManager().addPaymentTerm(this.getPaymentTermWithOutId()); //Will generate 1\r\n fail(\"DuplicatePaymentTermException is expected\");\r\n } catch (DuplicatePaymentTermException e) {\r\n assertTrue(e.getMessage().indexOf(\"There has a PaymentTerm with id '1' already been added\") >= 0);\r\n } finally {\r\n //Note: the block_size is 3, so the IDGenerator will query DB again at next time when the next_block_start\r\n //has been reset as 11\r\n this.updateIDGenerator(11);\r\n }\r\n }", "public void PushTransaction(Transaction new_transaction){\n try{\n \n FileWriter fileWriter = new FileWriter(\"C:\\\\Users\\\\cmpun\\\\Desktop\\\\SoftwareEngineeringProject\\\\src\\\\softwareengineeringproject\\\\TransactionLog.txt\", true);\n\n fileWriter.write(new_transaction.Date + \",\" + new_transaction.processed_items + \",\" + new_transaction.Total + \"\\n\");\n \n fileWriter.close();\n\n }catch(Exception E){\n \n System.out.println(\"Unable to enter transaction into Log...\");\n \n }\n \n }", "@Test\n public void CompoundTransaction_process_TestA()\n {\n ct = new CompoundTransaction(\"compound\");\n\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n ct.addTransaction(new Transaction(\"atomic1\", acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),10));\n\n ct.addTransaction(new Transaction(\"atomic2\",acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),40));\n\n Assert.assertEquals(true, ct.process());\n }", "@Test\n\tpublic void testAddTransaction(){\n setDoubleEntryEnabled(true);\n\t\tsetDefaultTransactionType(TransactionType.DEBIT);\n validateTransactionListDisplayed();\n\n\t\tonView(withId(R.id.fab_create_transaction)).perform(click());\n\n\t\tonView(withId(R.id.input_transaction_name)).perform(typeText(\"Lunch\"));\n\t\tonView(withId(R.id.input_transaction_amount)).perform(typeText(\"899\"));\n\t\tonView(withId(R.id.input_transaction_type))\n\t\t\t\t.check(matches(allOf(isDisplayed(), withText(R.string.label_receive))))\n\t\t\t\t.perform(click())\n\t\t\t\t.check(matches(withText(R.string.label_spend)));\n\n\t\tString expectedValue = NumberFormat.getInstance().format(-899);\n\t\tonView(withId(R.id.input_transaction_amount)).check(matches(withText(expectedValue)));\n\n int transactionsCount = getTransactionCount();\n\t\tonView(withId(R.id.menu_save)).perform(click());\n\n validateTransactionListDisplayed();\n\n List<Transaction> transactions = mTransactionsDbAdapter.getAllTransactionsForAccount(DUMMY_ACCOUNT_UID);\n assertThat(transactions).hasSize(2);\n Transaction transaction = transactions.get(0);\n\t\tassertThat(transaction.getSplits()).hasSize(2);\n\n assertThat(getTransactionCount()).isEqualTo(transactionsCount + 1);\n }", "public boolean checkNewTrans(JsonObject block){\n \tJsonArray transactions = block.get(\"Transactions\").getAsJsonArray();\n \tint N = transactions.size();\n \tfor (int i=0; i<N; i++) {\n \t\tJsonObject Tx = transactions.get(i).getAsJsonObject();\n \t\tif (TxPool_used.contains(Tx))\n \t\t\treturn false;\n }\n return true;\n }", "private static synchronized void writeTransaction( StmTransaction transaction ) {\n\n // Check for conflicts.\n for ( AbstractVersionedItem versionedItem : transaction.versionedItemsRead ) {\n versionedItem.ensureNotWrittenByOtherTransaction();\n }\n\n // Set the revision number to a committed value.\n transaction.targetRevisionNumber.set( lastCommittedRevisionNumber.incrementAndGet() );\n\n }", "@Test\n public void processCompoundTransaction_TestB() throws Exception {\n ct = new CompoundTransaction(\"compound\");\n\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n ct.addTransaction(new Transaction(\"atomic1\", acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),10001));\n\n ct.addTransaction(new Transaction(\"atomic2\",acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),40));\n\n Assert.assertEquals(false,trans_mang.processCompoundTransaction(ct));\n }", "@Test\r\n void test_insert_same_vertex_twice() {\r\n graph.addVertex(\"1\");\r\n graph.addVertex(\"1\"); \r\n graph.addVertex(\"1\"); \r\n vertices = graph.getAllVertices();\r\n if(vertices.size() != 1 ||graph.order() != 1) {\r\n fail();\r\n }\r\n }", "protected boolean isDuplicate(ELesxUseCase useCase) {\n return false;\n }", "private boolean insertTransactions(String filename) {\n\n login = HibernateDaoFactory.DEFAULT.getAnalysisDatabaseLogin();\n\n mysqlDb = HibernateDaoFactory.DEFAULT.getAnalysisDatabaseName();\n mysqlUser = login.get(\"user\");\n mysqlPwd = login.get(\"password\");\n\n Runtime runTime = Runtime.getRuntime();\n\n String[] commands = new String[]{MYSQL, mysqlDb, userFlag + mysqlUser, pwdFlag + mysqlPwd,\n executeFlag, sourceCommand + filename};\n String[] commandsToPrint = new String[]{MYSQL, mysqlDb,\n userFlag + mysqlUser, pwdFlag + \"*****\",\n executeFlag, sourceCommand + filename};\n try {\n logger.info(\"Beginning insert of transactions. Command Params:\"\n + Arrays.toString(commandsToPrint));\n\n Process proc = runTime.exec(commands);\n\n StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), \"ERROR\");\n\n StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), \"OUTPUT\");\n\n errorGobbler.start();\n outputGobbler.start();\n\n try {\n if (proc.waitFor() == 1) {\n logger.error(\"Return code indicates error in running the DBMerge mysql \"\n + \"process\");\n return false;\n }\n } catch (InterruptedException exception) {\n logger.error(\"Interrupted Exception while running the DBMerge mysql process.\",\n exception);\n return false;\n }\n\n } catch (IOException exception) {\n logger.error(\"Attempt to spawn a DBMerge mysql process failed for file: \"\n + filename, exception);\n return false;\n }\n return true;\n }", "@Test\n public void processCompoundTransaction_TestD() throws Exception {\n ct = new CompoundTransaction(\"compound1\");\n ct1 = new CompoundTransaction(\"compound2\");\n\n acc3 = new Account(3,\"Jacob&Leon3\",2000);\n\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n acc_db.addAccount(acc3);\n\n ct.addTransaction(new Transaction(\"atomic1\", acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),100));\n ct.addTransaction(new Transaction(\"atomic2\", acc_db,acc3.get_Account_Number(),acc2.get_Account_Number(),100));\n\n ct1.addTransaction(new Transaction(\"atomic3\",acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),200));\n\n ct.addTransaction(ct1);\n\n Assert.assertEquals(true,trans_mang.processCompoundTransaction(ct));\n }", "public void createTransaction(Transaction trans);", "@Test\n public void preDefine_TestA()\n {\n //list of prerequisites,i.e. source accounts and destination accounts\n //source accounts created and added to db\n Account Deposit_High_Risk_srcAccount = new Account(3123, \"Deposit_High_Risk_srcAccount\", 10000);\n Account Deposit_Low_Risk_srcAccount = new Account(8665, \"Deposit_Low_Risk_srcAccount\", 10000);\n Account Main_High_Risk_srcAccount = new Account(3143, \"Main_High_Risk_srcAccount\", 10000);\n Account Main_Low_Risk_srcAccount = new Account(3133, \"Main_Low_Risk_srcAccount\", 10000);\n Account Commission_High_Risk_srcAccount = new Account(6565, \"Commission_High_Risk_srcAccount\", 10000);\n Account Commission_Low_Risk_srcAccount = new Account(6588, \"Commission_Low_Risk_srcAccount\", 10000);\n acc_db.addAccount(Deposit_High_Risk_srcAccount);\n acc_db.addAccount(Deposit_Low_Risk_srcAccount);\n acc_db.addAccount(Main_High_Risk_srcAccount);\n acc_db.addAccount(Main_Low_Risk_srcAccount);\n acc_db.addAccount(Commission_High_Risk_srcAccount);\n acc_db.addAccount(Commission_Low_Risk_srcAccount);\n\n //create and add destination accounts\n Account Commission_High_Risk_destAccount = new Account(4444, \"Commission_High_Risk_destAccount\", 10000);\n Account Commission_Low_Risk_destAccount = new Account(4445, \"Commission_Low_Risk_destAccount\", 10000);\n acc_db.addAccount(Commission_High_Risk_destAccount);\n acc_db.addAccount(Commission_Low_Risk_destAccount);\n\n\n\n //adding Main Transaction Destination Accounts to database\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n CompoundTransaction ct = new CompoundTransaction(\"High Risk Preset\");\n\n List<Account> mainDests = new ArrayList<Account>();\n mainDests.add(acc);\n mainDests.add(acc2);\n\n List<Long> mainAmounts = new ArrayList<Long>();\n long main_amount1 = 130;\n long main_amount2=70;\n mainAmounts.add(main_amount1);\n mainAmounts.add(main_amount2);\n\n //Creating and Adding Deposit Destination Account to Database\n acc3 = new Account(3,\"Jacob&Leon3\",2000);\n long depAmount = 20;\n acc_db.addAccount(acc3);\n\n RiskPresets preset = new RiskPresets(\"high\");\n\n Assert.assertEquals(true,ct.preDefine(preset,acc3,depAmount,mainDests,mainAmounts,acc_db));\n }", "@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\tList<MasterBEnt> masterBEntList = \r\n\t\t\t\t\t\thbSupport.createCriteria(ss, MasterBEnt.class)\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.idA\"))\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.idB\")).list();\r\n\t\t\t\tList<Map<String, Map<String, MasterBEnt>>> masterBEntBizarreList = new ArrayList<>();\r\n\t\t\t\t\r\n\t\t\t\tfor (MasterBEnt masterB : masterBEntList) {\r\n\t\t\t\t\tSignatureBean signBean = ((IPlayerManagerImplementor) PlayerManagerTest.this.manager).generateSignature(masterB);\r\n\t\t\t\t\tString signStr = PlayerManagerTest.this.manager.serializeSignature(signBean);\r\n\t\t\t\t\tMap<String, Map<String, MasterBEnt>> mapItem = new LinkedHashMap<>();\r\n\t\t\t\t\tPlayerSnapshot<MasterBEnt> masterBPS = PlayerManagerTest.this.manager.createPlayerSnapshot(masterB);\r\n\t\t\t\t\tMap<String, MasterBEnt> mapMapItem = new LinkedHashMap<>();\r\n\t\t\t\t\tmapMapItem.put(\"wrappedSnapshot\", masterB);\r\n\t\t\t\t\tmapItem.put(signStr, mapMapItem);\r\n\t\t\t\t\tmasterBEntBizarreList.add(mapItem);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(false));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<List<Map<String, Map<String, MasterBEnt>>>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(masterBEntBizarreList);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}", "public void newTransaction(){\n System.out.println(\"-----new transaction -----\");\n System.out.println(\"--no null value--\");\n List<Integer> idList =new LinkedList<>();\n List<Integer> cntList =new LinkedList<>();\n List<Double> discountList = new LinkedList<>();\n List<Double> actualPrice = new LinkedList<>();\n double totalPrice=0.0;\n System.out.print(\"cashier id: \");\n int cashierid=scanner.nextInt();\n System.out.print(\"store id: \");\n int storeid=scanner.nextInt();\n System.out.print(\"customer id: \");\n int customerid=scanner.nextInt();\n while(true){\n System.out.print(\"product id: \");\n idList.add(scanner.nextInt());\n System.out.print(\"count: \");\n cntList.add(scanner.nextInt());\n\n //support multiple product\n System.out.print(\"type y to continue(others would end): \");\n if(!scanner.next().equals('y')){\n break;\n }\n }\n\n try {\n //begin transaction\n connection.setSavepoint();\n connection.setAutoCommit(false);\n for(int i=0;i<idList.size();i++){\n //Step 1 load discount information\n String sql0=\"select * from onsaleproductions where ProductID=\"+idList.get(i)+\" and ValidDate > now()\";\n try {\n //first insert clubmemer\n result = statement.executeQuery(sql0);\n if(result.next()){\n discountList.add(result.getDouble(\"Discount\"));\n }else{\n discountList.add(1.0);\n }\n } catch (SQLException e) {\n //rollback when failed\n System.out.println(e.getMessage());\n connection.rollback();\n return;\n }\n\n // Step 2 reduce stock & judge whether the product expired or not\n String sql1=\"update merchandise set Quantity=Quantity-\"+cntList.get(i)+\" where ProductID=\"+idList.get(i)+\" and ExpirationDate > now()\";\n try {\n //first insert clubmemer\n int res = statement.executeUpdate(sql1);\n if(res==0){\n System.out.println(\"Transaction failed! No valid product found (may expired)\");\n connection.rollback();\n return;\n }\n } catch (SQLException e) {\n //rollback when failed\n System.out.println(\"Transaction failed! check product stock!\");\n connection.rollback();\n return;\n }\n\n String sql2=\"select * from merchandise where ProductID=\"+idList.get(i);\n try {\n //first insert clubmemer\n result = statement.executeQuery(sql2);\n double mprice=0.0;\n if(result.next()){\n mprice=result.getDouble(\"MarketPrice\");\n }\n actualPrice.add(mprice*discountList.get(i));\n totalPrice+=(cntList.get(i)*actualPrice.get(i));\n } catch (SQLException e) {\n //rollback when failed\n System.out.println(e.getMessage());\n connection.rollback();\n return;\n }\n }\n\n // Step 3 insert transaction record which include general information\n String sql3=\"insert into transactionrecords(cashierid,storeid,totalprice,date,customerid) values(\"+cashierid+\",\"+storeid+\",\"+totalPrice+\",now(), \"+customerid+\")\";\n int tid=0;\n try {\n //first insert clubmemer\n int res = statement.executeUpdate(sql3, Statement.RETURN_GENERATED_KEYS);\n ResultSet generatedKeys = statement.getGeneratedKeys();\n\n if (generatedKeys.next()) {\n //get generatedKeys for insert registration record\n tid=generatedKeys.getInt(\"GENERATED_KEY\");\n }\n } catch (SQLException e) {\n //rollback when failed\n System.out.println(e.getMessage());\n connection.rollback();\n return;\n }\n\n // Step 4 insert transaction contains which include product list\n for(int i=0;i<idList.size();i++){\n String sql4=\"insert into transactionContains(transactionid,productid,count,actualprice) values(\";\n sql4+=tid;\n sql4+=\", \";\n sql4+=idList.get(i);\n sql4+=\", \";\n sql4+=cntList.get(i);\n sql4+=\", \";\n sql4+=actualPrice.get(i);\n sql4+=\")\";\n try {\n //System.out.println(sql);\n int res = statement.executeUpdate(sql4);\n } catch (SQLException e) {\n //rollback when failed\n System.out.println(e.getMessage());\n connection.rollback();\n }\n\n }\n System.out.println(\"Success\");\n connection.commit();\n } catch (SQLException e) {\n System.out.println(e.getMessage());\n }finally {\n try {\n connection.setAutoCommit(true);\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }\n }", "@Override\r\n\tpublic int addTran(Transaction transaction) throws Exception {\n\t\t\t\t\r\n\t\treturn tranDao.insertTran(transaction);\r\n\t}", "Transaction getCurrentTransaction();", "protected void reuseTxn(Txn txn) throws Exception {\r\n }", "private List<CustStmtRecord> validateDuplicate (final List<CustStmtRecord> custStmtRecords) {\n\t\tlog.info(\"Entering {}.{}\", getClass().getName(), \"validateDuplicate()\");\n\t\tfinal List<CustStmtRecord> duplicateReference = custStmtRecords\n\t\t\t\t.parallelStream()\n\t\t\t\t\t.filter(e -> Collections.frequency(custStmtRecords, e) > 1)\n\t\t\t\t\t.collect(Collectors.toList());\n\t\t\t\t\t;\n\t\t\t\n\t\tlog.info(\"duplicateReference {}\", duplicateReference);\n\t\t\t\n\t\tlog.info(\"Exiting {}.{}\", getClass().getName(), \"validateDuplicate()\");\n\t\treturn duplicateReference;\n\t}", "@Test\n public void processCompoundTransaction_TestA() throws Exception\n {\n ct = new CompoundTransaction(\"compound\");\n\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n ct.addTransaction(new Transaction(\"atomic1\", acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),10));\n\n ct.addTransaction(new Transaction(\"atomic2\",acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),40));\n\n Assert.assertEquals(true, trans_mang.processCompoundTransaction(ct));\n }", "void addTransaction(Transaction transaction, long timestamp) throws TransactionNotInRangeException;", "@Test\n public void TxHandlerTestSecond() throws NoSuchAlgorithmException, SignatureException, InvalidKeyException {\n // generate key pairs, simulate initial tx from scrooge to alice\n System.out.println(\"-----------------------------------------------------------------\");\n System.out.println(\"Test if the TxHandler can reject the double spending\");\n KeyPair pkScrooge = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkAlice = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n KeyPair pkBob = KeyPairGenerator.getInstance(\"RSA\").generateKeyPair();\n\n Transaction tx0 = new Transaction();\n tx0.addOutput(25, pkScrooge.getPublic());\n\n byte[] initHash = null;\n tx0.addInput(initHash, 0);\n tx0.signTx(pkScrooge.getPrivate(), 0);\n\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(tx0.getHash(), 0);\n utxoPool.addUTXO(utxo, tx0.getOutput(0));\n\n // tx 1\n Transaction tx1 = new Transaction();\n tx1.addInput(tx0.getHash(), 0);\n tx1.addOutput(25, pkAlice.getPublic());\n tx1.signTx(pkScrooge.getPrivate(), 0);\n\n TxHandler txHandler = new TxHandler(utxoPool);\n\n System.out.println(\"txHandler.isValidTx(tx1) returns: \" + txHandler.isValidTx(tx1));\n assertTrue(\"tx1:One valid transaction\", txHandler.handleTxs(new Transaction[]{tx1}).length == 1);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx1: one UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n // tx 2:Scrooge --> Bob 20coins [*Double-spending*]\n Transaction tx2 = new Transaction();\n tx2.addInput(tx0.getHash(), 0);\n tx2.addOutput(25, pkBob.getPublic());\n tx2.signTx(pkScrooge.getPrivate(), 0);\n\n txHandler = new TxHandler(utxoPool);\n System.out.println(\"txHandler.isValidTx(tx2) returns: \" + txHandler.isValidTx(tx2));\n assertTrue(\"tx2:no valid transaction\", txHandler.handleTxs(new Transaction[]{tx2}).length == 0);\n // update utxo pool\n utxoPool = txHandler.getHandledUtxoPool();\n assertTrue(\"tx2:no UTXO's created.\", utxoPool.getAllUTXO().size() == 1);\n\n// System.out.println(\"tx1.hashCode returns: \" + tx1.hashCode());\n// System.out.println(\"tx2.hashCode returns: \" + tx2.hashCode());\n\n }", "@Test\n void duplicateNftSerials() {\n\n mockOkExpiryValidator();\n writableAccountStore = newWritableStoreWithAccounts(\n Account.newBuilder()\n .accountId(ACCOUNT_4680)\n .numberTreasuryTitles(0)\n .numberPositiveBalances(1)\n .numberOwnedNfts(3)\n .build(),\n Account.newBuilder()\n .accountId(TREASURY_ACCOUNT_9876)\n .numberTreasuryTitles(1)\n .numberPositiveBalances(1)\n .numberOwnedNfts(1)\n .build());\n writableTokenStore = newWritableStoreWithTokens(newNftToken531(10));\n writableTokenRelStore =\n newWritableStoreWithTokenRels(newAccount4680Token531Rel(3), newTreasuryToken531Rel(1));\n writableNftStore = newWritableStoreWithNfts(\n Nft.newBuilder()\n .nftId(NftID.newBuilder()\n .tokenId(TOKEN_531)\n .serialNumber(1)\n .build())\n // do not set ownerId - default to null, meaning treasury owns this NFT\n .build(),\n Nft.newBuilder()\n .nftId(NftID.newBuilder()\n .tokenId(TOKEN_531)\n .serialNumber(2)\n .build())\n .ownerId(ACCOUNT_4680)\n .build(),\n Nft.newBuilder()\n .nftId(NftID.newBuilder()\n .tokenId(TOKEN_531)\n .serialNumber(3)\n .build())\n .ownerId(ACCOUNT_4680)\n .build(),\n Nft.newBuilder()\n .nftId(NftID.newBuilder()\n .tokenId(TOKEN_531)\n .serialNumber(4)\n .build())\n .ownerId(ACCOUNT_4680)\n .build());\n final var txn = newWipeTxn(ACCOUNT_4680, TOKEN_531, 0, 2L, 2L, 3L, 3L, 4L, 4L, 2L, 3L, 4L);\n final var context = mockContext(txn);\n\n subject.handle(context);\n\n final var acct = writableAccountStore.get(ACCOUNT_4680);\n Assertions.assertThat(acct.numberOwnedNfts()).isZero();\n Assertions.assertThat(acct.numberPositiveBalances()).isZero();\n final var treasuryAcct = writableAccountStore.get(TREASURY_ACCOUNT_9876);\n // The treasury still owns its NFT, so its counts shouldn't change\n Assertions.assertThat(treasuryAcct.numberOwnedNfts()).isEqualTo(1);\n Assertions.assertThat(treasuryAcct.numberTreasuryTitles()).isEqualTo(1);\n Assertions.assertThat(treasuryAcct.numberPositiveBalances()).isEqualTo(1);\n final var token = writableTokenStore.get(TOKEN_531);\n // Verify that 3 NFTs were removed from the total supply\n Assertions.assertThat(token.totalSupply()).isEqualTo(7);\n final var tokenRel = writableTokenRelStore.get(ACCOUNT_4680, TOKEN_531);\n Assertions.assertThat(tokenRel.balance()).isZero();\n // Verify the treasury's NFT wasn't removed\n Assertions.assertThat(writableNftStore.get(new NftID(TOKEN_531, 1))).isNotNull();\n // Verify that the account's NFTs were removed\n Assertions.assertThat(writableNftStore.get(new NftID(TOKEN_531, 2))).isNull();\n Assertions.assertThat(writableNftStore.get(new NftID(TOKEN_531, 3))).isNull();\n Assertions.assertThat(writableNftStore.get(new NftID(TOKEN_531, 4))).isNull();\n }", "@Test\n public void addDiffItemDupNameTest() {\n final String itemName = \"item1\";\n List<Item> items = itemSrv.getAllItems();\n Assert.assertNotNull(\"List of items is null\", items);\n\n Assert.assertEquals(\"Wrong initial size of the list, should be 0\", 0, items.size());\n\n final Item item = new Item(itemName, \"item1 description\");\n Assert.assertEquals(\"Item adding failure\", ErrCode.ADD_SUCCESS, itemSrv.addItem(item));\n\n items = itemSrv.getAllItems();\n Assert.assertEquals(\"Total item count should be 1\", 1, items.size());\n\n // Add different item, but with duplicate Name\n final Item diffItemSameName = new Item(itemName, \"different description\");\n itemSrv.addItem(diffItemSameName);\n\n items = itemSrv.getAllItems();\n Assert.assertEquals(\"Total item count should be 1 after addition of different item which has duplicate Name\", 1, items.size());\n\n final Item retrievedItem = items.get(0);\n\n Assert.assertEquals(\"Retrieved item is not the same as original\", item, retrievedItem);\n Assert.assertNotEquals(\"Retrieved item should NOT be the same as duplicate item that was attempted to be inserted\",\n diffItemSameName, retrievedItem);\n }", "@Test\n public void createDuplicateAccount() {\n final String username1 = \"[email protected]\";\n final String username2 = \"[email protected]\";\n final String username3 = \"[email protected]\";\n final String firstname = \"william\";\n final String lastname = \"shakespeare\";\n final String address = \"@iaeste.org\";\n\n final CreateUserRequest request1 = new CreateUserRequest(username1, firstname, lastname);\n final CreateUserResponse response1 = administration.createUser(token, request1);\n assertThat(response1, is(not(nullValue())));\n assertThat(response1.isOk(), is(true));\n assertThat(response1.getUser(), is(not(nullValue())));\n assertThat(response1.getUser().getAlias(), is(firstname + '.' + lastname + address));\n\n final CreateUserRequest request2 = new CreateUserRequest(username2, firstname, lastname);\n final CreateUserResponse response2 = administration.createUser(token, request2);\n assertThat(response2, is(not(nullValue())));\n assertThat(response2.isOk(), is(true));\n assertThat(response2.getUser(), is(not(nullValue())));\n assertThat(response2.getUser().getAlias(), is(firstname + '.' + lastname + 2 + address));\n\n final CreateUserRequest request3 = new CreateUserRequest(username3, firstname, lastname);\n final CreateUserResponse response3 = administration.createUser(token, request3);\n assertThat(response3, is(not(nullValue())));\n assertThat(response3.isOk(), is(true));\n assertThat(response3.getUser(), is(not(nullValue())));\n assertThat(response3.getUser().getAlias(), is(firstname + '.' + lastname + 3 + address));\n }", "private void assertIsolatedSnapshot(String source, String dest) {\n List<Row> expected = spark.sql(String.format(\"SELECT * FROM %s\", source)).collectAsList();\n\n List<SimpleRecord> extraData = Lists.newArrayList(new SimpleRecord(4, \"d\"));\n Dataset<Row> df = spark.createDataFrame(extraData, SimpleRecord.class);\n df.write().format(\"iceberg\").mode(\"append\").saveAsTable(dest);\n\n List<Row> result = spark.sql(String.format(\"SELECT * FROM %s\", source)).collectAsList();\n Assert.assertEquals(\n \"No additional rows should be added to the original table\", expected.size(), result.size());\n\n List<Row> snapshot =\n spark\n .sql(String.format(\"SELECT * FROM %s WHERE id = 4 AND data = 'd'\", dest))\n .collectAsList();\n Assert.assertEquals(\"Added row not found in snapshot\", 1, snapshot.size());\n }", "public boolean addTransaction(Transaction transaction) throws SQLException {\n\t\t\n\t\ttry (PreparedStatement statement = conn.prepareStatement(\"INSERT INTO transaction(Date, Type, Category, Amount) VALUES (?, ?, ?, ?)\")) {\n\t\t\tstatement.setDate(1, transaction.date());\n\t\t\tstatement.setString(2, transaction.type());\n\t\t\tstatement.setString(3, transaction.category());\n\t\t\tstatement.setDouble(4, transaction.amount());\n\t\t\treturn statement.executeUpdate() != 0;\n\t\t}\n\t}", "@Test\n public void preDefine_TestB()\n {\n //list of prerequisites,i.e. source accounts and destination accounts\n //source accounts created and added to db\n Account Deposit_High_Risk_srcAccount = new Account(3123, \"Deposit_High_Risk_srcAccount\", 10000);\n Account Deposit_Low_Risk_srcAccount = new Account(8665, \"Deposit_Low_Risk_srcAccount\", 10000);\n Account Main_High_Risk_srcAccount = new Account(3143, \"Main_High_Risk_srcAccount\", 10000);\n Account Main_Low_Risk_srcAccount = new Account(3133, \"Main_Low_Risk_srcAccount\", 10000);\n Account Commission_High_Risk_srcAccount = new Account(6565, \"Commission_High_Risk_srcAccount\", 10000);\n Account Commission_Low_Risk_srcAccount = new Account(6588, \"Commission_Low_Risk_srcAccount\", 10000);\n acc_db.addAccount(Deposit_High_Risk_srcAccount);\n acc_db.addAccount(Deposit_Low_Risk_srcAccount);\n acc_db.addAccount(Main_High_Risk_srcAccount);\n acc_db.addAccount(Main_Low_Risk_srcAccount);\n acc_db.addAccount(Commission_High_Risk_srcAccount);\n acc_db.addAccount(Commission_Low_Risk_srcAccount);\n\n //create and add destination accounts\n Account Commission_High_Risk_destAccount = new Account(4444, \"Commission_High_Risk_destAccount\", 10000);\n Account Commission_Low_Risk_destAccount = new Account(4445, \"Commission_Low_Risk_destAccount\", 10000);\n acc_db.addAccount(Commission_High_Risk_destAccount);\n acc_db.addAccount(Commission_Low_Risk_destAccount);\n\n //adding Main Transaction Destination Accounts to database\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n CompoundTransaction ct = new CompoundTransaction(\"Low Risk Preset\");\n\n List<Account> mainDests = new ArrayList<Account>();\n mainDests.add(acc);\n mainDests.add(acc2);\n\n List<Long> mainAmounts = new ArrayList<Long>();\n long main_amount1 = 130;\n long main_amount2=70;\n mainAmounts.add(main_amount1);\n mainAmounts.add(main_amount2);\n\n //Creating and Adding Deposit Destination Account to Database\n acc3 = new Account(3,\"Jacob&Leon3\",2000);\n long depAmount = 20;\n acc_db.addAccount(acc3);\n\n RiskPresets preset = new RiskPresets(\"low\");\n\n Assert.assertEquals(true,ct.preDefine(preset,acc3,depAmount,mainDests,mainAmounts,acc_db));\n }", "public boolean commit() {\n\t\tif (blocks.size() <= 1) return false;\n\n\t\tHashMap<String, Integer> pairMap = new HashMap<String, Integer>();\n\t\tHashMap<Integer, Integer> countMap = new HashMap<Integer, Integer>();\n\n\t\tListIterator<Transaction> iterator = blocks.listIterator();\n\t\twhile (iterator.hasNext()) {\n\t\t\tTransaction block = iterator.next();\n\t\t\tpairMap.putAll((Map<? extends String, ? extends Integer>) block.getNameValue());\n\t\t}\n\n\t\tfor (Entry<String, Integer> entry : pairMap.entrySet()) {\n\t\t\tInteger value = entry.getValue();\n\t\t\tif(countMap.get(value) == null){\n\t\t\t\tcountMap.put(value, new Integer(1));\n\t\t\t}\n\t\t\telse{\n\t\t\t\tcountMap.put(value, new Integer(countMap.get(value) + 1));\n\t\t\t}\n\t\t\tpairMap.put(entry.getKey(),entry.getValue());\n\t\t}\t\t\n\n\t\tblocks = new LinkedList<Transaction>();\n\t\tblocks.add(new Transaction(pairMap, countMap));\n\n\t\treturn true;\n\t}", "@Test\n public void testMarketTransaction ()\n {\n initializeService();\n accountingService.addMarketTransaction(bob,\n timeslotRepo.findBySerialNumber(2), 0.5, -45.0);\n accountingService.addMarketTransaction(bob,\n timeslotRepo.findBySerialNumber(3), 0.7, -43.0);\n assertEquals(0, accountingService.getPendingTariffTransactions().size(), \"no tariff tx\");\n List<BrokerTransaction> pending = accountingService.getPendingTransactions();\n assertEquals(2, pending.size(), \"correct number in list\");\n MarketTransaction mtx = (MarketTransaction)pending.get(0);\n assertNotNull(mtx, \"first mtx not null\");\n assertEquals(2, mtx.getTimeslot().getSerialNumber(), \"correct timeslot id 0\");\n assertEquals(-45.0, mtx.getPrice(), 1e-6, \"correct price id 0\");\n Broker b1 = mtx.getBroker();\n Broker b2 = brokerRepo.findById(bob.getId());\n assertEquals(b1, b2, \"same broker\");\n mtx = (MarketTransaction)pending.get(1);\n assertNotNull(mtx, \"second mtx not null\");\n assertEquals(0.7, mtx.getMWh(), 1e-6, \"correct quantity id 1\");\n // broker market positions should have been updated already\n MarketPosition mp2 = bob.findMarketPositionByTimeslot(2);\n assertNotNull(mp2, \"should be a market position in slot 2\");\n assertEquals(0.5, mp2.getOverallBalance(), 1e-6, \".5 mwh in ts2\");\n MarketPosition mp3 = bob.findMarketPositionByTimeslot(3);\n assertNotNull(mp3, \"should be a market position in slot 3\");\n assertEquals(0.7, mp3.getOverallBalance(), 1e-6, \".7 mwh in ts3\");\n }", "@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\tList<MasterBEnt> masterBEntList = \r\n\t\t\t\t\t\thbSupport.createCriteria(ss, MasterBEnt.class)\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.idA\"))\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.idB\")).list();\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(false));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<List<MasterBEnt>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(masterBEntList);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}", "public final void testValidTransaction() {\n assertTrue(testTransaction1.isValidTransaction());\n assertFalse(testTransaction2.isValidTransaction());\n }", "Transaction createTransaction();", "@Test\n\tpublic void testConcurrentInsert() {\n\n\t\ttry (DbTransaction transaction = new DbTransaction()) {\n\t\t\t// enforce a repeatable read for the current transaction\n\t\t\tAGUuid uuidObject = AGUuid.loadByUuidString(TEST_UUID.toString());\n\t\t\tassertNull(uuidObject);\n\n\t\t\t// insert the UUID with another connection\n\t\t\tInteger uuidId = insertUuidConcurrently();\n\t\t\tassertNotNull(uuidId);\n\n\t\t\t// check that the new UUID is found\n\t\t\tuuidObject = AGUuid.getOrCreate(TEST_UUID);\n\t\t\tassertNotNull(uuidObject);\n\t\t\tassertEquals(uuidId, uuidObject.getId());\n\t\t}\n\t}", "public void testDuplicate() {\n System.out.println(\"duplicate\");\n BufferedCharSequence instance = null;\n BufferedCharSequence expResult = null;\n BufferedCharSequence result = instance.duplicate();\n assertEquals(expResult, result);\n // TODO review the generated test code and remove the default call to fail.\n fail(\"The test case is a prototype.\");\n }", "private void insertNodesCatalogTransactionsPendingForPropagation(NodesCatalogTransaction transaction) throws CantInsertRecordDataBaseException {\n\n /*\n * Save into the data base\n */\n getDaoFactory().getNodesCatalogTransactionsPendingForPropagationDao().create(transaction);\n }", "public Receipt recordTransaction(Transaction t) throws RemoteException;", "BrainTreeCloneTransactionResult cloneTransaction(BrainTreeCloneTransactionRequest request);", "@Test\r\n public void testSave_again() {\r\n\r\n PaymentDetailPojo expResult = instance.save(paymentDetail1);\r\n assertEquals(expResult, instance.save(paymentDetail1));\r\n }", "public boolean processTransaction() {\r\n\t\t\r\n\t\t\tif(verifySignature() == false) {\r\n\t\t\t\tSystem.out.println(\"#Transaction Signature failed to verify\");\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\ttransactionId = calulateHash();\r\n\t\t\t\r\n\t\t\t\t\t\t\r\n\t\t\treturn true;\r\n\t\t}", "public boolean combine(Transaction tr) {\r\n if(tr.getAccountNumber() == getAccountNumber()) {\r\n balance += tr.getTransactionAmount();\r\n return true;\r\n }\r\n return false;\r\n }", "public boolean createTransaction() {\n\t\t\treturn false;\n\t\t}", "private static void createDummyTransactions() {\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 10L, new Transaction(10000d, \"cars\", 0L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 11L, new Transaction(15000d, \"shopping\", 10L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 12L, new Transaction(20000d, \"keys\", 11L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 13L, new Transaction(25000d, \"furniture\", 12L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 14L, new Transaction(30000d, \"keys\", 13L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 15L, new Transaction(40000d, \"cars\", 14L)));\n targetAndTransactions.add(new TargetAndTransaction(rootWebTarget, 16L, new Transaction(50000d, \"cars\", 15L)));\n }", "@Transactional\n\tpublic String addTransaction(int toAccNo, int fromAccNo, Transaction tran) {\n\t\t\tEntityManager entityManager = getEntityManager();\n\t\t\tAccountdetail acc = (Accountdetail) entityManager.createQuery(\"select a from Accountdetail a where a.accountnumber =: toaccNo\").setParameter(\"toaccNo\", toAccNo ).getSingleResult();\n\t\t\tAccountdetail acc1 = (Accountdetail) entityManager.createQuery(\"select ac from Accountdetail ac where ac.accountnumber =: fromAccNo\").setParameter(\"fromAccNo\", fromAccNo ).getSingleResult();\n\t\t\t\n\t\t\t//Validation -----> The Balance amount should be greater than the Amount Transfered \n\t\t\tif(acc1.getCurrentbalance()>=tran.getAmounttransferred()) {\n\t\t\t\t\ttran.setAccountto(acc);\n\t\t\t\t\ttran.setAccountfrom(acc1);\n\t\t\t\t\tentityManager.merge(tran);\n\t\t\t\t\t\n\t\t\t\t\t//Taking the amount transfered\n\t\t\t\t\tint amt = tran.getAmounttransferred();\n\t\t\t\t\tSystem.out.println(toAccNo);\n\t\t\t\t\t\n\t\t\t\t\t//Also crediting and debiting the amount from the accounts \n\t\t\t\t\tacc.setCurrentbalance(acc.getCurrentbalance()+amt);\n\t\t\t\t\tacc1.setCurrentbalance(acc1.getCurrentbalance()-amt);\n\t\t\t\t\t\n\t\t\t\t\t//Mailing the details of the transaction to the Respective Account Numbers\n\t\t\t\t\tString info_deb = \"Amount debited from your account.\\nAmount -->\"+amt+\"\\nTo Account -->\"+acc.getAccountnumber();\n String info_rec = \"Amount credited to your account.\\nAmount -->\"+amt+\"\\nFrom Account -->\"+acc1.getAccountnumber();\n mailService.sendMail(info_deb, acc1.getCustomerdetail().getEmail());\n mailService.sendMail(info_rec, acc.getCustomerdetail().getEmail());\n \n\t\t\t\t\treturn \"Transaction Inserted\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//If Balance is less than the Amount Transfered \n\t\t\t\telse if(acc1.getCurrentbalance()<tran.getAmounttransferred()) {\n\t\t\t\t\treturn \"insufficient funds\";\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//If the Details is wrong\n\t\t\t\telse {\n\t\t\t\t\treturn \"Wrong details. Please try again\";\n\t\t\t\t}\n\t }", "private void checkIfTransactionDoesntExists(TransactionDto transactionDto) {\n Optional<Transaction> transactionO = transactionRepository.findById(transactionDto.getId());\n if (transactionO.isPresent()) {\n throw new BusinessLogicException(String.format(\"A transaction with the id '%s' already exists.\",\n transactionDto.getId()));\n }\n }", "public boolean deleteAccountTransactions(AccountTransaction t) {\n\t\t\ttry(Connection conn = ConnectionUtil.getConnection();){\n\t\t\t\tString sql = \"INSERT INTO archive_account_transactions \"\n\t\t\t\t\t\t+ \"(transaction_id,account_id_fk,trans_type,\"\n\t\t\t\t\t\t+ \"debit,credit,signed_amount,running_balance,\"\n\t\t\t\t\t\t+ \"status,memo,user_id_fk,transaction_dt,deleted_by) \"\n\t\t\t\t\t\t+ \"SELECT transaction_id,account_id_fk,trans_type, \"\n\t\t\t\t\t\t+ \"debit,credit,signed_amount,running_balance,\" \n\t\t\t\t\t\t+ \"status,memo,user_id_fk,transaction_dt, ? \"\n\t\t\t\t\t\t+ \"FROM account_transactions \"\n\t\t\t\t\t\t+ \"WHERE account_id_fk = ?;\";\t\t\t\t\t\t\n\t\t\t\tPreparedStatement statement = conn.prepareStatement(sql);\n\t\t\t\tstatement.setInt(1,t.getUserId());\n\t\t\t\tstatement.setInt(2,t.getAccountId());\n\t\t\t\t\n\t\t\t\tint iCount = statement.executeUpdate();\n\t\t\t\t\n\t\t\t\tsql = \t\"DELETE \"\n\t\t\t\t\t\t+ \"FROM account_transactions \"\n\t\t\t\t\t\t+ \"WHERE account_id_fk = ?;\";\t\t\t\t\t\t\n\t\t\t\tstatement = conn.prepareStatement(sql);\n\t\t\t\tstatement.setInt(1,t.getAccountId());\n\t\t\t\t\n\t\t\t\tint dCount = statement.executeUpdate();\n\t\t\t\t\n//\t\t\t\tSystem.out.println(iCount);\n//\t\t\t\tSystem.out.println(dCount);\n\t\t\t\t\n\t\t\t\t//Did you delete the same # of transactions as you moved to archive\n\t\t\t\treturn iCount == dCount;\n\t\t\t\t\t\t\t\t\n\t\t\t}catch(SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\treturn false;\n\t\t\t\n\t\t}", "@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\tMasterBCompId compId = new MasterBCompId();\r\n\t\t\t\tcompId.setIdA(1);\r\n\t\t\t\tcompId.setIdB(1);\r\n\t\t\t\tMasterBEnt masterBEnt = (MasterBEnt) ss.get(MasterBEnt.class, compId);\r\n\t\t\t\tSystem.out.println(\"$$$$: \" + masterBEnt.getDatetimeA());\r\n\t\t\t\tSystem.out.println(\"$$$$: \" + masterBEnt.getDatetimeA().getTime());\r\n\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(true));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<MasterBEnt> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(masterBEnt);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}", "@Test\r\n void test_insert_same_edge_twice() {\r\n // Add two vertices with one edge\r\n graph.addEdge(\"A\", \"B\");\r\n graph.addEdge(\"A\", \"B\");\r\n if (graph.size() != 1) {\r\n fail();\r\n }\r\n if (!graph.getAdjacentVerticesOf(\"A\").contains(\"B\")) {\r\n fail();\r\n }\r\n\r\n }", "@Test(expected = IllegalArgumentException.class)\n public void transferBetweenTwoAccountsMustBelongToSameOwner() {\n Account accountFrom = AccountFactory.createAccount(AccountFactory.AccountType.SAVINGS, \"owner1\");\n Account accountTo = AccountFactory.createAccount(AccountFactory.AccountType.SAVINGS, \"owner2\");\n\n // Put some money in the from account\n Transaction transaction = new Transaction.Builder().setDescription(\"Test\").setAmount(DollarAmount.fromInt(100)).setType(Transaction.Type.DEPOSIT).build();\n accountFrom.applyTransaction(transaction);\n assertEquals(accountFrom.getAccountBalance(), DollarAmount.fromInt(100));\n\n // Attempt transfer\n Account.transfer(accountFrom, accountTo, DollarAmount.fromInt(30));\n\n // Assert transfer was successful\n assertEquals(DollarAmount.fromInt(70), accountFrom.getAccountBalance());\n assertEquals(DollarAmount.fromInt(30), accountTo.getAccountBalance());\n }", "public void testInsert2() throws Exception {\n\n DAS das = DAS.FACTORY.createDAS(getConnection());\n Command insert = das.createCommand(\"insert into COMPANY (NAME) values (?)\");\n insert.setParameter(1, \"AAA Rental\");\n insert.execute();\n\n // insert another using same command\n insert.setParameter(1, \"BBB Rental\");\n insert.execute();\n\n // Verify insert\n // Verify\n Command select = das.createCommand(\"Select ID, NAME from COMPANY\");\n DataObject root = select.executeQuery();\n\n assertEquals(5, root.getList(\"COMPANY\").size());\n\n }", "@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\tList<DetailAEnt> detailAEntList = \r\n\t\t\t\t\t\thbSupport.createCriteria(ss, DetailAEnt.class)\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.masterA.id\"))\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.subId\")).list();\r\n\t\t\t\t\r\n\t\t\t\tList<DetailACompComp> detailACompIdList = new ArrayList<>();\r\n\t\t\t\tfor (DetailAEnt detailAEnt : detailAEntList) {\r\n\t\t\t\t\tdetailACompIdList.add(detailAEnt.getDetailAComp().getDetailACompComp());\r\n\t\t\t\t\tPlayerManagerTest.this.manager.registerComponentOwner(\r\n\t\t\t\t\t\t\tDetailAEnt.class, \r\n\t\t\t\t\t\t\tdetailAEnt.getDetailAComp().getDetailACompComp(),\r\n\t\t\t\t\t\t\td -> d.getDetailAComp().getDetailACompComp());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(false));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<List<DetailACompComp>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(detailACompIdList);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}", "public Transaction getDummyTransaction(String action) {\n\n\t\t// Long payerAccountNum = 111l;\n\t\tLong payerRealmNum = 0l;\n\t\tLong payerShardNum = 0l;\n\t\t// Long nodeAccountNum=123l;\n\t\tLong nodeRealmNum = 0l;\n\t\tLong nodeShardNum = 0l;\n\t\tlong transactionFee = 0l;\n\t\tTimestamp startTime =\n\t\t\t\tRequestBuilder.getTimestamp(Instant.now(Clock.systemUTC()).minusSeconds(13));\n\t\tDuration transactionDuration = RequestBuilder.getDuration(100);\n\t\tboolean generateRecord = false;\n\t\tString memo = \"UnitTesting\";\n\t\tint thresholdValue = 10;\n\t\tList<Key> keyList = new ArrayList<>();\n\t\tKeyPair pair = new KeyPairGenerator().generateKeyPair();\n\t\tbyte[] pubKey = ((EdDSAPublicKey) pair.getPublic()).getAbyte();\n\t\tKey akey =\n\t\t\t\tKey.newBuilder().setEd25519(ByteString.copyFromUtf8((MiscUtils.commonsBytesToHex(pubKey)))).build();\n\t\tPrivateKey priv = pair.getPrivate();\n\t\tkeyList.add(akey);\n\t\tlong initBal = 100;\n\t\tlong sendRecordThreshold = 5;\n\t\tlong receiveRecordThreshold = 5;\n\t\tboolean receiverSign = false;\n\t\tDuration autoRenew = RequestBuilder.getDuration(100);\n\t\t;\n\t\tlong proxyAccountNum = 12345l;\n\t\tlong proxyRealmNum = 0l;\n\t\tlong proxyShardNum = 0l;\n\t\tint proxyFraction = 10;\n\t\tint maxReceiveProxyFraction = 10;\n\t\tlong shardID = 0l;\n\t\tlong realmID = 0l;\n\n\t\tTransaction trx = null;\n\t\tSignatureList sigList = SignatureList.getDefaultInstance();\n\t\tTimestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\n\t\t/**\n\t\t * SignatureList sigList = SignatureList.getDefaultInstance(); Transaction transferTx =\n\t\t * RequestBuilder.getCryptoTransferRequest( payer.getAccountNum(), payer.getRealmNum(),\n\t\t * payer.getShardNum(), nodeAccount.getAccountNum(), nodeAccount.getRealmNum(),\n\t\t * nodeAccount.getShardNum(), 800, timestamp, transactionDuration, false, \"test\", sigList,\n\t\t * payer.getAccountNum(), -100l, nodeAccount.getAccountNum(), 100l); transferTx =\n\t\t * TransactionSigner.signTransaction(transferTx, accountKeys.get(payer));\n\t\t */\n\n\t\tif (\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t\ttrx = RequestBuilder.getCryptoTransferRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 800, timestamp,\n\t\t\t\t\ttransactionDuration, false, \"test\", sigList, payerAccountId.getAccountNum(), -100l,\n\t\t\t\t\tnodeAccountId.getAccountNum(), 100l);\n\t\t\t// trx = TransactionSigner.signTransaction(trx, account2keyMap.get(payerAccountId));\n\t\t}\n\n\t\tif (\"createContract\".equalsIgnoreCase(action)) {\n\t\t\tFileID fileID = FileID.newBuilder().setFileNum(9999l).setRealmNum(1l).setShardNum(2l).build();\n\n\t\t\ttrx = RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 50000000000l, timestamp,\n\t\t\t\t\ttransactionDuration, true, \"createContract\", DEFAULT_CONTRACT_OP_GAS, fileID,\n\t\t\t\t\tByteString.EMPTY, 0, transactionDuration,\n\t\t\t\t\tSignatureList.newBuilder().addSigs(\n\t\t\t\t\t\t\tSignature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t\t\t\t\t\t.build(),\n\t\t\t\t\t\"\");\n\t\t}\n\n\t\t// if(\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t// long durationInSeconds = DAY_SEC * 30;\n\t\t// * Duration contractAutoRenew = Duration.newBuilder().setSeconds(durationInSeconds).build();\n\t\t// * Timestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\t\t// * Duration transactionDuration = RequestBuilder.getDuration(30, 0);\n\t\t// * Transaction createContractRequest =\n\t\t// RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t// * payerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t// * nodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 100l, timestamp,\n\t\t// transactionDuration, true, \"createContract\",\n\t\t// * DEFAULT_CONTRACT_OP_GAS, contractFile, ByteString.EMPTY, 0, contractAutoRenew,\n\t\t// * SignatureList.newBuilder()\n\t\t// *\n\t\t// .addSigs(Signature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t// * .build());\n\t\t// }\n\n\t\treturn trx;\n\n\t}", "protected boolean transaction(Connection connection, PreparedStatement statement, int expectedModificationCount)\n\t\t\tthrows DAOException {\n\t\tint affectedRows;\n\n\t\ttry {\n\t\t\t// executing operation.\n\t\t\taffectedRows = statement.executeUpdate();\n\n\t\t\t\n\t\t\t/*\n\t\t\t * if affected rows is necessary value, and its value doesn't match\n\t\t\t * to expected - throw exception.\n\t\t\t */\n\t\t\tif (expectedModificationCount != -1 && affectedRows != expectedModificationCount) {\n\t\t\t\tthrow new SQLException();\n\t\t\t} else if (affectedRows < 1) {\n\t\t\t\tthrow new SQLException();\n\t\t\t}\n\n\t\t\t// in case of successful operation - commit.\n\t\t\tconnection.commit();\n\n\t\t\t// at last - close statement and exit loop.\n\t\t\tstatement.close();\n\t\t\treturn true;\n\t\t} catch (SQLException ignore) {\n\n\t\t\t// if operation failed - try to rollback.\n\t\t\ttry {\n\t\t\t\tconnection.rollback();\n\t\t\t} catch (SQLException cause) {\n\t\t\t\tthrow new DAOException(cause);\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\tList<DetailAEnt> detailAEntList = \r\n\t\t\t\t\t\thbSupport.createCriteria(ss, DetailAEnt.class)\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.masterA.id\"))\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.subId\")).list();\r\n\t\t\t\t\r\n\t\t\t\tList<DetailACompComp> detailACompIdList = new ArrayList<>();\r\n\t\t\t\tfor (DetailAEnt detailAEnt : detailAEntList) {\r\n\t\t\t\t\tdetailACompIdList.add(detailAEnt.getDetailAComp().getDetailACompComp());\r\n\t\t\t\t\tPlayerManagerTest.this.manager.registerComponentOwner(detailAEnt, d -> d.getDetailAComp());\r\n\t\t\t\t\tPlayerManagerTest.this.manager.registerComponentOwner(detailAEnt.getDetailAComp(), dc -> dc.getDetailACompComp());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(false));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<List<DetailACompComp>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(detailACompIdList);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}", "@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\tList<DetailAEnt> detailAEntList = \r\n\t\t\t\t\t\thbSupport.createCriteria(ss, DetailAEnt.class)\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.masterA.id\"))\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.subId\")).list();\r\n\t\t\t\t\r\n\t\t\t\tList<DetailACompId> detailACompIdList = new ArrayList<>();\r\n\t\t\t\tfor (DetailAEnt detailAEnt : detailAEntList) {\r\n\t\t\t\t\tdetailACompIdList.add(detailAEnt.getCompId());\r\n\t\t\t\t\tPlayerManagerTest.this.manager.registerComponentOwner(DetailAEnt.class, detailAEnt.getCompId(), d -> d.getCompId());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(false));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<List<DetailACompId>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(detailACompIdList);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}", "void addTransaction(Transaction transaction) throws SQLException, BusinessException;", "@Test\n public void shouldNotJoinOnTableUpdates() {\n pushToStream(2, \"X\");\n processor.checkAndClearProcessResult(EMPTY);\n\n // push two items to the table. this should not produce any item.\n pushToTable(2, \"Y\");\n processor.checkAndClearProcessResult(EMPTY);\n\n // push all four items to the primary stream. this should produce two items.\n pushToStream(4, \"X\");\n processor.checkAndClearProcessResult(new KeyValueTimestamp<>(0, \"X0+Y0\", 0),\n new KeyValueTimestamp<>(1, \"X1+Y1\", 1));\n\n // push all items to the table. this should not produce any item\n pushToTable(4, \"YY\");\n processor.checkAndClearProcessResult(EMPTY);\n\n // push all four items to the primary stream. this should produce four items.\n pushToStream(4, \"X\");\n processor.checkAndClearProcessResult(new KeyValueTimestamp<>(0, \"X0+YY0\", 0),\n new KeyValueTimestamp<>(1, \"X1+YY1\", 1),\n new KeyValueTimestamp<>(2, \"X2+YY2\", 2),\n new KeyValueTimestamp<>(3, \"X3+YY3\", 3));\n\n // push all items to the table. this should not produce any item\n pushToTable(4, \"YYY\");\n processor.checkAndClearProcessResult(EMPTY);\n }", "@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\tList<MasterAEnt> masterAEntList = \r\n\t\t\t\t\t\thbSupport.createCriteria(ss, MasterAEnt.class)\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"id\")).list();\r\n\t\t\t\tList<MasterAWrapper> masterAWrapperList = new ArrayList<>();\r\n\t\t\t\tfor (MasterAEnt masterAEnt : masterAEntList) {\r\n\t\t\t\t\tMasterAWrapper masterAWrapper = new MasterAWrapper();\r\n\t\t\t\t\tmasterAWrapper.setMasterA(masterAEnt);\r\n\t\t\t\t\tmasterAWrapper.setDetailAWrapperList(new ArrayList<>());\r\n\t\t\t\t\tmasterAWrapper.setDetailAEntCol(new ArrayList<>(masterAEnt.getDetailAEntCol()));\r\n\t\t\t\t\tfor (DetailAEnt detailAEnt : masterAEnt.getDetailAEntCol()) {\r\n\t\t\t\t\t\tDetailAWrapper detailAWrapper = new DetailAWrapper();\r\n\t\t\t\t\t\tdetailAWrapper.setDetailA(detailAEnt);\r\n\t\t\t\t\t\tmasterAWrapper.getDetailAWrapperList().add(detailAWrapper);\r\n\t\t\t\t\t}\r\n\t\t\t\t\tmasterAWrapperList.add(masterAWrapper);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(true));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<List<MasterAWrapper>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(masterAWrapperList);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}", "@Test public void testTransactionExclusion2() throws Exception {\n server.start(THREAD1, XID1, XAResource.TMNOFLAGS, 100,false);\n\n try {\n server.start(THREAD2, XID1, XAResource.TMNOFLAGS, 100,false);\n fail(\"exception expected\"); //$NON-NLS-1$\n } catch (XATransactionException ex) {\n assertEquals(\"TEIID30522 Global transaction Teiid-Xid global:1 branch:null format:0 already exists.\", ex.getMessage()); //$NON-NLS-1$\n }\n }", "@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\r\n\t\t\t\t@SuppressWarnings(\"unchecked\")\r\n\t\t\t\tList<DetailAEnt> detailAEntList = \r\n\t\t\t\t\t\thbSupport.createCriteria(ss, DetailAEnt.class)\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.masterA.id\"))\r\n\t\t\t\t\t\t\t.addOrder(OrderCompat.asc(\"compId.subId\")).list();\r\n\t\t\t\t\r\n\t\t\t\tList<DetailACompId> detailACompIdList = new ArrayList<>();\r\n\t\t\t\tfor (DetailAEnt detailAEnt : detailAEntList) {\r\n\t\t\t\t\tdetailACompIdList.add(detailAEnt.getCompId());\r\n\t\t\t\t\tPlayerManagerTest.this.manager.registerComponentOwner(detailAEnt, d -> d.getCompId());\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t.this\r\n\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t.overwriteConfigurationTemporarily(\r\n\t\t\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t\t\t.clone()\r\n\t\t\t\t\t\t\t\t\t\t\t.configSerialiseBySignatureAllRelationship(false));\r\n\t\t\t\t\r\n\t\t\t\tPlayerSnapshot<List<DetailACompId>> playerSnapshot = PlayerManagerTest.this.manager.createPlayerSnapshot(detailACompIdList);\r\n\t\t\t\t\r\n\t\t\t\tFileOutputStream fos;\r\n\t\t\t\ttry {\r\n\t\t\t\t\tfos = new FileOutputStream(generatedFileResult);\r\n\t\t\t\t\tPlayerManagerTest\r\n\t\t\t\t\t\t.this\r\n\t\t\t\t\t\t\t.manager\r\n\t\t\t\t\t\t\t\t.getConfig()\r\n\t\t\t\t\t\t\t\t\t.getObjectMapper()\r\n\t\t\t\t\t\t\t\t\t\t.writerWithDefaultPrettyPrinter()\r\n\t\t\t\t\t\t\t\t\t\t\t.writeValue(fos, playerSnapshot);\r\n\t\t\t\t\t\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\t// TODO Auto-generated catch block\r\n\t\t\t\t\tthrow new RuntimeException(\"Unexpected\", e);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}", "@Test\n public void testImpossible1TransferMoney() {\n Bank bank = new Bank();\n User user = new User(\"Petr\", \"0000 000000\");\n AccountOfUser acc = new AccountOfUser(0, \"0000 0000 0000 0000\");\n AccountOfUser acc2 = new AccountOfUser(0, \"0000 0000 0000 0001\");\n bank.addUser(user);\n bank.addAccountToUser(user.getPassport(), acc);\n bank.addAccountToUser(user.getPassport(), acc2);\n assertThat(bank.transferMoney(user.getPassport(), acc.getRequisites(), user.getPassport(), acc2.getRequisites(), 100), is(false));\n }", "public void testTwoPCSuccess() throws Exception {\n tm.begin();\n tm.setTransactionTimeout(10); // TX must not timeout\n\n Connection connection1 = poolingDataSource1.getConnection();\n connection1.createStatement();\n\n Connection connection2 = poolingDataSource2.getConnection();\n PooledConnectionProxy handle = (PooledConnectionProxy) connection2;\n XAConnection xaConnection2 = (XAConnection) AbstractMockJdbcTest.getWrappedXAConnectionOf(handle.getPooledConnection());\n connection2.createStatement();\n\n tm.commit();\n\n }", "private void insertTestTransactionsForAccount(SmsAccount smsAccount) {\n\n\t\tint g = 10000;\n\t\tfor (int i = 0; i < 10; i++) {\n\t\t\tSmsTransaction smsTransaction = new SmsTransaction();\n\t\t\tsmsTransaction.setCreditBalance(10L);\n\t\t\tsmsTransaction.setSakaiUserId(\"sakaiUserId\" + i);\n\t\t\tsmsTransaction.setTransactionDate(new Date(System\n\t\t\t\t\t.currentTimeMillis()\n\t\t\t\t\t+ g));\n\t\t\tsmsTransaction.setTransactionTypeCode(\"TC\");\n\t\t\tsmsTransaction.setTransactionCredits(666);\n\t\t\tsmsTransaction.setSmsAccount(smsAccount);\n\t\t\tsmsTransaction.setSmsTaskId(1L);\n\t\t\tg += 1000;\n\t\t\thibernateLogicLocator.getSmsTransactionLogic()\n\t\t\t\t\t.insertReserveTransaction(smsTransaction);\n\t\t}\n\t}", "public final void testDifferentClassEquals() {\n final Account test = new Account(\"Test\");\n assertFalse(testTransaction1.equals(test));\n // pmd doesn't like either way\n }", "public static boolean saveTransaction(Transaction transaction, TransactionType transactionType) {\r\n\t\tdbConnect();\r\n\t\tPreparedStatement stmt = null;\r\n\t\tboolean isTransactionOk = true;\r\n\r\n\t\t// Format Transaction Date for mysql\r\n\t\tDate date = new Date();\r\n\t\tSimpleDateFormat sdf = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n\t\t// Could also use java.sql.Date\r\n\t\t// java.sql.Date dat = new java.sql.Date(date.getTime());\r\n\r\n\t\t// Get purchase ClientId if existing and insert if client is new\r\n\t\tint purchaseClientId = getClientId(transaction.getNameOfClient(), transactionType);\r\n\t\tif (purchaseClientId == 0) {\r\n\t\t\tClient newClient = createNewClient(new Client(0, \"'\" + transaction.getNameOfClient() + \"'\", null, null),\r\n\t\t\t\t\ttransactionType);\r\n\t\t\tpurchaseClientId = newClient.getClientId();\r\n\t\t}\r\n\r\n\t\tfinal String INSERT_NEW_TRANSACTION;\r\n\t\t// Insert to purchase table\r\n\t\tif (transactionType == TransactionType.PURCHASE) {\r\n\t\t\tINSERT_NEW_TRANSACTION = \"INSERT INTO purchase (purchase_id, purchase_date, purchase_client_id, purchase_payment)\"\r\n\t\t\t\t\t+ \" VALUES (\" + transaction.getTransactionNumber() + \",'\" + sdf.format(date) + \"',\"\r\n\t\t\t\t\t+ purchaseClientId + \",\" + transaction.getTotalAmount() + \")\";\r\n\t\t} else {\r\n\t\t\tINSERT_NEW_TRANSACTION = \"INSERT INTO sales (sales_id, sales_date, sales_client_id, sales_payment)\"\r\n\t\t\t\t\t+ \" VALUES (\" + transaction.getTransactionNumber() + \",'\" + sdf.format(date) + \"',\"\r\n\t\t\t\t\t+ purchaseClientId + \",\" + transaction.getTotalAmount() + \")\";\r\n\t\t}\r\n\t\ttry {\r\n\t\t\tstmt = conn.prepareStatement(INSERT_NEW_TRANSACTION);\r\n\t\t\tstmt.execute();\r\n\t\t\tstmt.close();\r\n\t\t} catch (SQLException e) {\r\n\t\t\tisTransactionOk = false;\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t\t// Insert to product_transaction table\r\n\t\tboolean isProductTransactionOk = saveProductTransactions(\r\n\t\t\t\t(transactionType == TransactionType.PURCHASE ? transaction.getTransactionNumber() : 0),\r\n\t\t\t\ttransaction.getProductList(),\r\n\t\t\t\t(transactionType == TransactionType.RETAIL ? transaction.getTransactionNumber() : 0));\r\n\r\n\t\t// Update Product Stock Quantity in product table\r\n\t\tboolean isInventoryStockOk = updateInventoryStock(transaction.getProductList(), transactionType);\r\n\r\n\t\treturn isTransactionOk && isProductTransactionOk && isInventoryStockOk;\r\n\t}", "public final void testDifferentNameEquals() {\n assertFalse(testTransaction1.equals(testTransaction2)); // pmd doesn't\n // like either\n // way\n }", "@Override\r\n\t\t\tpublic Object doInTransaction(TransactionStatus arg0) {\n\t\t\t\t\r\n\t\t\t\tSqlLogInspetor sqlLogInspetor = new SqlLogInspetor();\r\n\t\t\t\tsqlLogInspetor.enable();\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\tSignatureBean signatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQkVudCIsInJhd0tleVZhbHVlcyI6WyIxIiwiMSJdLCJyYXdLZXlUeXBlTmFtZXMiOlsiamF2YS5sYW5nLkludGVnZXIiLCJqYXZhLmxhbmcuSW50ZWdlciJdfQ\");\r\n\t\t\t\tMasterBEnt masterBEnt = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\t\t\t\t\r\n\t\t\t\tsignatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQUVudCIsImlzQ29sbCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoiZGV0YWlsQUVudENvbCIsInJhd0tleVZhbHVlcyI6WyIxIl0sInJhd0tleVR5cGVOYW1lcyI6WyJqYXZhLmxhbmcuSW50ZWdlciJdfQ\");\r\n\t\t\t\tCollection<DetailAEnt> detailAEntCol = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\t\t\t\t\r\n\t\t\t\tsignatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQkVudCIsImlzQ29tcCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoibWFzdGVyQkNvbXAiLCJyYXdLZXlWYWx1ZXMiOlsiMSIsIjEiXSwicmF3S2V5VHlwZU5hbWVzIjpbImphdmEubGFuZy5JbnRlZ2VyIiwiamF2YS5sYW5nLkludGVnZXIiXX0\");\r\n\t\t\t\tMasterBComp masterBComp = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\r\n\t\t\t\tsignatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQkVudCIsImlzQ29sbCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoibWFzdGVyQkNvbXAuZGV0YWlsQUVudENvbCIsInJhd0tleVZhbHVlcyI6WyIxIiwiMSJdLCJyYXdLZXlUeXBlTmFtZXMiOlsiamF2YS5sYW5nLkludGVnZXIiLCJqYXZhLmxhbmcuSW50ZWdlciJdfQ\");\r\n\t\t\t\tCollection<DetailAEnt> compDetailAEntCol = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\r\n\t\t\t\tsignatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQkVudCIsImlzQ29tcCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoibWFzdGVyQkNvbXAubWFzdGVyQkNvbXBDb21wIiwicmF3S2V5VmFsdWVzIjpbIjEiLCIxIl0sInJhd0tleVR5cGVOYW1lcyI6WyJqYXZhLmxhbmcuSW50ZWdlciIsImphdmEubGFuZy5JbnRlZ2VyIl19\");\r\n\t\t\t\tMasterBCompComp masterBCompComp = PlayerManagerTest.this.manager.getBySignature(signatureBean);\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tsignatureBean = PlayerManagerTest.this.manager.deserializeSignature(\"eyJjbGF6ek5hbWUiOiJvcmcuanNvbnBsYXliYWNrLnBsYXllci5oaWJlcm5hdGUuZW50aXRpZXMuTWFzdGVyQkVudCIsImlzQ29sbCI6dHJ1ZSwicHJvcGVydHlOYW1lIjoibWFzdGVyQkNvbXAubWFzdGVyQkNvbXBDb21wLmRldGFpbEFFbnRDb2wiLCJyYXdLZXlWYWx1ZXMiOlsiMSIsIjEiXSwicmF3S2V5VHlwZU5hbWVzIjpbImphdmEubGFuZy5JbnRlZ2VyIiwiamF2YS5sYW5nLkludGVnZXIiXX0\");\r\n\t\t\t\tCollection<DetailAEnt> compCompDetailAEntCol = PlayerManagerTest.this.manager.getBySignature(signatureBean);\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tAssert.assertThat(\"masterBEnt.getMasterBComp(), sameInstance(masterBComp)\", masterBEnt.getMasterBComp(), sameInstance(masterBComp));\r\n\t\t\t\tAssert.assertThat(\"masterBEnt.getMasterBComp().getMasterBCompComp(), sameInstance(masterBCompComp)\", masterBEnt.getMasterBComp().getMasterBCompComp(), sameInstance(masterBCompComp));\r\n\t\t\t\t\r\n\t\t\t\tAssert.assertThat(\"masterBComp.getMasterBCompComp(), sameInstance(masterBCompComp)\", masterBComp.getMasterBCompComp(), sameInstance(masterBCompComp));\r\n\t\t\t\tAssert.assertThat(\"detailAEntCol, not(sameInstance(compDetailAEntCol))\", detailAEntCol, not(sameInstance(compDetailAEntCol)));\r\n\t\t\t\tAssert.assertThat(\"detailAEntCol, not(sameInstance(compCompDetailAEntCol))\", detailAEntCol, not(sameInstance(compCompDetailAEntCol)));\r\n\t\t\t\tAssert.assertThat(\"compDetailAEntCol, not(sameInstance(compCompDetailAEntCol))\", compDetailAEntCol, not(sameInstance(compCompDetailAEntCol)));\r\n\t\t\t\t\r\n\t\t\t\tsqlLogInspetor.disable();\r\n\t\t\t\t\r\n\t\t\t\treturn null;\r\n\t\t\t}", "boolean hasTransactionChangesPending() {\n// System.out.println(transaction_mod_list);\n return transaction_mod_list.size() > 0;\n }", "public int TransBuy(Long userid,Long compid,Long newbalance,Double amount)throws SQLException {\n\tjava.util.Date d=new java.util.Date();\r\n\tSimpleDateFormat sd=new SimpleDateFormat(\"dd-MMM-yy\");\r\n\tString sdate=sd.format(d);\r\n\tResultSet rs1=DbConnect.getStatement().executeQuery(\"select * from transaction where type='purchase' and bywhom='self' and comp_id=\"+compid+\" and DATEOFTRANS='\"+sdate+\"' and user_id=\"+userid+\"\");\r\n\tif(rs1.next()==true)\r\n\t{\r\n\t\tint l=DbConnect.getStatement().executeUpdate(\"update transaction set amount=amount+\"+amount+\",SHAREAMOUNT=SHAREAMOUNT+\"+newbalance+\" where type='purchase' and bywhom='self' and comp_id=\"+compid+\" and DATEOFTRANS='\"+sdate+\"' and user_id=\"+userid+\" \");\r\n\t}\r\n\telse\r\n\t{\r\n\t\tint i=DbConnect.getStatement().executeUpdate(\"Insert into transaction values(trans_seq.nextval,\"+userid+\",'\"+sdate+\"',\"+amount+\",'purchase','self',\"+compid+\",\"+newbalance+\")\");\r\n\r\n\t}\r\n\t\tResultSet rss=DbConnect.getStatement().executeQuery(\"select * from FINALALLOCATION where user_id=\"+userid+\" and comp_id=\"+compid+\" \");\r\n\tif(rss.next()==true)\r\n\t{\r\n\t\tint j=DbConnect.getStatement().executeUpdate(\"update FINALALLOCATION set no_share=no_share+\"+newbalance+\" where user_id=\"+userid+\" and comp_id=\"+compid+\" \");\t\r\n\t}\r\n\telse\r\n\t{\r\n\t\tint k=DbConnect.getStatement().executeUpdate(\"insert into FINALALLOCATION values(\"+userid+\",\"+compid+\",\"+newbalance+\")\");\r\n\t}\r\n\treturn 1;\r\n}", "public void duplicate() {\n System.out.println(\"Je bent al in bezit van deze vragenlijst!\");\n }", "public boolean transferAmount(String id,String sourceAccount,String targetAccount,int amountTransfer) throws SQLException {\n\t\n\tConnection con = null;\n\tcon = DatabaseUtil.getConnection();\n\tint var=0;\n\tint var2=0;\n\tPreparedStatement ps1 = null;\n\tPreparedStatement ps2 = null;\n\tPreparedStatement ps3 = null;\n\tPreparedStatement ps4 = null;\n\tResultSet rs1 = null;\n\tResultSet rs2 = null;\n\tResultSet rs3 = null;\n\tResultSet rs4 = null;\n\tboolean flag=false;\n\n\tcon = DatabaseUtil.getConnection();\n\t\n\t//Account account=new Account();\n\tps1=con.prepareStatement(\"select Balance from CustomerAccount_RBM where SSN_ID=? and Account_Type=?\");\n\tps1.setInt(1,Integer.parseInt(id));\n\tps1.setString(2,targetAccount);\n\trs1=ps1.executeQuery();\n\t\n\twhile (rs1.next()) {\n\t var = rs1.getInt(1);\n\t \n\t if (rs1.wasNull()) {\n\t System.out.println(\"id is null\");\n\t }\n\t}\n\t\n\tint targetAmount=var+amountTransfer;\n\tSystem.out.println(\"target amount \"+targetAmount);\n\t//System.out.println(\"very good\");\n\tps2=con.prepareStatement(\"select Balance from CustomerAccount_RBM where SSN_ID=? and Account_Type=?\");\n\tps2.setInt(1,Integer.parseInt(id));\n\tps2.setString(2,sourceAccount);\n\trs2=ps2.executeQuery();\n\t\n\twhile (rs2.next()) {\n\t var2 = rs2.getInt(1);\n\t //System.out.println(\"id=\" + var);\n\t if (rs2.wasNull()) {\n\t System.out.println(\"name is null\");\n\t }\n\t}\n\t\n\tint sourceAmount=var2-amountTransfer;\n\tSystem.out.println(\"source amount\"+ sourceAmount);\n\tif(sourceAmount<0 ) {\n\t\tSystem.out.println(\"Unable to tranfer\");\n\t}else {\n\t\tflag=true;\n\t\tps3=con.prepareStatement(\"update CustomerAccount_RBM set Balance=? where Account_Type=?\");\n\t\tps3.setInt(1,sourceAmount);\n\t\tps3.setString(2,sourceAccount);\n\t\t//System.out.println(\"hey\");\n\t\trs3=ps3.executeQuery();\n\t\t\n\t\tps4=con.prepareStatement(\"update CustomerAccount_RBM set Balance=? where Account_Type=?\");\n\t\tps4.setInt(1,targetAmount);\n\t\tps4.setString(2,targetAccount);\n\t\trs4=ps4.executeQuery();\n\t\t//System.out.println(\"Transfer Dao1\");\n\t}\n\tDatabaseUtil.closeConnection(con);\n\tDatabaseUtil.closeStatement(ps1);\n\tDatabaseUtil.closeStatement(ps2);\n\tDatabaseUtil.closeStatement(ps3);\n\tDatabaseUtil.closeStatement(ps4);\n\treturn flag;\n}" ]
[ "0.63687694", "0.6106939", "0.6065073", "0.5903291", "0.575435", "0.5745094", "0.569909", "0.56916356", "0.56742746", "0.5672573", "0.56640047", "0.56400955", "0.56331277", "0.5626508", "0.5623507", "0.5604464", "0.559845", "0.5581869", "0.5569591", "0.5538824", "0.5535129", "0.55236274", "0.55203784", "0.5490604", "0.5463591", "0.5444826", "0.5428466", "0.54133886", "0.54126924", "0.5411384", "0.5394023", "0.538148", "0.53699785", "0.5366569", "0.5365747", "0.5354834", "0.5340838", "0.5308041", "0.53020227", "0.5294832", "0.5288667", "0.5271984", "0.526116", "0.52589667", "0.52503127", "0.52473253", "0.5235945", "0.5188649", "0.5187478", "0.518615", "0.51860166", "0.5181931", "0.51571494", "0.5155674", "0.51554036", "0.51529545", "0.5149531", "0.51462156", "0.5143055", "0.51359856", "0.5135652", "0.5128373", "0.5128356", "0.5119824", "0.5119598", "0.5111827", "0.51099557", "0.5105692", "0.51055586", "0.5104419", "0.510299", "0.5098465", "0.50937", "0.50882864", "0.50775975", "0.5060688", "0.50571996", "0.50487757", "0.5048676", "0.5044234", "0.5042798", "0.504135", "0.50213045", "0.50053984", "0.50033045", "0.5003141", "0.50027424", "0.5000657", "0.4999883", "0.49945927", "0.49903312", "0.49879593", "0.49879512", "0.4982127", "0.49802235", "0.49771848", "0.49666592", "0.49601915", "0.49600255", "0.49548894" ]
0.75571835
0
Deleting an transaction, testing if there no transaction and logging the result to the report
@Test(groups = "Transactions Tests", description = "Delete transaction") public void deleteTransaction() { MainScreen.clickAccountItem("Income"); SubAccountScreen.clickSubAccountItem("Salary"); TransactionsScreen.clickOptionsBtnFromTransactionItem("Bonus"); TransactionsScreen.clickDeleteTransactionOption(); TransactionsScreen.clickOptionsBtnFromTransactionItem("Bonus"); TransactionsScreen.clickDeleteTransactionOption(); TransactionsScreen.transactionItens("Edited Transaction test").shouldHave(size(0)); test.log(Status.PASS, "Transaction successfully deleted"); //Testing if there no transaction in the 'Double Entry' account and logging the result to the report returnToHomeScreen(); MainScreen.clickAccountItem("Assets"); SubAccountScreen.clickSubAccountItem("Current Assets"); SubAccountScreen.clickSubAccountItem("Cash in Wallet"); TransactionsScreen.transactionItens("Bonus").shouldHave(size(0)); test.log(Status.PASS, "Transaction successfully deleted from the 'Double Entry' account"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public boolean delete(Transaction transaction) throws Exception;", "@Override\n\tpublic void deleteTransaction(Transaction transaction) {\n\n\t}", "public void deleteTransactionById(int id);", "public void deleteTransaction() {\n\t\tconn = MySqlConnection.ConnectDb();\n\t\tString sqlDelete = \"delete from Account where transactionID = ?\";\n\t\ttry {\n\t\t\t\n\t\t\tps = conn.prepareStatement(sqlDelete);\n\t\t\tps.setString(1, txt_transactionID.getText());\n\t\t\tps.execute();\n\n\t\t\tUpdateTransaction();\n\t\t} catch (Exception e) {\n\t\t}\n\t}", "private void deleteTransaction() {\n LogUtils.logEnterFunction(Tag);\n\n boolean isDebtValid = true;\n if(mDbHelper.getCategory(mTransaction.getCategoryId()).getDebtType() == Category.EnumDebt.MORE) { // Borrow\n List<Debt> debts = mDbHelper.getAllDebts();\n\n Double repayment = 0.0, borrow = 0.0;\n for(Debt debt : debts) {\n if(mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.LESS) { // Repayment\n repayment += debt.getAmount();\n }\n\n if(!mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.MORE) { // Borrow\n borrow += debt.getAmount();\n }\n }\n\n if(borrow - mTransaction.getAmount() < repayment) {\n isDebtValid = false;\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_debt_delete_invalid));\n }\n }\n\n if(isDebtValid) {\n mDbHelper.deleteTransaction(mTransaction.getId());\n if(mDbHelper.getDebtByTransactionId(mTransaction.getId()) != null) {\n mDbHelper.deleteDebt(mDbHelper.getDebtByTransactionId(mTransaction.getId()).getId());\n }\n\n cleanup();\n\n // Return to FragmentListTransaction\n getFragmentManager().popBackStackImmediate();\n LogUtils.logLeaveFunction(Tag);\n }\n }", "@Override\n\tpublic void delete(Integer transactionId) {\n\n\t}", "@Override\n\t\tpublic boolean delete(AccountTransaction t, int id) {\n\t\t\treturn false;\n\t\t}", "int deleteByExample(TransactionExample example);", "public boolean deleteTransaction(String uid){\n return deleteRecord(getID(uid));\n\t}", "public Boolean removeTransaction()\n {\n return true;\n }", "public boolean deleteTransaction(User user, long transactionId) {\n Optional<Transaction> optional = transactionDAO.findById(user, transactionId);\n if(optional.isPresent()) {\n Transaction transaction = optional.get();\n Budget budget = transaction.getBudget();\n budget.setActual(budget.getActual() - transaction.getAmount());\n transactionDAO.delete(transaction);\n return true;\n }\n return false;\n }", "@Override\n public Nary<Void> applyWithTransactionOn(TransactionContext transactionContext) {\n String deleteHql = \"DELETE FROM \" + persistentType.getName() + \" WHERE id = :deletedId\";\n Session session = transactionContext.getSession();\n Query deleteQuery = session.createQuery(deleteHql);\n deleteQuery.setParameter(\"deletedId\", deletedId);\n int affectedRows = deleteQuery.executeUpdate();\n if(affectedRows != 1){\n LOG.debug(\"Deletion of {}[{}] did not affect just 1 row: {}\", persistentType, deletedId, affectedRows);\n }\n // No result expected from this operation\n return Nary.empty();\n }", "public void deleteTransaction(int id) throws SQLException {\n String sql = \"DELETE FROM LabStore.Transaction_Detail WHERE id = ?\";\n\n try (Connection conn = database.getConnection();\n PreparedStatement preStmt = conn.prepareStatement(sql)) {\n preStmt.setInt(1, id);\n preStmt.executeUpdate();\n }\n }", "public void deleteAllTransactions();", "void endTransaction();", "void rollback(Transaction transaction);", "private void deleteTransaction()\n {\n System.out.println(\"Delete transaction with the ID: \");\n\n BufferedReader bufferRead = new BufferedReader(new InputStreamReader(System.in));\n try {\n Long id = Long.valueOf(bufferRead.readLine());\n ctrl.deleteTransaction(id);\n }\n catch(IOException e)\n {\n e.printStackTrace();\n }\n\n }", "protected abstract void abortTxn(Txn txn) throws PersistException;", "void rollbackTransaction();", "public void endTransaction(int transactionID);", "public boolean deleteAccountTransactions(AccountTransaction t) {\n\t\t\ttry(Connection conn = ConnectionUtil.getConnection();){\n\t\t\t\tString sql = \"INSERT INTO archive_account_transactions \"\n\t\t\t\t\t\t+ \"(transaction_id,account_id_fk,trans_type,\"\n\t\t\t\t\t\t+ \"debit,credit,signed_amount,running_balance,\"\n\t\t\t\t\t\t+ \"status,memo,user_id_fk,transaction_dt,deleted_by) \"\n\t\t\t\t\t\t+ \"SELECT transaction_id,account_id_fk,trans_type, \"\n\t\t\t\t\t\t+ \"debit,credit,signed_amount,running_balance,\" \n\t\t\t\t\t\t+ \"status,memo,user_id_fk,transaction_dt, ? \"\n\t\t\t\t\t\t+ \"FROM account_transactions \"\n\t\t\t\t\t\t+ \"WHERE account_id_fk = ?;\";\t\t\t\t\t\t\n\t\t\t\tPreparedStatement statement = conn.prepareStatement(sql);\n\t\t\t\tstatement.setInt(1,t.getUserId());\n\t\t\t\tstatement.setInt(2,t.getAccountId());\n\t\t\t\t\n\t\t\t\tint iCount = statement.executeUpdate();\n\t\t\t\t\n\t\t\t\tsql = \t\"DELETE \"\n\t\t\t\t\t\t+ \"FROM account_transactions \"\n\t\t\t\t\t\t+ \"WHERE account_id_fk = ?;\";\t\t\t\t\t\t\n\t\t\t\tstatement = conn.prepareStatement(sql);\n\t\t\t\tstatement.setInt(1,t.getAccountId());\n\t\t\t\t\n\t\t\t\tint dCount = statement.executeUpdate();\n\t\t\t\t\n//\t\t\t\tSystem.out.println(iCount);\n//\t\t\t\tSystem.out.println(dCount);\n\t\t\t\t\n\t\t\t\t//Did you delete the same # of transactions as you moved to archive\n\t\t\t\treturn iCount == dCount;\n\t\t\t\t\t\t\t\t\n\t\t\t}catch(SQLException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\treturn false;\n\t\t\t\n\t\t}", "@Override\n\t@Transactional\n\tpublic void deleteFundTransaction(Long fundTransactionId) throws InstanceNotFoundException {\n\t\tlogger.debug(\">>deleteFundTransaction\");\n\t\tfundTransactionDao.remove(fundTransactionId);\n\t\tlogger.debug(\"deleteFundTransaction>>\");\n\t}", "void rollback() {\r\n tx.rollback();\r\n tx = new Transaction();\r\n }", "@Before\n @After\n public void deleteTestTransactions() {\n if (sessionId == null) {\n getTestSession();\n }\n\n // No test transaction has been made yet, thus no need to delete anything.\n if (testTransactionId != null) {\n given()\n .header(\"X-session-ID\", sessionId)\n .delete(String.format(\"api/v1/transactions/%d\", testTransactionId));\n }\n\n if (clutterTransactionId != null) {\n given()\n .header(\"X-session-ID\", sessionId)\n .delete(String.format(\"api/v1/transactions/%d\", clutterTransactionId));\n }\n }", "public static void finishTransaction()\n {\n if (currentSession().getTransaction().isActive())\n {\n try\n {\n System.out.println(\"INFO: Transaction not null in Finish Transaction\");\n Thread.dumpStack();\n rollbackTransaction();\n// throw new UAPersistenceException(\"Incorrect Transaction handling! While finishing transaction, transaction still open. Rolling Back.\");\n } catch (UAPersistenceException e)\n {\n System.out.println(\"Finish Transaction threw an exception. Don't know what to do here. TODO find solution for handling this situation\");\n }\n }\n }", "public long delete(long id) throws Exception\n\t{\n\t\tthis.updateStatus(id, SETTConstant.TransactionStatus.DELETED);\n\t\treturn id;\n\t}", "public void cancelTransaction() {\n\t\t//Cancel the transaction\n\t\tregister[registerSelected].cancelTransaction();\n\t}", "@Test(groups = \"Transactions Tests\", description = \"Delete account with Transaction\")\n\tpublic void deleteAccountWithTransaction() {\n\t\tMainScreen.clickAddAccountBtn();\n\t\tNewAccountScreen.typeAccountName(\"Freelance jobs\");\n\t\tNewAccountScreen.clickAccountColor();\n\t\tNewAccountScreen.clickColorOption();\n\t\tNewAccountScreen.typeAccountDescription(\"Account to control my freelance jobs money\");\n\t\tNewAccountScreen.clickPlaceholderAccountOption();\n\t\tNewAccountScreen.clickSaveBtn();\n\t\tMainScreen.accountItem(\"Freelance jobs\").shouldBe(visible);\n\t\ttest.log(Status.PASS, \"Account created successfully\");\n\n\t\t//Creating a new sub-account, testing if it's visible and logging the result to the report\n\t\tMainScreen.clickAccountItem(\"Freelance jobs\");\n\t\tSubAccountScreen.clickAddSubAccountBtn();\n\t\tNewAccountScreen.typeAccountName(\"Test Automation jobs\");\n\t\tNewAccountScreen.clickAccountColor();\n\t\tNewAccountScreen.clickColorOption();\n\t\tNewAccountScreen.typeAccountDescription(\"Sub-account to control meu Test Automation freelance jobs\");\n\t\tNewAccountScreen.clickSaveBtn();\n\t\tSubAccountScreen.subAccountItem(\"Test Automation jobs\").shouldBe(visible);\n\t\ttest.log(Status.PASS, \"Sub-account created successfully\");\n\n\t\t//Creating a new transaction, testing if it's visible, if the value is correct and logging the result to the report\n\t\tSubAccountScreen.clickSubAccountItem(\"Test Automation jobs\");\n\t\tTransactionsScreen.clickAddTransactionBtn();\n\t\tTransactionsScreen.typeTransactionDescription(\"N26 Home Task\");\n\t\tTransactionsScreen.typeTransactionAmount(\"250\");\n\t\tTransactionsScreen.clickSaveBtn();\n\t\tTransactionsScreen.transactionItem(\"N26 Home Task\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$250\"));\n\t\ttest.log(Status.PASS, \"Transaction created and the value is correct\");\n\n\t\t//Testing if the transaction was created in the 'Double Entry' account and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickAccountItem(\"Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Current Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Cash in Wallet\");\n\t\tTransactionsScreen.transactionItem(\"N26 Home Task\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$250\"));\n\t\ttest.log(Status.PASS, \"Transaction in the 'Double Entry' account created and the value is correct\");\n\n\t\t//Deleting the account with the transaction, testing if it's not listed and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickOptionsBtnFromAccountItem(\"Freelance jobs\");\n\t\tMainScreen.clickDeleteAccountOption();\n\t\tMainScreen.clickDeleteTransactionRadioOption();\n\t\tMainScreen.clickDeleteBtn();\n\t\tMainScreen.accountItem(\"Freelance jobs\").shouldNotBe(visible);\n\t\ttest.log(Status.PASS, \"Account and Transaction deleted successfully\");\n\n\t\t//Testing if the transaction were deleted from the 'Double Entry' account and logging the result to the report\n\t\tMainScreen.clickAccountItem(\"Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Current Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Cash in Wallet\");\n\t\tTransactionsScreen.transactionItem(\"N26 Home Task\").shouldNotBe(visible);\n\t\ttest.log(Status.PASS, \"Transaction deleted successfully from the 'Double Entry' account\");\n\n\t}", "@Override\n public void delete(Long id) {\n log.debug(\"Request to delete ProjectTransactionRecord : {}\", id);\n projectTransactionRecordRepository.delete(id);\n }", "public void removeTransaction(Transaction transaction)\n\t{\n\t\ttransactionQueue.remove(transaction);\n\t}", "@Test\n\tpublic void deleteItemTest() {\n\t\tInteger associatedAccountId_1 = 1;\n\t\tString type_1 = \"deposit\";\n\t\tString date_1 = \"2018-04-03\";\n\t\tInteger amount_1 = 100;\n\t\tString description_1 = \"This is test transaction number one\";\n\t\tTransaction testDeleteTransaction_1 = new Transaction();\n\t\ttestDeleteTransaction_1.setAssociatedAccountId(associatedAccountId_1);\n\t\ttestDeleteTransaction_1.setType(type_1);\n\t\ttestDeleteTransaction_1.setDate(date_1);\n\t\ttestDeleteTransaction_1.setAmount(amount_1);\n\t\ttestDeleteTransaction_1.setDescription(description_1);\n\t\ttransacRepoTest.saveItem(testDeleteTransaction_1);\t\t\n\t\t\n\t\t//should now be 1 transaction in the repo\t\t\n\t\tArrayList<Transaction> transList = transacRepoTest.getItemsFromAccount(associatedAccountId_1);\n\t\tassertEquals(transList.size(), 1);\n\t\t\t\n\t\ttransacRepoTest.deleteItem(associatedAccountId_1);\n\n\t\t//should now be 0 transactions in the repo\n\t\ttransList = transacRepoTest.getItemsFromAccount(associatedAccountId_1);\n\t\tassertEquals(transList.size(), 0);\n\t\t\n\t}", "@DeleteMapping(\"/{id}\")\n\tpublic Transaction deleteTransactionById(@PathVariable Long id) {\n\t\tTransaction deletedTransaction = null;\n\t\t\n\t\ttry {\n\t\t\tdeletedTransaction = transactionService.deleteTransactionById(id);\n\t\t} \n\t\tcatch (TransactionNotFoundException e) {\n\t\t\tthrow new TransactionNotFoundException(id);\n\t\t}\n\t\tcatch (UserDoesNotOwnResourceException e) {\n\t\t\tthrow new UserDoesNotOwnResourceException();\n\t\t}\n\t\t\n\t\treturn deletedTransaction;\n\t}", "@Override\n public int cancelTransaction() {\n System.out.println(\"Please make a selection first\");\n return 0;\n }", "@Override\n\tpublic void cancelTransaction() {\n\t\t\n\t}", "@Transactional\n\t@Override\n\tpublic boolean deleteSalesorder(SalesorderModel salesorder)\n\t\t\tthrows Exception {\n\t\treturn false;\n\t}", "public void closeTransaction(){\n\t\ttr.rollback();\n\t\ttr = null;\n\t}", "public static void deshacerTransaccion() {\n try {\n con.rollback();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n }", "protected void deleteWithoutCommit() {\n \t\ttry {\n \t\t\tcheckedActivate(3); // TODO: Figure out a suitable depth.\n \t\t\t\n \t\t\tfor(MessageReference ref : getAllMessages(false)) {\n \t\t\t\tref.initializeTransient(mFreetalk);\n \t\t\t\tref.deleteWithoutCommit();\n \t\t\t}\n \n \t\t\tcheckedDelete();\n \t\t}\n \t\tcatch(RuntimeException e) {\n \t\t\tcheckedRollbackAndThrow(e);\n \t\t}\n \n \t}", "public void deleteTransfer(Transfer transfer) {\n User sender = Database.getUser(transfer.getSenderUsername());\n if (sender == null) {\n System.out.println(\"Failed to find sender\");\n return;\n }\n User receiver = Database.getUser(transfer.getReceiverUsername());\n if (receiver == null) {\n System.out.println(\"Failed to find receiver\");\n return;\n }\n if (receiver.getBalance() < transfer.getAmount()) {\n System.out.println(\"Receiver does not have the available balance to delete this transfer\");\n return;\n }\n String title = \"Confirm delete of transfer(Y/N): \";\n if (Validation.confirmAction(title)) {\n Database.deleteTransfer(transfer);\n System.out.println(\"Transfer deleted successfully\");\n } else System.out.println(\"Delete of transfer aborted\");\n }", "@TransactionAttribute(TransactionAttributeType.REQUIRED)\r\n/* 133: */ public void eliminar(Reporteador reporteador)\r\n/* 134: */ throws AS2Exception\r\n/* 135: */ {\r\n/* 136: */ try\r\n/* 137: */ {\r\n/* 138:158 */ reporteador = this.reporteadorDao.cargarDetalle(reporteador.getIdReporteador());\r\n/* 139: */ \r\n/* 140:160 */ eliminarDetallesReporteador(reporteador, null);\r\n/* 141:162 */ for (DetalleReporteadorVariable detalle : reporteador.getListaDetalleReporteadorVariable()) {\r\n/* 142:163 */ this.detalleReporteadorVariableDao.eliminar(detalle);\r\n/* 143: */ }\r\n/* 144:166 */ this.reporteadorDao.eliminar(reporteador);\r\n/* 145: */ }\r\n/* 146: */ catch (AS2Exception e)\r\n/* 147: */ {\r\n/* 148:168 */ this.context.setRollbackOnly();\r\n/* 149:169 */ throw e;\r\n/* 150: */ }\r\n/* 151: */ catch (Exception e)\r\n/* 152: */ {\r\n/* 153:171 */ e.printStackTrace();\r\n/* 154:172 */ this.context.setRollbackOnly();\r\n/* 155:173 */ throw new AS2Exception(e.getMessage());\r\n/* 156: */ }\r\n/* 157: */ }", "@Test\n public void deleteAccount() {\n Account accountToBeDeleted = new Account(\"deleteMe\", \"deleteMe\", false,\n \"Fontys Stappegoor\", \"[email protected]\");\n accountQueries.addAccount(accountToBeDeleted);\n\n // Get ID of recently inserted Account to be able to test deletion\n Account toDelete = accountQueries.getAccountByUserName(\"deleteMe\");\n boolean succeeded = accountQueries.deleteAccount(toDelete.getID());\n\n assertEquals(succeeded, true);\n }", "@Override\n public String deleteStatement() throws Exception {\n return null;\n }", "void confirmTrans(ITransaction trans);", "public void testDeletePhase_NotExist() throws Exception {\n Phase phase = new Phase(new Project(new Date(), new DefaultWorkdays()), 123);\n phase.setId(23455);\n persistence.deletePhase(phase);\n\n // check whether the phase is deleted.\n DBRecord[] records = TestHelper.getPhaseRecords(\"\");\n assertEquals(\"No phase should be deleted.\", 6, records.length);\n }", "@Override\n\tpublic String deleteStatement() throws Exception {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic int deletePurchase(PurchaseVo vo) {\n\t\treturn 0;\r\n\t}", "@TransactionAttribute(TransactionAttributeType.REQUIRED)\r\n/* 160: */ private void eliminarDetallesReporteador(Reporteador reporteador, DetalleReporteador detalleReporteadorPadre)\r\n/* 161: */ throws AS2Exception\r\n/* 162: */ {\r\n/* 163: */ try\r\n/* 164: */ {\r\n/* 165:181 */ List<DetalleReporteador> listaDetalleReporteador = null;\r\n/* 166:182 */ if (detalleReporteadorPadre == null) {\r\n/* 167:183 */ listaDetalleReporteador = reporteador.getListaDetalleReporteador();\r\n/* 168: */ } else {\r\n/* 169:185 */ listaDetalleReporteador = detalleReporteadorPadre.getListaDetalleReporteadorHijo();\r\n/* 170: */ }\r\n/* 171:189 */ for (DetalleReporteador detalleReporteador : listaDetalleReporteador) {\r\n/* 172:190 */ eliminarDetallesReporteador(reporteador, detalleReporteador);\r\n/* 173: */ }\r\n/* 174:194 */ if ((detalleReporteadorPadre != null) && (detalleReporteadorPadre.getId() != 0)) {\r\n/* 175:195 */ this.detalleReporteadorDao.eliminar(detalleReporteadorPadre);\r\n/* 176: */ }\r\n/* 177: */ }\r\n/* 178: */ catch (AS2Exception e)\r\n/* 179: */ {\r\n/* 180:198 */ this.context.setRollbackOnly();\r\n/* 181:199 */ throw e;\r\n/* 182: */ }\r\n/* 183: */ catch (Exception e)\r\n/* 184: */ {\r\n/* 185:201 */ e.printStackTrace();\r\n/* 186:202 */ this.context.setRollbackOnly();\r\n/* 187:203 */ throw new AS2Exception(e.getMessage());\r\n/* 188: */ }\r\n/* 189: */ }", "@Override\n\tpublic int deletePendingTransactions(String transactionType) {\n\t\treturn 0;\n\t}", "public abstract boolean delete(Log log) throws DataException;", "public void logTransactionEnd();", "public void rollbackTx()\n\n{\n\n}", "TransactionContext cancelTransaction() throws IOException;", "@Test\n void deleteSuccess() {\n dao.delete(dao.getById(3));\n assertNull(dao.getById(3));\n }", "@Override\n public boolean deletePurchase(Connection connection, Long purchaseID) throws SQLException {\n PreparedStatement ps = null;\n try{\n // Prepare the statement\n String deleteSQL = \"DELETE FROM Purchase WHERE purchaseID = ?;\";\n ps = connection.prepareStatement(deleteSQL);\n ps.setLong(1, purchaseID);\n ps.executeUpdate();\n \n return true;\n }\n catch(Exception ex){\n ex.printStackTrace();\n //System.out.println(\"Exception in ContainerDaoImpl.retrieveContainer()\");\n if (ps != null && !ps.isClosed()){\n ps.close();\n }\n if (connection != null && !connection.isClosed()){\n connection.close();\n }\n \n return false;\n }\n }", "@Test\n\tpublic void testInvalidMerchantTransaction() {\n\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\tdatabase.addCustomer(customer);\n\t\t//database.addCustomer(merchant); Merchant not in database\n\t\tdatabase.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\t\t\n\t\tassertEquals(\"This merchant is not a DTUPay user\",verifyParticipants);\n\t}", "public JSONObject deleteTransaction(JSONObject message, Session session, Connection conn) {\n\t\ttry {\n\t\t\tStatement st = conn.createStatement();\n\t\t\tint transID = message.getInt(\"transactionID\");\n\t\t\tint userID = message.getInt(\"userID\");\n\t\t\tint budgetID = 0;\n\t\t\tdouble amount = 0;\n\t\t\tResultSet rs = st.executeQuery(\"SELECT * FROM Transactions WHERE transactionID=\" + transID + \";\");\n\t\t\tint bigBudgetID = 0;\n\t\t\tif (rs.next()) {\n\t\t\t\tamount = rs.getFloat(\"Amount\");\n\t\t\t\tbudgetID = rs.getInt(\"budgetID\");\n\t\t\t}\n\t\t\tResultSet rs1 = st.executeQuery(\"SELECT * FROM Budgets WHERE budgetID=\" + budgetID + \";\");\n\t\t\tdouble budgetAmountSpent = 0;\n\t\t\t\n\t\t\tif (rs1.next()) {\n\t\t\t\tbudgetAmountSpent = rs1.getFloat(\"TotalAmountSpent\");\n\t\t\t\tbigBudgetID = rs1.getInt(\"bigBudgetID\");\n\t\t\t}\n\t\t\tResultSet rs2 = st.executeQuery(\"SELECT * FROM BigBudgets WHERE bigBudgetID=\" + bigBudgetID + \";\");\n\t\t\tdouble bigBudgetAmountSpent = 0;\n\t\t\tif (rs2.next()) {\n\t\t\t\tbigBudgetAmountSpent = rs2.getFloat(\"TotalAmountSpent\");\n\t\t\t}\n\t\t\tStatement st4 = conn.createStatement();\n\t\t\tst4.execute(\"UPDATE Budgets SET TotalAmountSpent=\" + (budgetAmountSpent-amount) + \" WHERE budgetID=\" + budgetID + \";\");\n\t\t\tStatement st5 = conn.createStatement();\n\t\t\tst5.execute(\"UPDATE BigBudgets SET TotalAmountSpent=\" + (bigBudgetAmountSpent-amount) + \"WHERE bigBudgetID=\" + bigBudgetID + \";\");\n\t\t\t\n\t\t\tString deleteTrans = \"DELETE FROM Transactions WHERE transactionID=\" + transID + \";\";\n\t\t\tst.execute(deleteTrans);\n\t\t\tresponse = getData(conn, userID);\n\t\t\tresponse.put(\"message\", \"deleteTransactionSuccess\");\n\t\t} catch (SQLException | JSONException e) {\n\t\t\te.printStackTrace();\n\t\t\ttry {\n\t\t\t\tresponse.put(\"message\", \"deleteTransactionFail\");\n\t\t\t} catch (JSONException 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\treturn response;\n\t}", "@Test\n void deleteSuccess() {\n dao.delete(dao.getById(2));\n assertNull(dao.getById(2));\n }", "@Test\n void deleteSuccess() {\n genericDAO.delete(genericDAO.getByID(2));\n assertNull(genericDAO.getByID(2));\n }", "void commit() {\r\n tx.commit();\r\n tx = new Transaction();\r\n }", "@Override\n public void rollbackTx() {\n \n }", "void commit(Transaction transaction);", "public void deleteSales(int saleId) throws SQLException, SaleDoesnotExistException, ConnectionCorruptionException {\n if (salesLogContains(saleId)) {\n Sale saleToRemove = DatabaseSelectHelper.getSaleById(saleId);\n salesLog.remove(saleToRemove);\n salesCounter--;\n } else {\n\n throw new SaleDoesnotExistException();\n }\n\n }", "@Test\n public void deleteTest() throws SQLException {\n manager = new TableServizioManager(mockDb);\n manager.delete(1);\n Servizio servizio= manager.retriveById(1);\n assertNull(servizio,\"Should return true if delete Servizio\");\n }", "public void rollbackTransaction() throws TransactionException {\n\t\t\r\n\t}", "void commitTransaction();", "public void removeAllTransactions() {\n Realm realm = mRealmProvider.get();\n realm.executeTransaction(realm1 -> realm1.deleteAll());\n }", "public void abortTransaction(TransID tid) throws IllegalArgumentException {//done\n\t// Check that this is actually an active transaction\n try {\n\t\tatranslist.get(tid).abort();\n\t} catch (IOException e) {\n\t\t// TODO Auto-generated catch block\n\t\tSystem.out.println(\"IO exception\");\n\t\te.printStackTrace();\n\t\tSystem.exit(-1);\n\t}\n atranslist.remove(tid);\n }", "public int delegateDeleteTx(LdPublisher entity) {\r\n assertEntityNotNullAndHasPrimaryKeyValue(entity);\r\n filterEntityOfDelete(entity);\r\n assertEntityOfDelete(entity);\r\n return getMyDao().delete(entity);\r\n }", "@Override\n\tpublic boolean deleteRecord(long rowId){\n\t\tLog.d(TAG, \"Delete transaction with record Id: \" + rowId);\n\t\treturn mSplitsDbAdapter.deleteSplitsForTransaction(rowId) &&\n deleteRecord(TransactionEntry.TABLE_NAME, rowId);\n\t}", "public void testDeletePhase_Normal() throws Exception {\n Phase phase = new Phase(new Project(new Date(), new DefaultWorkdays()), 123);\n phase.setId(2);\n persistence.deletePhase(phase);\n\n // check whether the phase is deleted.\n DBRecord[] records = TestHelper.getPhaseRecords(\" WHERE project_phase_id=\" + phase.getId());\n assertEquals(\"The phase should be deleted.\", 0, records.length);\n\n // check whether the dependency is deleted.\n records = TestHelper.getDependencyRecords(\" WHERE dependency_phase_id=2 OR dependent_phase_id=2\");\n assertEquals(\"Failed to remove dependencies.\", 0, records.length);\n }", "public void delete(Long id) {\n log.debug(\"Request to delete OrderTransaction : {}\", id);\n orderTransactionRepository.deleteById(id);\n }", "@Override\r\n\tpublic void deleteReport(String taxId) throws SQLException {\n\t\treportDao.deleteReport(taxId);\r\n\t}", "private void rollbackTransaction(GraphTraversalSource g) {\n if (graphFactory.isSupportingTransactions()) {\n g.tx().rollback();\n }\n }", "private void clearTransactions() {\n transactions_ = emptyProtobufList();\n }", "@Override\n public boolean delete(String idTransaksi) {\n try {\n String query = \"DELETE FROM transaksi WHERE id = ?\";\n\n PreparedStatement ps = Koneksi().prepareStatement(query);\n ps.setString(1, idTransaksi);\n\n if (ps.executeUpdate() > 0) {\n return true;\n }\n } catch (SQLException se) {\n se.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return false;\n }", "@Test\n public void processTestC()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n //failed transaction\n trans = new Transaction(acc_db,acc.get_Account_Number(),5,10);\n\n Assert.assertEquals(false,trans.process());\n }", "public void delete() throws SQLException {\n Statement stmtIn = DatabaseConnector.getInstance().getStatementIn();\n int safeCheck = BusinessFacade.getInstance().checkIDinDB(this.goodID,\n \"orders\", \"goods_id\");\n if (safeCheck == -1) {\n stmtIn.executeUpdate(\"DELETE FROM ngaccount.goods WHERE goods.goods_id = \" +\n this.goodID + \" LIMIT 1;\");\n }\n }", "private static void deleteTest(int no) {\n\t\tboolean result=new CartDao().delete(no);\r\n\t\tif(!result) System.out.println(\"deleteTest fail\");\r\n\t}", "public boolean deleteRenter(int id){\n String sql = \"SELECT agreementID FROM agreement WHERE renterID = ? && end_date>=curdate() && is_cancelled = 0\";\n int activeContracts;\n //confirmation of deletion set to true as default\n boolean confirmation = true;\n try {\n activeContracts = template.queryForObject(sql, Integer.class, id);\n //exactly 1 future/active contract were found\n //can't delete renter\n confirmation = false;\n } catch (EmptyResultDataAccessException e){\n //this exception is okay - no contracts for the renter and it can execute finally block to delete the renter\n } catch (IncorrectResultSizeDataAccessException e){\n //more than 1 future/active contracts were found\n //can't delete renter\n confirmation = false;\n } finally{\n if (confirmation) {\n //if renter doesn't have active/future contracts it deletes him\n sql = \"DELETE FROM renter WHERE renterID = ?\";\n template.update(sql, id);\n }\n //returns whether deletion has been completed or no\n return confirmation;\n }\n }", "boolean delete(Account account);", "void removeConfirmedTransaction(int transId, String userId);", "protected abstract boolean commitTxn(Txn txn) throws PersistException;", "@Test\n void deleteSuccess() {\n genericDao.delete(genericDao.getById(3));\n assertNull(genericDao.getById(3));\n }", "@Override\r\n\tpublic int delete() throws Exception {\n\t\treturn 0;\r\n\t}", "@Transactional\r\n\tpublic void delete(int billingid) {\n\t\t\r\n\t}", "public long delete(Entity entity){\r\n\t\ttry {\r\n\t\t\tthis.prepareFields(entity, true);\r\n\t\t\tString tableName = this.getTableName();\r\n\t\t\tTransferObject to = new TransferObject(\r\n\t\t\t\t\t\ttableName,\r\n\t\t\t\t\t\tprimaryKeyTos,\r\n\t\t\t\t\t\tfieldTos, \r\n\t\t\t\t\t\tTransferObject.DELETE_TYPE);\r\n\t\t\t\r\n\r\n\t\t\t\r\n\t\t\treturn transactStatements(to);\r\n\t\t} catch (Exception e) {\r\n\t\t\tLog.e(\"GPALOG\" , e.getMessage(),e); \r\n\t\t}\r\n\t\treturn 0;\r\n\t}", "public void testDelete() {\r\n\r\n\t\ttry {\r\n\t\t\tlong count, newCount, diff = 0;\r\n\t\t\tcount = levelOfCourtService.getCount();\r\n\t\t\tLevelOfCourt levelOfCourt = (LevelOfCourt) levelOfCourtTestDataFactory\r\n\t\t\t\t\t.loadOneRecord();\r\n\t\t\tlevelOfCourtService.delete(levelOfCourt);\r\n\t\t\tnewCount = levelOfCourtService.getCount();\r\n\t\t\tdiff = newCount - count;\r\n\t\t\tassertEquals(diff, 1);\r\n\t\t} catch (Exception e) {\r\n\t\t\tfail(e.getMessage());\r\n\t\t}\r\n\t}", "public void delete(IncomingReport incoming_report) throws DAOException;", "public static Response controllerDeleteFutureTransaction(\n FutureTransaction futureTransaction,\n Token authorization\n ) {\n if (\n userOwnsAccount(futureTransaction.fromAccountId, authorization.userId) ==\n null\n ) {\n return new Response(\n 401,\n Router.AUTHENTICATION_ERROR,\n Response.ResponseType.TEXT\n );\n }\n try {\n TransactionDatabase.deleteFutureTransaction(\n futureTransaction.futureTransferId\n );\n return new Response(200, \"OK\", Response.ResponseType.TEXT);\n } catch (SQLException e) {\n return new Response(500, SQL_ERROR, Response.ResponseType.TEXT);\n }\n }", "@Transactional\n\t@Override\n\tpublic String delete(Detail t) {\n\t\treturn null;\n\t}", "public com.opentext.bn.converters.avro.entity.ContentErrorEvent.Builder clearTransactionId() {\n transactionId = null;\n fieldSetFlags()[10] = false;\n return this;\n }", "public static void getTransactionsAndDeleteAfterCancel() {\n // get DB helper\n mDbHelper = PointOfSaleDb.getInstance(context);\n\n // Each row in the list stores amount and date of transaction -- retrieves history from DB\n SQLiteDatabase db = mDbHelper.getReadableDatabase();\n\n // get the following columns:\n String[] tableColumns = { PointOfSaleDb.TRANSACTIONS_COLUMN_CREATED_AT,\n \"_ROWID_\"};// getting also _ROWID_ to delete the selected tx\n\n String sortOrder = PointOfSaleDb.TRANSACTIONS_COLUMN_CREATED_AT + \" DESC\";\n Cursor c = db.query(PointOfSaleDb.TRANSACTIONS_TABLE_NAME, tableColumns, null, null, null, null, sortOrder);\n //moving to first position to get last created transaction\n if(c.moveToFirst()) {\n int rowId = Integer.parseInt(c.getString(1));\n\n String selection = \"_ROWID_\" + \" = ? \";\n String[] selectionArgs = {String.valueOf(rowId)};\n int count = db.delete(PointOfSaleDb.TRANSACTIONS_TABLE_NAME, selection, selectionArgs);\n\n //send broadcast to update view\n sendBroadcast();\n }\n\n }", "void deleteDepositTransaction(int index, Ui ui, boolean isCardBill) throws TransactionException, BankException {\n throw new BankException(\"This account does not support this feature\");\n }", "public void testDeletePaymentTerm_EmptyDatabase() throws Exception {\r\n try {\r\n new SimpleCommonManager(\"SimpleCommonManager_Error_14\").deletePaymentTerm(1);\r\n fail(\"PaymentTermDAOException is expected\");\r\n } catch (PaymentTermDAOException e) {\r\n assertTrue(e.getCause() instanceof SQLException);\r\n }\r\n }", "@Transactional\n\t@Override\n\tpublic boolean deleteKitchenorder(SalesorderModel salesorder)\n\t\t\tthrows Exception {\n\t\treturn false;\n\t}", "@Transactional\n\t@Override\n\tpublic void deleteById(Integer id) throws Exception {\n\t\tparaderoRespository.deleteById(id);\n\t}", "public static void clear() {\r\n\t\tload();\r\n\t\tif (transList.size() == 0) {\r\n\t\t\tSystem.out.println(\"No transaction now....\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tfor (int i = 0; i < transList.size(); i++) {\r\n\t\t\tif (transList.get(i).toFile().charAt(0) == 'd') {\r\n\t\t\t\tDeposit trans = (Deposit) transList.get(i);\r\n\t\t\t\tif (!trans.isCleared()) {\r\n\t\t\t\t\ttrans.setCleared(AccountControl.deposit(trans.getAcc(), trans.getAmount()));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tsave();\r\n\t}", "@Test\n @WithMockUser(username = \"employee\", roles = {\"EMPLOYEE\"})\n public void deleteTransactionById() throws Exception {\n\n when(transactionService.getTransactionById(99)).thenReturn(transaction);\n this.mvc.perform(delete(\"/transactions/99\").contentType(MediaType.APPLICATION_JSON)\n .accept(MediaType.APPLICATION_JSON))\n .andExpect(status().is(200));\n }", "public void commitTransaction() throws TransactionException {\n\t\t\r\n\t}", "@Override\n\tpublic int delete(long id) throws DAOException {\n\t\treturn 0;\n\t}" ]
[ "0.7609447", "0.71998453", "0.70170695", "0.6954799", "0.6895283", "0.6690905", "0.655995", "0.62845415", "0.6278361", "0.62639445", "0.62284076", "0.6181802", "0.6180325", "0.61801773", "0.6143982", "0.6126395", "0.6110589", "0.61062056", "0.6096468", "0.6078374", "0.59967846", "0.5953522", "0.59403026", "0.59253705", "0.5897432", "0.58556473", "0.5854029", "0.58392173", "0.5838025", "0.5824267", "0.5824005", "0.58237344", "0.57825357", "0.57799506", "0.57791615", "0.5763623", "0.5762987", "0.575716", "0.5753466", "0.5742878", "0.57386976", "0.5733969", "0.5716457", "0.57097214", "0.5704459", "0.56661236", "0.56638604", "0.56563973", "0.56549597", "0.5654676", "0.56525666", "0.5649531", "0.56488806", "0.5648353", "0.56354624", "0.56138104", "0.5605154", "0.5591233", "0.5586676", "0.5577579", "0.556396", "0.55521494", "0.55514616", "0.55467373", "0.5540347", "0.5537772", "0.5535127", "0.55347717", "0.55253845", "0.55248964", "0.5523061", "0.5521671", "0.5521607", "0.55206233", "0.5517385", "0.55098176", "0.5501615", "0.5498833", "0.54941064", "0.54895455", "0.54854923", "0.5478544", "0.5472539", "0.5457096", "0.5450411", "0.544975", "0.5434552", "0.5433679", "0.54304844", "0.54268247", "0.541454", "0.54093", "0.5402303", "0.5399219", "0.5391693", "0.5391533", "0.5391222", "0.5388566", "0.5385576", "0.5381165" ]
0.7131652
2
Creating a new transaction, testing if its visible, if the value is correct and logging the result to the report
@Test(groups = "Transactions Tests", description = "Transaction Calculation") public void transactionCalculation() { MainScreen.clickAccountItem("Income"); SubAccountScreen.clickSubAccountItem("Salary"); TransactionsScreen.clickAddTransactionBtn(); TransactionsScreen.typeTransactionDescription("Extra income"); TransactionsScreen.typeTransactionAmount("100"); TransactionsScreen.clickTransactionType(); TransactionsScreen.clickSaveBtn(); TransactionsScreen.transactionItem("Extra income").shouldBe(visible); TransactionsScreen.transactionAmout().shouldHave(text("$100")); test.log(Status.PASS, "Transaction created successfully and the value is correct"); //Creating another transaction, testing if its visible, if the value is correct and logging the result to the report returnToHomeScreen(); MainScreen.clickAccountItem("Expenses"); SubAccountScreen.clickSubAccountItem("Books"); TransactionsScreen.clickAddTransactionBtn(); TransactionsScreen.typeTransactionDescription("How to become a good QA Engineer book"); TransactionsScreen.typeTransactionAmount("50"); TransactionsScreen.clickSaveBtn(); TransactionsScreen.transactionItem("How to become a good QA Engineer book").shouldBe(visible); TransactionsScreen.transactionAmout().shouldHave(text("$50")); test.log(Status.PASS, "Second transaction created successfully and the value is correct"); //Testing if the calculation is correct and logging the result to the report returnToHomeScreen(); MainScreen.clickAccountItem("Assets"); SubAccountScreen.clickSubAccountItem("Current Assets"); SubAccountScreen.transactionAmoutFromSubAccountItem("Cash in Wallet").shouldHave(text("$50")); test.log(Status.PASS, "Calculation is correct"); //Deleting both transactions for app cleanup and logging the result to the report SubAccountScreen.clickSubAccountItem("Cash in Wallet"); TransactionsScreen.clickOptionsBtnFromTransactionItem("Extra income"); TransactionsScreen.clickDeleteTransactionOption(); TransactionsScreen.clickOptionsBtnFromTransactionItem("How to become a good QA Engineer book"); TransactionsScreen.clickDeleteTransactionOption(); test.log(Status.PASS, "Transactions deleted successfully"); //Testing if both transactions were deleted from the 'Double Entry' account and logging the result to the report returnToHomeScreen(); MainScreen.clickAccountItem("Assets"); SubAccountScreen.clickSubAccountItem("Current Assets"); SubAccountScreen.transactionAmoutFromSubAccountItem("Cash in Wallet").shouldHave(text("$0")); test.log(Status.PASS, "Transactions from the 'Double Entry' account deleted successfully"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test(groups = \"Transactions Tests\", description = \"Create new transaction\")\n\tpublic void createNewTransaction() {\n\t\tMainScreen.clickAccountItem(\"Income\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Salary\");\n\t\tTransactionsScreen.clickAddTransactionBtn();\n\t\tTransactionsScreen.typeTransactionDescription(\"Extra income\");\n\t\tTransactionsScreen.typeTransactionAmount(\"300\");\n\t\tTransactionsScreen.clickTransactionType();\n\t\tTransactionsScreen.typeTransactionNote(\"Extra income from this month\");\n\t\tTransactionsScreen.clickSaveBtn();\n\t\tTransactionsScreen.transactionItem(\"Extra income\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$300\"));\n\t\ttest.log(Status.PASS, \"Sub-account created successfully and the value is correct\");\n\n\t\t//Testing if the transaction was created in the 'Double Entry' account, if the value is correct and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickAccountItem(\"Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Current Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Cash in Wallet\");\n\t\tTransactionsScreen.transactionItem(\"Extra income\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$300\"));\n\t\ttest.log(Status.PASS, \"'Double Entry' account also have the transaction and the value is correct\");\n\n\t}", "@Test\n\tpublic void testAddTransaction(){\n setDoubleEntryEnabled(true);\n\t\tsetDefaultTransactionType(TransactionType.DEBIT);\n validateTransactionListDisplayed();\n\n\t\tonView(withId(R.id.fab_create_transaction)).perform(click());\n\n\t\tonView(withId(R.id.input_transaction_name)).perform(typeText(\"Lunch\"));\n\t\tonView(withId(R.id.input_transaction_amount)).perform(typeText(\"899\"));\n\t\tonView(withId(R.id.input_transaction_type))\n\t\t\t\t.check(matches(allOf(isDisplayed(), withText(R.string.label_receive))))\n\t\t\t\t.perform(click())\n\t\t\t\t.check(matches(withText(R.string.label_spend)));\n\n\t\tString expectedValue = NumberFormat.getInstance().format(-899);\n\t\tonView(withId(R.id.input_transaction_amount)).check(matches(withText(expectedValue)));\n\n int transactionsCount = getTransactionCount();\n\t\tonView(withId(R.id.menu_save)).perform(click());\n\n validateTransactionListDisplayed();\n\n List<Transaction> transactions = mTransactionsDbAdapter.getAllTransactionsForAccount(DUMMY_ACCOUNT_UID);\n assertThat(transactions).hasSize(2);\n Transaction transaction = transactions.get(0);\n\t\tassertThat(transaction.getSplits()).hasSize(2);\n\n assertThat(getTransactionCount()).isEqualTo(transactionsCount + 1);\n }", "private void createTransaction() {\n\n String inputtedAmount = etAmount.getText().toString().trim().replaceAll(\",\", \"\");\n\n if (inputtedAmount.equals(\"\") || Double.parseDouble(inputtedAmount) == 0) {\n etAmount.setError(getResources().getString(R.string.Input_Error_Amount_Empty));\n return;\n }\n\n if (mAccount == null) {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.Input_Error_Account_Empty));\n return;\n }\n\n if(mCategory == null) {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.Input_Error_Category_Income_Empty));\n return;\n }\n\n Double amount = Double.parseDouble(etAmount.getText().toString().replaceAll(\",\", \"\"));\n if(amount < 0) {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.Input_Error_Amount_Invalid));\n return;\n }\n\n int CategoryId = mCategory != null ? mCategory.getId() : 0;\n String Description = tvDescription.getText().toString();\n int accountId = mAccount.getId();\n String strEvent = tvEvent.getText().toString();\n Event event = null;\n\n if (!strEvent.equals(\"\")) {\n event = mDbHelper.getEventByName(strEvent);\n if (event == null) {\n long eventId = mDbHelper.createEvent(new Event(0, strEvent, mCal, null));\n if (eventId != -1) {\n event = mDbHelper.getEvent(eventId);\n }\n }\n }\n\n boolean isDebtValid = true;\n // Less: DebtCollect, More: Borrow\n if(mCategory.getDebtType() == Category.EnumDebt.LESS) { // Income -> Debt Collecting\n List<Debt> debts = mDbHelper.getAllDebtByPeople(tvPeople.getText().toString());\n\n Double lend = 0.0, debtCollect = 0.0;\n for(Debt debt : debts) {\n if(mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.MORE) {\n lend += debt.getAmount();\n }\n\n if(!mDbHelper.getCategory(debt.getCategoryId()).isExpense() && mDbHelper.getCategory(debt.getCategoryId()).getDebtType() == Category.EnumDebt.LESS) {\n debtCollect += debt.getAmount();\n }\n }\n\n if(debtCollect + amount > lend) {\n isDebtValid = false;\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_debt_collect_invalid));\n }\n }\n\n if(isDebtValid) {\n Transaction transaction = new Transaction(0,\n TransactionEnum.Income.getValue(),\n amount,\n CategoryId,\n Description,\n 0,\n accountId,\n mCal,\n 0.0,\n \"\",\n event);\n\n long newTransactionId = mDbHelper.createTransaction(transaction);\n\n if (newTransactionId != -1) {\n\n if(mCategory.getDebtType() == Category.EnumDebt.LESS || mCategory.getDebtType() == Category.EnumDebt.MORE) {\n Debt newDebt = new Debt();\n newDebt.setCategoryId(mCategory.getId());\n newDebt.setTransactionId((int) newTransactionId);\n newDebt.setAmount(amount);\n newDebt.setPeople(tvPeople.getText().toString());\n\n long debtId = mDbHelper.createDebt(newDebt);\n if(debtId != -1) {\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_create_successful));\n cleanup();\n\n if(getFragmentManager().getBackStackEntryCount() > 0) {\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n }\n } else {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_transaction_create_fail));\n mDbHelper.deleteTransaction(newTransactionId);\n }\n } else {\n ((ActivityMain) getActivity()).showToastSuccessful(getResources().getString(R.string.message_transaction_create_successful));\n cleanup();\n\n if(getFragmentManager().getBackStackEntryCount() > 0) {\n // Return to last fragment\n getFragmentManager().popBackStackImmediate();\n }\n }\n\n } else {\n ((ActivityMain) getActivity()).showError(getResources().getString(R.string.message_transaction_create_fail));\n }\n }\n\n }", "@Test\n\tpublic void testValidTransaction() {\n\t\t\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\tdatabase.addCustomer(customer);\n\t\tdatabase.addCustomer(merchant);\n\t\tdatabase.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tString transJMSMessage = transHandle.generateTransactionJMSRequest();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\n\t\tassertEquals(\"Transaction participants are valid\",verifyParticipants);\n\t\tassertEquals(transJMSMessage,customer.getBankId()+\" \"+ merchant.getBankId()+ \" \" + amount + \" \" + \"comment\");\n\t}", "public void createNewAccountWithOpeningBalanceHelper() {\n\t\tparseDateTextFieldHelper();\n\t\tBalance balance = data.createNewAccountWithOpeningBalance();\n\t\tLocalDate date = LocalDate.of(year, month, dayOfMonth);\n\t\tbalance.setDate(date);\n\t\tJTextField amount = data.getTextFieldBalance();\n\t\t// this before was not being set, i thought i set it in expectedResult but\n\t\t// that's a different object!\n\t\tbalance.setAmount(Float.parseFloat(amount.getText()));\n\t\t// I think you can actually just insert the values here instead if using get()\n\t\tBalance resultExpected = new Balance(bankTest, accountTest,\n\t\t\t\tdate.getYear(), date.getMonthValue(), date.getDayOfMonth(),\n\t\t\t\tFloat.parseFloat(amount.getText()), TEST_TXTR_EXTRA_NOTES);\n\t\tassertEquals(resultExpected, balance);\n\t}", "public boolean createTransaction() {\n\t\t\treturn false;\n\t\t}", "@Test\n public void processTestC()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n //failed transaction\n trans = new Transaction(acc_db,acc.get_Account_Number(),5,10);\n\n Assert.assertEquals(false,trans.process());\n }", "public boolean requestTransaction(String name,String reason,double amount){\n Transaction t1 = new Transaction(name,reason,amount);\n boolean done=t1.registertransaction();\n \n return done; \n \n}", "public boolean AddTransactionToAccount(Double transaction)\n {\n\n if(this.transactions.add(transaction)){\n System.out.println(\"Failed to add transaction: \" + transaction);\n return false;\n }\n System.out.println(\"Successfully added Transaction: \" + transaction);\n return true;\n }", "@Test\n public void testPayTransactionSuccessfully() throws Exception {\n\n // login with sufficient rights\n shop.login(admin.getUsername(), admin.getPassword());\n\n // verify receive correct change when paying for sale\n double change = 3;\n assertEquals(change, shop.receiveCashPayment(saleId, toBePaid+change), 0.001);\n totalBalance += toBePaid;\n\n // verify sale is in state PAID/COMPLETED\n assertTrue(isTransactionInAccountBook(saleId));\n\n // verify system's balance did update correctly\n assertEquals(totalBalance, shop.computeBalance(), 0.001);\n }", "@Test(dataProvider=\"newPayment\")\n\tpublic void createPaymentTest(Long creditCardNumber, int secureCode, int zipcode, boolean expected) throws ClassNotFoundException, IOException, RegistrationException, SQLException {\n\t\tthePayment = new Payment(creditCardNumber, secureCode, zipcode);\n\t\tpaymentId = paymentDAO.createPayment(thePayment);\n\t\t// equivalent to isCreated = (actual != 0) ? true : false\n\t\tisCreated = (paymentId != 0);\n\t\tassertThat(isCreated , equalTo(expected));\n\t\t\n\t}", "public void createTransaction(Transaction trans);", "@Test\n public void processTestA()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n //pass transaction\n trans = new Transaction(acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),300);\n\n Assert.assertEquals(true,trans.process());\n }", "@Transactional\n\tpublic String addTransaction(int toAccNo, int fromAccNo, Transaction tran) {\n\t\t\tEntityManager entityManager = getEntityManager();\n\t\t\tAccountdetail acc = (Accountdetail) entityManager.createQuery(\"select a from Accountdetail a where a.accountnumber =: toaccNo\").setParameter(\"toaccNo\", toAccNo ).getSingleResult();\n\t\t\tAccountdetail acc1 = (Accountdetail) entityManager.createQuery(\"select ac from Accountdetail ac where ac.accountnumber =: fromAccNo\").setParameter(\"fromAccNo\", fromAccNo ).getSingleResult();\n\t\t\t\n\t\t\t//Validation -----> The Balance amount should be greater than the Amount Transfered \n\t\t\tif(acc1.getCurrentbalance()>=tran.getAmounttransferred()) {\n\t\t\t\t\ttran.setAccountto(acc);\n\t\t\t\t\ttran.setAccountfrom(acc1);\n\t\t\t\t\tentityManager.merge(tran);\n\t\t\t\t\t\n\t\t\t\t\t//Taking the amount transfered\n\t\t\t\t\tint amt = tran.getAmounttransferred();\n\t\t\t\t\tSystem.out.println(toAccNo);\n\t\t\t\t\t\n\t\t\t\t\t//Also crediting and debiting the amount from the accounts \n\t\t\t\t\tacc.setCurrentbalance(acc.getCurrentbalance()+amt);\n\t\t\t\t\tacc1.setCurrentbalance(acc1.getCurrentbalance()-amt);\n\t\t\t\t\t\n\t\t\t\t\t//Mailing the details of the transaction to the Respective Account Numbers\n\t\t\t\t\tString info_deb = \"Amount debited from your account.\\nAmount -->\"+amt+\"\\nTo Account -->\"+acc.getAccountnumber();\n String info_rec = \"Amount credited to your account.\\nAmount -->\"+amt+\"\\nFrom Account -->\"+acc1.getAccountnumber();\n mailService.sendMail(info_deb, acc1.getCustomerdetail().getEmail());\n mailService.sendMail(info_rec, acc.getCustomerdetail().getEmail());\n \n\t\t\t\t\treturn \"Transaction Inserted\";\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t//If Balance is less than the Amount Transfered \n\t\t\t\telse if(acc1.getCurrentbalance()<tran.getAmounttransferred()) {\n\t\t\t\t\treturn \"insufficient funds\";\n\t\t\t\t}\n\t\t\t\n\t\t\t\t//If the Details is wrong\n\t\t\t\telse {\n\t\t\t\t\treturn \"Wrong details. Please try again\";\n\t\t\t\t}\n\t }", "@Test\n public void checkingAccount2() {\n Bank bank = new Bank();\n Customer bill = new Customer(\"Bill\");\n Account checkingAccount = new CheckingAccount(bill, Account.CHECKING);\n bank.addCustomer(new Customer(\"Bill\").openAccount(checkingAccount));\n Transaction t = new CreditTransaction(1000.0);\n t.setTransactionDate(getTestDate(-5));\n checkingAccount.addTransaction(t);\n\n assertEquals(Math.pow(1 + 0.001 / 365.0, 5) * 1000 - 1000, bank.totalInterestPaid(), DOUBLE_DELTA);\n }", "@Test(groups = \"Transactions Tests\", description = \"Duplicate transaction\")\n\tpublic void duplicateTransaction() {\n\t\tMainScreen.clickAccountItem(\"Income\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Salary\");\n\t\tTransactionsScreen.clickOptionsBtnFromTransactionItem(\"Bonus\");\n\t\tTransactionsScreen.clickDuplicateTransactionOption();\n\t\tTransactionsScreen.transactionItens(\"Bonus\").shouldHave(size(2));\n\t\ttest.log(Status.PASS, \"Transaction successfully duplicated\");\n\n\t\t//Testing if there is two identical transactions in the 'Double Entry' account and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickAccountItem(\"Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Current Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Cash in Wallet\");\n\t\tTransactionsScreen.transactionItens(\"Bonus\").shouldHave(size(2));\n\t\ttest.log(Status.PASS, \"Transaction successfully duplicated in the 'Double Entry' account\");\n\n\t}", "public boolean ADDCHEDTransact(CHEDTransact trans) {\n query = \"INSERT INTO transact(NumberO)\";\n try {\n ps = con.prepareStatement(query);\n\n java.util.Date dateP = trans.getiTDate();\n\n Date dateSigned = new Date(dateP.getYear(), dateP.getMonth(), dateP.getDay());\n\n ps.setInt(1, trans.getNumberOFTrees());\n ps.setString(2, trans.getLotNumber());\n ps.setString(3, trans.getiTvoucher());\n ps.setString(4, trans.gettRvoucher());\n ps.setDate(5, dateSigned);\n ps.setFloat(6, trans.getAmountPayable());\n\n if (ps.executeUpdate() != 0) {\n status = true;\n }\n\n } catch (SQLException ex) {\n Logger.getLogger(FarmerManager.class.getName()).log(Level.SEVERE, null, ex);\n }\n\n return status;\n }", "private void reportTransactionStatus(boolean success){\n if(success){\n sendMessage(\"<st>\");\n }else{\n sendMessage(\"<f>\");\n }\n }", "boolean startTransaction(Klant klant, String IBAN1, String IBAN2, double value, String description) throws SessionExpiredException, IllegalArgumentException, LimitReachedException, RemoteException;", "private boolean prepareTransaction() {\n\n // Ensure Bitcoin network service is started\n BitcoinNetworkService bitcoinNetworkService = CoreServices.getOrCreateBitcoinNetworkService();\n Preconditions.checkState(bitcoinNetworkService.isStartedOk(), \"'bitcoinNetworkService' should be started\");\n\n Address changeAddress = bitcoinNetworkService.getNextChangeAddress();\n\n // Determine if this came from a BIP70 payment request\n if (paymentRequestData.isPresent()) {\n Optional<FiatPayment> fiatPayment = paymentRequestData.get().getFiatPayment();\n PaymentSession paymentSession;\n try {\n if (paymentRequestData.get().getPaymentRequest().isPresent()) {\n paymentSession = new PaymentSession(paymentRequestData.get().getPaymentRequest().get(), false);\n } else {\n log.error(\"No PaymentRequest in PaymentRequestData - cannot create a paymentSession\");\n return false;\n }\n } catch (PaymentProtocolException e) {\n log.error(\"Could not create PaymentSession from payment request {}, error was {}\", paymentRequestData.get().getPaymentRequest().get(), e);\n return false;\n }\n\n // Build the send request summary from the payment request\n Wallet.SendRequest sendRequest = paymentSession.getSendRequest();\n log.debug(\"SendRequest from BIP70 paymentSession: {}\", sendRequest);\n\n Optional<FeeState> feeState = WalletManager.INSTANCE.calculateBRITFeeState(true);\n\n // Prepare the transaction i.e work out the fee sizes (not empty wallet)\n sendRequestSummary = new SendRequestSummary(\n sendRequest,\n fiatPayment,\n FeeService.normaliseRawFeePerKB(Configurations.currentConfiguration.getWallet().getFeePerKB()),\n null,\n feeState\n );\n\n // Ensure we keep track of the change address (used when calculating fiat equivalent)\n sendRequestSummary.setChangeAddress(changeAddress);\n sendRequest.changeAddress = changeAddress;\n } else {\n Preconditions.checkNotNull(enterAmountPanelModel);\n Preconditions.checkNotNull(confirmPanelModel);\n\n // Check a recipient has been set\n if (!enterAmountPanelModel\n .getEnterRecipientModel()\n .getRecipient().isPresent()) {\n return false;\n }\n\n // Build the send request summary from the user data\n Coin coin = enterAmountPanelModel.getEnterAmountModel().getCoinAmount().or(Coin.ZERO);\n Address bitcoinAddress = enterAmountPanelModel\n .getEnterRecipientModel()\n .getRecipient()\n .get()\n .getBitcoinAddress();\n\n Optional<FeeState> feeState = WalletManager.INSTANCE.calculateBRITFeeState(true);\n\n // Create the fiat payment - note that the fiat amount is not populated, only the exchange rate data.\n // This is because the client and transaction fee is only worked out at point of sending, and the fiat equivalent is computed from that\n Optional<FiatPayment> fiatPayment;\n Optional<ExchangeRateChangedEvent> exchangeRateChangedEvent = CoreServices.getApplicationEventService().getLatestExchangeRateChangedEvent();\n if (exchangeRateChangedEvent.isPresent()) {\n fiatPayment = Optional.of(new FiatPayment());\n fiatPayment.get().setRate(Optional.of(exchangeRateChangedEvent.get().getRate().toString()));\n // A send is denoted with a negative fiat amount\n fiatPayment.get().setAmount(Optional.<BigDecimal>absent());\n fiatPayment.get().setCurrency(Optional.of(exchangeRateChangedEvent.get().getCurrency()));\n fiatPayment.get().setExchangeName(Optional.of(ExchangeKey.current().getExchangeName()));\n } else {\n fiatPayment = Optional.absent();\n }\n\n // Prepare the transaction i.e work out the fee sizes (not empty wallet)\n sendRequestSummary = new SendRequestSummary(\n bitcoinAddress,\n coin,\n fiatPayment,\n changeAddress,\n FeeService.normaliseRawFeePerKB(Configurations.currentConfiguration.getWallet().getFeePerKB()),\n null,\n feeState,\n false);\n }\n\n log.debug(\"Just about to prepare transaction for sendRequestSummary: {}\", sendRequestSummary);\n return bitcoinNetworkService.prepareTransaction(sendRequestSummary);\n }", "public void testCanCreateInvoiceAccuracy() throws Exception {\n assertEquals(\"The result is not as expected\", true, invoiceSessionBean.canCreateInvoice(5));\n\n }", "@Test\n @Transactional\n public void checkAmtIsRequired() throws Exception {\n assertThat(reportRepository.findAll()).hasSize(0);\n // set the field null\n report.setAmt(null);\n\n // Create the Report, which fails.\n restReportMockMvc.perform(post(\"/api/reports\")\n .contentType(TestUtil.APPLICATION_JSON_UTF8)\n .content(TestUtil.convertObjectToJsonBytes(report)))\n .andExpect(status().isBadRequest());\n\n // Validate the database is still empty\n List<Report> reports = reportRepository.findAll();\n assertThat(reports).hasSize(0);\n }", "@Override\n public boolean withdrawAmount(TransactionDTO transaction) {\n CustomerDetails customerDetails=this.viewAccount(transaction.getUserName()); \n if(customerDetails.getAccountBalance()>=transaction.getAmount()){\n customerDetails.setAccountBalance(customerDetails.getAccountBalance()-transaction.getAmount());\n customerRepository.save(customerDetails);\n return true;\n }\n else{\n return false;\n }\n }", "public void transaction() throws DBException {\n\t\tUsersTransaction transaction = new UsersTransaction();\n\t\tScanner scan = new Scanner(System.in);\n\t\tLogger.info(\"================TRANSACTION DETAILS TO DONATE======================\");\n\t\tLogger.info(\"Enter the transaction ID\");\n\t\ttransactionId = scan.nextInt();\n\t\tLogger.info(\"Enter the donor ID\");\n\t\tdonorId = scan.nextInt();\n\t\tLogger.info(\"Enter the fund Id\");\n\t\tfundRequestId = scan.nextInt();\n\t\tLogger.info(\"Enter the amount to be funded\");\n\t\ttargetAmount = scan.nextInt();\n\t\ttransaction.setTransactionId(transactionId);\n\t\ttransaction.setDonorId(donorId);\n\t\ttransaction.setFundRequestId(fundRequestId);\n\t\ttransaction.setTargetAmount(targetAmount);\n\t\tinsert(transaction);\n\t\tdonorFundRequest(reqType);\n\t}", "@Test\n public void processTestB()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n //failed transaction\n trans = new Transaction(acc_db,acc.get_Account_Number(),acc2.get_Account_Number(),2000);\n\n Assert.assertEquals(false,trans.process());\n }", "@Test\n public void testTransaction_1()\n throws Exception {\n Transaction result = new Transaction();\n assertNotNull(result);\n }", "@Override\n\tpublic int createTransaction(BankTransaction transaction) throws BusinessException {\n\t\tint tran = 0;\n\t\t\n\t\ttry {\n\t\t\tConnection connection = PostgresqlConnection.getConnection();\n\t\t\tString sql = \"insert into dutybank.transactions (account_id, transaction_type, amount, transaction_date) values(?,?,?,?)\";\n\t\t\t\n\t\t\tPreparedStatement preparedStatement = connection.prepareStatement(sql);\n\t\t\t\n\t\t\tpreparedStatement.setInt(1, transaction.getAccountid());\n\t\t\tpreparedStatement.setString(2, transaction.getTransactiontype());\n\t\t\tpreparedStatement.setDouble(3, transaction.getTransactionamount());\n\t\t\tpreparedStatement.setDate(4, new java.sql.Date(transaction.getTransactiondate().getTime()));\n\n\t\t\t\n\t\t\ttran = preparedStatement.executeUpdate();\n\t\t\t\n\t\t} catch (ClassNotFoundException | SQLException e) {\n\t\t\tthrow new BusinessException(\"Some internal error has occurred while inserting data\");\n\t\t}\n\t\t\n\n\t\treturn tran;\n\t}", "@Override\n public boolean depositAmount(TransactionDTO transaction) {\n if(transaction.getAmount()>0){\n CustomerDetails customerDetails=this.viewAccount(transaction.getUserName()); \n customerDetails.setAccountBalance(customerDetails.getAccountBalance()+transaction.getAmount());\n customerRepository.save(customerDetails);\n return true;\n }else{\n return false;\n }\n }", "@Test\n\tpublic void moneyTrnasferSucess() {\n\t\t\n\t\tString accountNumberFrom = createAccount(\"krishna\",4000);\n\t\tString accountNumberTo = createAccount(\"ram\",2000);\n\t\tdouble amountToBeTranfered = 500.0;\n\t\tMoneyTransfer moneyTransfer = new MoneyTransfer();\n\t\tmoneyTransfer.setAccountNumberFrom(Integer.parseInt(accountNumberFrom));\n\t\tmoneyTransfer.setAccountNumberTo(Integer.parseInt(accountNumberTo));\n\t\tmoneyTransfer.setAmount(amountToBeTranfered);\n\t\t\n\t\tString requestBody = gson.toJson(moneyTransfer);\n\t\t\n\t\tRequestSpecification request = RestAssured.given();\n\t\trequest.body(requestBody);\n\t\tResponse response = request.put(\"/transfer\");\n\t\t\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - START\n\t\tStringBuilder sb = new StringBuilder();\n\t\tsb.append(amountToBeTranfered);\n\t\tsb.append(\" has been transferred to : \");\n\t\tsb.append(accountNumberTo);\n\t\t// This logic is required due to response has been set as mix of Message and return data value. - END\n\t\t\n\t\tAssertions.assertEquals(sb.toString(), response.asString());\n\t\t\n\t}", "@Test\n\tpublic void addTransaction() {\n\t\tTransaction transaction = createTransaction();\n\t\tint size = transactionService.getTransactions().size();\n\t\ttransactionService.addTransaction(transaction);\n\t\tassertTrue(\"No transaction was added.\", size < transactionService.getTransactions().size());\n\t}", "public boolean addTransaction(Transaction transaction) throws SQLException {\n\t\t\n\t\ttry (PreparedStatement statement = conn.prepareStatement(\"INSERT INTO transaction(Date, Type, Category, Amount) VALUES (?, ?, ?, ?)\")) {\n\t\t\tstatement.setDate(1, transaction.date());\n\t\t\tstatement.setString(2, transaction.type());\n\t\t\tstatement.setString(3, transaction.category());\n\t\t\tstatement.setDouble(4, transaction.amount());\n\t\t\treturn statement.executeUpdate() != 0;\n\t\t}\n\t}", "@Test\n\tpublic void testInvalidCustomerTransaction() {\n\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\t\n\t\t//database.addCustomer(customer); not registered\n\t\tdatabase.addCustomer(merchant);\n\t\tdatabase.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\t\t\n\t\tassertEquals(\"This barcode does not belong to any of DTUPay users\",verifyParticipants);\n\t}", "@Test\n\tpublic void depositTest(){\n\t\tCustomer cus = new Customer(\"wgl\", myDate, \"Beijing\");\n\t\tAccount cAcc = new CurrentAccount(cus);\n\t\tbc.deposit(cAcc, 500, true);\n\t\tboolean flag = false;\n\t\tif(cAcc.getBalance() == 500.0){\n\t\t\tflag = true;\n\t\t}\n\t\tassertTrue(flag);\n\t}", "private Transaction creatTransaction(Bill bill, boolean b) {\n Transaction transaction = new Transaction();\n transaction.setDateOfTransaction(new Date());\n transaction.setCostOfTransaction(String.valueOf(bill.getCostOfBill()));\n transaction.setSerialOfTransaction(new TransactionSerialProducer().serialProducer());\n transaction.setFinished(b);\n transaction.setTypeOfTransaction(\"پرداخت قبض\");\n transaction.setBillingId(bill.getBillingId());\n transaction.setPaymentCode(bill.getPaymentCode());\n dbHelper = new DBHelper();\n dbHelper.insertTransaction(transaction);\n return transaction;\n }", "private Tx createTransaction(BitCoinResponseDTO btcDTO, SellerBitcoinInfo sbi) {\n\t\t\n\t\tTx tx = new Tx();\n\t\t\n\t\t\n\t\ttx.setDate(new Date());\n\t\ttx.setAmountOfMoney(btcDTO.getPrice_amount());\n\t\ttx.setStatus(TxStatus.PENDING);\n\t\ttx.setRecieverAddress(btcDTO.getPayment_url());\n\t\ttx.setorder_id(btcDTO.getId()); //ovaj id je na coin gate-u i moram ga cuvati u transakciji\n\t\ttx.setTxDescription(\"Porudzbina je kreirana od strane korisnika\");\n\t\ttx.setSbi(sbi);\n\t\t\n\t\t//trebace ovde jos da se setuje id korisnika koji je kreirao porudzbinu kako bi kasnije mogao da getuje sve\n\t\t//njegove transakcije\n\t\t\n\t\t\n\t\treturn tx;\n\t\t\n\t}", "protected final Transaction createTransaction(TransactionTypeKeys type) {\n\t\tTransaction trans = null;\n\t\tString payee = getForm().getPayFrom();\n\t\tdouble amount = parseAmount();\n\n\t\t// Put amount in proper form.\n\t\tif ((type == INCOME && amount < 0.0)\n\t\t\t\t|| (type == EXPENSE && amount >= 0.0)) {\n\t\t\tamount = -amount;\n\t\t}\n\n\t\t// Put payee in proper form.\n\t\tpayee = purgeIdentifier(payee);\n\n\t\ttrans = new Transaction(getForm().getField(CHECK_NUMBER).getText(),\n\t\t\t\tparseDate(), payee, Money.of(amount,\n\t\t\t\t\t\tUI_CURRENCY_SYMBOL.getCurrency()), getCategory(),\n\t\t\t\tgetForm().getField(NOTES).getText());\n\n\t\t// Set attributes not applicable in the constructor.\n\t\ttrans.setIsReconciled(getForm().getButton(PENDING).isSelected() == false);\n\n\t\tif (isInEditMode() == true) {\n\t\t\ttrans.setLabel(getEditModeTransaction().getLabel());\n\t\t}\n\n\t\treturn trans;\n\t}", "@Test\n\tpublic void testInvalidMerchantTransaction() {\n\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\tdatabase.addCustomer(customer);\n\t\t//database.addCustomer(merchant); Merchant not in database\n\t\tdatabase.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\t\t\n\t\tassertEquals(\"This merchant is not a DTUPay user\",verifyParticipants);\n\t}", "public void createTransaction(TransactionType type, double value, int id, int customerVat) throws ApplicationException {\n\t\ttry{\n\t\t\tTransaction t = new Transaction(type, value, id, customerVat);\n\t\t\tem.persist(t);\n\t\t}\n\t\tcatch (Exception e){\n\t\t\tthrow new ApplicationException(\"Something Shady happened: Error creating Transaction\", e);\n\t\t}\n\t\t\n\t}", "@Test\n public void proveraTransfera() {\n Account ivana = mobi.openAccount(\"Ivana\");\n Account pera = mobi.openAccount(\"Pera\");\n\n mobi.payInMoney(ivana.getNumber(), 5000.0);\n mobi.transferMoney(ivana.getNumber(), pera.getNumber(), 2000.0);\n //ocekujemo da nakon ovoga ivana ima 3000, a pera 2000\n\n SoftAssert sa = new SoftAssert();\n sa.assertEquals(ivana.getAmount(), 3000.0);\n sa.assertEquals(pera.getAmount(), 2000.0);\n\n sa.assertAll();\n }", "@Test\n public void existingTransaction() {\n Transaction t1 = startTransaction();\n IntRef intValue = new IntRef(10);\n t1.commit();\n\n Transaction t2 = startTransaction();\n assertEquals(10, intValue.get());\n\n intValue.inc();\n assertEquals(11, intValue.get());\n t2.commit();\n }", "@Test\n\tpublic void testInvalidBarcodeTransaction() {\n\n\t\tString customerCpr = \"111111-0000\";\n\t\tString merchantCpr = \"000000-1111\";\n\t\tString uuid = \"123412345\";\n\t\tdouble amount = 100;\n\t\t\n\t\tCustomer customer = new Customer(customerCpr,\"customer\",\"bankid\");\n\t\tCustomer merchant = new Customer(merchantCpr,\"merchant\",\"bankid\");\n\t\tdatabase.addCustomer(merchant); //Merchant not in database\n\t\t//database.addBarcode(customerCpr, uuid);\n\t\t\n\t\tTransactionRequest transRequest = new TransactionRequest(uuid,merchantCpr,amount,\"comment\");\n\t\tTransactionHandler transHandle = new TransactionHandler(transRequest);\n\t\t\n\t\tString verifyParticipants = transHandle.verifyTransactionParticipants();\n\t\tdatabase.deleteCustomer(customerCpr);\n\t\tdatabase.deleteCustomer(merchantCpr);\n\t\t\n\t\tassertEquals(\"This barcode does not exist\",verifyParticipants);\n\t}", "boolean hasTxnrequest();", "if (charge == adhocTicket.getCharge()) {\n System.out.println(\"Charge is passed\");\n }", "public Transaction getDummyTransaction(String action) {\n\n\t\t// Long payerAccountNum = 111l;\n\t\tLong payerRealmNum = 0l;\n\t\tLong payerShardNum = 0l;\n\t\t// Long nodeAccountNum=123l;\n\t\tLong nodeRealmNum = 0l;\n\t\tLong nodeShardNum = 0l;\n\t\tlong transactionFee = 0l;\n\t\tTimestamp startTime =\n\t\t\t\tRequestBuilder.getTimestamp(Instant.now(Clock.systemUTC()).minusSeconds(13));\n\t\tDuration transactionDuration = RequestBuilder.getDuration(100);\n\t\tboolean generateRecord = false;\n\t\tString memo = \"UnitTesting\";\n\t\tint thresholdValue = 10;\n\t\tList<Key> keyList = new ArrayList<>();\n\t\tKeyPair pair = new KeyPairGenerator().generateKeyPair();\n\t\tbyte[] pubKey = ((EdDSAPublicKey) pair.getPublic()).getAbyte();\n\t\tKey akey =\n\t\t\t\tKey.newBuilder().setEd25519(ByteString.copyFromUtf8((MiscUtils.commonsBytesToHex(pubKey)))).build();\n\t\tPrivateKey priv = pair.getPrivate();\n\t\tkeyList.add(akey);\n\t\tlong initBal = 100;\n\t\tlong sendRecordThreshold = 5;\n\t\tlong receiveRecordThreshold = 5;\n\t\tboolean receiverSign = false;\n\t\tDuration autoRenew = RequestBuilder.getDuration(100);\n\t\t;\n\t\tlong proxyAccountNum = 12345l;\n\t\tlong proxyRealmNum = 0l;\n\t\tlong proxyShardNum = 0l;\n\t\tint proxyFraction = 10;\n\t\tint maxReceiveProxyFraction = 10;\n\t\tlong shardID = 0l;\n\t\tlong realmID = 0l;\n\n\t\tTransaction trx = null;\n\t\tSignatureList sigList = SignatureList.getDefaultInstance();\n\t\tTimestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\n\t\t/**\n\t\t * SignatureList sigList = SignatureList.getDefaultInstance(); Transaction transferTx =\n\t\t * RequestBuilder.getCryptoTransferRequest( payer.getAccountNum(), payer.getRealmNum(),\n\t\t * payer.getShardNum(), nodeAccount.getAccountNum(), nodeAccount.getRealmNum(),\n\t\t * nodeAccount.getShardNum(), 800, timestamp, transactionDuration, false, \"test\", sigList,\n\t\t * payer.getAccountNum(), -100l, nodeAccount.getAccountNum(), 100l); transferTx =\n\t\t * TransactionSigner.signTransaction(transferTx, accountKeys.get(payer));\n\t\t */\n\n\t\tif (\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t\ttrx = RequestBuilder.getCryptoTransferRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 800, timestamp,\n\t\t\t\t\ttransactionDuration, false, \"test\", sigList, payerAccountId.getAccountNum(), -100l,\n\t\t\t\t\tnodeAccountId.getAccountNum(), 100l);\n\t\t\t// trx = TransactionSigner.signTransaction(trx, account2keyMap.get(payerAccountId));\n\t\t}\n\n\t\tif (\"createContract\".equalsIgnoreCase(action)) {\n\t\t\tFileID fileID = FileID.newBuilder().setFileNum(9999l).setRealmNum(1l).setShardNum(2l).build();\n\n\t\t\ttrx = RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t\t\t\tpayerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t\t\t\tnodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 50000000000l, timestamp,\n\t\t\t\t\ttransactionDuration, true, \"createContract\", DEFAULT_CONTRACT_OP_GAS, fileID,\n\t\t\t\t\tByteString.EMPTY, 0, transactionDuration,\n\t\t\t\t\tSignatureList.newBuilder().addSigs(\n\t\t\t\t\t\t\tSignature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t\t\t\t\t\t.build(),\n\t\t\t\t\t\"\");\n\t\t}\n\n\t\t// if(\"SolidityIDQuery\".equalsIgnoreCase(action)) {\n\t\t// long durationInSeconds = DAY_SEC * 30;\n\t\t// * Duration contractAutoRenew = Duration.newBuilder().setSeconds(durationInSeconds).build();\n\t\t// * Timestamp timestamp = TestHelper.getDefaultCurrentTimestampUTC();\n\t\t// * Duration transactionDuration = RequestBuilder.getDuration(30, 0);\n\t\t// * Transaction createContractRequest =\n\t\t// RequestBuilder.getCreateContractRequest(payerAccountId.getAccountNum(),\n\t\t// * payerAccountId.getRealmNum(), payerAccountId.getShardNum(), nodeAccountId.getAccountNum(),\n\t\t// * nodeAccountId.getRealmNum(), nodeAccountId.getShardNum(), 100l, timestamp,\n\t\t// transactionDuration, true, \"createContract\",\n\t\t// * DEFAULT_CONTRACT_OP_GAS, contractFile, ByteString.EMPTY, 0, contractAutoRenew,\n\t\t// * SignatureList.newBuilder()\n\t\t// *\n\t\t// .addSigs(Signature.newBuilder().setEd25519(ByteString.copyFrom(\"testsignature\".getBytes())))\n\t\t// * .build());\n\t\t// }\n\n\t\treturn trx;\n\n\t}", "@Test\n\tpublic void createAccountCashTest() {\n\t\tsetChequingRadioDefaultOff();\n\t\trdbtnCash.setSelected(true);\n\t\tdata.setRdbtnCash(rdbtnCash);\n\t\tAccount account = data.createNewAccount();\n\t\taccountTest = new Account(TEST_ACCOUNT_NAME, bankTest,\n\t\t\t\tAccount.Types.CASH.getAccountType());\n\t\tassertEquals(accountTest, account);\n\n\t}", "@Test\r\n public void testCreate() throws Exception {\r\n System.out.println(\"create\");\r\n Bureau obj = new Bureau(0,\"Test\",\"000000000\",\"\");\r\n BureauDAO instance = new BureauDAO();\r\n instance.setConnection(dbConnect);\r\n Bureau expResult = new Bureau(0,\"Test\",\"000000000\",\"\");\r\n Bureau result = instance.create(obj);\r\n \r\n assertEquals(\"sigles différents\",expResult.getSigle(), result.getSigle());\r\n assertEquals(\"tel différents\",expResult.getTel(), result.getTel());\r\n //etc\r\n assertNotEquals(\"id non généré\",expResult.getIdbur(),result.getIdbur());\r\n int idclient=result.getIdbur();\r\n obj=new Bureau(0,\"Test\",\"000000000\",\"\");\r\n try{\r\n Bureau result2 = instance.create(obj);\r\n fail(\"exception de doublon non déclenchée\");\r\n instance.delete(result2);\r\n }\r\n catch(SQLException e){}\r\n instance.delete(result);\r\n \r\n obj=new Bureau(0,\"Test2\",\"000000001\",\"\");\r\n try{\r\n Bureau result3 = instance.create(obj);\r\n fail(\"exception de code postal non déclenchée\");\r\n instance.delete(result3);\r\n }\r\n catch(SQLException e){}\r\n \r\n }", "boolean hasTxnresponse();", "@Test\n void bankListIsAccountExistToTransfer_accountExistWithSufficientMoneyToTransfer_success() {\n ByteArrayOutputStream outContent = new ByteArrayOutputStream();\n System.setOut(new PrintStream(outContent));\n BankList bankList = new BankList(storage);\n Ui uiTest = new Ui();\n Bank newSavingAccount = new Saving(\"Test Saving Account\", 1000, 2000);\n Bank newInvestmentAccount = new Investment(\"Test Investment Account\", 1000);\n String expectedReturnType = \"investment\";\n\n try {\n bankList.bankListAddBank(newSavingAccount, uiTest);\n bankList.bankListAddBank(newInvestmentAccount, uiTest);\n outContent.reset();\n String returnType = bankList.getTransferBankType(\"Test Investment Account\",\n 500);\n assertEquals(expectedReturnType, returnType);\n\n\n } catch (BankException error) {\n System.out.println(\"Expected no throw, but error thrown\");\n }\n\n assertEquals(2, bankList.getBankListSize());\n\n }", "public final void testValidTransaction() {\n assertTrue(testTransaction1.isValidTransaction());\n assertFalse(testTransaction2.isValidTransaction());\n }", "public boolean recordTrade(Trade trade) throws Exception;", "@Test\n public void savings_account2() {\n Bank bank = new Bank();\n Customer bill = new Customer(\"Bill\");\n Account savingsAccount = new SavingsAccount(bill, Account.SAVINGS);\n bank.addCustomer(new Customer(\"Bill\").openAccount(savingsAccount));\n Transaction t = new CreditTransaction(500.0);\n t.setTransactionDate(getTestDate(-15));\n savingsAccount.addTransaction(t);\n\n assertEquals(Math.pow(1 + 0.001 / 365, 15) * 500.0 - 500, bank.totalInterestPaid(), DOUBLE_DELTA);\n }", "@Override\n public TransactionModel createTransaction(String custId, LocalDateTime transactionTime, String accountNumber, TransactionType type, BigDecimal amount,String description)\n {\n return transactionDao.createTransaction(custId,accountNumber,transactionTime,type,amount,description);\n }", "public void base_ok(Transaction t) {\n verify_transaction(t);\n make_transaction(t);\n }", "@GetMapping(\"test\")\n\t@Timed\n\t@ResponseStatus(HttpStatus.CREATED)\n\tpublic void saveTransaction() throws ClientProtocolException, IOException {\n\n\t\ttry {\n\t\t\tContext context = new Context();\n\t\t\tcontext.setVariable(\"order\", \"fsdf\");\n\t\t\tcontext.setVariable(\"email\", \"fsdf\");\n\t\t\tcontext.setVariable(\"hash\", \"https://\" + CAN_NETWORK + \"etherscan.io/tx/\");\n\t\t\tcontext.setVariable(\"can\", \"https://\" + CAN_NETWORK + \"etherscan.io/tx/\");\n\t\t\tcontext.setVariable(\"amount\", \"CAN\");\n\t\t\tcontext.setVariable(BASE_URL, jHipsterProperties.getMail().getBaseUrl());\n\t\t\tString content = templateEngine.process(\"mail/transactionConfirm\", context);\n\n\t\t\tsendEmail(\"[email protected]\", \"Transaction Successful\", content, false, true);\n\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "int insert(Transaction record);", "@Test\n public void transferCheckingtoSavingsTest(){\n assertTrue(userC.transfer(150.00, userS));\n }", "@Test(groups = \"Transactions Tests\", description = \"Delete account with Transaction\")\n\tpublic void deleteAccountWithTransaction() {\n\t\tMainScreen.clickAddAccountBtn();\n\t\tNewAccountScreen.typeAccountName(\"Freelance jobs\");\n\t\tNewAccountScreen.clickAccountColor();\n\t\tNewAccountScreen.clickColorOption();\n\t\tNewAccountScreen.typeAccountDescription(\"Account to control my freelance jobs money\");\n\t\tNewAccountScreen.clickPlaceholderAccountOption();\n\t\tNewAccountScreen.clickSaveBtn();\n\t\tMainScreen.accountItem(\"Freelance jobs\").shouldBe(visible);\n\t\ttest.log(Status.PASS, \"Account created successfully\");\n\n\t\t//Creating a new sub-account, testing if it's visible and logging the result to the report\n\t\tMainScreen.clickAccountItem(\"Freelance jobs\");\n\t\tSubAccountScreen.clickAddSubAccountBtn();\n\t\tNewAccountScreen.typeAccountName(\"Test Automation jobs\");\n\t\tNewAccountScreen.clickAccountColor();\n\t\tNewAccountScreen.clickColorOption();\n\t\tNewAccountScreen.typeAccountDescription(\"Sub-account to control meu Test Automation freelance jobs\");\n\t\tNewAccountScreen.clickSaveBtn();\n\t\tSubAccountScreen.subAccountItem(\"Test Automation jobs\").shouldBe(visible);\n\t\ttest.log(Status.PASS, \"Sub-account created successfully\");\n\n\t\t//Creating a new transaction, testing if it's visible, if the value is correct and logging the result to the report\n\t\tSubAccountScreen.clickSubAccountItem(\"Test Automation jobs\");\n\t\tTransactionsScreen.clickAddTransactionBtn();\n\t\tTransactionsScreen.typeTransactionDescription(\"N26 Home Task\");\n\t\tTransactionsScreen.typeTransactionAmount(\"250\");\n\t\tTransactionsScreen.clickSaveBtn();\n\t\tTransactionsScreen.transactionItem(\"N26 Home Task\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$250\"));\n\t\ttest.log(Status.PASS, \"Transaction created and the value is correct\");\n\n\t\t//Testing if the transaction was created in the 'Double Entry' account and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickAccountItem(\"Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Current Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Cash in Wallet\");\n\t\tTransactionsScreen.transactionItem(\"N26 Home Task\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$250\"));\n\t\ttest.log(Status.PASS, \"Transaction in the 'Double Entry' account created and the value is correct\");\n\n\t\t//Deleting the account with the transaction, testing if it's not listed and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickOptionsBtnFromAccountItem(\"Freelance jobs\");\n\t\tMainScreen.clickDeleteAccountOption();\n\t\tMainScreen.clickDeleteTransactionRadioOption();\n\t\tMainScreen.clickDeleteBtn();\n\t\tMainScreen.accountItem(\"Freelance jobs\").shouldNotBe(visible);\n\t\ttest.log(Status.PASS, \"Account and Transaction deleted successfully\");\n\n\t\t//Testing if the transaction were deleted from the 'Double Entry' account and logging the result to the report\n\t\tMainScreen.clickAccountItem(\"Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Current Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Cash in Wallet\");\n\t\tTransactionsScreen.transactionItem(\"N26 Home Task\").shouldNotBe(visible);\n\t\ttest.log(Status.PASS, \"Transaction deleted successfully from the 'Double Entry' account\");\n\n\t}", "private void createTx() throws Exception {\n PublicKey recipient = Seed.getRandomAddress();\n Transaction tx = new Transaction(wallet.pb, recipient, wallet.pr);\n//\t\tSystem.out.println(\"Created a tx\");\n txPool.add(tx);\n//\t\tcache.put(tx.txId, null);\n sendTx(tx);\n }", "@Test\n public void testImpossible1TransferMoney() {\n Bank bank = new Bank();\n User user = new User(\"Petr\", \"0000 000000\");\n AccountOfUser acc = new AccountOfUser(0, \"0000 0000 0000 0000\");\n AccountOfUser acc2 = new AccountOfUser(0, \"0000 0000 0000 0001\");\n bank.addUser(user);\n bank.addAccountToUser(user.getPassport(), acc);\n bank.addAccountToUser(user.getPassport(), acc2);\n assertThat(bank.transferMoney(user.getPassport(), acc.getRequisites(), user.getPassport(), acc2.getRequisites(), 100), is(false));\n }", "private void submitTransaction() {\n String amountGiven = amount.getText().toString();\n double decimalAmount = Double.parseDouble(amountGiven);\n amountGiven = String.format(\"%.2f\", decimalAmount);\n String sourceGiven = source.getText().toString();\n String descriptionGiven = description.getText().toString();\n String clientId = mAuth.getCurrentUser().getUid();\n String earnedOrSpent = \"\";\n\n if(amountGiven.isEmpty()){\n amount.setError(\"Please provide the amount\");\n amount.requestFocus();\n return;\n }\n\n if(sourceGiven.isEmpty()){\n source.setError(\"Please provide the source\");\n source.requestFocus();\n return;\n }\n\n if(descriptionGiven.isEmpty()){\n descriptionGiven = \"\";\n }\n\n int selectedRadioButton = radioGroup.getCheckedRadioButtonId();\n\n if(selectedRadioButton == R.id.radioSpending){\n Log.d(\"NewTransactionActivity\", \"Clicked on Spending\");\n earnedOrSpent = \"Spent\";\n }\n else{\n Log.d(\"NewTransactionActivity\", \"Clicked on Earning\");\n earnedOrSpent = \"Earned\";\n }\n\n storeTransactionToDatabase(clientId, earnedOrSpent, amountGiven, sourceGiven, descriptionGiven);\n\n }", "@Test\n\tpublic void withdrawTest(){\n\t\tCustomer cus = new Customer(\"wgl\", myDate, \"Beijing\");\n\t\tAccount cAcc = new CurrentAccount(cus);\n\t\tbc.withdraw(cAcc, 300);\n\t\tboolean flag = false;\n\t\tif(cAcc.getBalance() == -300.0){\n\t\t\tflag = true;\n\t\t}\n\t\tassertTrue(flag);\n\t}", "@Test\n public void testValidBalance() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, 100 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(100, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n\tpublic void createAccountChequingTest() {\n\t\trdbtnChequing.setSelected(true); // by default AddAccountDialog will\n\t\t\t\t\t\t\t\t\t\t\t// select this to be true, for\n\t\t\t\t\t\t\t\t\t\t\t// testing reset to fault\n\t\tdata.setRdbtnChequing(rdbtnChequing);\n\t\tAccount account = data.createNewAccount();\n\t\taccountTest = new Account(TEST_ACCOUNT_NAME, bankTest,\n\t\t\t\tAccount.Types.CHEQUING.getAccountType());\n\t\tassertEquals(accountTest, account);\n\t}", "public boolean registerPayment(Payment transfer) {\n boolean done = false;\n String sql = \"INSERT INTO payment(description, total, member_id) VALUES(?,?,?)\";//pay_date: en la base de datos poner por defecto el valor del tiempo actual con el metodo now()\n try ( Connection con = connect(); PreparedStatement pstmt = con.prepareStatement(sql)) {\n pstmt.setString(1, transfer.getDescription());\n pstmt.setInt(2, (int) transfer.getTotal());\n\n pstmt.setInt(3, transfer.getMember_id());\n pstmt.executeUpdate();\n done = true;\n\n System.out.println(\"Payment transfered\");\n } catch (SQLException e) {\n System.out.println(\"Error in the transaction\");\n System.out.println(e.getMessage());\n }\n\n return done;\n }", "@Test\n\tpublic void testAdminCreate() {\n\t\tAccount acc1 = new Account(00000, \"ADMIN\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"ADMIN\", 00000, 0, \"A\"));\n\t\ttransactions.add(1, new Transaction(05, \"new acc\", 00001, 100.00, \"A\"));\n\t\ttransactions.add(2, new Transaction(00, \"ADMIN\", 00000, 0, \"A\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tif (outContent.toString().contains(\"Account Created\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"unable to create account as admin\", testResult);\n\t}", "void setTransactionSuccessful();", "@Test\n public void testRecordInboundMovement1() throws Exception {\n System.out.println(\"recordInboundMovement\");\n Long factoryId = 1L;\n Long goodsReceiptId = 1L;\n Long toBinId = 500L;\n String status = \"unrestricted\";\n Double quantity = 40D;\n Calendar creationDate = Calendar.getInstance();\n creationDate.set(2014, 9, 30, 15, 0, 0);\n Long expResult = -3L;\n Long result = FactoryInventoryManagementModule.recordInboundMovement(factoryId, goodsReceiptId, toBinId, status, quantity, creationDate);\n assertEquals(expResult, result);\n }", "@Override\n public boolean insert(Transaksi transaksi) {\n try {\n String query = \"INSERT INTO transaksi (id, tgl_transaksi) VALUES (?, ?)\";\n\n PreparedStatement ps = Koneksi().prepareStatement(query);\n ps.setString(1, transaksi.getId());\n ps.setString(2, transaksi.getTglTransaksi());\n\n if (ps.executeUpdate() > 0) {\n return true;\n }\n } catch (SQLException se) {\n se.printStackTrace();\n } catch (Exception e) {\n e.printStackTrace();\n }\n\n return false;\n }", "public void other_statements_ok(Transaction t) {\n System.out.println(\"about to verify\");\n verify_transaction(t);\n System.out.println(\"verified\");\n make_transaction(t);\n System.out.println(\"success!\");\n }", "public static void createTransaction() throws IOException {\n\t\t\n\t\tDate date = new Date((long) random(100000000));\n\t\tString date2 = \"'19\" + date.getYear() + \"-\" + (random(12)+1) + \"-\" + (random(28)+1) + \"'\";\n\t\tint amount = random(10000);\n\t\tint cid = random(SSNmap.size()) + 1;\n\t\tint vid = random(venders.size()) + 1;\n\t\t\n\t\twhile(ownership.get(cid) == null)\n\t\t\tcid = random(SSNmap.size()) + 1;\n\t\tString cc = ownership.get(cid).get(random(ownership.get(cid).size()));\n\t\t\n\t\twriter.write(\"INSERT INTO Transaction (Id, Date, vid, cid, CCNum, amount) Values (\" + tid++ +\", \" \n\t\t\t\t+ date2 + \", \" + vid + \", \" + cid + \", '\" + cc + \"', \" + amount + line);\n\t\twriter.flush();\n\t}", "protected abstract Transaction createAndAdd();", "@Test\r\n\tpublic void testInsertMoney() {\r\n\t\tvendMachine.insertMoney(10.0);\r\n\t\tassertEquals(10.0, vendMachine.getBalance(), 0.001);\r\n\t}", "private Transaction setUpTransaction(double amount, Transaction.Operation operation, String username){\n Transaction transaction = new Transaction();\n transaction.setDate(Date.valueOf(LocalDate.now()));\n transaction.setAmount(amount);\n transaction.setOperation(operation);\n transaction.setUserId(userRepository.getByUsername(username).getId());\n return transaction;\n }", "public void testAutoBalanceTransactions(){\n\t\tsetDoubleEntryEnabled(false);\n\t\tmTransactionsDbAdapter.deleteAllRecords();\n\n\t\tassertThat(mTransactionsDbAdapter.getRecordsCount()).isEqualTo(0);\n\t\tString imbalanceAcctUID = mAccountsDbAdapter.getImbalanceAccountUID(Currency.getInstance(CURRENCY_CODE));\n\t\tassertThat(imbalanceAcctUID).isNull();\n\n\t\tvalidateTransactionListDisplayed();\n\t\tonView(withId(R.id.fab_create_transaction)).perform(click());\n\t\tonView(withId(R.id.fragment_transaction_form)).check(matches(isDisplayed()));\n\n\t\tonView(withId(R.id.input_transaction_name)).perform(typeText(\"Autobalance\"));\n\t\tonView(withId(R.id.input_transaction_amount)).perform(typeText(\"499\"));\n\n\t\t//no double entry so no split editor\n\t\t//TODO: check that the split drawable is not displayed\n\t\tonView(withId(R.id.menu_save)).perform(click());\n\n\t\tassertThat(mTransactionsDbAdapter.getRecordsCount()).isEqualTo(1);\n\t\tTransaction transaction = mTransactionsDbAdapter.getAllTransactions().get(0);\n\t\tassertThat(transaction.getSplits()).hasSize(2);\n\t\timbalanceAcctUID = mAccountsDbAdapter.getImbalanceAccountUID(Currency.getInstance(CURRENCY_CODE));\n\t\tassertThat(imbalanceAcctUID).isNotNull();\n\t\tassertThat(imbalanceAcctUID).isNotEmpty();\n\t\tassertTrue(mAccountsDbAdapter.isHiddenAccount(imbalanceAcctUID)); //imbalance account should be hidden in single entry mode\n\n\t\tassertThat(transaction.getSplits()).extracting(\"mAccountUID\").contains(imbalanceAcctUID);\n\n\t}", "public boolean insertMethod(Scanner scanner,Connection connection,Logger logger) {\n\t\tTransaction trxn = new Transaction();\n\t\tMySQLAccess create_Query=new MySQLAccess();\n\t\tboolean r = false;\n\t\ttry {\n\n\t\t\tSystem.out.println(\"-------Creating a Transaction-------\");\n\t\t\tSystem.out.println(\"Enter ID\");\n\t\t\ttrxn.setID(scanner.next());\n\t\t\tSystem.out.println(\"Enter Name_on_card\");\n\t\t\ttrxn.setNameOnCard(scanner.next()); \n\t\t\t//trxn.setCardNumber(CardNumber);\n\t\t\tSystem.out.println(\"CardNumber\");\n\t\t\tString CardNumber = scanner.next();\n\t\t\ttrxn.setCardNumber(CardNumber);\n\t\t\tSystem.out.println(\"UnitPrice\");\n\t\t\t//String up = scanner.next();\n\t\t\t\n\t\t\ttrxn.setUnitPrice(Integer.parseInt(scanner.next()) );\n\t\t\tSystem.out.println(\"Quantity\");\n\t\t\ttrxn.setQuantity(Integer.parseInt(scanner.next()));\n\t\t\tSystem.out.println(\"TotalPrice\");\n\t\t\ttrxn.setTotalPrice(Float.parseFloat(scanner.next()));\n\t\t\tSystem.out.println(\"ExpDate\");\n\t\t\tString ExpDate = scanner.next();\n\t\t\t\n\t\t\t//System.out.println(ExpDate.length());\n\t\t\t//System.out.println(ExpDate.lastIndexOf(\"/\"));\n\t\t\tint flag =0;\n\t\t\tif (ExpDate.length()== 7 && ExpDate.lastIndexOf(\"/\")==2)\n\t\t\t{\n\t\t\t\tint MM = Integer.parseInt(ExpDate.substring(0, ExpDate.lastIndexOf(\"/\")));\n\t\t\t\tint YYYY = Integer.parseInt(ExpDate.substring(ExpDate.lastIndexOf(\"/\")+1,ExpDate.length() ));\n\t\t\t\tSystem.out.println(MM);\n\t\t\t\tSystem.out.println(YYYY);\n\t\t\t\tif (MM>0 && YYYY>2015 && YYYY<2032 && MM<13)\n\t\t\t\t{\n\t\t\t\t\t//System.out.println(\"correct\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tSystem.out.println(\"Incorrect Date Format\");\n\t\t\t\t\tflag = 1;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.println(\"Incorrect Date Format\");\n\t\t\t\tflag = 1;\n\t\t\t}\n\t\t\ttrxn.setExpDate(ExpDate);\t\n\t\t\t//System.out.println(\"CreatedOn\");\n\t\t\tString CreatedOn = new SimpleDateFormat(\"yyyy/MM/dd HH:mm:ss\").format(Calendar.getInstance().getTime());\n\t\t\ttrxn.setCreatedOn(CreatedOn);\n\t\t\t//System.out.println(\"CreatedBy\");\n\t\t\t//statement.setString(9, System.getProperty(\"user.name\"));\n\t\t\ttrxn.setCreatedBy(System.getProperty(\"user.name\"));\n\t\t\t//System.out.println(\"Credit card type(1.Visa/2.American Express/3.Mastercard)\");\n\t\t\t// String cardtype = scanner.next();\n\t\t\t//\n\t\t\tString cardtype = \"Unknown\";\n\t\t\tif (CardNumber.length() == 16) {\n\t\t\t\tif (CardNumber.startsWith(\"51\") || CardNumber.startsWith(\"52\") || CardNumber.startsWith(\"53\")\n\t\t\t\t\t\t|| CardNumber.startsWith(\"54\") || CardNumber.startsWith(\"55\")) {\n\t\t\t\t\tcardtype = \"Mastercard\";\n\n\t\t\t\t}\n\t\t\t\tif (CardNumber.startsWith(\"4\")) {\n\t\t\t\t\tcardtype = \"Visa\";\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (CardNumber.length() == 15 && (CardNumber.startsWith(\"34\") || (CardNumber.startsWith(\"37\")))) {\n\t\t\t\t\tcardtype = \"American Express\";\n\t\t\t\t}\n\n\t\t\t}\n\t\t\ttrxn.setCardtype(cardtype);\n\t\t\t//System.out.println(trxn);\n\n\t\t\t\n\t\t\t//statement.setString(10, cardtype);\n\t\t\t\n/*\t\t\tString DisplaysqlID = \"select * from transaction where ID =\"+ID;\n\t\t\tConnection con1 = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/tutorial1\", \"root\", \"root\");\n\t\t\tPreparedStatement stmt1 = con1.prepareStatement(DisplaysqlID);\t\n\t\t\tSystem.out.println(DisplaysqlID);\n\t\t\tResultSet resultSet = stmt1.executeQuery(DisplaysqlID);\n\t\t\tif(resultSet.next())\n\t\t\t\tflag = 2;\n\t\t\t\n\t\t\t// the validation of fields if empty is taken care by using Scanner.next()\n\t\t\tif (flag == 0)\n\t\t\t{\n\t\t\tint rowsInserted = statement.executeUpdate();\n\t\t\tif (rowsInserted == 1) {\n\t\t\t\tSystem.out.println(\"Your data has been inserted\");\n\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif(flag==2)\n\t\t\t\t\tSystem.out.println(\"User already exists\");\n\t\t\t\telse\n\t\t\t\t\tSystem.out.println(\"Please once again check your data\");\n\t\t\t}\n\t\t\t//scanner.close();\n\t\t\tcon.close();*/\n\t\t\t r = create_Query.createTransaction(trxn,connection,logger);\n\t\t} catch (InputMismatchException e) {\n\t\t\tSystem.out.println(\"Enter Valid Input\");\n\t\t\tlogger.severe(e.getMessage());\n\t\t}\n\t\t//System.out.println(trxn);\n\t\treturn r;\n\n\t}", "@Test\n public void testCreatePurchaseOrder() throws Exception {\n System.out.println(\"createPurchaseOrder\");\n Long factoryId = 1L;\n Long contractId = 2L;\n Double purchaseAmount = 4D;\n Long storeId = 2L;\n String destination = \"store\";\n Calendar deliveryDate = Calendar.getInstance();\n deliveryDate.set(2015, 0, 13);\n Boolean isManual = false;\n Boolean isToStore = true;\n PurchaseOrderEntity result = PurchaseOrderManagementModule.createPurchaseOrder(factoryId, contractId, purchaseAmount, storeId, destination, deliveryDate, isManual, isToStore);\n assertNotNull(result);\n }", "Transaction createTransaction();", "@Test\n public void testPositiveAllocation() {\n Allocation allocation = new Allocation(\n doctors.get(0),\n surgeryRooms.get(0),\n (new Period(50, 10, 15))\n );\n boolean expected = true;\n boolean actual = hospital.allocate(allocation);\n assertEquals(expected, actual);\n }", "@Test\n public void testValidOutputValues() {\n\n // Creates 100 coins to Alice\n Transaction createCoinTx = new Transaction();\n createCoinTx.addOutput(100, kpAlice.getPublic());\n createCoinTx.finalize();\n // Output of createCoinTx is put in UTXO pool\n UTXOPool utxoPool = new UTXOPool();\n UTXO utxo = new UTXO(createCoinTx.getHash(), 0);\n utxoPool.addUTXO(utxo, createCoinTx.getOutput(0));\n TxHandler txHandler = new TxHandler(utxoPool);\n\n // Alice transfers 10 coins to Bob, -20 to Cal\n Transaction tx1 = new Transaction();\n tx1.addInput(createCoinTx.getHash(), 0);\n tx1.addOutput(10, kpBob.getPublic());\n tx1.addOutput(-20, kpCal.getPublic());\n\n // Sign for tx1 with Alice's kp\n byte[] sig1 = null;\n try {\n Signature sig = Signature.getInstance(\"SHA256withRSA\");\n sig.initSign(kpAlice.getPrivate());\n sig.update(tx1.getRawDataToSign(0));\n sig1 = sig.sign();\n } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) {\n e.printStackTrace();\n }\n tx1.getInput(0).addSignature(sig1);\n tx1.finalize();\n\n assertFalse(txHandler.isValidTx(tx1));\n }", "@Test\n public void testImpossible2TransferMoney() {\n Bank bank = new Bank();\n User user = new User(\"Petr\", \"0000 000000\");\n AccountOfUser acc = new AccountOfUser(0, \"0000 0000 0000 0001\");\n bank.addUser(user);\n bank.addAccountToUser(user.getPassport(), acc);\n assertThat(bank.transferMoney(user.getPassport(), \"0000 0000 0000 0000\", user.getPassport(), acc.getRequisites(), 100), is(false));\n }", "public void addTrans(View v)\r\n {\r\n Log.d(TAG, \"Add transaction button clicked!\");\r\n\r\n EditText editLabel = (EditText) findViewById(R.id.edit_label);\r\n String label = (editLabel == null)? \"\" : editLabel.getText().toString();\r\n\r\n EditText editAmount = (EditText) findViewById(R.id.edit_amount);\r\n double amount = ((editAmount == null) || (editAmount.getText().toString().equals(\"\")))? 0 :\r\n Double.valueOf(editAmount.getText().toString());\r\n\r\n CheckBox chkBill = (CheckBox) findViewById(R.id.chk_bill);\r\n CheckBox chkLoan = (CheckBox) findViewById(R.id.chk_loan);\r\n String special = \"\";\r\n special = (chkBill == null || !chkBill.isChecked())? special : \"Bill\";\r\n special = (chkLoan == null || !chkLoan.isChecked())? special : \"Loan\";\r\n\r\n\r\n EditText editTag = (EditText) findViewById(R.id.edit_tag);\r\n String tag = (editTag == null)? \"\" : editTag.getText().toString();\r\n\r\n Transaction t = new Transaction(false, amount, label, special, tag);\r\n\r\n Week weekAddedTo = BasicFinancialMainActivity.weeks\r\n .get(BasicFinancialMainActivity.currentWeekIndex);\r\n weekAddedTo.addTrans(t);\r\n BasicFinancialMainActivity.weeks.set(BasicFinancialMainActivity.currentWeekIndex, weekAddedTo);\r\n BasicFinancialMainActivity.saveWeeksData();\r\n\r\n startActivity(new Intent(this, BasicFinancialMainActivity.class));\r\n }", "@Override\n public void beforeValidate(Transaction transaction) {\n transaction = transaction;\n Toast.makeText(getActivity(), transaction.getReference(), Toast.LENGTH_LONG).show();\n\n }", "@Test\n\tpublic void createAccountDebtsTest() {\n\t\tsetChequingRadioDefaultOff();\n\t\trdbtnDebt.setSelected(true);\n\t\tdata.setRdbtnDebt(rdbtnDebt);\n\t\tAccount account = data.createNewAccount();\n\t\taccountTest = new Account(TEST_ACCOUNT_NAME, bankTest,\n\t\t\t\tAccount.Types.DEBITS.getAccountType());\n\t\tassertEquals(accountTest, account);\n\t}", "@Override\n public void onSuccess(Transaction transaction) {\n\n transaction = transaction;\n dialog.setMessage(\"Trying to Verify Your Transaction... please wait\");\n Log.d(\"REFERENCE\", transaction.getReference());\n Toast.makeText(getActivity(), transaction.getReference(), Toast.LENGTH_LONG).show();\n\n\n verifyOnServer(transaction.getReference());\n }", "public boolean addTransaction(double amount) {\n if ((this.balance+amount)>=0) {\r\n this.transactions.add(amount);\r\n balance+=amount;\r\n return true;\r\n }else{\r\n System.out.println(\"Balance Insufficient\");\r\n return false;\r\n }\r\n }", "@Test\n\tpublic void createAccTest() {\n\t\tCustomer cus = new Customer(\"wgl\", myDate, \"Beijing\");\n\t\tbc.createAccount(cus, 1);\n\t\tassertEquals(1, cus.getAccList().size());\n\t}", "public boolean makeTransfer(String fromAccountNumber,\r\n\t\t\tString toAccountNumber, double amount, String memo) {\r\n\t\tif (DaoUtility.isAccountNumberValid(fromAccountNumber)\r\n\t\t\t\t&& DaoUtility.isAccountNumberValid(toAccountNumber)) {\r\n\t\t} else\r\n\t\t\treturn false;\r\n\r\n\t\t// do transaction\r\n\t\tConnection conn = dbConnector.getConnection();\r\n\t\tif (conn==null)\r\n\t\t\treturn false;\r\n\t\t\r\n\t\tPreparedStatement st;\r\n\t\tString sql;\r\n\t\tResultSet rs;\r\n\r\n\t\ttry {\r\n\t\t\tconn.setAutoCommit(false);\r\n\t\t\tSavepoint savepnt = conn.setSavepoint();\r\n\r\n\t\t\ttry {\r\n\t\t\t\tint fromAccountId=0;\r\n\t\t\t\tint toAccountId=0;\r\n\t\t\t\tString fromName=\"SECRET USER\";\r\n\t\t\t\tString toName=\"SECRET USER\";\r\n\t\t\t\tString fname,mname,lname;\r\n\t\t\t\t\r\n\t\t\t\tst = conn.prepareStatement(\"select tbAccount.aid,balance,isactive,\"\r\n\t\t\t\t\t\t+ \"fname,mname,lname from tbAccount, tbClient \"\r\n\t\t\t\t\t\t+ \" where acnumber= ? and tbAccount.cid=tbClient.cid\");\r\n\t\t\t\tst.setString(1, fromAccountNumber);\r\n\t\t\t\trs = st.executeQuery();\r\n\t\t\t\tif (rs.next()){\r\n\t\t\t\t\tfromAccountId = rs.getInt(\"aid\");\r\n\t\t\t\t\tdouble balance = rs.getDouble(\"balance\");\r\n\t\t\t\t\tboolean isactive = rs.getBoolean(\"isactive\");\r\n\t\t\t\t\tfname = rs.getString(\"fname\");\r\n\t\t\t\t\tmname = rs.getString(\"mname\");\r\n\t\t\t\t\tlname = rs.getString(\"lname\");\r\n\t\t\t\t\tfromName = fname + \" \" + (mname==null?\"\":mname) + \" \" +lname;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (balance<amount || !isactive) { //not enough money or frozen\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tst = conn.prepareStatement(\"select aid,isactive,\"\r\n\t\t\t\t\t\t+ \" fname,mname,lname from tbAccount,tbClient \"\r\n\t\t\t\t\t\t+ \" where acnumber= ? and tbAccount.cid=tbClient.cid\");\r\n\t\t\t\tst.setString(1, toAccountNumber);\r\n\t\t\t\trs = st.executeQuery();\r\n\t\t\t\tif (rs.next()){\r\n\t\t\t\t\ttoAccountId = rs.getInt(\"aid\");\r\n\t\t\t\t\tboolean isactive = rs.getBoolean(\"isactive\");\r\n\t\t\t\t\tfname = rs.getString(\"fname\");\r\n\t\t\t\t\tmname = rs.getString(\"mname\");\r\n\t\t\t\t\tlname = rs.getString(\"lname\");\r\n\t\t\t\t\ttoName = fname + \" \" + (mname==null?\"\":mname) + \" \" +lname;\r\n\t\t\t\t\t\r\n\t\t\t\t\tif (!isactive) { //frozen\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t// substract balance of fromAccount\r\n\t\t\t\tst = conn.prepareStatement(\r\n\t\t\t\t\t\t\"update tbAccount set balance = balance - ? \"\r\n\t\t\t\t\t\t\t\t+ \" where balance >= ? \"\r\n\t\t\t\t\t\t\t\t+ \" and acnumber = ? \"\r\n\t\t\t\t\t\t\t\t+ \" and isactive=TRUE \");\r\n\t\t\t\tst.setDouble(1, amount);\r\n\t\t\t\tst.setDouble(2, amount);\r\n\t\t\t\tst.setString(3, fromAccountNumber);\r\n\t\t\t\tint nRs = st.executeUpdate();\r\n\t\t\t\tif (nRs <= 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tconn.rollback(savepnt);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// add balance of toAccount\r\n\t\t\t\tst = conn.prepareStatement(\r\n\t\t\t\t\t\t\"update tbAccount set balance = balance + ? \"\r\n\t\t\t\t\t\t\t\t+ \" where acnumber = ? \"\r\n\t\t\t\t\t\t\t\t+ \" and isactive=TRUE \");\r\n\t\t\t\tst.setDouble(1, amount);\r\n\t\t\t\tst.setString(2, toAccountNumber);\r\n\t\t\t\tnRs = st.executeUpdate();\r\n\t\t\t\tif (nRs <= 0)\r\n\t\t\t\t{\r\n\t\t\t\t\tconn.rollback(savepnt);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// insert 2 transaction record\r\n\t\t\t\t// insert into tbTransaction(aid, trtype, amount, description)\r\n\t\t\t\t// values( select aid from tbAccount where acnumber='acnumber',\r\n\t\t\t\t// DEPOSIT_TRANSACTION_TYPE_ID,\r\n\t\t\t\t// amount, 'transfer 123.4 dollars to 3333343 on 2014-09-19')\r\n\t\t\t\t//\r\n\t\t\t\tDateFormat dateFormat = new SimpleDateFormat(\"yyyy-MM-dd\");\r\n\t\t\t\tjava.util.Date date = new java.util.Date();\r\n\t\t\t\tString currentDate = dateFormat.format(date); // 2014-08-06\r\n\r\n\t\t\t\tsql = String.format(\r\n\t\t\t\t\t\t\"insert into tbTransaction(aid,trtype,amount,description) \"\r\n\t\t\t\t\t\t\t\t+ \" values( %d, \" + \"\t\t\t%d, \"\r\n\t\t\t\t\t\t\t\t+ \"\t\t\t%f, 'Transfer out %.2f dollars to %s(%s) on %s. MEMO: %s' ) \", \r\n\t\t\t\t\t\t\t\tfromAccountId,\r\n\t\t\t\t\tTRANSFER_OUT_TRANSACTION_TYPE_ID, amount, amount,\r\n\t\t\t\t\ttoAccountNumber, toName, currentDate,memo);\r\n\t\t\t\tnRs = st.executeUpdate(sql);\r\n\t\t\t\tif (nRs<=0)\r\n\t\t\t\t{\r\n\t\t\t\t\tconn.rollback(savepnt);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tsql = String.format(\r\n\t\t\t\t\t\t\"insert into tbTransaction(aid,trtype,amount,description) \"\r\n\t\t\t\t\t\t\t\t+ \" values( %d, \" + \" %d, \"\r\n\t\t\t\t\t\t\t\t+ \"\t%f, 'Transfer in %.2f dollars from %s(%s) on %s. MEMO: %s' ) \", \r\n\t\t\t\t\t\t\t\ttoAccountId,\r\n\t\t\t\t\tTRANSFER_IN_TRANSACTION_TYPE_ID, amount, amount,\r\n\t\t\t\t\tfromAccountNumber, fromName, currentDate,memo);\r\n\t\t\t\tnRs = st.executeUpdate(sql);\r\n\t\t\t\tif (nRs<=0)\r\n\t\t\t\t{\r\n\t\t\t\t\tconn.rollback(savepnt);\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn true;\r\n\t\t\t\t\r\n\t\t\t} catch (Exception ex) {\r\n\t\t\t\tex.printStackTrace();\r\n\t\t\t\tconn.rollback(savepnt);\r\n\t\t\t} finally {\r\n\t\t\t\tconn.setAutoCommit(true);\r\n\t\t\t}\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tif (conn != null)\r\n\t\t\t\t\tconn.close();\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}", "Purchase create(Purchase purchase) throws SQLException, DAOException;", "public boolean deposito(int idConta, double quantia) {\n try {\n Conta conta = new Conta(idConta); //deveria poder fazer isto\n boolean executado = conta.depositoConta(quantia);\n System.out.println(executado ? \"Deposito efetuado com sucesso.\" : \"Erro ao Efeuar o Deposito\" );\n return executado;\n } catch (Exception e) {\n System.out.println(\"Erro no serviço deposito: \" + e.getMessage());\n return false;\n } \n}", "@Test\n public void processTransactionManagerCaseA()\n {\n acc_db.addAccount(acc);\n acc_db.addAccount(acc2);\n\n Assert.assertEquals(false,trans_mang.processTransaction(acc.get_Account_Number(),acc2.get_Account_Number(),2000));\n }", "protected abstract Txn createTxn(Txn parent, IsolationLevel level) throws Exception;", "@Suspendable\n @Override\n protected void checkTransaction(SignedTransaction stx) throws FlowException {\n }", "@Test\n\tpublic void createNewAccountWithOpeningBalanceChequingTest() {\n\t\tcreateAccountChequingTest();\n\t\tcreateNewAccountWithOpeningBalanceHelper();\n\t}", "@Test\r\n\tpublic void testMakePurchase_not_enough_money() {\r\n\t\tassertEquals(false, vendMachine.makePurchase(\"A\"));\r\n\t}", "boolean hasLedger();", "@Test\n\tpublic void testSettleCreditDifference() {\n\t\tint creditEstimate = 50;\n\t\tLong originalAccBalance = 150l;\n\n\t\tSmsAccount smsAccount = new SmsAccount();\n\t\tsmsAccount.setSakaiUserId(\"3\");\n\t\tsmsAccount.setSakaiSiteId(\"3\");\n\t\tsmsAccount.setMessageTypeCode(\"3\");\n\t\tsmsAccount.setOverdraftLimit(1000L);\n\t\tsmsAccount.setCredits(originalAccBalance);\n\t\tsmsAccount.setAccountName(\"accountname\");\n\t\tsmsAccount.setAccountEnabled(true);\n\t\thibernateLogicLocator.getSmsAccountLogic()\n\t\t\t\t.persistSmsAccount(smsAccount);\n\n\t\tSmsTask smsTask = new SmsTask();\n\t\tsmsTask.setSakaiSiteId(SmsConstants.SMS_DEV_DEFAULT_SAKAI_SITE_ID);\n\t\tsmsTask.setSenderUserName(\"sakaiUserId\");\n\t\tsmsTask.setSmsAccountId(smsAccount.getId());\n\t\tsmsTask.setDateCreated(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setDateToSend(new Timestamp(System.currentTimeMillis()));\n\t\tsmsTask.setStatusCode(SmsConst_DeliveryStatus.STATUS_PENDING);\n\t\tsmsTask.setAttemptCount(2);\n\t\tsmsTask.setMessageBody(SmsConstants.SMS_DEV_DEFAULT_SMS_MESSAGE_BODY);\n\t\tsmsTask.setSenderUserName(\"senderUserName\");\n\t\tsmsTask.setMaxTimeToLive(1);\n\t\tsmsTask.setCreditEstimate(creditEstimate);\n\t\tsmsTask.setGroupSizeActual(0);\n\t\tsmsTask.setMessageTypeId(SmsConstants.MESSAGE_TYPE_SYSTEM_ORIGINATING);\n\t\tCalendar cal = Calendar.getInstance();\n\t\tcal.setTime(smsTask.getDateToSend());\n\t\tcal.add(Calendar.SECOND, smsTask.getMaxTimeToLive());\n\t\tsmsTask.setDateToExpire(cal.getTime());\n\t\thibernateLogicLocator.getSmsTaskLogic().persistSmsTask(smsTask);\n\n\t\tsmsBillingImpl.reserveCredits(smsTask);\n\n\t\tsmsAccount = hibernateLogicLocator.getSmsAccountLogic().getSmsAccount(\n\t\t\t\tsmsAccount.getId());\n\t\tAssert.assertNotNull(smsAccount);\n\n\t\t// Account was credited\n\t\tAssert.assertTrue(smsAccount.getCredits() < originalAccBalance);\n\n\t\tsmsBillingImpl.settleCreditDifference(smsTask, smsTask.getCreditEstimate(), smsTask.getCreditsActual());\n\n\t\tsmsAccount = hibernateLogicLocator.getSmsAccountLogic().getSmsAccount(\n\t\t\t\tsmsAccount.getId());\n\n\t\t// Account balance was returnd to origional state since the actual\n\t\t// groups size on the task was zero\n\t\tAssert.assertTrue(smsAccount.getCredits() == originalAccBalance);\n\n\t}", "@Test\n public void testRecordInboundMovement4() throws Exception {\n System.out.println(\"recordInboundMovement\");\n Long factoryId = 1L;\n Long goodsReceiptId = 20L;\n Long toBinId = 5L;\n String status = \"\";\n Double quantity = 40D;\n Calendar creationDate = Calendar.getInstance();\n creationDate.set(2014, 9, 30, 15, 0, 0);\n Long expResult = -1L;\n Long result = FactoryInventoryManagementModule.recordInboundMovement(factoryId, goodsReceiptId, toBinId, status, quantity, creationDate);\n assertEquals(expResult, result);\n }", "@Override\n\tpublic void createItem(Object result) {\n\t\t\n\t\tunloadform();\n\t\tif (result != null) {\n\t\t\tIOTransactionLogic tr = (IOTransactionLogic) result;\n\t\t\tint year = Calendar.getInstance().get(Calendar.YEAR);\n\t\t\tint month = Calendar.getInstance().get(Calendar.MONTH);\n\t\t\t\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\tcal.setTime(tr.getDate());\n\t\t\tint trYear = cal.get(Calendar.YEAR);\n\t\t\tint trMonth = cal.get(Calendar.MONTH);\n\t\t\t\n\t\t\tif ((year == trYear) && (month == trMonth)\n\t\t\t\t\t&& tr.getBankAccountID() == bal.getId()) {\n\t\t\t\ttransactionDisplayer trDisplayer = new transactionDisplayer(tr);\n\t\t\t\tsetDataLineChart();\n\t\t\t\tsetDataPieChart();\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "int insert(PurchasePayment record);", "public Transaction createTransaction(Credentials user, TransactionType tt) throws RelationException;" ]
[ "0.70256174", "0.64621663", "0.620057", "0.6059172", "0.6005508", "0.58925414", "0.58261156", "0.580826", "0.5775638", "0.56959265", "0.56824064", "0.5682304", "0.5663322", "0.56488544", "0.56428486", "0.5641981", "0.5624004", "0.55969757", "0.5596861", "0.55713403", "0.55652654", "0.555933", "0.554362", "0.5534168", "0.55255336", "0.55210084", "0.5516837", "0.5513149", "0.5507285", "0.5500314", "0.54915714", "0.54852706", "0.5474183", "0.54608303", "0.54539496", "0.5450395", "0.5447718", "0.544709", "0.5444196", "0.54298085", "0.5428463", "0.54119116", "0.5409043", "0.5406429", "0.5400752", "0.5398419", "0.5395084", "0.5390848", "0.5390605", "0.5387303", "0.5371405", "0.53678316", "0.53678036", "0.5362948", "0.53592217", "0.5359167", "0.5358666", "0.5356083", "0.5350601", "0.5330933", "0.53240424", "0.53136533", "0.5304129", "0.53014815", "0.52955234", "0.5289768", "0.5284693", "0.5284587", "0.52819806", "0.52751225", "0.5264906", "0.5264068", "0.52522254", "0.52469707", "0.5243163", "0.5234511", "0.5231323", "0.5226329", "0.52245337", "0.5223623", "0.5222252", "0.52215207", "0.52201486", "0.52184665", "0.52150726", "0.52140826", "0.5213338", "0.5213021", "0.52127916", "0.5211555", "0.520583", "0.5201394", "0.5200613", "0.52000463", "0.5195692", "0.51939243", "0.5193616", "0.5193331", "0.51887023", "0.5185719" ]
0.5671565
12
Creating a new account, testing if it's visible and logging the result to the report
@Test(groups = "Transactions Tests", description = "Delete account with Transaction") public void deleteAccountWithTransaction() { MainScreen.clickAddAccountBtn(); NewAccountScreen.typeAccountName("Freelance jobs"); NewAccountScreen.clickAccountColor(); NewAccountScreen.clickColorOption(); NewAccountScreen.typeAccountDescription("Account to control my freelance jobs money"); NewAccountScreen.clickPlaceholderAccountOption(); NewAccountScreen.clickSaveBtn(); MainScreen.accountItem("Freelance jobs").shouldBe(visible); test.log(Status.PASS, "Account created successfully"); //Creating a new sub-account, testing if it's visible and logging the result to the report MainScreen.clickAccountItem("Freelance jobs"); SubAccountScreen.clickAddSubAccountBtn(); NewAccountScreen.typeAccountName("Test Automation jobs"); NewAccountScreen.clickAccountColor(); NewAccountScreen.clickColorOption(); NewAccountScreen.typeAccountDescription("Sub-account to control meu Test Automation freelance jobs"); NewAccountScreen.clickSaveBtn(); SubAccountScreen.subAccountItem("Test Automation jobs").shouldBe(visible); test.log(Status.PASS, "Sub-account created successfully"); //Creating a new transaction, testing if it's visible, if the value is correct and logging the result to the report SubAccountScreen.clickSubAccountItem("Test Automation jobs"); TransactionsScreen.clickAddTransactionBtn(); TransactionsScreen.typeTransactionDescription("N26 Home Task"); TransactionsScreen.typeTransactionAmount("250"); TransactionsScreen.clickSaveBtn(); TransactionsScreen.transactionItem("N26 Home Task").shouldBe(visible); TransactionsScreen.transactionAmout().shouldHave(text("$250")); test.log(Status.PASS, "Transaction created and the value is correct"); //Testing if the transaction was created in the 'Double Entry' account and logging the result to the report returnToHomeScreen(); MainScreen.clickAccountItem("Assets"); SubAccountScreen.clickSubAccountItem("Current Assets"); SubAccountScreen.clickSubAccountItem("Cash in Wallet"); TransactionsScreen.transactionItem("N26 Home Task").shouldBe(visible); TransactionsScreen.transactionAmout().shouldHave(text("$250")); test.log(Status.PASS, "Transaction in the 'Double Entry' account created and the value is correct"); //Deleting the account with the transaction, testing if it's not listed and logging the result to the report returnToHomeScreen(); MainScreen.clickOptionsBtnFromAccountItem("Freelance jobs"); MainScreen.clickDeleteAccountOption(); MainScreen.clickDeleteTransactionRadioOption(); MainScreen.clickDeleteBtn(); MainScreen.accountItem("Freelance jobs").shouldNotBe(visible); test.log(Status.PASS, "Account and Transaction deleted successfully"); //Testing if the transaction were deleted from the 'Double Entry' account and logging the result to the report MainScreen.clickAccountItem("Assets"); SubAccountScreen.clickSubAccountItem("Current Assets"); SubAccountScreen.clickSubAccountItem("Cash in Wallet"); TransactionsScreen.transactionItem("N26 Home Task").shouldNotBe(visible); test.log(Status.PASS, "Transaction deleted successfully from the 'Double Entry' account"); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void createAccount(){\n System.out.println(\"vi skal starte \");\n }", "@Test\n\tpublic void createAccount() {\t\n\t\t\n\t\tRediffOR.setCreateAccoutLinkClick();\n\t\tRediffOR.getFullNameTextField().sendKeys(\"Kim Smith\");\n\t\tRediffOR.getEmailIDTextField().sendKeys(\"Kim Smith\");\n\t\t\t\t\t\n\t\t\n\t}", "@Override\n\tpublic String createAccount() {\n\t\treturn \"Created Saving Account Sucessfully\";\n\t}", "private void createNewAccount() {\n\n // if user has not provided valid data, do not create an account and return from method\n if (!validateData()) {\n return;\n }\n\n // If flag value is false, that means email provided by user doesn't exists in database\n // so initialize the loader to create a new account\n if (!mEmailExistsFlag) {\n getLoaderManager().initLoader(CREATE_NEW_ACCOUNT_LOADER_ID, null, this);\n } else {\n // If flag is true, that means email provided by user already exists in database\n // so restart the loader and allow user to enter new email address for account\n getLoaderManager().restartLoader(CREATE_NEW_ACCOUNT_LOADER_ID, null, this);\n }\n\n }", "Account create();", "public void createAccount() {\n\t\tSystem.out.print(\"Enter Name: \");\n\t\tString name = nameCheck(sc.next());\n\t\tSystem.out.print(\"Enter Mobile No.: \");\n\t\tlong mobNo = mobCheck(sc.nextLong());\n\t\tlong accNo = mobNo - 1234;\n\t\tSystem.out.print(\"Enter Balance: \"); \n\t\tfloat balance = amountCheck(sc.nextFloat());\n\t\tuserBean BeanObjCreateAccountObj = new userBean(accNo, name, mobNo, balance);\n\t\tSystem.out.println(\"Account created with Account Number: \" +accNo);\n\t\tServiceObj.bankAccountCreate(BeanObjCreateAccountObj);\n\t\t\n\t\n\t}", "@Override\r\n\tpublic boolean create(Account newAccount) {\n\t\treturn daoref.create(newAccount);\r\n\t}", "@Override\r\n\tpublic boolean createAccount(Account account) {\n\t\treturn dao.createAccount(account);\r\n\t}", "public void createAccount() {\n System.out.println(\"Would you like to create a savings or checking account?\");\n String AccountRequest = input.next().toLowerCase().trim();\n createAccount(AccountRequest);\n\n }", "int createAccount(Account account);", "@Test\n\tpublic void createAccTest() {\n\t\tCustomer cus = new Customer(\"wgl\", myDate, \"Beijing\");\n\t\tbc.createAccount(cus, 1);\n\t\tassertEquals(1, cus.getAccList().size());\n\t}", "public void createUserAccount(UserAccount account);", "@Override\r\n\tpublic boolean createAccount(Account account) throws Exception {\n\t\tboolean flag = false;\r\n\t\ttry {\r\n\t\t\tflag = this.dao.createAccount(account);\r\n\t\t}catch(Exception e) {\r\n\t\t\tthrow e;\r\n\t\t}finally {\r\n\t\t\tthis.dbc.close();\r\n\t\t}\r\n\t\treturn flag;\r\n\t}", "@Test\n\tpublic void createAccountChequingTest() {\n\t\trdbtnChequing.setSelected(true); // by default AddAccountDialog will\n\t\t\t\t\t\t\t\t\t\t\t// select this to be true, for\n\t\t\t\t\t\t\t\t\t\t\t// testing reset to fault\n\t\tdata.setRdbtnChequing(rdbtnChequing);\n\t\tAccount account = data.createNewAccount();\n\t\taccountTest = new Account(TEST_ACCOUNT_NAME, bankTest,\n\t\t\t\tAccount.Types.CHEQUING.getAccountType());\n\t\tassertEquals(accountTest, account);\n\t}", "private void createAccount()\n {\n // check for blank or invalid inputs\n if (Utils.isEmpty(edtFullName))\n {\n edtFullName.setError(\"Please enter your full name.\");\n return;\n }\n\n if (Utils.isEmpty(edtEmail) || !Utils.isValidEmail(edtEmail.getText().toString()))\n {\n edtEmail.setError(\"Please enter a valid email.\");\n return;\n }\n\n if (Utils.isEmpty(edtPassword))\n {\n edtPassword.setError(\"Please enter a valid password.\");\n return;\n }\n\n // check for existing user\n AppDataBase database = AppDataBase.getAppDataBase(this);\n User user = database.userDao().findByEmail(edtEmail.getText().toString());\n\n if (user != null)\n {\n edtEmail.setError(\"Email already registered.\");\n return;\n }\n\n user = new User();\n user.setId(database.userDao().findMaxId() + 1);\n user.setFullName(edtFullName.getText().toString());\n user.setEmail(edtEmail.getText().toString());\n user.setPassword(edtPassword.getText().toString());\n\n database.userDao().insert(user);\n\n Intent intent = new Intent(this, LoginActivity.class);\n intent.putExtra(\"user\", user);\n startActivity(intent);\n }", "public LandingPage registerNewAccount(){\n\t\taction.WaitForWebElement(linkRegisterNewAccount)\n\t\t\t .Click(linkRegisterNewAccount);\n\t\treturn this;\n\t}", "@Test\n public void whenAccountCreationSucceeds() throws Exception {\n Mockito.when(view.getName()).thenReturn(USERNAME);\n Mockito.when(view.getEmail()).thenReturn(VALID_EMAIL);\n Mockito.when(view.getPassword()).thenReturn(VALID_PASSWORD);\n Mockito.when(view.getPasswordConfirmation()).thenReturn(VALID_PASSWORD);\n\n presenter.onCreateAccountClick();\n\n Mockito.verify(view).startProfilePageActivity();\n }", "@Test\n\tvoid testCreateAccount() {\n\t\t\n\t\t// Data Object for unregister user\n\t\tUser user = new User(\"Create AccountExample\", \"CreateAccount\", \"[email protected]\");\n\t\t\n\t\t// Prepare data\n\t\tUserDAO dao = new UserDAO();\n\t\tboolean exist = false;\n\t\t\n\t\ttry {\n\t\t\t// Creating User in DB\n\t\t\tdao.createAccount(user, \"CreateAccountPassword\");\n\t\t\t\n\t\t\t// Boolean confirming if exist\n\t\t\texist = !dao.availabilityUsername(user.getUsername());\n\t\t\t\n\t\t\t// Deleting account\n\t\t\tdao.deleteAccount(user.getUsername());\n\t\t\t\n\t\t} catch (ClassNotFoundException | UnsupportedEncodingException | SQLException | GeneralSecurityException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t\n\t\t// Asserting that the create account works\n\t\tassertTrue(exist);\n\t}", "public void clkcreateAccountBtn() {\n\t\tcreateAccountBtn.click();\n\t\tExtentTestManager.getTest().log(LogStatus.INFO, \"Click on 'Create an account' button\");\n\t}", "private void createAccountButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_createAccountButtonActionPerformed\n na.setVisible(true);\n boolean isLoggedInNew = uL.isLoggedIn();\n boolean isLoggedIn = na.isLoggedIn();\n if (isLoggedInNew || isLoggedIn) {\n dm.messageMustLogOut();\n na.dispose();\n }\n }", "boolean hasAccount();", "boolean hasAccount();", "boolean hasAccount();", "@Test\n\tpublic void createAccountSavingTest() {\n\t\tsetChequingRadioDefaultOff();\n\t\trdbtnSaving.setSelected(true);\n\t\tdata.setRdbtnSaving(rdbtnSaving);\n\t\tAccount account = data.createNewAccount();\n\t\taccountTest = new Account(TEST_ACCOUNT_NAME, bankTest,\n\t\t\t\tAccount.Types.SAVING.getAccountType());\n\t\tassertEquals(accountTest, account);\n\t}", "@Test\n\tpublic void testAdminCreate() {\n\t\tAccount acc1 = new Account(00000, \"ADMIN\", true, 1000.00, 0, false);\n\t\taccounts.add(acc1);\n\n\t\ttransactions.add(0, new Transaction(10, \"ADMIN\", 00000, 0, \"A\"));\n\t\ttransactions.add(1, new Transaction(05, \"new acc\", 00001, 100.00, \"A\"));\n\t\ttransactions.add(2, new Transaction(00, \"ADMIN\", 00000, 0, \"A\"));\n\n\t\ttransHandler = new TransactionHandler(accounts, transactions);\n\t\toutput = transHandler.HandleTransactions();\n\n\t\tif (outContent.toString().contains(\"Account Created\")) {\n\t\t\ttestResult = true;\n\t\t} else {\n\t\t\ttestResult = false;\n\t\t}\n\n\t\tassertTrue(\"unable to create account as admin\", testResult);\n\t}", "void openAccount(String name, String address, String cnic, int contact_no, int age, String email_address,\r\n int noOfAccounts, String incomeSource, String AccountType, String securityquestion) {\n\r\n if (bankPolicy.isEligibilityCriteriaFulfilled(age)) {// is customer eligible\r\n System.out.println(\"Criteria fulfilled\");\r\n\r\n boolean newCustomer = isItANewCustomer(cnic);\r\n\r\n if (newCustomer) {// is customer new\r\n Customer C = new Customer(Integer.toString(customers.size() + 1), cnic, name, address, contact_no,\r\n email_address, incomeSource, securityquestion);\r\n // Print and ASK FOR SECURITY QUESTION\r\n System.out.println(\"Its a new Customer\");\r\n System.out.println(\"Password: \" + C.credentials.password);\r\n // add customer to arraylist\r\n customers.add(C);\r\n // save new customer to database\r\n record.SaveCustomer(C);\r\n // save customer credentials to database\r\n record.SaveCredentials(C.credentials, C.customerID);\r\n\r\n }\r\n int index = -1;\r\n for (int i = 0; i < customers.size(); i++) {\r\n if (customers.get(i).CNIC.equals(cnic))\r\n index = i;\r\n }\r\n\r\n Account A = new Account(String.valueOf(accounts.size() + 1), getDateFormat(), AccountType,\r\n \"Pending\", customers.get(index).customerID);\r\n // add account to customer\r\n accounts.add(A);\r\n customers.get(index).customerAccount.add(A);\r\n // save account to database\r\n record.SaveAccount(A);\r\n }\r\n\r\n }", "BankAccount(){\n\t\tSystem.out.println(\"NEW ACCOUNT CREATED\");\t\n\t}", "public void switchToCreateAccount() {\r\n\t\tlayout.show(this, \"createPane\");\r\n\t\trevalidate();\r\n\t\trepaint();\r\n\t}", "@Test\n\tpublic void createAccountCashTest() {\n\t\tsetChequingRadioDefaultOff();\n\t\trdbtnCash.setSelected(true);\n\t\tdata.setRdbtnCash(rdbtnCash);\n\t\tAccount account = data.createNewAccount();\n\t\taccountTest = new Account(TEST_ACCOUNT_NAME, bankTest,\n\t\t\t\tAccount.Types.CASH.getAccountType());\n\t\tassertEquals(accountTest, account);\n\n\t}", "public void TestAccount1() {\n\n AccountCreator account = new AccountCreator();\n account.setFirstName(\"Bob\");\n account.setLastName(\"Smith\");\n account.setAddress(\"5 Rain Road\");\n account.setPIN();\n account.setTestBalance(300);\n accountList.add(account);\n\n }", "boolean hasHasAccount();", "public void run() {\n int id = getIdentity();\n iUser user = createUser(id);\n boolean userCreated = (user != null);\n if (userCreated) {\n presenter.printAccountCreated();\n } else {\n presenter.printRequestDeclined();\n }\n }", "@Override\r\n\tpublic void showAccount() {\n\t\t\r\n\t}", "private void registerUser()\n {\n /*AuthService.createAccount takes a Consumer<Boolean> where the result will be true if the user successfully logged in, or false otherwise*/\n authService.createAccount(entryService.extractText(namedFields), result -> {\n if (result.isEmpty()) {\n startActivity(new Intent(this, DashboardActivity.class));\n } else {\n makeToast(result);\n formContainer.setAlpha(1f);\n progressContainer.setVisibility(View.GONE);\n progressContainer.setOnClickListener(null);\n }\n });\n }", "@Then(\"^the account should be added successfully$\")\n\tpublic void the_account_should_be_added_successfully() throws Throwable {\n\t assertTrue(\"Verify that the account is saved\",waitforElementPresent(Edit,10));\n\t UIDriver.mystep.write(\"This is a custom message -- Account saved successfully\");\n\t result = AccessibilityDriver.run508OnPage(UIDriver.driver.getPageSource(),\"Successful Account Page\");\n\t UIDriver.mystep.write(result);\n\t}", "public boolean makeNewAccount(String name, BigDecimal balance, int type)\n throws SQLException, ConnectionFailedException, DatabaseInsertException {\n if (currentCustomerAuthenticated && currentUserAuthenticated) {\n int id = DatabaseInsertHelper.insertAccount(name, balance, type);\n EnumMapRolesAndAccounts map = new EnumMapRolesAndAccounts();\n map.createEnumMap();\n // find out what account type the account is and create and add that account to the customer\n if (type == map.accountTypes.get(AccountTypes.CHEQUING)) {\n ChequingAccount chequing = new ChequingAccountImpl(id, name, balance);\n currentCustomer.addAccount(chequing);\n DatabaseInsertHelper.insertUserAccount(currentCustomer.getId(), id);\n System.out.println(\"Account ID - \" + id);\n return true;\n } else if (type == map.accountTypes.get(AccountTypes.SAVINGS)) {\n SavingsAccount savings = new SavingsAccountImpl(id, name, balance);\n currentCustomer.addAccount(savings);\n DatabaseInsertHelper.insertUserAccount(currentCustomer.getId(), id);\n System.out.println(\"Account ID - \" + id);\n return true;\n } else if (type == map.accountTypes.get(AccountTypes.TFSA)) {\n TFSA tfsa = new TFSAImpl(id, name, balance);\n currentCustomer.addAccount(tfsa);\n DatabaseInsertHelper.insertUserAccount(currentCustomer.getId(), id);\n System.out.println(\"Account ID - \" + id);\n return true;\n } else if (type == map.accountTypes.get(AccountTypes.RESTRICTEDSAVING)) {\n RestrictedSavingsAccount rsavings = new RestrictedSavingsAccountImpl(id, name, balance);\n currentCustomer.addAccount(rsavings);\n DatabaseInsertHelper.insertUserAccount(currentCustomer.getId(), id);\n System.out.println(\"Account ID - \" + id);\n return true;\n }\n return false;\n }\n System.out.println(\"reached here\");\n throw new ConnectionFailedException();\n }", "@Override\n\tpublic boolean addAccount(Account account) {\n\t\taccount.setStatus(-1);\n\t\t//String passwd = new UU\n\t\treturn accountDAO.addAccount(account);\n\t}", "@Test\n public void testGiveAccount() {\n System.out.println(\"giveAccount\");\n String name = \"Gert Hansen\";\n String address = \"Grønnegade 12\";\n String phone = \"98352010\";\n CustomerCtr instance = new CustomerCtr();\n int customerID = instance.createCustomer(name, address, phone);\n String type = \"Visa\";\n int regNo = 39292492;\n int cardNo = 457153253;\n instance.giveAccount(customerID, type, regNo, cardNo);\n Account result = instance.getCustomer(customerID).getAccount();\n assertNotNull(result);\n assertEquals(\"Visa\", result.getType());\n assertEquals(39292492, result.getRegNr());\n assertEquals(457153253, result.getCardNr());\n // TODO review the generated test code and remove the default call to fail.\n// fail(\"The test case is a prototype.\");\n }", "@Test\n public void testCreateAccountWithPassword() {\n final CreateUserRequest createUserRequest = new CreateUserRequest();\n createUserRequest.setUsername(\"[email protected]\");\n createUserRequest.setPassword(\"beta\");\n createUserRequest.setFirstname(\"Alpha\");\n createUserRequest.setLastname(\"Gamma\");\n\n // Now, perform the actual test - create the Account, and verify that\n // the response is ok, and that a Notification was sent\n final CreateUserResponse result = administration.createUser(token, createUserRequest);\n assertThat(result.isOk(), is(true));\n assertThat(result.getUser(), is(not(nullValue())));\n assertThat(result.getUser().getUserId(), is(not(nullValue())));\n // Creating a new User should generate an Activate User notification\n final NotificationType type = NotificationType.ACTIVATE_NEW_USER;\n assertThat(spy.size(type), is(1));\n final String activationCode = spy.getNext(type).getFields().get(NotificationField.CODE);\n assertThat(activationCode, is(not(nullValue())));\n }", "@Test\n\tpublic void testCreateAdminAccountSuccessfully() {\n\t\tassertEquals(2, adminAccountService.getAllAdminAccounts().size());\n\n\t\tString username = \"newUsername\";\n\t\tAdminAccount user = null;\n\t\ttry {\n\t\t\tuser = adminAccountService.createAdminAccount(username, PASSWORD1, NAME1);\n\t\t} catch (InvalidInputException e) {\n\t\t\tfail();\n\t\t}\n\t\tassertNotNull(user);\n\t\tassertEquals(username, user.getUsername());\n\t\tassertEquals(PASSWORD1, user.getPassword());\n\t\tassertEquals(NAME1, user.getName());\n\t}", "public String createAccount(Account account){\n try {\n List<Account> accounts = new ArrayList<>();\n\n if(!accountsFile.createNewFile()){\n accounts = mapper.readValue(accountsFile, new TypeReference<ArrayList<Account>>(){});\n }\n List<Account> customerAccounts = getAccountsForUSer(accounts, account.getCustomerName());\n if(!customerAccounts.stream().anyMatch(a -> a.getAccountName().equals(account.getAccountName()))){\n accounts.add(account);\n mapper.writerWithDefaultPrettyPrinter().writeValue(accountsFile, accounts);\n } else {\n return messageService.accountAlreadyExist(account.getCustomerName(), account.getAccountName());\n }\n } catch (Exception e) {\n return messageService.unexpectedError(e);\n }\n return messageService.accountCreated(account.getAccountName(), account.getCustomerName());\n }", "public static void createAccount3() {\n\n\n System.setProperty(\"webdriver.chrome.driver\",\"resources/chromedriver.exe\");\n\n WebDriver driver = new ChromeDriver();\n\n driver.get(\"https://fasttrackit.org/selenium-test/\");\n driver.findElement(By.cssSelector(\"a[href*=\\\"account\\\"] .label\")).click();\n driver.findElement(By.cssSelector(\"a[title=\\\"Register\\\"]\")).click();\n\n driver.findElement(By.cssSelector(\"#middlename\")).sendKeys(\"test\");\n driver.findElement(By.cssSelector(\"#lastname\")).sendKeys(\"chris\");\n driver.findElement(By.cssSelector(\"#email_address\")).sendKeys(\"[email protected]\");\n driver.findElement(By.cssSelector(\"#password\")).sendKeys(\"test1212\");\n driver.findElement(By.cssSelector(\"#confirmation\")).sendKeys(\"test1212\");\n driver.findElement(By.cssSelector(\"button[title=\\\"Register\\\"]\")).click();\n\n driver.quit();\n\n\n\n }", "@Test\n public void testCreateAccountWithoutPassword() {\n final CreateUserRequest createUserRequest = new CreateUserRequest();\n createUserRequest.setUsername(\"[email protected]\");\n createUserRequest.setFirstname(\"Beta\");\n createUserRequest.setLastname(\"Gamma\");\n\n // Now, perform the actual test - create the Account, and verify that\n // the response is ok, and that a Notification was sent\n final Response result = administration.createUser(token, createUserRequest);\n assertThat(result.isOk(), is(true));\n // Creating a new User should generate an Activate User notification\n final NotificationType type = NotificationType.ACTIVATE_NEW_USER;\n assertThat(spy.size(type), is(1));\n final String activationCode = spy.getNext(type).getFields().get(NotificationField.CODE);\n assertThat(activationCode, is(not(nullValue())));\n\n // Check that the user is in the list of members\n final String memberGroupId = findMemberGroup(token).getGroupId();\n token.setGroupId(memberGroupId);\n final FetchGroupRequest groupRequest = new FetchGroupRequest(memberGroupId);\n final FetchGroupResponse groupResponse = administration.fetchGroup(token, groupRequest);\n assertThat(groupResponse, is(not(nullValue())));\n }", "GenerateUserAccount () {\r\n }", "public void AddToAccountInfo();", "public static boolean accountAutocreate() {\n\t\treturn getAccountAutocreate().equals(\"yes\");\n\t}", "@Test\n public void createDuplicateAccount() {\n final String username1 = \"[email protected]\";\n final String username2 = \"[email protected]\";\n final String username3 = \"[email protected]\";\n final String firstname = \"william\";\n final String lastname = \"shakespeare\";\n final String address = \"@iaeste.org\";\n\n final CreateUserRequest request1 = new CreateUserRequest(username1, firstname, lastname);\n final CreateUserResponse response1 = administration.createUser(token, request1);\n assertThat(response1, is(not(nullValue())));\n assertThat(response1.isOk(), is(true));\n assertThat(response1.getUser(), is(not(nullValue())));\n assertThat(response1.getUser().getAlias(), is(firstname + '.' + lastname + address));\n\n final CreateUserRequest request2 = new CreateUserRequest(username2, firstname, lastname);\n final CreateUserResponse response2 = administration.createUser(token, request2);\n assertThat(response2, is(not(nullValue())));\n assertThat(response2.isOk(), is(true));\n assertThat(response2.getUser(), is(not(nullValue())));\n assertThat(response2.getUser().getAlias(), is(firstname + '.' + lastname + 2 + address));\n\n final CreateUserRequest request3 = new CreateUserRequest(username3, firstname, lastname);\n final CreateUserResponse response3 = administration.createUser(token, request3);\n assertThat(response3, is(not(nullValue())));\n assertThat(response3.isOk(), is(true));\n assertThat(response3.getUser(), is(not(nullValue())));\n assertThat(response3.getUser().getAlias(), is(firstname + '.' + lastname + 3 + address));\n }", "public void addAccount() {\n\t\t\n\t\ttry {\n\t\t\tlog.log(Level.INFO, \"Please enter name\");\n String custName = scan.next();\n validate.checkName(custName);\n \t\tlog.log(Level.INFO, \"Select Account Type: \\n 1 for Savings \\n 2 for Current \\n 3 for FD \\n 4 for DEMAT\");\n\t\t\tint bankAccType = Integer.parseInt(scan.next());\n\t\t\tvalidate.checkAccType(bankAccType);\n\t\t\tlog.log(Level.INFO, \"Please Enter your Aadar Card Number\");\n\t\t\tString aadarNumber = scan.next();\n\t\t\tlog.log(Level.INFO, \"Please Enter Phone Number: \");\n\t\t\tString custMobileNo = scan.next();\n\t\t\tvalidate.checkPhoneNum(custMobileNo);\n\t\t\tlog.log(Level.INFO, \"Please Enter Customer Email Id: \");\n\t\t\tString custEmail = scan.next();\n\t\t\tvalidate.checkEmail(custEmail);\n\t\t\tbankop.add(accountNumber, custName, bankAccType, custMobileNo, custEmail, aadarNumber);\n\t\t\taccountNumber();\n\t\t\n\t\t} catch (AccountDetailsException message) {\n\t\t\tlog.log(Level.INFO, message.getMessage()); \n }\n\n\t}", "@Override\n public void createOnlineAccount(String name, \n String ssn, String id, String psw)\n {\n final String url = \n \"jdbc:mysql://mis-sql.uhcl.edu/<username>?useSSL=false\";\n \n Connection connection = null;\n Statement statement = null;\n ResultSet resultSet = null;\n \n try\n {\n \n //connect to the databse\n connection = DriverManager.getConnection(url, \n db_id, db_password);\n connection.setAutoCommit(false);\n //crate the statement\n statement = connection.createStatement();\n \n //do a query\n resultSet = statement.executeQuery(\"Select * from onlineAccount \"\n + \"where id = '\" + id + \"' or ssn = '\"\n + ssn + \"'\");\n \n if(resultSet.next())\n {\n //either the ssn is used or the id is used\n System.out.println(\"Account creation failed\");\n }\n else\n {\n //insert a record into onlineAccount\n int r = statement.executeUpdate(\"insert into onlineAccount values\"\n + \"('\" + name + \"', '\" + id + \"', '\" + ssn + \"', '\"\n + psw +\"')\");\n System.out.println(\"Account creation successful!\");\n System.out.println();\n }\n connection.commit();\n connection.setAutoCommit(true);\n \n }\n catch (SQLException e)\n {\n System.out.println(\"Something wrong during the creation process!\");\n e.printStackTrace();\n }\n finally\n {\n //close the database\n try\n {\n resultSet.close();\n statement.close();\n connection.close();\n }\n catch(Exception e)\n {\n e.printStackTrace();\n }\n }\n \n }", "Document createAccount(String username, String accountDisplayName,\n String accountFullName, double balance, double interestRate);", "private void createAccount() {\n mAuth.createUserWithEmailAndPassword(mTextEmail.getText().toString(), mTextPassword.getText().toString()).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n Log.d(TAG, \"createUserWithEmail:onComplete:\" + task.isSuccessful());\n\n if(!task.isSuccessful()){\n Toast.makeText(SignInActivity.this, \"Account creation failed!\", Toast.LENGTH_SHORT).show();\n } else {\n Toast.makeText(SignInActivity.this, \"Account creation success!\", Toast.LENGTH_SHORT).show();\n }\n }\n });\n }", "private void createPassenger() {\n account = new Account(\"driver\", \"password\", \"[email protected]\",\n \"Dan\", \"20 Howard Street\", 1234567, 64278182123L);\n }", "public boolean\tnewAccount(String type, String name, float balance) throws IllegalArgumentException;", "public void createAccount() {\n\t\t// Assigns variables based on user input\n\t\tString username = usernameField.getText();\n\t\tString firstName = firstNameField.getText();\n\t\tString lastName = lastNameField.getText();\n\t\tString address = addressField.getText();\n\t\tString postCode = postcodeField.getText();\n\t\tString phoneNumber = phoneNumberField.getText();\n\t\tlong phoneNumberLong;\n\t\tif (username.isEmpty() || firstName.isEmpty() || lastName.isEmpty() || address.isEmpty() || postCode.isEmpty()\n\t\t\t\t|| phoneNumber.isEmpty()) { // Checks if number is correct format\n\n\t\t\tAlert alert = new Alert(AlertType.ERROR); // Error message\n\t\t\talert.setTitle(\"Error\");\n\n\t\t\talert.setHeaderText(\"Could not create an user\");\n\t\t\talert.setContentText(\"Make sure you fill all fields and press button again\");\n\t\t\talert.showAndWait();\n\n\t\t\treturn;\n\t\t}\n\n\t\telse {\n\t\t\ttry {\n\t\t\t\tphoneNumberLong = Long.parseLong(phoneNumber);\n\t\t\t} catch (Exception e) {\n\t\t\t\tAlert alert = new Alert(AlertType.ERROR);\n\t\t\t\talert.setTitle(\"Error\");\n\n\t\t\t\talert.setHeaderText(\"Wrong format of phone number\");\n\t\t\t\talert.setContentText(\"Please enter correct phone number\");\n\t\t\t\talert.showAndWait();\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tif(FileReader.exists(username)) {\n\t\t\t\tAlert alert = new Alert(AlertType.ERROR);\n\t\t\t\talert.setTitle(\"Error\");\n\n\t\t\t\talert.setHeaderText(\"User with the username \"+ username +\" already exists. \");\n\t\t\t\talert.setContentText(\"Please choose another username\");\n\t\t\t\talert.showAndWait();\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tString userdata = \"\";\n\t\t\tuserdata += \"\\n Username: \" + username;\n\t\t\tuserdata += \"\\n First name: \" + firstName;\n\t\t\tuserdata += \"\\n Last name: \" + lastName;\n\t\t\tuserdata += \"\\n Address: \" + address;\n\t\t\tuserdata += \"\\n Post code: \" + postCode;\n\t\t\tuserdata += \"\\n Phone number: \" + phoneNumberLong;\n\t\t\t\n\n\t\t\tif(custom) {\n\t\t\t\tavatarIndex = 101;\n\t\t\t\t// Gives users the custom avatar\n\t\t\t\tFile file1 = new File(\"artworkImages/\" + username);\n\t\t\t\tfile1.mkdir();\n\t\t\t\tPath path = Paths.get(\"customAvatars/\" + username + \".png\");\n\t\t\t\tString path1 = \"tmpImg.png\";\n\t\t\t\tFile file = new File(path1);\n\n\t\t\t\ttry {\n\t\t\t\t\tFiles.copy(file.toPath(), path, StandardCopyOption.REPLACE_EXISTING);\n\t\t\t\t} catch (IOException e) {\n\t\t\t\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tUser user = new User(username, firstName, lastName, address, postCode, phoneNumberLong, avatarIndex);\n\t\t\tFileReader.addUser(user); // Creates user\n\n\t\t\ttry {\n\t\t\t\tWriter.writeUserFile(user); // Adds user to memory\n\t\t\t} catch (IOException e) {\n\t\t\t\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t\t\n\n\t\t\tAlert alert = new Alert(AlertType.INFORMATION); // Success message\n\t\t\talert.setTitle(\"Success\");\n\n\t\t\talert.setHeaderText(\"The user has been created\");\n\t\t\talert.setContentText(\"Close this window to return to login screen\");\n\t\t\talert.showAndWait();\n\n\t\t\tcreateAccountButton.getScene().getWindow().hide();\n\t\t}\n\n\t}", "@Test(priority=1, dataProvider=\"User Details\")\n\t\tpublic void registration(String firstname,String lastname,String emailAddress,\n\t\t\t\tString telephoneNum,String address1,String cityName,String postcodeNum,\n\t\t\t\tString country,String zone,String pwd,String confirm_pwd) throws Exception{\n\t\t\t\n\t\t\thomePage = new HomePage(driver);\n//'**********************************************************\t\t\t\n//Calling method to click on 'Create Account' link\n\t\t\tregistraionPageOC = homePage.clickCreateAccount();\n//'**********************************************************\t\t\t\n//Calling method to fill user details in Registration page and verify account is created\n\t\t\tregistraionPageOC.inputDetails(firstname,lastname,emailAddress,telephoneNum,address1,cityName,postcodeNum,country,zone,pwd,confirm_pwd);\n\t\t\ttry{\n\t\t\tAssert.assertEquals(\"Your Account Has Been Created!\", driver.getTitle(),\"Titles Not Matched: New Account Not Created\");\n\t\t\textentTest.log(LogStatus.PASS, \"Registration: New User Account is created\");\n\t\t\t}catch(Exception e){\n\t\t\t\textentTest.log(LogStatus.FAIL, \"Registration is not successful\");\n\t\t\t}\n\t\t}", "@Override\n public boolean createAccount(String fullName, String username, String password, String email){\n // will change this if we make some errors.\n if(!usernameToPerson.containsKey(username)) { // check that there is not someone with that username\n Organizer og = new Organizer(fullName, username, password, email);\n updateUsernameToPerson(og.getUsername(), og); // see below\n idToPerson.put(og.getID(), og);\n return true;\n }\n\n return false;\n\n }", "Account() { }", "public Account createAccount(Account account){\n\t\t\n\t\taccount.createdDate = new Date();\n\t\taccount.isActive = true;\n\t\t\n\t\t\n\t\taccount.person = personService.createPerson(account.person);\n\t\taccount.person.personSettings = personalSettingsService.createSettings(account.person.personSettings);\n\t\t\n\t\t\n\t\treturn account;\n\t}", "@Override\r\n\tpublic boolean isAccountExist(Account account) {\n\t\treturn false;\r\n\t}", "NewAccountPage openNewAccountPage();", "@FXML\r\n\tpublic void saveNewAccount( ) {\r\n\t\t// Save user input\r\n\t\tString name = userName.getText( );\r\n\t\tString mail = email.getText( );\r\n\r\n\t\t// Call the to file method to write to data.txt\r\n\t\tUserToFile.toFile(name, pin, mail);\r\n\t\t\r\n\t\t// View the test after the info is saved\r\n\t\tviewTest( );\r\n\t}", "@Test\n\tpublic void testCreateAdminAccountWithTakenUsername() {\n\n\t\tString error = null;\n\t\tAdminAccount user = null; \n\t\ttry {\n\t\t\tuser = adminAccountService.createAdminAccount(USERNAME1, PASSWORD1, NAME1);\n\t\t} catch (InvalidInputException e) {\n\t\t\terror = e.getMessage();\n\t\t}\n\n\t\tassertNull(user);\n\t\t// check error\n\t\tassertEquals(\"This username is not available.\", error);\n\t}", "@Test\n\tpublic void createAccountRRSPInvestmentTest() {\n\t\tsetChequingRadioDefaultOff();\n\t\trdbtnRrspInvestments.setSelected(true);\n\t\tdata.setRdbtnRrspInvestments(rdbtnRrspInvestments);\n\t\tAccount account = data.createNewAccount();\n\t\taccountTest = new Account(TEST_ACCOUNT_NAME, bankTest,\n\t\t\t\tAccount.Types.RRSP_INVESTMENTS.getAccountType());\n\t\tassertEquals(accountTest, account);\n\t}", "@Test\n\tpublic void Accounts_23214_execute() throws Exception {\n\t\tVoodooUtils.voodoo.log.info(\"Running \" + testName + \"...\");\n\t\t\n\t\tDataSource ds = testData.get(testName);\n\t\tmyAccount.navToRecord();\n\t\tStandardSubpanel accSub = sugar().accounts.recordView.subpanels.get(\"Accounts\");\n\t\taccSub.addRecord();\t\t\n\t\tsugar().accounts.createDrawer.showMore();\n\t\tsugar().accounts.createDrawer.getEditField(\"name\").set(ds.get(0).get(\"name\"));\n\t\tsugar().accounts.createDrawer.getEditField(\"billingAddressCity\").set(ds.get(0).get(\"billingAddressCity\"));\n\t\tsugar().accounts.createDrawer.getEditField(\"workPhone\").set(ds.get(0).get(\"workPhone\"));\n\t\tsugar().contacts.createDrawer.save();\n\t\tVoodooUtils.waitForAlertExpiration();\n\t\t//VOOD-609\n\t\tnew VoodooControl(\"span\", \"css\", \"div.filtered.layout_Accounts tbody span.fld_name.list\").assertEquals(ds.get(0).get(\"name\"), true);\n\t\tnew VoodooControl(\"span\", \"css\", \"div.filtered.layout_Accounts tbody span.fld_billing_address_city.list\").assertEquals(ds.get(0).get(\"billingAddressCity\"), true);\n\t\tnew VoodooControl(\"span\", \"css\", \"div.filtered.layout_Accounts tbody span.fld_phone_office.list\").assertEquals(ds.get(0).get(\"workPhone\"), true);\n\t\tVoodooUtils.voodoo.log.info(testName + \" complete.\");\n\t}", "public abstract void createAccount(final GDataAccount account)\n throws ServiceException;", "private boolean accountChecks(Account account){\n // ie. if the account has to be personal for the round-up service to apply\n account.getName(); // check personal\n return true;\n }", "@Test\n public void testCreateStudentAccount() {\n // For this test, we also need the Access Client\n //final AccessClient accessClient = new AccessClient();\n\n // Create the new User Request Object\n final String username = \"[email protected]\";\n final String password = \"myPassword\";\n final CreateUserRequest createUserRequest = new CreateUserRequest(username, password, \"Student\", \"Graduate\");\n createUserRequest.setStudentAccount(true);\n\n final Students students = new StudentClient();\n final FetchStudentsRequest fetchStudentsRequest = new FetchStudentsRequest();\n final FetchStudentsResponse beforeStudentsResponse = students.fetchStudents(token, fetchStudentsRequest);\n\n // Now, perform the actual test - create the Account, and verify that\n // the response is ok, and that a Notification was sent\n final Response result = administration.createUser(token, createUserRequest);\n assertThat(result.isOk(), is(true));\n assertThat(spy.size(), is(0));\n\n //TODO Pavel 2014-04-15: students are not supposed to receive activation email now so the following test should not work\n // since no notification is generated. Once the emails are sent, following lines have to be uncommented\n// assertThat(spy.size(), is(1));\n// final String activationCode = spy.getNext().getFields().get(NotificationField.CODE);\n// assertThat(activationCode, is(not(nullValue())));\n\n // Attempt to login using the new User Account. It should not yet work,\n // since the account is not activated\n// final AuthenticationRequest request = new AuthenticationRequest(username, password);\n// final AuthenticationResponse response1 = accessClient.generateSession(request);\n// assertThat(response1.isOk(), is(false));\n// assertThat(response1.getError(), is(IWSErrors.AUTHENTICATION_ERROR));\n\n // Verify that the Students exists\n final FetchStudentsResponse afterFetchStudentsResponse = students.fetchStudents(token, fetchStudentsRequest);\n assertThat(afterFetchStudentsResponse.isOk(), is(true));\n assertThat(afterFetchStudentsResponse.getStudents().size(), is(beforeStudentsResponse.getStudents().size() + 1));\n\n // Activate the Account\n// final Fallible acticationResult = administration.activateUser(activationCode);\n// assertThat(acticationResult.isOk(), is(true));\n\n // Now, attempt to login again\n// final AuthenticationResponse response2 = accessClient.generateSession(request);\n// assertThat(response2.isOk(), is(true));\n// assertThat(response2.getToken(), is(not(nullValue())));\n\n //// Now, read the Permissions that the student has, basically, there is\n //// only 1 permission - which is applying for Open Offers\n //final FetchPermissionResponse permissionResponse = accessClient.fetchPermissions(response2.getToken());\n //assertThat(permissionResponse.isOk(), is(true));\n //// The following fails, since the order of the UserGroup Object in the\n //// Authorization Object is undefined, for this reason, the code is\n //// commented out\n //assertThat(permissionResponse.getAuthorizations().get(0).getUserGroup().getRole().getPermissions().contains(Permission.APPLY_FOR_OPEN_OFFER), is(true));\n\n // Deprecate the Students Session, the test is over :-)\n// final Fallible deprecateSessionResult = accessClient.deprecateSession(response2.getToken());\n// assertThat(deprecateSessionResult.isOk(), is(true));\n }", "@Test\n @Order(4)\n void create_account_2() {\n Account empty = service.createAccount(client.getId());\n Assertions.assertEquals(client.getId(), empty.getClientId());\n Assertions.assertNotEquals(-1, empty.getId());\n Assertions.assertEquals(0, empty.getAmount());\n client.addAccount(empty);\n }", "public boolean createUser(Account account, Enrollee enrollee) throws DBException {\n boolean result = true;\n PreparedStatement statement = null;\n ResultSet resultSet;\n try {\n connection = DBManager.getConnection();\n connection.setAutoCommit(false);\n connection.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);\n\n statement = connection.prepareStatement(CREATE_ACCOUNT);\n statement.setString(1, account.getEmail());\n statement.setString(2, account.getPassword());\n statement.setInt(3, account.getRole_id().ordinal());\n statement.setBoolean(4, account.is_banned());\n statement.executeUpdate();\n\n statement = connection.prepareStatement(GET_ACCOUNT_ID_BY_EMAIL);\n statement.setString(1, account.getEmail());\n resultSet = statement.executeQuery();\n if (resultSet.next()) {\n account.setId(resultSet.getLong(Field.ID));\n }\n\n statement = connection.prepareStatement(CREATE_ENROLLEE);\n statement.setString(1, enrollee.getFirst_name());\n statement.setString(2, enrollee.getLast_name());\n statement.setString(3, enrollee.getPatronymic());\n statement.setInt(4, enrollee.getCertificate_score());\n statement.setLong(5, account.getId());\n statement.setLong(6, enrollee.getLevel_id());\n statement.executeUpdate();\n connection.commit();\n } catch (SQLException e) {\n DBManager.rollback(connection);\n LOG.error(e.getMessage(), e);\n throw new DBException(e.getMessage(), e);\n } finally {\n DBManager.closeStatement(statement);\n DBManager.closeConnection(connection);\n }\n return result;\n }", "private void createDriver() {\n account = new Account(\"driver\", \"password\", \"[email protected]\",\n \"Dan\", \"20 Howard Street\", 1234567, 64278182123L,\n new Licence(\"Full for over 2 years\", \"YXF87231\",\n LocalDate.parse(\"12/12/2015\", formatter),\n LocalDate.parse(\"12/12/2020\", formatter)));\n }", "public void create(UserValidator account) {\n Account validated = new Account();\n validated.setUsername(account.getUsername());\n validated.setPassword(passwordEncoder.encode(account.getPassword()));\n validated.setFirstName(account.getFirstName());\n validated.setLastName(account.getLastName());\n validated.getAuthorities().add(\"USER\");\n\n this.accountRepository.save(validated);\n }", "@Test(enabled = false)\n\tpublic void viewTravelHistoryRegistredCustomerOneAccount() throws Exception {\n\n\t\t// create travel history via soap call\n\t\tSOAPClientSAAJ sClient = new SOAPClientSAAJ();\n\t\tCreditCardNumberGenerator ccGenerator = new CreditCardNumberGenerator();\n\t\tString validCCNumber = ccGenerator.generate(\"4\", 16);\n\t\tString accountID = sClient.travelHistorySOAPCall(validCCNumber);\n\t\tLog.info(\"cc number being used is \" + validCCNumber);\n\t\tLog.info(\"account id being returned is \" + accountID);\n\t\tLog.info(\"waiting for ABP to get updated\");\n\t\tUtils.waitTime(180000);\n\n\t\t\n\t\t// create account and link it to cc\n\t\tcoreTest.signIn(driver);\n\t\tcoreTest.createCustomer(driver);\n\t\tBasePage bPage = new BasePage(driver);\n\t\tbPage.clickLinkAccount(driver);\n\t\tLinkAccountPage lPage = new LinkAccountPage(driver);\n\t\n\t\t// use cc number from soap call to link account\n\t\tlPage.enterBankAccount(driver, validCCNumber);\n\t\tlPage.selectExpMonth(driver);\n\t\tlPage.selectExpYear(driver, 2);\n\t\tlPage.clickSearchToken(driver);\n\t\tlPage.enterNickName(driver, \"adam\");\n\t\tlPage.clickLinkAccount(driver);\n\t\n\t\t// do another tap after linking the account\n\t\t// verify that travel history shows up on one account now\n\t\tString postTab = sClient.travelHistoryPostTab(validCCNumber);\n\t\tLog.info(\"second tab was \" + postTab);\n\t\t\n\t\t// takes around 6 minutes for travel history to show on cmc\n Utils.waitTime(360000);\n\n\t\tbPage.clickTravelHistory(driver);\n\t\t\t// do assertions on oneaccount travel history\n\n\t\tLog.info(\"viewTravelHistoryRegistredCustomerOneAccount Completed\");\n\t\tdriver.close();\n\t}", "@Override\n\tpublic String createUserAccountQuery(String username, String password, String firstName, String lastName,\n\t\t\tString dob, String accountType, String accountID, String creationDate, String requestDate,\n\t\t\tString phoneNumber, String email, boolean isApproved) {\n\t\treturn null;\n\t}", "@Test(groups = \"Transactions Tests\", description = \"Create new transaction\")\n\tpublic void createNewTransaction() {\n\t\tMainScreen.clickAccountItem(\"Income\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Salary\");\n\t\tTransactionsScreen.clickAddTransactionBtn();\n\t\tTransactionsScreen.typeTransactionDescription(\"Extra income\");\n\t\tTransactionsScreen.typeTransactionAmount(\"300\");\n\t\tTransactionsScreen.clickTransactionType();\n\t\tTransactionsScreen.typeTransactionNote(\"Extra income from this month\");\n\t\tTransactionsScreen.clickSaveBtn();\n\t\tTransactionsScreen.transactionItem(\"Extra income\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$300\"));\n\t\ttest.log(Status.PASS, \"Sub-account created successfully and the value is correct\");\n\n\t\t//Testing if the transaction was created in the 'Double Entry' account, if the value is correct and logging the result to the report\n\t\treturnToHomeScreen();\n\t\tMainScreen.clickAccountItem(\"Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Current Assets\");\n\t\tSubAccountScreen.clickSubAccountItem(\"Cash in Wallet\");\n\t\tTransactionsScreen.transactionItem(\"Extra income\").shouldBe(visible);\n\t\tTransactionsScreen.transactionAmout().shouldHave(text(\"$300\"));\n\t\ttest.log(Status.PASS, \"'Double Entry' account also have the transaction and the value is correct\");\n\n\t}", "private void createAccounts(){\r\n for(int i = 0; i < accountInTotal; i++){\r\n try {\r\n Account tempAccount = new Account(startingBonds);\r\n theAccounts.add(tempAccount);\r\n } catch(Exception e){\r\n System.err.println(\"Error\");\r\n }\r\n }\r\n }", "@ReactMethod\n public void reportUserRegister(String accountId) {\n Tracking.setRegisterWithAccountID(accountId);\n }", "public abstract void createAccount(JSONObject account);", "@Override\n public void actionPerformed(ActionEvent e) {\n try {\n Account account = new Account(APPKEY, APPSECRET);\n accounts.add(account);\n int mc = JOptionPane.WARNING_MESSAGE;\n if (!accountDispName.getText().contains(account.screenName)) {\n accountDispName.setText(accountDispName.getText() + account.screenName + \"\\n\");\n accountDispName.setOpaque(true);\n statusDisplay.setText(statusDisplay.getText() + \"active\\n\");\n if (!accountDisplayNameHeader.isVisible())\n accountDisplayNameHeader.setVisible(true);\n if (!accountStatusHeader.isVisible())\n accountStatusHeader.setVisible(true);\n if (!accountDispName.isVisible())\n accountDispName.setVisible(true);\n if (!statusDisplay.isVisible())\n statusDisplay.setVisible(true);\n //f1.validate();\n account.persistAccount();\n JOptionPane.showMessageDialog(null, \"Account Added Successfully!!\", \"Success!!\", mc);\n nAccounts++;\n } else {\n JOptionPane.showMessageDialog(null, \"Account Already Exists\", \"Duplicate!!\", mc);\n }\n } catch (Exception e1) {\n int mc = JOptionPane.WARNING_MESSAGE;\n JOptionPane.showMessageDialog(null, \"Unable To Add Account!\", \"Error\", mc);\n e1.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.\n }\n }", "@Test\n public void testAddAccount() {\n Assert.assertEquals(\"Initial size of reporter list is incorrect\", 1,\n theModel.getAccountList().size());\n try {\n theModel.addAccountInfo(new Account(1, \"[email protected]\", \"mbills2\", Credential.MANAGER));\n theModel.addAccountInfo(new Account(2, \"madie\", \"madie\", Credential.USER));\n theModel.addAccountInfo(new Account(3, \"sbills3\", \"sbills3\", Credential.ADMIN));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail(\"Should not have thrown exception here\");\n }\n Assert.assertEquals(\"Total account list size wrong after adding\", 4,\n theModel.getAccountList().size());\n }", "private boolean requestNewAccount() {\n\t\tServerAPITask userTasks = new ServerAPITask();\n\t\tString uName = usernameField.getText().toString();\n\t\tuserTasks.setAPIRequest(\"http://riptide.alexkersten.com:3333/stoneapi/account/lookup/\" + uName);\n\t\ttry {\n\t\t\tString response = userTasks.execute(\"\").get();\n\t\t\tLog.e(\"Response String\", response);\n\t\t\t\n\t\t\tjsonResponse = new JSONArray(response);\n\t\t\tif (jsonResponse.length() > 0) {\n\t\t\t\tToast.makeText(this.getContext(), \"The username already exists\", Toast.LENGTH_LONG).show();\n\t\t\t}\n\t\t\telse {\n\t\t\t\tuserTasks = new ServerAPITask();\n\t\t\t\tuserTasks.setAPIRequest(\"http://riptide.alexkersten.com:3333/stoneapi/account/create/\" + uName);\n\t\t\t\t\n\t\t\t\tString createResp = userTasks.execute(\"\").get();\n\t\t\t\tLog.e(\"Create Response\", createResp);\n\t\t\t\tJSONObject cObj = new JSONObject(createResp);\n\t\t\t\t\n\t\t\t\tString success = cObj.getString(\"success\");\n\t\t\t\tif (success.equals(\"false\")) {\n\t\t\t\t\tToast.makeText(this.getContext(), \"The username already exists\", Toast.LENGTH_LONG).show();\n\t\t\t\t}\n\t\t\t\telse if (success.equals(\"true\")) {\t\t\t\t\t\n\t\t\t\t\tuserTasks = new ServerAPITask();\n\t\t\t\t\tuserTasks.setAPIRequest(\"http://riptide.alexkersten.com:3333/stoneapi/account/lookup/\" + uName);\n\t\t\t\t\t\n\t\t\t\t\tcreateResp = userTasks.execute(\"\").get();\n\t\t\t\t\tLog.e(\"Get User ID\", createResp);\n\t\t\t\t\t\n\t\t\t\t\tjsonResponse = new JSONArray(createResp);\n\t\t\t\t\tJSONObject jsObj = jsonResponse.getJSONObject(0);\n\t\t\t\t\t\n\t\t\t\t\tif (jsObj == null) {\n\t\t\t\t\t\tToast.makeText(this.getContext(), \"An error occurred while retrieving user\", Toast.LENGTH_SHORT).show();\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\tString _user_id = jsObj.getString(\"_id\");\n\t\t\t\t\t\tPreferencesUtil.saveToPrefs(userContext, PreferencesUtil.PREFS_LOGIN_USER_ID_KEY, _user_id);\n\t\t\t\t\t\tPreferencesUtil.saveToPrefs(userContext, PreferencesUtil.PREFS_LOGIN_USERNAME_KEY, uName);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn true;\n\t}", "boolean hasAccountId();", "boolean hasAccountId();", "boolean hasAccountId();", "boolean hasAccountId();", "boolean hasAccountId();", "boolean hasAccountId();", "boolean hasAccountId();", "@Test\n public void testCreateOnBehalfUser() throws Exception {\n String password = \"abcdef\";\n VOUserDetails result = idService\n .createOnBehalfUser(customer.getOrganizationId(), password);\n checkCreatedUser(result, customer, password, false);\n }", "public static void createChecking(ArrayList<Account> accounts, int id, double balance, double interestRate) throws IOException{\n CheckingAccount cAccount = new CheckingAccount(id, balance, interestRate);\r\n \r\n //add the account just created to array\r\n accounts.add(cAccount);\r\n System.out.println(\"Your account has been created. Information of your new account is below. \\n\");\r\n \r\n //get the current index of the id and print out the info\r\n int idIndex = idIndex(accounts, cAccount.getID());\r\n System.out.println(\"Account type: Checking\");\r\n accounts.get(idIndex).displayAccountInformation();\r\n }", "String addAccount(UserInfo userInfo);", "public static void requestNewAccount(String uid){\n accountManager.requestNewAccount(uid);\n }", "private void CreateUserAccount(final String lname, String lemail, String lpassword, final String lphone, final String laddress, final String groupid, final String grouppass ){\n mAuth.createUserWithEmailAndPassword(lemail,lpassword).addOnCompleteListener(this, new OnCompleteListener<AuthResult>() {\n @Override\n public void onComplete(@NonNull Task<AuthResult> task) {\n if(task.isSuccessful()){\n //account creation successful\n showMessage(\"Account Created\");\n //after user account created we need to update profile other information\n updateUserInfo(lname, pickedImgUri,lphone, laddress, groupid, grouppass, mAuth.getCurrentUser());\n }\n else{\n //account creation failed\n showMessage(\"Account creation failed\" + task.getException().getMessage());\n regBtn.setVisibility(View.VISIBLE);\n loadingProgress.setVisibility(View.INVISIBLE);\n\n }\n }\n });\n }", "@Test\n\tpublic void createAccountDebtsTest() {\n\t\tsetChequingRadioDefaultOff();\n\t\trdbtnDebt.setSelected(true);\n\t\tdata.setRdbtnDebt(rdbtnDebt);\n\t\tAccount account = data.createNewAccount();\n\t\taccountTest = new Account(TEST_ACCOUNT_NAME, bankTest,\n\t\t\t\tAccount.Types.DEBITS.getAccountType());\n\t\tassertEquals(accountTest, account);\n\t}", "private void createAccount(String username, String passphrase, String email) {\n\tif (!AccountManager.getUniqueInstance().candidateUsernameExists(username)) {\n\t try {\n\t\tAccountManager.getUniqueInstance().createCandidateAccount(username, \n\t\t\t\t\t\t\t\t\t passphrase, \n\t\t\t\t\t\t\t\t\t email);\n\t } catch (Exception e) {\n\t\tthrow new RuntimeException(\"creation failed\");\n\t }\n\t} else {\n\t throw new RuntimeException(\"username already exists\");\n\t}\n }", "BankAccount(String accountType){\n\t\tSystem.out.println(\"NEW ACCOUNT: \" + accountType);\n\t\tthis.accountType = accountType; \n\t}", "@Test\n\tpublic void getAccountTestSuccess() {\n\n\t\tString accountNumber = createAccount(\"viaks\",1000);\n\t\tMap<String, String> parametersMap = new HashMap<>();\n\t\tparametersMap.put(\"accountNumber\", accountNumber);\n\n\t\tRestAssured.given().when().parameters(parametersMap).get(\"/account\").then().assertThat().statusCode(200);\n\t}", "@Override\r\n\tpublic boolean createAccount(CustomerBean cb) {\n\t\r\n\t\treturn customerList.add(cb);\r\n\t}", "public boolean addAccount() {\r\n String update = \"INSERT INTO LOGIN VALUES('\" + this.username + \"', '\" + new MD5().md5(this.password) + \"', '\" + this.codeID + \"', N'\" + this.fullname + \"')\";\r\n return model.ConnectToSql.update(update);\r\n }", "public void openAccount(Account a) {}", "public void createAccountOnClick(View v){\n\n String email = emailTextView.getText().toString();\n String password = passwordTextView.getText().toString();\n createEmailAndPasswordAccount(email, password);\n\n }", "@Override\n public void onClick(View v) {\n CreateAccount();\n }" ]
[ "0.73140806", "0.7223947", "0.71283185", "0.6842713", "0.6816629", "0.68144506", "0.6659177", "0.6649392", "0.659907", "0.65895915", "0.6542764", "0.6526161", "0.6428114", "0.63601124", "0.6347817", "0.6318162", "0.6275739", "0.62695664", "0.6247896", "0.6233415", "0.6220047", "0.6220047", "0.6220047", "0.6161571", "0.6157648", "0.61548203", "0.6073409", "0.60716665", "0.60705876", "0.6061297", "0.60473394", "0.60373116", "0.60320634", "0.5988822", "0.5983217", "0.59774613", "0.5967375", "0.5959425", "0.5957993", "0.5957165", "0.5956823", "0.5955215", "0.5950266", "0.5949347", "0.594899", "0.5946869", "0.59416795", "0.5941082", "0.5935463", "0.5930602", "0.5920953", "0.59099734", "0.5904471", "0.58834517", "0.58714473", "0.5858723", "0.585122", "0.58502114", "0.58397466", "0.5822516", "0.58189505", "0.5817212", "0.581343", "0.58117497", "0.580884", "0.5807102", "0.58057857", "0.5800528", "0.57976985", "0.57730967", "0.5772717", "0.5772083", "0.5769177", "0.57488716", "0.5747549", "0.5745557", "0.57408655", "0.57294583", "0.57130075", "0.57117057", "0.56964123", "0.56964123", "0.56964123", "0.56964123", "0.56964123", "0.56964123", "0.56964123", "0.569627", "0.5695065", "0.56871516", "0.56824577", "0.56812376", "0.5673287", "0.5672763", "0.5671211", "0.5655659", "0.5655016", "0.5650634", "0.5650243", "0.5644579", "0.5641176" ]
0.0
-1
Instantiates a new Dictionary pair.
DictionaryPair (K someKey , V someValue) { this.key = someKey; this.value = someValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Dictionary createDictionary(){\n Dictionary dict = new Dictionary(9973);\n return dict;\n }", "public static final HashMap dict (Object ... pairs) {\r\n HashMap map = new HashMap();\r\n for (int i=0; i<pairs.length; i=i+2) {\r\n map.put(pairs[i], pairs[i+1]);\r\n }\r\n return map;\r\n }", "public Pair(Key key, Value value) {\n this.key = key;\n this.value = value;\n }", "protected Pair() {\n\t\t\n\t\tsuper(2);\n\t}", "public Pair(K key, V value){\n this.key = key;\n this.value = value;\n }", "public Pair() {\r\n\t}", "public Pair() {\n // nothing to do here\n }", "public Pair(K key, V value) {\n this.key = key;\n this.value = value;\n }", "public Pair(S n1, S n2) {\n\t\tkey1 = n1;\n\t\tkey2 = n2;\n\t}", "public Pair(K first, V second) {\r\n\t\tthis.first = first;\r\n\t\tthis.second = second;\r\n\t}", "private static <K, V> Map<K, V> newHashMap() {\n return new HashMap<K, V>();\n }", "public Hashtable<String,Stock> createMap(){\n\tHashtable table = new Hashtable<String, Stock>();\n\treturn table;\n}", "public Dictionary () {\n list = new DoubleLinkedList<>();\n this.count = 0;\n }", "public MutablePair(Pair<K, V> pair) {\n this(pair.getKey(), pair.getValue());\n }", "public static <K, V> HashMap<K, V> initHashMap() {\n\t\treturn new HashMap<K, V>();\n\t}", "CritPair createCritPair();", "public Pair(int first, int second) {\n this.first = first;\n this.second = second;\n }", "public Pair(Pair<T,V> p){\r\n this.v1 = p.v1;\r\n this.v2 = p.v2;\r\n }", "public MutablePair(Map.Entry<K, V> entry) {\n this(entry.getKey(), entry.getValue());\n }", "public Pair(T first, T second) {\r\n this.first = first;\r\n this.second = second;\r\n }", "public KeyValuePair () {\n key = null;\n value = null;\n }", "public Pair(String state, double value) {\r\n\t\tthis.key = state;\r\n\t\tthis.val = value;\r\n\t}", "KeyIdPair createKeyIdPair();", "public MagicDictionary() {\n this.map = new HashMap<>();\n }", "public CoinsuperPair() {}", "public MagicDictionary() {\n\n }", "public Pair(T v1, V v2) {\r\n this.v1 = v1;\r\n this.v2 = v2;\r\n }", "public PairImpl(F key, S value) {\n this.key = key;\n this.value = value;\n }", "public static KeyPair createKeyPair(){\n KeyPair pair = KeyPair.random();\n System.out.println(pair.getSecretSeed());\n System.out.println(pair.getAccountId());\n return pair;\n\n }", "public Pair(Object i, Object j)\n {\n a = i;\n b = j;\n }", "public Pair(X first, Y second) {\n this.first = first;\n this.second = second;\n }", "public Pair(double v1, double v2) {\n\t\t\n\t\tsuper(v1, v2);\n\t}", "public MutablePair(K key, V value) {\n this.key = key;\n this.value = value;\n }", "public Dict(Obj value) {\n this.value = value;\n }", "public Pair(String origin_id, String destination_id){\n this.origin_id = origin_id;\n this.destination_id = destination_id;\n }", "public Q706DesignHashMap() {\n keys = new ArrayList<>();\n values = new ArrayList<>();\n\n }", "public PDEncryptionDictionary()\n {\n encryptionDictionary = new COSDictionary();\n }", "public Hints(final Object key1, final Object value1,\n final Object key2, final Object value2,\n final Object... pairs)\n {\n this(key1, value1, key2, value2);\n fromPairs(pairs);\n }", "private Tuple(K key, V value) {\n this.key = key;\n this.value = value;\n }", "ParamMapEntry createParamMapEntry();", "public MyHashMap() {\n\n }", "public ClothingPair(E left, E right) {\n super(left, right);\n }", "public static <K, V> Map<K, V> createMap(K key1, V value1, K key2, V value2) {\n\t\tif (key1.equals(key2))\n\t\t\tthrow new IllegalArgumentException(\n\t\t\t\t\t\"Key1 = Key2, value1 will be overwritten! The createMap method requires unique keys.\");\n\t\tMap<K, V> map = new HashMap<K, V>();\n\t\tmap.put(key1, value1);\n\t\tmap.put(key2, value2);\n\t\treturn map;\n\t}", "private Pair(U first, V second) {\n\t\t\tthis.first = first;\n\t\t\tthis.second = second;\n\t\t}", "public void createHashMap() {\n myList = new HashMap<>();\n scrabbleList = new HashMap<>();\n }", "public MyHashMap() {\n\n }", "public MyHashMap() {\n map = new HashMap();\n }", "public static <A, B> PairImpl <A, B> create(A a, B b) {\n return new PairImpl<A, B>(a, b);\n }", "public CertificatePair(Certificate forward, Certificate reverse)\n {\n this.forward = forward;\n this.reverse = reverse;\n }", "public Pair(String one, String two, double corr) {\n word1 = one;\n word2 = two;\n correlation = corr;\n }", "public Pair(String unparsed, K parsed)\n {\n this.unparsed = unparsed;\n this.parsed = parsed;\n }", "public DictionaryAdapter(Map<String,String> dict) {\n mData = new ArrayList();\n mData.addAll(dict.entrySet());\n }", "private void createHashtable()\n {\n int numLanguages = languages.length;\n mapping = new Hashtable(numLanguages, 1.0f);\n for (int i = 0; i < numLanguages; i++)\n mapping.put(languages[i], values[i]);\n }", "public MapNode(\n\t\tMap<String, AbstractNode>\tpairs)\n\t{\n\t\t// Call alternative constructor\n\t\tthis(null, pairs);\n\t}", "public static <K, V> MutablePair<K, V> of(Pair<K, V> pair) {\n return new MutablePair<>(pair);\n }", "public Dictionary () {\n\t\tsuper();\n\t\t//words = new ArrayList < String > () ;\n\t}", "public Dictionary(String dataname, String username){\n this(dataname, null, username);\n }", "public MyHashMap() {\n this.key_space = 2069;\n this.hash_table = new ArrayList<Bucket>();\n for (int i = 0; i < this.key_space; ++i) {\n this.hash_table.add(new Bucket());\n }\n }", "private DictionaryReader() {}", "public static <K, V> Map<K, V> createMap(K key1, V value1, K key2, V value2, K key3, V value3) {\n\t\tMap<K, V> map = new HashMap<K, V>();\n\t\tmap.put(key1, value1);\n\t\tmap.put(key2, value2);\n\t\tmap.put(key3, value3);\n\t\treturn map;\n\t}", "@Override HashMapEntry<K, V> constructorNewEntry(\n K key, V value, int hash, HashMapEntry<K, V> next) {\n LinkedEntry<K, V> header = this.header;\n LinkedEntry<K, V> oldTail = header.prv;\n LinkedEntry<K, V> newTail\n = new LinkedEntry<K,V>(key, value, hash, next, header, oldTail);\n return oldTail.nxt = header.prv = newTail;\n }", "@Override\n public Map makeMap() {\n Map<Integer,String> testMap = new HashingMap<>();\n return testMap;\n }", "public MapNode(\n\t\tIterable<? extends Pair>\tpairs)\n\t{\n\t\t// Call alternative constructor\n\t\tthis(null, pairs);\n\t}", "public Dictionary()\n\t{\n\t\tfor(Character i = 97; i<=122;i++)\n\t\t\tthis.put(i,new ArrayList<DictionaryElement>());\n\t\t\t\n\t}", "MapBuilder<K,V> pairInjection(Injection<OrderedPair<K,V>, byte[]> pairInjection);", "public void createDictionary() \n {\n dictionary = new HashMap<String, Map<String, String>>();\n \n addTranslations(\n \"EN\", // Language code\n \"OK\", \"Ok\",\n \"UPDATE\", \"Update\",\n \"OPEN\", \"Open\",\n \"CLOSE\", \"Close\",\n \"CANCEL\", \"Cancel\",\n \"MESSAGES\", \"Messages\",\n \"NO_MESSAGES_TO_DISPLAY\", \"No messages to display\",\n \"EVALUATE\", \"Evaluate\",\n \"RUN\", \"Run\",\n \"RUN_AS_ACTIVITY\", \"Run Activity\",\n \"OPEN_SCRIPT\", \"Open script\",\n \"START_SERVER\", \"Start server\",\n \"STOP_SERVER\", \"Stop server\",\n \"SHOW_MESSAGES\", \"Messages\",\n \"UPDATE_APP_SCRIPTS\", \"Update\",\n \"THIS_WILL_OVERWRITE_ALL_APP_SCRIPTS\", \"This will overwrite all application scripts!\",\n \"ENTER_FILE_OR_URL\", \"Enter file or url:\",\n \"UPDATE_APP_SCRIPTS_DONE\", \"Update complete!\",\n \"UPDATE_APP_SCRIPTS_DONE_RESTART\", \"Restart the application to make changes take effect\",\n \"QUIT_APP\", \"Quit\",\n \"CLOSE\", \"Close\",\n \"BE_KIND\", \"Be kind\",\n \"BE_KIND_MESSAGE\", \"Be a kind person\"\n );\n }", "public Dictionary(){\n root = null;\n numItems = 0;\n }", "public Tuple(K newKey, V newValue) {\r\n\t\tkey = newKey;\r\n\t\tvalue = newValue;\r\n\t}", "public static <K, V> MutablePair<K, V> of(Map.Entry<K, V> entry) {\n return new MutablePair<>(entry);\n }", "public Dictionary() throws IOException {\r\n\t\tthis(FILE_NAME);\r\n\t}", "public static <K, V> MapBuilder<HashMap<K, V>, K, V> hashMap()\n {\n return new MapBuilder<HashMap<K, V>, K, V>(new HashMap<K, V>());\n }", "public Dictionary(){\n front = null;\n numItems = 0;\n }", "protected SafeHashMap.Entry<K, V> instantiateEntry()\n {\n return new Entry<>();\n }", "public Pair(Card firstCard, Card secondCard){\r\n this.firstCard = firstCard;\r\n this.secondCard = secondCard;\r\n }", "public Pair(Object exchange, PairType type) {\n\t\tthis.exchange = exchange;\n\t\tthis.type = type;\n\t}", "public void setPair(String key, String definition){\n\t\tpair = new Model(key, definition);\n\t}", "public Dictionary(String filename) throws IOException {\r\n\t\tFile dFile = new File(filename);\r\n\t\tFileReader fr = new FileReader(dFile);\r\n\t\tnew BufferedReader(fr).lines().forEach(e -> dict.add(e));\r\n\t\tfr.close();\r\n\t}", "public EntityPair(int entity1, int entity2) {\n\t \n\t this.entity1 = entity1;\n\t this.entity2 = entity2;\n }", "FutureSecureMap<KeyType, ValueType> create(String name);", "private IMapData<Integer, String> getHashMapData2() {\n List<IKeyValueNode<Integer, String>> creationData = ArrayLists.make(\n KeyValueNode.make(1, \"a\"),\n KeyValueNode.make(1, \"a\"),\n KeyValueNode.make(2, \"b\"),\n KeyValueNode.make(2, \"c\"),\n KeyValueNode.make(2, \"b\"),\n KeyValueNode.make(3, \"a\"),\n KeyValueNode.make(3, \"b\"),\n KeyValueNode.make(3, \"c\"));\n\n List<IKeyValueNode<Integer, String>> data = ArrayLists.make(\n KeyValueNode.make(1, \"a\"),\n KeyValueNode.make(2, \"b\"),\n KeyValueNode.make(3, \"c\"));\n\n List<Integer> keys = this.createKeys(data);\n List<String> values = this.createValues(data);\n\n return new MapData<>(\n creationData,\n data,\n keys,\n values);\n }", "public CVectorPair(double x1, double y1, double x2, double y2) {\n\tthis(new CVector(x1, y1), new CVector(x2, y2));\n }", "public OrderedPair(int x, int y) {\n this.x = x;\n this.y = y;\n }", "private static Map<String, String> createPropertiesAttrib() {\r\n Map<String, String> map = new HashMap<String, String>();\r\n map.put(\"Property1\", \"Value1SA\");\r\n map.put(\"Property3\", \"Value3SA\");\r\n return map;\r\n }", "@Contract(value = \" -> new\", pure = true)\n @Nonnull\n public static <K, V> Map<K, V> createSoftValueMap() {\n return new SoftValueHashMap<>(canonicalStrategy());\n }", "public Hints(final Object key1, final Object value1,\n final Object key2, final Object value2)\n {\n this (key1, value1);\n super.put(key2, value2);\n }", "public void initializeDictionary() {\n\t\tmyDictionary = new SLogoDictionary();\n\t}", "public PDEncryptionDictionary(COSDictionary d)\n {\n encryptionDictionary = d;\n }", "public WordDictionary() {\n }", "protected SafeHashMap.Entry instantiateEntry()\n {\n return new Entry();\n }", "static <K extends Comparable<? super K>, V> KeyValue<K, V> make(K key, V value) {\n return new Tuple<>(key, value);\n }", "public ValueMap(final String keyValuePairs)\n\t{\n\t\tthis(keyValuePairs, \",\");\n\t}", "public MagicDictionary() {\n root=new Node();\n }", "public static <K, V> MutablePair<K, V> of(K key, V value) {\n return new MutablePair<>(key, value);\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 ScopedMap() {\n\t\tmap = new ArrayList<HashMap<K, V>>();\n\n\t}", "public Pair(Object first, Object rest) {\n\t\tthis.first = first; this.rest = rest;\n\t}", "public TreeDictionary() {\n\t\t\n\t}", "public DictionaryModuleImpl() {\r\n }", "public ChainedHashDictionary() {\r\n this.capacity = 31;\r\n this.load = 0;\r\n this.chains = makeArrayOfChains(capacity);\r\n }", "protected Map createPropertiesMap() {\n return new HashMap();\n }" ]
[ "0.7101338", "0.68039674", "0.6574625", "0.6433278", "0.6343924", "0.62561226", "0.62349534", "0.6229912", "0.6176179", "0.6165443", "0.6002332", "0.5954013", "0.5917588", "0.58613664", "0.5851697", "0.5770473", "0.5721529", "0.5720304", "0.5714059", "0.5684827", "0.56767493", "0.56587136", "0.5635891", "0.5602667", "0.55916846", "0.55874723", "0.5585827", "0.55842346", "0.55653024", "0.55344516", "0.55290276", "0.5527474", "0.54985785", "0.54925114", "0.5485846", "0.5465848", "0.54540896", "0.54429233", "0.5423901", "0.5415212", "0.53624153", "0.53603953", "0.5353372", "0.5349212", "0.53454804", "0.53226495", "0.531947", "0.53123975", "0.52981216", "0.5289189", "0.52877307", "0.52765536", "0.52643967", "0.52618915", "0.5255297", "0.52412385", "0.5236865", "0.52359444", "0.52251184", "0.521985", "0.52102387", "0.52084386", "0.52023697", "0.5197811", "0.5190591", "0.51829845", "0.51826364", "0.51718885", "0.5150318", "0.51485336", "0.51457214", "0.5130914", "0.51279193", "0.5126407", "0.5126059", "0.5123459", "0.5121214", "0.5102356", "0.51003957", "0.50905794", "0.5087241", "0.5083895", "0.50545853", "0.5053302", "0.5053231", "0.504532", "0.5036188", "0.50334716", "0.5033328", "0.50308055", "0.50197124", "0.5014368", "0.5007056", "0.5003673", "0.5001897", "0.4998518", "0.49976838", "0.4993531", "0.49919182", "0.4989289" ]
0.71542233
0
Sets key. Actually, we don't use this function.
public void setKey(K newKey) { this.key = newKey; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "void setKey(java.lang.String key);", "void setKey(final String key);", "private void setKey(String key) {\n this.key = key;\n }", "void setKey(String key);", "public void setKey(final String key);", "public void setKey(final String key);", "private void setKey(String key){\n\t\tthis.key=key;\n\t}", "public void setKey(Key key) {\n this.key = key;\n }", "protected void setKey(String key) {\r\n this.key = key;\r\n }", "void setKey(K key);", "public void setKey(String key) {\r\n this.key = key;\r\n }", "public void setKey(String key) {\n\t\tthis.key = key;\n\t}", "public void setKey(String key) {\n this.key = key;\n }", "public void setKey(String key) {\r\n\t\tthis.key = key;\r\n\t}", "public void setKey(int key);", "public void setKey(int key);", "public void setKey(String key) {\n this.key = key;\n }", "public void setKey(String key) {\n this.key = key;\n }", "public void setKey(String key) {\n this.key = key;\n }", "public final void setKey(String key) {\n this.key = key;\n }", "public void setKey(String key) {\n\n this.key = key;\n }", "public void setKey(String key)\r\n {\r\n m_key = key;\r\n }", "public void setKey(int key){\r\n this.key = key; \r\n }", "public void setKey(String key) {\n\t\tthis.key = key;\n\t}", "public void setKey(String key) {\n\t\tthis.key = key;\n\t}", "public void setKey(final String key) {\n this.key = key;\n }", "public void setKey (K k) {\n key = k;\n }", "public void setKey(java.lang.String key) {\n\t\tthis.key = key;\n\t}", "void setKey(int key);", "public void _setKey(String e)\n {\n _key = e;\n }", "public void setKey(char key){ this.key = key;}", "private void setKey() {\n\t\t \n\t}", "public void setKey(String key) {\n if (element != null) {\n element.setKey(key);\n }\n }", "public void setKey(K newKey) {\r\n\t\tkey = newKey;\r\n\t}", "public void setKey( Long key ) {\n this.key = key ;\n }", "public void setKey(com.coda.www.efinance.schemas.elementmaster.ElmFullKey key) {\r\n this.key = key;\r\n }", "public void setKey(String aKey) {\n\t\tthis.key = aKey;\n\t}", "public K setKey(K key);", "@Override\n public void setKey(byte[] key) {\n }", "public void setKey(MessageKey key) {\n\tthis.key = key;\n }", "public void set(String newKey)\n\t{\n\t\tthis.Key = newKey;\n\t}", "public void setKey(TableKey key) {\n\tthis.key = key;\n }", "String setKey(String newKey);", "void setKey(int i, int key);", "@Override\n\tpublic ManagedFunctionObjectTypeBuilder<M> setKey(M key) {\n\t\tthis.key = key;\n\t\tthis.index = key.ordinal();\n\t\treturn this;\n\t}", "public void setKey(byte[] argKey) {\n this.key = argKey;\n }", "public void setKey(Boolean key) {\n this.key = key;\n }", "public void setKey(java.lang.String param){\n localKeyTracker = true;\n \n this.localKey=param;\n \n\n }", "void setKey(int key) {\n if (key < 0) {\n throw new IllegalArgumentException(String.format(\"Error: key (%d) < 0\\n\", key));\n } else {\n this.key = key;\n }\n }", "public void setKey(SelectionKey key) {\n this._key = key;\n }", "public void setItskey(String newItskey) {\n keyTextField.setText(newItskey);\n itskey = newItskey;\n }", "public void setKey(String key) {\n this.key = key == null ? null : key.trim();\n }", "public void setKey(String key) {\n this.key = key == null ? null : key.trim();\n }", "protected void setSearchKey(Key key)\n\t{\n\t\tint last_idx = _searchKeyList.size() - 1 ;\n\t\t_searchKeyList.set(last_idx, key) ;\n\t}", "public void setKey(int position,int key) {\r\n\t\tthis.treeKey[position]=key;\r\n\t}", "@Override public void setKey(IndexKey key) {\n listOfKeys.add(key);\n\n }", "public static void setUserKey(Key newKey) {\n\t\tlocalKey.set(newKey);\n\t}", "public void setKey(KeyField key)\n\tthrows SdpException {\n\tif (key == null)\n\t throw new SdpException(\"The key is null\");\n\tsetKeyField(key);\n }", "private native void switchKey(String newKey);", "public void setKey(String s){\n this.key = s;\n this.blockLen = s.length();\n }", "public void setKey(String e)\n {\n ScControlRegistry r;\n r = getRegistry();\n r.unregister(this);\n\n _key = e;\n r.register(this);\n }", "void setKeyNumber(int number)\r\n {\r\n number_of_key = number;\r\n }", "public void setKeyField(KeyField k) {\n\tkeyField = k;\n }", "@Test\n public void testSetKey() {\n Integer key = 12;\n AVLNode<Integer> instance = new AVLNode<> ();\n instance.setKey( key );\n assertEquals( instance.getKey(), key );\n }", "public void setKey(String key) throws ClientException {\n Pattern pattern = Pattern.compile(KEY_REGEX);\n Matcher matcher = pattern.matcher(key);\n\n if (matcher.matches()) {\n this.key = key;\n } else {\n throw new ClientException(\"your key is invalid\", OSSErrorCode.INVALID_ARGUMENT, null);\n }\n }", "public void setEventKey(final EventKey val) {\n eventKey = val;\n }", "public static void setKey(byte[] key) {\n SquareAttack.key = key.clone();\n MainFrame.printToConsole(\"Chosen key:\");\n for (byte b : key) {\n MainFrame.printToConsole(\" \".concat(MainFrame.byteToHex(b)));\n }\n MainFrame.printToConsole(\"\\n\");\n }", "public void setKeyData(String keyData)\n\t{\n\t\tthis.keyData = keyData;\n\t}", "public void set(String key, Object value) {\n set(key, value, 0);\n }", "public Builder setKey(\n java.lang.String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n \n key_ = value;\n onChanged();\n return this;\n }", "public Builder setKey(\n String value) {\n if (value == null) {\n throw new NullPointerException();\n }\n bitField0_ |= 0x00000001;\n key_ = value;\n onChanged();\n return this;\n }", "final void set(String key, String value) {\n set(key, value, false);\n }", "@Override\n @NonNull\n public SliceActionImpl setKey(@NonNull String key) {\n mActionKey = key;\n return this;\n }", "public void setKeyBytes(byte[] key){\n\t\t\n\t\tsetKey(new String(key));\n\t}", "public void setKey(String nkey) {\r\n setAttribute(\"id\", nkey);\r\n }", "void setObjectKey(String objectKey);", "public void setIdkey(String pIdkey){\n this.idkey = pIdkey;\n }", "public void setKey(String symKey) {\n this.symKey = symKey;\n }", "void xsetKey(org.apache.xmlbeans.XmlNMTOKEN key);", "public void setKeyName(String newName){\n\n //assigns the value newName to the keyName field\n this.keyName = newName;\n }", "final <T> void set(String key, T value) {\n set(key, value, false);\n }", "public void put(String key) {\n\t root = put(root, key, 0);\n\t }", "String setKey(String keyName, String value, KeyOptions opts)\n throws P4JavaException;", "public void setKey (String key, int value) {\n this.diccionario = new Diccionario(key,value);\n }", "public void setKey(int nKey){\n\t\tkey = clamp(nKey, MINKEY, MAXKEY);\n\t}", "public void setValue(CharSequence... key) {\n\t\tthis.isExist();\n\t\tthis.element.clear();\n\t\tthis.element.sendKeys(key);\t\t\n\t}", "void set(K key, V value);", "public void setKeyJump(final int key) {\n jumpKey = key;\n }", "public abstract void set(String key, T data);", "void setAuthInfoKey(Object key);", "public void setKeyId(String keyId) {\n setProperty(KEY_ID, keyId);\n }", "public final void setKeyId(int keyId)\r\n\t{\r\n\t\tthis.keyId = keyId;\r\n\t}", "public void setPermissionKey(String key){\r\n\t\tFactoryUtil.setPermissionKey(key);\r\n\t}", "protected void setGroupKey(Key key)\n\t{\n\t\tfor (int i = 0; i < _searchKeyList.size(); i++)\n\t\t{\n\t\t\tKey ky = (Key)_searchKeyList.get(i) ;\n\t\t\tif (ky.getTableColumn().equals(key.getTableColumn()))\n\t\t\t{\n\t\t\t\tky.setTableGroup(key.getTableGroup()) ;\n\t\t\t\t_searchKeyList.set(i, ky) ;\n\t\t\t\tbreak ;\n\t\t\t}\n\t\t}\n\t}", "public void set_a_key(int selected_user_key) {\n switch (selected_user_key) {\n case 0:\n DES_key = key_k0;\n break;\n case 3:\n DES_key = key_k3;\n break;\n case 5:\n DES_key = key_k5;\n break;\n case 6:\n DES_key = key_k6;\n break;\n case 9:\n DES_key = key_k9;\n break;\n case 10:\n DES_key = key_k10;\n break;\n case 12:\n DES_key = key_k12;\n break;\n case 15:\n DES_key = key_k15;\n break;\n case 16:\n DES_key = key_user;\n break;\n // default: DES_key = key_Schneier;\n }\n }", "public Builder key(String key) {\n this.key = key;\n return this;\n }", "public void set(String key, Object value) {\r\n\t\tthis.context.setValue(key, value);\r\n\t}", "public void setKeyPressed(int keyCode){\n this.keys[keyCode] = true;\n\n }", "@Transient\n public void setCacheKey(String key) {\n String keyVals[];\n if(key.contains(\".\")) {\n keyVals = key.split(\".\");\n } else {\n keyVals = new String[] {key};\n }\n this.setTableName(keyVals[0]);\n }", "public Builder setKey(int value) {\n bitField0_ |= 0x00000001;\n key_ = value;\n onChanged();\n return this;\n }" ]
[ "0.83833957", "0.8341458", "0.83083117", "0.83046573", "0.8302332", "0.8302332", "0.82819116", "0.82662946", "0.8229606", "0.81961906", "0.8171741", "0.8119748", "0.8111704", "0.81113297", "0.8081525", "0.8081525", "0.8068404", "0.8068404", "0.8068404", "0.806707", "0.8066728", "0.80531186", "0.8049915", "0.8036107", "0.8036107", "0.7939105", "0.79231626", "0.79196256", "0.7888264", "0.7697333", "0.7648933", "0.7648178", "0.763145", "0.75903803", "0.75518036", "0.7550065", "0.75269663", "0.7501755", "0.7483754", "0.7482495", "0.74263954", "0.73876286", "0.7380138", "0.736711", "0.7302135", "0.7282442", "0.7266889", "0.7265999", "0.7213818", "0.72089493", "0.7110865", "0.71011186", "0.71011186", "0.70899", "0.694034", "0.6913432", "0.691236", "0.6909058", "0.68807465", "0.6874415", "0.68253696", "0.676413", "0.675707", "0.67531735", "0.67241627", "0.6685012", "0.66580224", "0.6632315", "0.6627113", "0.6627036", "0.66250235", "0.66206425", "0.66193557", "0.660328", "0.6596463", "0.6578628", "0.65554017", "0.65403426", "0.6538295", "0.65337896", "0.6533415", "0.65307826", "0.65296507", "0.6526357", "0.6523345", "0.6508508", "0.6497004", "0.6489141", "0.6483341", "0.64799494", "0.64716214", "0.6468737", "0.6449068", "0.64303666", "0.64149046", "0.6407325", "0.6397185", "0.638961", "0.63685024", "0.6363887" ]
0.7476585
40
Sets new value via key.
public void setValue(V newValue) { this.value = newValue; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setValue(K key, V value);", "void set(K key, V value);", "void set(String key, Object value);", "public void set(String key, Object value) {\n set(key, value, 0);\n }", "public void set(String key, Object value) {\r\n\t\tthis.context.setValue(key, value);\r\n\t}", "final <T> void set(String key, T value) {\n set(key, value, false);\n }", "final void set(String key, String value) {\n set(key, value, false);\n }", "public abstract void set(String key, T data);", "public void set(String newKey)\n\t{\n\t\tthis.Key = newKey;\n\t}", "void setKey(K key);", "public void setValue(K key, V value) {\n this.add(key, value);\n }", "abstract protected DataValue updateValue(String key);", "void setKey(final String key);", "public void setKey(Key key) {\n this.key = key;\n }", "void setKey(String key);", "public void setData(@NotNull String key, @NotNull Object value) {\n data.put(key, value);\n }", "public void setKey(final String key);", "public void setKey(final String key);", "public void setKey (K k) {\n key = k;\n }", "public void setKey(K newKey) {\r\n\t\tkey = newKey;\r\n\t}", "void setKey(java.lang.String key);", "protected void setKey(String key) {\r\n this.key = key;\r\n }", "private void setKey(String key) {\n this.key = key;\n }", "public static void set(String key, String value) {\n stringRedisTemplate.opsForValue().set(key, value);\n }", "public void setKey(K newKey) {\n this.key = newKey;\n }", "public <T> void setValue (String key, T value)\n\t{\n\t\tproperties.get(key).value.setValue(value);\n\t}", "public void setData(String key, String value) {\r\n\t\tdata.put(key, value);\r\n\t}", "private void setKey(String key){\n\t\tthis.key=key;\n\t}", "public void setKey(String key) {\n this.key = key;\n }", "public final void set(final String key, final Object value) {\n try {\n synchronized (jo) {\n if (value == null) {\n jo.remove(key);\n } else {\n jo.put(key, value);\n }\n }\n } catch (JSONException e) {\n }\n }", "public void setKey(String key) {\r\n this.key = key;\r\n }", "public void put(String key, E value) {\n getOrCreateNode(key).data = value;\n }", "public void put(String key, T value) {\r\n\t\troot = put (root, key, value, 0);\r\n\t}", "boolean setValue(String type, String key, String value);", "public void update (String key_val, String val)\n {\n }", "public void put(Key key, Value val);", "public void put(String key, Object value)\n\t{\n\t\tverifyParseState();\n\t\tvalues.put(key, ValueUtil.createValue(value));\n\t}", "public JbootVoModel set(String key, Object value) {\n super.put(key, value);\n return this;\n }", "public final void setKey(String key) {\n this.key = key;\n }", "void putValue(String key, Object data);", "public void setKey(String key) {\n\n this.key = key;\n }", "void put(K key, V value);", "void put(K key, V value);", "public void setKey(String key) {\n this.key = key;\n }", "public void setKey(String key) {\n this.key = key;\n }", "public void setKey(String key) {\n this.key = key;\n }", "protected void set(String key, String value)\r\n\t{ this.preferences.put(key, value); }", "protected abstract void put(K key, V value);", "public void setKey(String key)\r\n {\r\n m_key = key;\r\n }", "public void putKV(String key, String value) throws Exception;", "public Value set(Value key, Value value) {\n\t\tif (get(key) != null)\n\t\t\tput(key, value);\n\t\telse if (parent != null)\n\t\t\tparent.put(key, value);\n\t\telse\n\t\t\tput(key, value);\n\t\treturn value;\n\t}", "public void setKey(String key) {\r\n\t\tthis.key = key;\r\n\t}", "public void setKey(String key) {\n\t\tthis.key = key;\n\t}", "public void set(K key, V val) {\n\t\tif (exists(key)) {\n\t\t\tmoveToTail(key);\n\t\t\ttail.val = val;\n\t\t} else {\n\t\t\tKVNode<K, V> node = new KVNode<K, V>(key, val);\n\t\t\tsize++;\n\t\t\ttail.next = node;\n\t\t\tkeyToPrev.put(key, tail);\n\t\t\ttail = node;\n\n\t\t\tif (size > capacity) {\n\t\t\t\tKVNode<K, V> first = head.next;\n\t\t\t\thead.next = first.next;\n\t\t\t\tkeyToPrev.remove(first.key);\n\t\t\t\tsize--;\n\t\t\t}\n\n\t\t}\n\t}", "public void setDataValue(String key, Object value) {\n\t\t if (value == null) {\n\t\t\t data.remove(key);\n\t\t }else {\n\t\t\t data.put(key, value);\n\t\t }\n\t }", "public void put(String key) {\n\t root = put(root, key, 0);\n\t }", "public void setKey(int key);", "public void setKey(int key);", "public void set(R key, List<S> value){\n map.remove(key);\n map.put(key, value);\n }", "public Value put(Key key, Value thing) ;", "public void setKey(int key){\r\n this.key = key; \r\n }", "Object put(Object key, Object value);", "public void setKey(String key) {\n\t\tthis.key = key;\n\t}", "public void setKey(String key) {\n\t\tthis.key = key;\n\t}", "String setKey(String newKey);", "public void setValue(CharSequence... key) {\n\t\tthis.isExist();\n\t\tthis.element.clear();\n\t\tthis.element.sendKeys(key);\t\t\n\t}", "public void put(String key, Value val) {\n root = put(root, key, 0, val);\n }", "public void setKey(final String key) {\n this.key = key;\n }", "public void put(Value key, Value value) {\n\t\tstorage.put(key, value);\n\t}", "void put(@NonNull String key, @NonNull T value);", "V put(final K key, final V value);", "void put(String key, Object value);", "public void put(Key key,Value value){\n\t\troot = insert(root,key,value);\n\t}", "@Override\n public void putValue(String key, Object value) {\n\n }", "public void setKey( Long key ) {\n this.key = key ;\n }", "public K setKey(K key);", "public void put(final Book key, final String value) {\n root = put(root, key, value);\n }", "@Override\n public void put(K key, V value) {\n root = put(root, key, value);\n }", "public void set(K key, V value)\n {\n // If there are too many entries, expand the table.\n if (this.size > (this.buckets.length * LOAD_FACTOR))\n {\n expand();\n } // if there are too many entries\n // Find out where the key belongs.\n int index = this.find(key);\n // Create a new association list, if necessary.\n if (buckets[index] == null)\n {\n this.buckets[index] = new AssociationList<K, V>();\n } // if (buckets[index] == null)\n // Add the entry.\n AssociationList<K, V> bucket = this.get(index);\n int oldsize = bucket.size;\n bucket.set(key, value);\n // Update the size\n this.size += bucket.size - oldsize;\n }", "protected void setSearchKey(Key key)\n\t{\n\t\tint last_idx = _searchKeyList.size() - 1 ;\n\t\t_searchKeyList.set(last_idx, key) ;\n\t}", "public void put(Key key, Value value) {\n\t\tNode entry = new Node(key, value, current_node);\n\t\tcurrent_node = entry; size++;\n\t}", "public void put(K key, V value) {\r\n size++;\r\n checkAndModifySize();\r\n\r\n Node newElement = new Node(key, value);\r\n int currentHash = newElement.hash % data.length;\r\n if (currentHash < 0){\r\n currentHash *= -1;\r\n }\r\n\r\n if (data[currentHash] == null) {\r\n data[currentHash] = newElement;\r\n } else {\r\n Node currentElement = data[currentHash];\r\n while (currentElement.next != null) {\r\n if (currentElement.key == key || currentElement.key.equals(key)) {\r\n currentElement.value = value;\r\n size--;\r\n return;\r\n }\r\n currentElement = currentElement.next;\r\n }\r\n currentElement.next = newElement;\r\n }\r\n }", "public abstract V put(K key, V value);", "public void set(String key, String value){\n\t\tif(first == null){\n\t\t\tfirst = new ListMapEntry(key, value);\n\t\t}\n\t\tListMapEntry temp = first;\n\t\tListMapEntry prev = null;\n\t\twhile(temp!=null && !temp.getKey().equals(key)){\n\t\t\tprev = temp;\n\t\t\ttemp = temp.getNext();\n\t\t}\n\t\tif(temp==null){\n\t\t\tprev.setNext(new ListMapEntry(key, value));\n\t\t}\n\t\telse{\n\t\t\ttemp.setValue(value);\n\t\t}\n\t}", "V put(K key, V value);", "@Override\n public void put(K key, V value) {\n root = putHelper(key,value,root);\n }", "public V put(K key, V value) throws InvalidKeyException;", "public void set(String key, String value) {\n if (key.indexOf('=') != -1 || key.indexOf(';') != -1) {\n Log.e(TAG, \"Key \\\"\" + key + \"\\\" contains invalid character (= or ;)\");\n return;\n }\n if (value.indexOf('=') != -1 || value.indexOf(';') != -1) {\n Log.e(TAG, \"Value \\\"\" + value + \"\\\" contains invalid character (= or ;)\");\n return;\n }\n\n mMap.put(key, value);\n }", "public void put(String key, String value)\n\t{\n\t\tverifyParseState();\n\t\tvalues.put(key, ValueUtil.createValue(value));\n\t}", "public V put(K key, V value);", "public boolean put(String key, String value);", "public <T> void set(String key, T value, Class<T> type) {\n this.data.put(key, value);\n }", "void setInt(String key, int val);", "public void setKey(java.lang.String key) {\n\t\tthis.key = key;\n\t}", "public static void setUserKey(Key newKey) {\n\t\tlocalKey.set(newKey);\n\t}", "void setKey(int key);", "public void put(String key, T value);", "public void onChange(String key, String value) throws Exception;", "final <T> void set(String key, T value, boolean commit) {\n if ( value == null ) {\n remove(key, commit);\n }\n else {\n set(key, value.toString(), commit);\n }\n }", "public void setValue(String key, Object value)\n {\n if (value != null)\n {\n if (otherDetails == null)\n {\n otherDetails = new Hashtable();\n }\n\n otherDetails.put(key, value);\n }\n }", "private void put(K key, V value) {\n\t\t\tif (key == null || value == null)\n\t\t\t\treturn;\n\t\t\telse if (keySet.contains(key)) {\n\t\t\t\tvalueSet.set(keySet.indexOf(key), value);\n\t\t\t} else {\n\t\t\t\tkeySet.add(key);\n\t\t\t\tvalueSet.add(keySet.indexOf(key), value);\n\t\t\t\tsize++;\n\t\t\t}\n\t\t}" ]
[ "0.8000552", "0.7963359", "0.75919294", "0.75058055", "0.7436106", "0.7349112", "0.7337807", "0.72984815", "0.7286553", "0.723537", "0.7155324", "0.71493953", "0.710588", "0.70861655", "0.7070242", "0.70453584", "0.7031449", "0.7031449", "0.7021766", "0.70178306", "0.70132625", "0.69718176", "0.6962818", "0.69468576", "0.6940773", "0.69299775", "0.6914147", "0.6904736", "0.688862", "0.6880398", "0.68777466", "0.68746907", "0.68572724", "0.6854222", "0.6853903", "0.6849249", "0.6840645", "0.6836142", "0.68069637", "0.68042785", "0.6791491", "0.6783314", "0.6783314", "0.6781861", "0.6781861", "0.6781861", "0.67739916", "0.6769515", "0.6759558", "0.67574084", "0.6752926", "0.6740557", "0.6732583", "0.6729196", "0.6712178", "0.67106354", "0.6703429", "0.6703429", "0.66972595", "0.6687575", "0.66831416", "0.66811633", "0.66811234", "0.66811234", "0.66776425", "0.6670476", "0.6664909", "0.6663974", "0.66566336", "0.6650558", "0.6650322", "0.6648839", "0.6647923", "0.66371465", "0.66339487", "0.66335225", "0.66222405", "0.6618956", "0.6618804", "0.6609926", "0.660952", "0.66086185", "0.6604711", "0.66036713", "0.65976423", "0.65974873", "0.6595174", "0.6589706", "0.65820026", "0.65631896", "0.6560339", "0.6552557", "0.6549445", "0.65415424", "0.65314496", "0.65293324", "0.6524466", "0.65207076", "0.6502482", "0.6497466", "0.64918196" ]
0.0
-1
Compare two keys same or not.
@Override public int compareTo(DictionaryPair o) { return this.key.compareTo(o.key); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof Acquirente)) {\n return false;\n }\n Acquirente that = (Acquirente) other;\n if (this.getIdacquirente() != that.getIdacquirente()) {\n return false;\n }\n return true;\n }", "protected abstract boolean equalityTest(Object key, Object key2);", "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 }", "private boolean equalKeys(Object other) {\r\n if (this == other) {\r\n return true;\r\n }\r\n if (!(other instanceof Contacto)) {\r\n return false;\r\n }\r\n Contacto that = (Contacto) other;\r\n if (this.getIdContacto() != that.getIdContacto()) {\r\n return false;\r\n }\r\n return true;\r\n }", "private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof User)) {\n return false;\n }\n User that = (User) other;\n if (this.getIduser() != that.getIduser()) {\n return false;\n }\n return true;\n }", "private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof BlastingtypeRelationsAud)) {\n return false;\n }\n BlastingtypeRelationsAud that = (BlastingtypeRelationsAud) other;\n Object myBtrAudUid = this.getBtrAudUid();\n Object yourBtrAudUid = that.getBtrAudUid();\n if (myBtrAudUid==null ? yourBtrAudUid!=null : !myBtrAudUid.equals(yourBtrAudUid)) {\n return false;\n }\n return true;\n }", "private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof ApptranregFeesAud)) {\n return false;\n }\n ApptranregFeesAud that = (ApptranregFeesAud) other;\n Object myAtrfAudUid = this.getAtrfAudUid();\n Object yourAtrfAudUid = that.getAtrfAudUid();\n if (myAtrfAudUid==null ? yourAtrfAudUid!=null : !myAtrfAudUid.equals(yourAtrfAudUid)) {\n return false;\n }\n return true;\n }", "@Test\n\tpublic void equalsSimilarObjects() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tboolean equals = key1.equals(key2);\n\t\tSystem.out.println();\n\t\tAssert.assertTrue(equals);\n\t}", "private boolean equalKeys(Object other) {\n if (this==other) {\n return true;\n }\n if (!(other instanceof RegistrationItems)) {\n return false;\n }\n RegistrationItems that = (RegistrationItems) other;\n Object myRegItemUid = this.getRegItemUid();\n Object yourRegItemUid = that.getRegItemUid();\n if (myRegItemUid==null ? yourRegItemUid!=null : !myRegItemUid.equals(yourRegItemUid)) {\n return false;\n }\n return true;\n }", "public boolean haveSameKeys(Tree<K, V> otherTree) {\n\t\tif (this.size() != otherTree.size()) {\n\t\t\treturn false;\n\t\t} else {\n\t\t\tTree<K, V> t = this;\n\t\t\tboolean sameKey = true;\n\t\t\treturn haveSameKeys(t, otherTree, sameKey);\n\t\t}\n\t}", "public boolean keyEquals(Entry<K, V> other) {\n return key.equals(other.key);\n }", "private static void compareForIdenticalKeys() {\n Integer[] identical = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1};\n\n Insertion insertion = new Insertion();\n insertion.analyzeSort(identical);\n insertion.getStat().printReport();\n\n Selection selection = new Selection();\n selection.analyzeSort(identical);\n selection.getStat().printReport();\n }", "protected boolean equalityTest(Object key, Object key2) {\n\t\t\treturn this.set.equalityTest(key, key2);\n\t\t}", "public boolean haveSameKeys(Tree<K, V> t, Tree<K, V> otherTree,\n\t\t\tboolean sameKey) {\n\t\tif (!sameKey) {\n\t\t\treturn false;\n\t\t} else if (otherTree.lookup(key) == null) {\n\t\t\tsameKey = false;\n\t\t} else {\n\t\t\tsameKey = left.haveSameKeys(left, otherTree, sameKey);\n\t\t\tsameKey = right.haveSameKeys(right, otherTree, sameKey);\n\t\t}\n\t\treturn sameKey;\n\t}", "@Test\n public void equalsWithDifferentName() throws Exception {\n AttributeKey<Number> key1 = new AttributeKey<Number>(Number.class, \"key1\");\n AttributeKey<Number> key2 = new AttributeKey<Number>(Number.class, \"key2\");\n\n assertThat(key1.equals(key2), is(false));\n assertThat(key2.equals(key1), is(false));\n }", "@Override\n public boolean equals(Object obj) {\n if ( obj == null ) return false;\n if ( this == obj ) return true;\n Keys c = (Keys) obj;\n return Arrays.equals(this.keys, c.keys);\n }", "private static int compareKeys(\n List<Object> key_group1,\n List<Object> key_group2)\n {\n final int len1 = key_group1.size();\n final int len2 = key_group2.size();\n assert (len1 == len2);\n\n for (int i = 0; i < len1; ++i) {\n int compare =\n FarragoSyslibUtil.compareKeysUsingGroupBySemantics(\n key_group1.get(i),\n key_group2.get(i));\n if (compare != 0) {\n return compare;\n }\n }\n return 0;\n }", "public boolean equal (MapIterator other)\n {\n if(this.MapItr.element.Key == other.MapItr.element.Key)//*****Value or Key?\n return true;\n \n else\n return false;\n }", "@Override\n public boolean equals(Object other) {\n if (!(other instanceof Acquirente)) return false;\n return this.equalKeys(other) && ((Acquirente)other).equalKeys(this);\n }", "@Test\n\tpublic void hashCodeSimilarObjects() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tAssert.assertEquals(key1.hashCode(), key2.hashCode());\n\t}", "@Test\n\tpublic void equalsNullIdBoth() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tkey1.setId(LONG_ZERO);\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tkey2.setId(LONG_ZERO);\n\t\tboolean equals = key1.equals(key2);\n\t\tAssert.assertTrue(equals);\n\t}", "@Override\n public boolean equals(Object other) {\n if (!(other instanceof Sanpham)) return false;\n return this.equalKeys(other) && ((Sanpham)other).equalKeys(this);\n }", "@Test\n\tpublic void equalsSameObject() {\n\t\tProductScanImageURIKey key = this.getDefaultKey();\n\t\tboolean equals = key.equals(key);\n\t\tAssert.assertTrue(equals);\n\t}", "@Test\n public void testKeyEquivalence() throws Exception {\n ScanResultMatchInfo matchInfo1 = ScanResultMatchInfo.fromWifiConfiguration(mConfig1);\n ScanResultMatchInfo matchInfo1Prime = ScanResultMatchInfo.fromWifiConfiguration(mConfig1);\n ScanResultMatchInfo matchInfo2 = ScanResultMatchInfo.fromWifiConfiguration(mConfig2);\n assertFalse(matchInfo1 == matchInfo1Prime); // Checking assumption\n MacAddress mac1 = MacAddressUtils.createRandomUnicastAddress();\n MacAddress mac2 = MacAddressUtils.createRandomUnicastAddress();\n assertNotEquals(mac1, mac2); // really tiny probability of failing here\n\n WifiCandidates.Key key1 = new WifiCandidates.Key(matchInfo1, mac1, 1);\n\n assertFalse(key1.equals(null));\n assertFalse(key1.equals((Integer) 0));\n // Same inputs should give equal results\n assertEquals(key1, new WifiCandidates.Key(matchInfo1, mac1, 1));\n // Equal inputs should give equal results\n assertEquals(key1, new WifiCandidates.Key(matchInfo1Prime, mac1, 1));\n // Hash codes of equal things should be equal\n assertEquals(key1.hashCode(), key1.hashCode());\n assertEquals(key1.hashCode(), new WifiCandidates.Key(matchInfo1, mac1, 1).hashCode());\n assertEquals(key1.hashCode(), new WifiCandidates.Key(matchInfo1Prime, mac1, 1).hashCode());\n\n // Unequal inputs should give unequal results\n assertFalse(key1.equals(new WifiCandidates.Key(matchInfo2, mac1, 1)));\n assertFalse(key1.equals(new WifiCandidates.Key(matchInfo1, mac2, 1)));\n assertFalse(key1.equals(new WifiCandidates.Key(matchInfo1, mac1, 2)));\n }", "@SuppressWarnings({ \"rawtypes\"})\n\t\t@Override\n\t\tpublic int compare(WritableComparable a, WritableComparable b) {\n\t\t\tMyKey o1 = (MyKey)a;\n\t\t\tMyKey o2 = (MyKey)b;\n\t\t\treturn o1.getK().compareTo(o2.getK());\n\t\t}", "Boolean same(MapComp<K, V> m);", "private int compararEntradas (Entry<K,V> e1, Entry<K,V> e2)\r\n\t{\r\n\t\treturn (comp.compare(e1.getKey(),e2.getKey()));\r\n\t}", "@Override\r\n\tpublic boolean equals(Object obj) {\n\t\tAttributeKey ak = (AttributeKey)obj;\r\n\t\treturn this.key.equals(ak.getKey());\r\n\t}", "public boolean hasSameKey(String... tags) {\n if (tags.length != tagNames.size() * 2) {\n return false;\n }\n for (int i = 0; i < tags.length; i += PAIR_SIZE) {\n if (!tagNames.contains(tags[i])) {\n return false;\n }\n }\n return true;\n }", "@Test\n\tpublic void getOtherKeys() {\n\t\tRsaKeyStore ks = new RsaKeyStore();\n\t\tKeyPair kp = RsaHelper.generateKeyPair();\n\t\tks.addOtherKey(\"first other one\", kp.getPublic());\n\t\tKeyPair kpp = RsaHelper.generateKeyPair();\n\t\tks.addOtherKey(\"second other one\", kpp.getPublic());\n\t\tPublicKey pk = ks.getOtherKey(\"first other one\");\n\t\tassertTrue(\"should be same key\", kp.getPublic().equals(pk));\n\t\tPublicKey ppk = ks.getOtherKey(\"second other one\");\n\t\tassertTrue(\"should be same key\", kpp.getPublic().equals(ppk));\n\t}", "@SuppressWarnings(\"unchecked\")\r\n\t\tpublic boolean equals(Object other) {\r\n\t\t\tboolean flag = false;\r\n\r\n\t\t\tif (other instanceof TableElement) {\r\n\t\t\t\tTableElement<K, V> candidate = (TableElement<K, V>) other;\r\n\r\n\t\t\t\tif ((this.getKey()).equals(candidate.getKey()))\r\n\t\t\t\t\tflag = true;\r\n\t\t\t}\r\n\r\n\t\t\treturn flag;\r\n\t\t}", "@Test\n public void equalsWithDifferentTypes() throws Exception {\n AttributeKey<Number> key1 = new AttributeKey<Number>(Number.class, \"keyName\");\n AttributeKey<Date> key2 = new AttributeKey<Date>(Date.class, \"keyName\");\n\n assertThat(key1.equals(key2), is(false));\n assertThat(key2.equals(key1), is(false));\n }", "@Override\r\n public boolean equals(Object other) {\r\n if (!(other instanceof Contacto))\r\n return false;\r\n return this.equalKeys(other) && ((Contacto) other).equalKeys(this);\r\n }", "public boolean matchSameColumns(Key key);", "@Override\n default int compareTo(KeyValue<K, V> other) {\n return this.getKey().compareTo(other.getKey());\n }", "@Test\n\tpublic void equalsNullSequenceNumberBoth() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tkey1.setSequenceNumber(LONG_ZERO);\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tkey2.setSequenceNumber(LONG_ZERO);\n\t\tboolean equals = key1.equals(key2);\n\t\tAssert.assertTrue(equals);\n\t}", "private boolean isSameColumnKeyComponent(ByteBuffer[] components1, ByteBuffer[] components2) {\n\t\tfor (int i = columnAliasNames.length - 1; i >= 0; i--) {\n\t\t\tif (!components1[i].equals(components2[i]))\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "@Test\n\tpublic void hashCodeDifferentId() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tkey1.setId(2);\n\t\tAssert.assertNotEquals(key1.hashCode(), key2.hashCode());\n\t}", "@SuppressWarnings( \"unchecked\" )\n\tpublic int compare( final KeyedRecord record1, final KeyedRecord record2 ) {\n\t\tint comparison = 0;\n\t\t\n\t\tfor ( int index = 0 ; index < _keys.length ; index++ ) {\n\t\t\tfinal String key = _keys[index];\n final Object value1 = record1.valueForKey( key );\n final Object value2 = record2.valueForKey( key );\n if ( value1 instanceof Comparable && value2 instanceof Comparable ) {\n final Comparable<Object> comp1 = (Comparable<Object>)value1;\n final Comparable<Object> comp2 = (Comparable<Object>)value2;\n comparison = comp1.compareTo( comp2 );\n if ( comparison != 0 ) return comparison; \n }\n else {\n if ( !( value1 instanceof Comparable ) ) {\n throw new IllegalArgumentException( \"Record comparison failed because value 1: \" + value1 + \" is not comparable...\" );\n }\n else { \n throw new IllegalArgumentException( \"Record comparison failed because value 2: \" + value2 + \" is not comparable...\" );\n }\n }\n\t\t}\n\t\treturn comparison;\n\t}", "@Test\n public void testEquals() {\n Term t1 = structure(\"abc\", atom(\"a\"), atom(\"b\"), atom(\"c\"));\n Term t2 = structure(\"abc\", integerNumber(), decimalFraction(), variable());\n PredicateKey k1 = PredicateKey.createForTerm(t1);\n PredicateKey k2 = PredicateKey.createForTerm(t2);\n testEquals(k1, k2);\n }", "boolean hasSameAs();", "private boolean comparePersistentIdEntrys(@Nonnull PairwiseId one, @Nonnull PairwiseId other)\n {\n // Do not compare times\n //\n return Objects.equals(one.getPairwiseId(), other.getPairwiseId()) &&\n Objects.equals(one.getIssuerEntityID(), other.getIssuerEntityID()) &&\n Objects.equals(one.getRecipientEntityID(), other.getRecipientEntityID()) &&\n Objects.equals(one.getSourceSystemId(), other.getSourceSystemId()) &&\n Objects.equals(one.getPrincipalName(), other.getPrincipalName()) &&\n Objects.equals(one.getPeerProvidedId(), other.getPeerProvidedId());\n }", "@Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (o == null || getClass() != o.getClass()) return false;\n\n NameKey nameKey = (NameKey) o;\n return this.analyser.compare(this, nameKey) == 0;\n }", "@Override\n public boolean equals(Object obj) {\n if (this == obj) {\n return true;\n }\n if (obj == null || getClass() != obj.getClass()) {\n return false;\n }\n Key key = (Key) obj;\n return Objects.equals(exponent, key.exponent)\n && Objects.equals(modulus, key.modulus);\n }", "boolean keyeq(LuaValue key);", "@Test\n\tpublic void hashCodeSameObject() {\n\t\tProductScanImageURIKey key = this.getDefaultKey();\n\t\tAssert.assertEquals(key.hashCode(), key.hashCode());\n\t}", "@Override\n public boolean equals(Object other) {\n if (!(other instanceof BlastingtypeRelationsAud)) return false;\n return this.equalKeys(other) && ((BlastingtypeRelationsAud)other).equalKeys(this);\n }", "@Override\n\t\tpublic int compareTo(StringMapEntry other)\n\t\t{\n\t\t\treturn Integer.compare(key, other.key);\n\t\t}", "public boolean DEBUG_compare(Alphabet other) {\n System.out.println(\"now comparing the alphabets this with other:\\n\"+this+\"\\n\"+other);\n boolean sameSlexic = true;\n for (String s : other.slexic.keySet()) {\n if (!slexic.containsKey(s)) {\n sameSlexic = false;\n break;\n }\n if (!slexic.get(s).equals(other.slexic.get(s))) {\n sameSlexic = false;\n break;\n }\n slexic.remove(s);\n }\n System.out.println(\"the slexic attributes are the same : \" + sameSlexic);\n boolean sameSlexicinv = true;\n for (int i = 0, limit = other.slexicinv.size(); i < limit; i++) {\n boolean temp = false;\n for (int j = i, limit2 = slexicinv.size() + i; j < limit2; j++) {\n int k = j % slexicinv.size();\n if (other.slexicinv.get(i).equals(slexicinv.get(k))) {\n temp = true;\n break;\n }\n }\n if (!temp) {\n sameSlexicinv = false;\n break;\n }\n\n }\n boolean sameSpair = true;\n System.out.println(\"the slexicinv attributes are the same : \" + sameSlexicinv);\n for (IntegerPair p : other.spair.keySet()) {\n if(!spair.containsKey(p)) {\n //if (!containsKey(spair, p)) {\n sameSpair = false;\n break;\n }\n //if (!(get(spair, p).equals(get(a.spair, p)))) {\n if (!spair.get(p).equals(other.spair.get(p))) {\n sameSpair = false;\n break;\n }\n }\n System.out.println(\"the spair attributes are the same : \" + sameSpair);\n boolean sameSpairinv = true;\n for (int i = 0, limit = other.spairinv.size(); i < limit; i++) {\n boolean temp = false;\n for (int j = i, limit2 = spairinv.size() + i; j < limit2; j++) {\n int k = j % spairinv.size();\n if (other.spairinv.get(i).equals(spairinv.get(k))) {\n temp = true;\n break;\n }\n }\n if (!temp) {\n sameSpairinv = false;\n break;\n }\n }\n System.out.println(\"the spairinv attributes are the same : \" + sameSpairinv);\n return (sameSpairinv && sameSpair && sameSlexic && sameSlexicinv);\n }", "private static boolean areBundlesEqual(Bundle lhs, Bundle rhs) {\n if (!lhs.keySet().equals(rhs.keySet())) {\n // Keys differ - bundles are not equal.\n return false;\n }\n for (String key : lhs.keySet()) {\n if (!areEqual(lhs.get(key), rhs.get(key))) {\n return false;\n }\n }\n return true;\n }", "@Override\n public boolean equals(Object other) {\n if (!(other instanceof User)) return false;\n return this.equalKeys(other) && ((User)other).equalKeys(this);\n }", "@Override\n public boolean equals(Object other) {\n if (!(other instanceof RegistrationItems)) return false;\n return this.equalKeys(other) && ((RegistrationItems)other).equalKeys(this);\n }", "public boolean equals (KeyValuePair<K, V> pair) {\n return key.equals(pair.key);\n }", "@SuppressWarnings(\"resource\")\n @Test\n public void testEquals() {\n try {\n ApiKey apikey1 = new ApiKey(\"bd1f89fbddbde18d4244b748ca1d250b\", new Date(1570127619232L), 58,\n \"bd1f89fbddbde18d4244b748ca1d250b\", \"933738f6-d022-45c8-bc68-d7c6722e913b\", -46,\n \"3cac25f8-fd0d-4e6c-b1dd-e24a49542b75\", \"bd1f89fbddbde18d4244b748ca1d250b\",\n ApiKeyStatus.getDefault(), new Date(1570127625184L));\n ApiKey apikey2 = new ApiKey(\"bd1f89fbddbde18d4244b748ca1d250b\", new Date(1570127619232L), 58,\n \"bd1f89fbddbde18d4244b748ca1d250b\", \"933738f6-d022-45c8-bc68-d7c6722e913b\", -46,\n \"3cac25f8-fd0d-4e6c-b1dd-e24a49542b75\", \"bd1f89fbddbde18d4244b748ca1d250b\",\n ApiKeyStatus.getDefault(), new Date(1570127625184L));\n ApiKey apikey3 = new ApiKey(\"bd1f89fbddbde18d4244b748ca1d250b\", new Date(1570127620542L), 76,\n \"bd1f89fbddbde18d4244b748ca1d250b\", \"e31184de-791f-4689-9075-d12706757ba9\", -7,\n \"d34afc91-63f2-42e0-bde5-cfbb131751fd\", \"bd1f89fbddbde18d4244b748ca1d250b\",\n ApiKeyStatus.getDefault(), new Date(1570127620923L));\n assertNotNull(apikey1);\n assertNotNull(apikey2);\n assertNotNull(apikey3);\n assertNotSame(apikey2, apikey1);\n assertNotSame(apikey3, apikey1);\n assertEquals(apikey2, apikey1);\n assertEquals(apikey2, apikey1);\n assertEquals(apikey1, apikey2);\n assertEquals(apikey1, apikey1);\n assertFalse(apikey1.equals(null));\n assertNotEquals(apikey3, apikey1);\n } catch (Exception exception) {\n fail(exception.getMessage());\n }\n }", "@Override\r\n\tpublic int compareTo(AttributeKey o) {\n\t\treturn key.compareTo(o.getKey());\r\n\t}", "public int compareTo(KeyedItem<T> other)\n {\n if (other instanceof KeyedItem)\n return key.compareTo(other.getKey());\n else {\n System.out.println(\"Invalid Comaprison\");\n return 0;\n }\n }", "@Override\r\n\t\tpublic boolean equalsWithOrder(\r\n\t\t\t\tPair<? extends T, ? extends S> anotherPair) {\n\t\t\tsynchronized (mutex) {\r\n\t\t\t\treturn pair.equalsWithOrder(anotherPair);\r\n\t\t\t}\r\n\t\t}", "public int compare(Key<Double, Double> a, Key<Double, Double> b){\n\t\t\tif (a.getFirst() < b.getFirst()){\n\t\t\t\treturn -1;\n\t\t\t} else if (a.getFirst() == b.getFirst()){\n\t\t\t\treturn 0;\n\t\t\t} else {\n\t\t\t\treturn 1;\n\t\t\t}\n\t\t}", "@Test\n\tpublic void hashCodeDifferentSequenceNumber() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tkey1.setSequenceNumber(2);\n\t\tAssert.assertNotEquals(key1.hashCode(), key2.hashCode());\n\t}", "public static boolean compare (TreeMap<Character, Integer> m1, TreeMap<Character, Integer> m2) {\n if (m1.keySet().size() != m2.keySet().size()) {\n return false; // Words do not contain the same number of variants of characters\n } else {\n for (char c : m1.keySet()) {\n if (!m2.containsKey(c)) {\n return false; // Words do not have the same characters\n } else {\n if (m1.get(c) != m2.get(c)) {\n return false; // Words do not have the same number of the same characters\n }\n }\n }\n }\n\n return true; // The word is an anagram\n }", "private static boolean slowEquals(byte[] a, byte[] b) {\n\t int diff = a.length ^ b.length;\n\t for(int i = 0; i < a.length && i < b.length; i++)\n\t diff |= a[i] ^ b[i];\n\t return diff == 0;\n\t }", "@Override\n public boolean equals(Object other) {\n if (!(other instanceof ApptranregFeesAud)) return false;\n return this.equalKeys(other) && ((ApptranregFeesAud)other).equalKeys(this);\n }", "@SuppressWarnings(\"EqualsUnsafeCast\")\n @Override\n public boolean equals(Object o) {\n final Key key = (Key) o;\n return powerComponent == key.powerComponent\n && processState == key.processState;\n }", "@Override\n\tpublic int compare(HashMap<K, V> a, HashMap<K, V> b) {\n\t\tint comparison = 0;\n\t\tint counter = 0;\n\t\t/*\n\t\t * If the first keyToSortWith is the same in both HashMaps, sort by the\n\t\t * next keyToSortWith\n\t\t */\n\t\twhile ((comparison == 0) && (counter < keysToSortWith.length)) {\n\t\t\tcomparison = a.get(keysToSortWith[counter]).compareTo(\n\t\t\t\t\tb.get(keysToSortWith[counter]));\n\t\t\tcounter++;\n\t\t}\n\t\t/*\n\t\t * If the current keyToSortWith is supposed to be sorted negatively\n\t\t * (according to the reverse array), returns the opposite result\n\t\t */\n\t\tif (reverse[counter - 1] == true) {\n\t\t\treturn comparison * (-1);\n\t\t}\n\t\treturn comparison;\n\t}", "private boolean slowEquals(byte[] a, byte[] b)\n {\n int diff = a.length ^ b.length;\n for(int i = 0; i < a.length && i < b.length; i++)\n diff |= a[i] ^ b[i];\n return diff == 0;\n }", "public boolean equals(Object o) {\n if (this == o) {\n return true;\n }\n if (o == null) {\n return false;\n }\n if (o.getClass().equals(SingleFieldKey.class)) {\n SingleFieldKey otherSingleFieldKey = (SingleFieldKey)o;\n return otherSingleFieldKey.keyField == keyField &&\n keyField.valueEqual(otherSingleFieldKey.value, value);\n }\n\n if (!Key.class.isAssignableFrom(o.getClass())) {\n return false;\n }\n Key otherKey = (Key)o;\n return keyField.getGlobType() == otherKey.getGlobType()\n && keyField.valueEqual(value, otherKey.getValue(keyField));\n }", "@Override\n public boolean equals(Object other) {\n return (other instanceof Entry\n && key.equals(((Entry<K, V>) other).key)\n && value.equals(((Entry<K, V>) other).value));\n }", "private static boolean slowEquals(final byte[] a, final byte[] b) {\n int diff = a.length ^ b.length;\n for (int i = 0; i < a.length && i < b.length; i++) {\n diff |= a[i] ^ b[i];\n }\n return diff == 0;\n }", "private static boolean slowEquals(byte[] a, byte[] b) {\r\n int diff = a.length ^ b.length;\r\n for (int i = 0; i < a.length && i < b.length; i++) {\r\n diff |= a[i] ^ b[i];\r\n }\r\n return diff == 0;\r\n }", "@Override\n\tpublic boolean equals(Object obj) {\n\t\treturn instance.equals(((HadoopRecordKey)obj).instance);\n\t}", "@Override\n public int compareKey(KVComparator comparator, byte[] key, int offset, int length) {\n ByteBuffer bb = getKeyDeepCopy();\n return comparator.compareFlatKey(key, offset, length, bb.array(), bb.arrayOffset(), bb.limit());\n }", "@Test\n\tpublic void equalsNullSequenceNumber() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tkey1.setSequenceNumber(LONG_ZERO);\n\t\tboolean equals = key1.equals(key2);\n\t\tAssert.assertFalse(equals);\n\t}", "@Test\n\tpublic void equalsNullItemType() {\n\t\tProductScanImageURIKey key1 = this.getDefaultKey();\n\t\tProductScanImageURIKey key2 = this.getDefaultKey();\n\t\tkey1.setId(LONG_ZERO);\n\t\tboolean equals = key1.equals(key2);\n\t\tAssert.assertFalse(equals);\n\t}", "public static void main(String[] args) {\n Pair first = new Pair(\"Pesho\", \"Gosho\");\r\n Pair second = new Pair(\"Pesho\", \"Gosho\");\r\n Pair third = new Pair(\"Pesho\", \"Mariika\");\r\n \r\n System.out.println(first.equals(second));\r\n System.out.println(first.equals(third));\r\n }", "public int compare(String a, String b) {\n if (base.get(a) >= base.get(b)) {\n return -1;\n } else {\n return 1;\n } // returning 0 would merge keys\n }", "public Boolean same(MapComp<K, V> m) {\n return m.vals().same(this.vals());\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 PaymentRecordKey other = (PaymentRecordKey) that;\n return (this.getRecordId() == null ? other.getRecordId() == null : this.getRecordId().equals(other.getRecordId()))\n && (this.getOrdersId() == null ? other.getOrdersId() == null : this.getOrdersId().equals(other.getOrdersId()))\n && (this.getBuildDay() == null ? other.getBuildDay() == null : this.getBuildDay().equals(other.getBuildDay()));\n }", "private static void testKEqual(EventNode e1, EventNode e2, int k) {\n assertTrue(KTails.kEquals(e1, e2, k));\n assertTrue(KTails.kEquals(e2, e1, k));\n }", "public int compare(String a, String b) {\n\t if (base.get(a) >= base.get(b)) {\n\t return -1;\n\t } else {\n\t return 1;\n\t } // returning 0 would merge keys\n\t }", "public boolean equalsQ(Vector comparison){\n\t\tfor (Object o1 : comparison.getClock().entrySet()) {\n\t\t\tHashMap.Entry pair = (HashMap.Entry) o1;\n\n\t\t\tif(this.clock.containsKey(pair.getKey())){\n\t\t\t\tif(!((Long)pair.getValue()).equals((Long)this.clock.get(pair.getKey()))){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tfor (Object o1 : this.clock.entrySet()) {\n\t\t\tHashMap.Entry pair = (HashMap.Entry) o1;\n\n\t\t\tif(comparison.getClock().containsKey(pair.getKey())){\n\t\t\t\tif(!((Long)pair.getValue()).equals((Long)comparison.getClock().get(pair.getKey()))){\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "@Override\npublic int compareTo(CompositeKey o) {\n\tif(o == null ||this.key1<o.getKey1()) return -1;\n if(this.key1>o.getKey1())return 1;\n\treturn 0;\n}", "public static boolean same(int[] a, int[] b) {\r\n \treturn (a[0] == b[0] && a[1] == b[1]) || (a[0] == b[1] && a[1] == b[0]);\r\n }", "public boolean Equals(Pair rhs) {\n if(this.first == rhs.first &&\n this.second == rhs.second)\n return true;\n\n return false;\n }", "public int compare(WritableComparable o1, WritableComparable o2) {\r\n\t\tText key1 = (Text) o1;\r\n\t\tText key2 = (Text) o2;\r\n\t\tint t1char = key1.charAt(0); \r\n\t\tint t2char = key2.charAt(0); \r\n\t\tif (t1char < t2char) return 1;\r\n\t\telse if (t1char > t2char) return -1;\r\n\t\telse return 0;\r\n\t}", "private static boolean equalityTest3(String a, String b)\n {\n return System.identityHashCode(a) == System.identityHashCode(b);\n }", "private boolean isUsed(String key2) {\n\t\tfor(int i = 0; i < size; i++){\n\t\t\tif(keys[i].equals(key2)) return true;\n\t\t}\n\t\treturn false;\n\t}", "public final int compareTo(KeyPermission other)\r\n\t{\r\n\t\treturn this.keyId - other.keyId;\r\n\t}", "public static boolean timingSafeEquals(CharSequence first, CharSequence second) {\n if (first == null) {\n return second == null;\n } else if (second == null) {\n return false;\n } else if (second.length() <= 0) {\n return first.length() <= 0;\n }\n int firstLength = first.length();\n int secondLength = second.length();\n char result = (char) ((firstLength == secondLength) ? 0 : 1);\n int j = 0;\n for (int i = 0; i < firstLength; ++i) {\n result |= first.charAt(i) ^ second.charAt(j);\n j = (j + 1) % secondLength;\n }\n return result == 0;\n }", "@Override\n public int compare(Integer a, Integer b) {\n if (base.get(a) >= base.get(b)) {\n return 1;\n } else {\n return -1;\n } // returning 0 would merge keys\n }", "protected abstract boolean isEqual(E entryA, E entryB);", "public static boolean slowEquals(byte[] a, byte[] b) {\n int diff = a.length ^ b.length;\n for (int i = 0; i < a.length && i < b.length; i++)\n diff |= a[i] ^ b[i];\n return diff == 0;\n }", "@Override\n\tpublic int compare(WritableComparable a, WritableComparable b) {\n\t\tIntPaire o1 = (IntPaire) a;\n\t\tIntPaire o2 = (IntPaire) b;\n\t\tif(!o1.getFirstKey().equals(o2.getFirstKey())){\n\t\t\treturn o1.getFirstKey().compareTo(o2.getFirstKey());\n\t\t}else{\n\t\t\treturn o1.getSecondKey() - o2.getSecondKey();\n\t\t}\n\t}", "@Test\n public void testHashcodeReturnsSameValueForIdenticalRecords() {\n int hashcodeA = record.hashCode();\n int hashcodeB = otherRecord.hashCode();\n\n assertThat(hashcodeA == hashcodeB, is(true));\n }", "@Test\n\tpublic void doEqualsTestDifferentMaps() {\n\t\tassertFalse(bigBidiMap.equals(leftChildMap));\n\n\t}", "public interface HPTKeyComparator<K> {\n\n boolean keysEqual(int queryKeyIndex, K queryKey, K treeKey);\n\n }", "@Override\n @Generated(\"eclipse\")\n public boolean equals(final Object obj) {\n if (this == obj) {\n return true;\n }\n if (obj == null) {\n return false;\n }\n if (getClass() != obj.getClass()) {\n return false;\n }\n @SuppressWarnings(\"unchecked\")\n HolderKey<T> other = (HolderKey<T>) obj;\n if (this.asyncSupported != other.asyncSupported) {\n return false;\n }\n if (this.heldValue == null) {\n if (other.heldValue != null) {\n return false;\n }\n } else if (!this.heldValue.equals(other.heldValue)) {\n return false;\n }\n if (this.initParameters == null) {\n if (other.initParameters != null) {\n return false;\n }\n } else if (!this.initParameters.equals(other.initParameters)) {\n return false;\n }\n if (this.name == null) {\n if (other.name != null) {\n return false;\n }\n } else if (!this.name.equals(other.name)) {\n return false;\n }\n if (this.serviceReference == null) {\n if (other.serviceReference != null) {\n return false;\n }\n } else if (!this.serviceReference.equals(other.serviceReference)) {\n return false;\n }\n return true;\n }", "@Test\n\tpublic void doEqualsTestSameMapDifferentInstances() {\n\t\tassertTrue(bigBidiMap.equals(bigBidiMap_other));\n\n\t}", "boolean hasKey();", "boolean hasKey();", "boolean hasKey();" ]
[ "0.74812675", "0.7382617", "0.72286236", "0.7175957", "0.71175873", "0.69519955", "0.6950424", "0.69211733", "0.6864309", "0.67182225", "0.66599005", "0.66293484", "0.6616995", "0.65696084", "0.64817", "0.6468629", "0.64584273", "0.6455308", "0.644449", "0.63863665", "0.6353899", "0.6278819", "0.6176815", "0.61761004", "0.6170333", "0.6161011", "0.6149905", "0.61395997", "0.6137345", "0.61210304", "0.61175096", "0.61003906", "0.6098167", "0.60944146", "0.607246", "0.60658836", "0.5998241", "0.5989213", "0.5962656", "0.5955534", "0.5909102", "0.5907679", "0.5904789", "0.5861108", "0.58465695", "0.58328575", "0.5821473", "0.58138096", "0.5790779", "0.57853264", "0.5763304", "0.57477194", "0.5746009", "0.57155514", "0.5711376", "0.5682692", "0.56808233", "0.5675159", "0.5644316", "0.56364834", "0.56201094", "0.5619417", "0.5618849", "0.561305", "0.55951107", "0.559436", "0.5590475", "0.5581394", "0.5556449", "0.555117", "0.553522", "0.5520239", "0.55193424", "0.55145913", "0.5509339", "0.55081415", "0.54634845", "0.54580873", "0.5456496", "0.5442146", "0.54378057", "0.542845", "0.54258835", "0.5422888", "0.5420532", "0.54169977", "0.5412487", "0.54055405", "0.5405381", "0.54021853", "0.53868645", "0.53861254", "0.5378988", "0.53780407", "0.5376928", "0.5371816", "0.53707314", "0.5353686", "0.5353686", "0.5353686" ]
0.5696551
55
Instantiates a new Dictionary. We use list to store Dictionary pair.
public Dictionary () { list = new DoubleLinkedList<>(); this.count = 0; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public Dictionary createDictionary(){\n Dictionary dict = new Dictionary(9973);\n return dict;\n }", "public void createHashMap() {\n myList = new HashMap<>();\n scrabbleList = new HashMap<>();\n }", "public Dictionary()\n\t{\n\t\tfor(Character i = 97; i<=122;i++)\n\t\t\tthis.put(i,new ArrayList<DictionaryElement>());\n\t\t\t\n\t}", "public Dictionary ( ArrayList < String > listOfWords ) {\n\t\tsuper(listOfWords.get((listOfWords.size()-1)/2));\n\t\t\n\t\t//store words list as binary tree\n\t\t//starts with left side then with right\n\t\tint start = 0;\n\t\tint end = listOfWords.size()-1;\n\t\tint mid = (start+end)/2;\n\t\tmakeTree(listOfWords, start, mid-1);\n\t\tmakeTree(listOfWords, mid+1, end);\n\t\t\n\t\t\n\t\t/**old code written by Professor below\n\t\t * \n\t\t */\n\t\t//words = listOfWords;\n\t\t//if (null == words) {\n\t\t//\twords = new ArrayList <String> ();\n\t\t//}\n\t\t\n\n\t\t\n\t}", "public Q706DesignHashMap() {\n keys = new ArrayList<>();\n values = new ArrayList<>();\n\n }", "public Dictionary () {\n\t\tsuper();\n\t\t//words = new ArrayList < String > () ;\n\t}", "public MyHashMap() {\n hashMap = new ArrayList<>();\n }", "public static final HashMap dict (Object ... pairs) {\r\n HashMap map = new HashMap();\r\n for (int i=0; i<pairs.length; i=i+2) {\r\n map.put(pairs[i], pairs[i+1]);\r\n }\r\n return map;\r\n }", "public Hashtable<String,Stock> createMap(){\n\tHashtable table = new Hashtable<String, Stock>();\n\treturn table;\n}", "public Dictionary(){\n front = null;\n numItems = 0;\n }", "public ScopedMap() {\n\t\tmap = new ArrayList<HashMap<K, V>>();\n\n\t}", "private static <K, V> Map<K, V> newHashMap() {\n return new HashMap<K, V>();\n }", "public Dictionary(){\n root = null;\n numItems = 0;\n }", "public MagicDictionary() {\n this.map = new HashMap<>();\n }", "public MyHashMap() {\n this.key_space = 2069;\n this.hash_table = new ArrayList<Bucket>();\n for (int i = 0; i < this.key_space; ++i) {\n this.hash_table.add(new Bucket());\n }\n }", "private void createHashtable()\n {\n int numLanguages = languages.length;\n mapping = new Hashtable(numLanguages, 1.0f);\n for (int i = 0; i < numLanguages; i++)\n mapping.put(languages[i], values[i]);\n }", "public static <K, V> HashMap<K, V> initHashMap() {\n\t\treturn new HashMap<K, V>();\n\t}", "public Dictionary(String filename) throws IOException {\r\n\t\tFile dFile = new File(filename);\r\n\t\tFileReader fr = new FileReader(dFile);\r\n\t\tnew BufferedReader(fr).lines().forEach(e -> dict.add(e));\r\n\t\tfr.close();\r\n\t}", "protected Depot(List<E> list) {\n\t\tthis.list = list == null ? getList() : list;\n\t\tdict = new LinkedHashMap<UUID, E>();\n\t\tfor (E t : this.list) {\n\t\t\tdict.put(UUID.randomUUID(), t);\n\t\t}\n\t\tnames = new LinkedHashMap<String, UUID>();\n\t}", "DictionaryPair (K someKey , V someValue) {\n this.key = someKey;\n this.value = someValue;\n }", "public DictionaryAdapter(Map<String,String> dict) {\n mData = new ArrayList();\n mData.addAll(dict.entrySet());\n }", "WordList(){\r\n\t\tm_words = new HashMap();\r\n\t}", "public MyHashMap() {\n map = new ArrayList<>();\n for (int i = 0;i<255;i++)\n map.add(new Entry());\n }", "@SuppressWarnings(\"unchecked\")\r\n\tpublic HashMap()\r\n\t{\r\n\t\ttable = new MapEntry[7];\r\n\t\tcount = 0;\r\n\t\tmaxCount = table.length - table.length/3;\r\n\t\tDUMMY = new MapEntry<>(null, null);\r\n\t}", "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 map = new HashMap();\n }", "public Dict(Obj value) {\n this.value = value;\n }", "public Dictionary() {\n\t\tthis.dictionary = new HashSet<String>();\n\t\ttry {\n\t\t\tthis.populateDictionary();\n\t\t} catch (IOException e) {\n\t\t\tSystem.out.println(\"Error: File not found, please try again with a valid filename.\");\n\t\t}\n\t}", "public final Map<String, Integer> mo34029a(List<String> list) {\n return (Map) m446a(new C1840ci(this, list));\n }", "public ChainedHashDictionary() {\r\n this.capacity = 31;\r\n this.load = 0;\r\n this.chains = makeArrayOfChains(capacity);\r\n }", "public OmaHashMap() {\n this.values = new OmaLista[32];\n this.numberOfValues = 0;\n }", "public HashMap() {\n this.capacity = 100;\n this.hashMap = new LinkedList[capacity];\n }", "public MagicDictionary() {\n\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 void initializeDictionary() {\n\t\tmyDictionary = new SLogoDictionary();\n\t}", "public Frequency(ArrayList<LottoDay> list) {\n\n\t\tfill(list);//fill the maps\n\t}", "public MyHashMap() {\n\t\tthis(INIT_CAPACITY);\n\t}", "public MyHashMap() {\n store = new int[1000001]; // Max number of key-value pairs allowed in the HashMap, cant exceed it.\n Arrays.fill(store, -1); // we have to anyways return -1 if key doesn't exists.\n }", "private TagListSingleton() {\n\t\t// The file is always going to have same pathname\n\t\tFile f = new File(pathName);\n\t\ttry {\n\t\t\tif (f.exists()) {\n\t\t\t\treadFromFile();\n\t\t\t} else {\n\t\t\t\t// If file does not exist, create new map\n\t\t\t\tf.createNewFile();\n\t\t\t\ttagToImg = new HashMap<String, HashSet<String>>();\n\t\t\t}\n\t\t} catch (IOException | ClassNotFoundException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\t// Initialize the other map\n\t\tmakeImgToTag();\n\t}", "@Override HashMapEntry<K, V> constructorNewEntry(\n K key, V value, int hash, HashMapEntry<K, V> next) {\n LinkedEntry<K, V> header = this.header;\n LinkedEntry<K, V> oldTail = header.prv;\n LinkedEntry<K, V> newTail\n = new LinkedEntry<K,V>(key, value, hash, next, header, oldTail);\n return oldTail.nxt = header.prv = newTail;\n }", "public Dictionary() throws IOException {\r\n\t\tthis(FILE_NAME);\r\n\t}", "public HashMap(){\n\t\tthis.numOfBins=10;\n\t\tthis.size=0;\n\t\tinitializeMap();\n\t}", "public final Map<String, Integer> mo33708h(List<String> list) {\n return (Map) m968r(new C2164bs(this, list));\n }", "public MyHashMap() {\n\n }", "public MyHashMap(int M) {\n\t\tthis.M = M;\n\t\tst = new MyLinkedList[M];\n\t\tfor (int i = 0; i < M; i++)\n\t\t\tst[i] = new MyLinkedList<Key, Value>();\n\t}", "public MyHashMap() {\r\n\t\tloadFactor = DEFAULT_LOAD_FACTOR;\r\n\t\tcapacity = DEFAULT_CAPACITY;\r\n\t\thashMapArray = new LinkedList[capacity];\r\n\t}", "public TimeMap() {\n hashMap = new HashMap<String, List<Data>>();\n }", "public Supermarket(HashMap productList)\n {\n this.productList = productList;\n }", "public NamedList() {\n\t\tnvPairs = new ArrayList<Object>();\n\t}", "public Dictionary() { //constructor\r\n try {\r\n createDictionary(); //create dictionary\r\n addCustomWords(); //add any user define words in it\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n }\r\n }", "public MyHashMap() {\r\n data = new Node[DEFAULT_CAPACITY];\r\n }", "public Dictionary(String dataname, String username){\n this(dataname, null, username);\n }", "public void createDictionary() \n {\n dictionary = new HashMap<String, Map<String, String>>();\n \n addTranslations(\n \"EN\", // Language code\n \"OK\", \"Ok\",\n \"UPDATE\", \"Update\",\n \"OPEN\", \"Open\",\n \"CLOSE\", \"Close\",\n \"CANCEL\", \"Cancel\",\n \"MESSAGES\", \"Messages\",\n \"NO_MESSAGES_TO_DISPLAY\", \"No messages to display\",\n \"EVALUATE\", \"Evaluate\",\n \"RUN\", \"Run\",\n \"RUN_AS_ACTIVITY\", \"Run Activity\",\n \"OPEN_SCRIPT\", \"Open script\",\n \"START_SERVER\", \"Start server\",\n \"STOP_SERVER\", \"Stop server\",\n \"SHOW_MESSAGES\", \"Messages\",\n \"UPDATE_APP_SCRIPTS\", \"Update\",\n \"THIS_WILL_OVERWRITE_ALL_APP_SCRIPTS\", \"This will overwrite all application scripts!\",\n \"ENTER_FILE_OR_URL\", \"Enter file or url:\",\n \"UPDATE_APP_SCRIPTS_DONE\", \"Update complete!\",\n \"UPDATE_APP_SCRIPTS_DONE_RESTART\", \"Restart the application to make changes take effect\",\n \"QUIT_APP\", \"Quit\",\n \"CLOSE\", \"Close\",\n \"BE_KIND\", \"Be kind\",\n \"BE_KIND_MESSAGE\", \"Be a kind person\"\n );\n }", "public MyHashMap() {\n\n }", "public Dictionary(String filename) throws FileNotFoundException, IOException {\n wordlist = loadWordList(filename);\n }", "public MagicDictionary() {\n root=new Node();\n }", "private void setUpHashMap(int number)\n {\n switch (number)\n {\n case 1:\n {\n this.hourly.put(\"Today\",new ArrayList<HourlyForecast>());\n break;\n }\n case 2:\n {\n this.hourly.put(\"Today\",new ArrayList<HourlyForecast>());\n this.hourly.put(\"Tomorrow\", new ArrayList<HourlyForecast>());\n break;\n }\n case 3:\n {\n this.hourly.put(\"Today\", new ArrayList<HourlyForecast>());\n this.hourly.put(\"Tomorrow\", new ArrayList<HourlyForecast>());\n this.hourly.put(\"Day After Tomorrow\", new ArrayList<HourlyForecast>());\n break;\n }default:\n break;\n }\n }", "public PDEncryptionDictionary()\n {\n encryptionDictionary = new COSDictionary();\n }", "public Graph() {\n\t\tdictionary=new HashMap<>();\n\t}", "private void initialize() {\n first = null;\n last = null;\n size = 0;\n dictionary = new Hashtable();\n }", "public static <K, V> Map<K, V> createMap(List<K> keys, List<V> values) {\n if (keys == null || values == null || keys.size() != values.size()) {\n throw new IllegalArgumentException(\"Keys and Values cannot be null and must be the same size\");\n }\n Map<K, V> newMap = new HashMap<>();\n for (int i = 0; i < keys.size(); i++) {\n newMap.put(keys.get(i), values.get(i));\n }\n return newMap;\n }", "public Map<T, V> populateMap() {\n Map<T, V> map = new HashMap<>();\n for (int i = 0; i < entryNumber; i++) {\n cacheKeys[i] = (T) Integer.toString(random.nextInt(1000000000));\n String key = cacheKeys[i].toString();\n map.put((T) key, (V) Integer.toString(random.nextInt(1000000000)));\n }\n return map;\n }", "private void getDictionary(){\r\n // TODO: read Dictionary\r\n try{\r\n lstDictionary.clear();\r\n for(int i = 0; i < IConfig.LABEL_COUNT; i++){\r\n lstDictionary.add(new HashMap<>());\r\n DictionaryReader dictionaryReader = new DictionaryReader(lstDictionary.get(i), IConfig.DICTIONARY_URL[i]);\r\n dictionaryReader.read();\r\n }\r\n }catch (Exception e){\r\n e.printStackTrace();\r\n }\r\n }", "public AgentBuilderDictionary(int initialCapacity) {\n\t\tsuper(initialCapacity);\n\t}", "public TreeDictionary() {\n\t\t\n\t}", "public static void initDictionaries()\r\n\t{\r\n\t\t\r\n\t\tString cfdictversion = getInitialDictVersion();\r\n\t\t\r\n\t\t//long time = System.currentTimeMillis();\r\n\t\t//System.out.println(\"Dictionaries initialized start\");\r\n\t\t\r\n\t\t\r\n\t\t//get the dictionary config file into a DOM\r\n\t\tloadDictionaryConfig();\r\n\t\tif(dictionaryConfig == null)\r\n\t\t\tthrow new IllegalArgumentException(\"Problem loading dictionaryconfig.xml\");\r\n\t\t\r\n\t\t//load the default dictionaries into the cache\r\n\t\t//this is kind of weak but it'll do pig... it'll do...\r\n\t\tif (cfdictversion.trim().length() == 0) {\r\n\t\t\tcfdictversion = getFirstVersion(CFDIC);\r\n\t\t}\r\n\t\tString htdictversion = getFirstVersion(HTDIC);\r\n\t\tString jsdictversion = getFirstVersion(JSDIC);\r\n\t\t\r\n\t\t\r\n\t\t//load the dictionary into the cache\r\n\t\tloadDictionaryByVersion(cfdictversion);\r\n\t\tloadDictionaryByVersion(htdictversion);\r\n\t\tloadDictionaryByVersion(jsdictversion);\r\n\t\t\r\n\t\t//load from the cache to the live\r\n\t\tloadDictionaryFromCache(cfdictversion,CFDIC);\r\n\t\tloadDictionaryFromCache(cfdictversion,SQLDIC);\r\n\t\tloadDictionaryFromCache(htdictversion,HTDIC);\r\n\t\tloadDictionaryFromCache(jsdictversion,JSDIC);\r\n\t\t\t\t\r\n\t\t//System.out.println(\"Dictionaries initialized in \" + (System.currentTimeMillis() - time) + \" ms\");\r\n\t}", "public void add(Map<Variable, Object> instance) {\n\t\tthis.listInstance.add(instance);\n\t}", "private void fillWithDictionaries() {\n\t\trecentDictionaries = Preferences.getRecentDictionaries();\n\t\tListAdapter dictionaryList = new ListAdapter();\n\t\tsetListAdapter(dictionaryList);\n\t}", "public HashEntityMap()\n\t\t{\n\t\t\tmapNameToValue = new HashMap<String, Integer>();\n\t\t}", "@Override\n public Map makeMap() {\n Map<Integer,String> testMap = new HashingMap<>();\n return testMap;\n }", "public Pair(Key key, Value value) {\n this.key = key;\n this.value = value;\n }", "public DictionaryModuleImpl() {\r\n }", "public WordDictionary() {\n }", "public Dictionary(String filename)\n\t\tthrows FileNotFoundException, IOException\n\t{\n\t\tmyFilename = filename;\n\t\t\n\t\tchar myCharacter = 'a';\n\t\tString myWord = new String(\"\");\n\t\tBufferedReader myReader = new BufferedReader(new FileReader(myFilename));\n\t\t\n\t\tmyWord = myReader.readLine();\n\t\t\n\t\t//creates each WordList for the words in the given text file\n\t\tfor(int counter = 0; counter < 26; ++counter)\n\t\t{\nSystem.out.print((char)(counter + (int)'a'));\n\t\t\tint position = 0;\n\t\t\tString[] tempArray = new String[100];\n\t\t\t\n\t\t\tmyCharacter = (char)myWord.charAt(0);\n\t\t\ttempArray[position] = myWord;\n\t\t\t\n\t\t\tmyWord = myReader.readLine();\n\t\t\t\n\t\t\twhile(myWord != null && myWord.charAt(0) == myCharacter)\n\t\t\t{\n\t\t\t\t++position;\n\t\t\t\t\n\t\t\t\tif(tempArray.length >= position)\n\t\t\t\t{\n\t\t\t\t\ttempArray = enlargeArray(tempArray);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\ttempArray[position] = myWord;\n\t\t\t\t\n\t\t\t\tmyWord = myReader.readLine();\n\t\t\t}\n\t\t\t\n\t\t\tmyDictionaryArray[counter] = new WordList(shrinkArray(tempArray));\n\t\t}\n\t\t\n\t\tmyReader.close();\n\t}", "public AgentBuilderDictionary() {\n\t\tsuper();\n\t}", "MyHashMap(int initialCapacity) {\r\n data = new Node[initialCapacity];\r\n }", "private DictionaryReader() {}", "public WordDictionary() {\n\n }", "public WordDictionary() {\n\n }", "public WordDictionary() {\n\n }", "public WordDictionary() {\n \n \n }", "protected SafeHashMap.Entry<K, V> instantiateEntry()\n {\n return new Entry<>();\n }", "protected SafeHashMap.Entry instantiateEntry()\n {\n return new Entry();\n }", "public ArrayHashMap() {\n super();\n }", "public AgentBuilderDictionary(int initialCapacity, float loadFactor) {\n\t\tsuper(initialCapacity, loadFactor);\n\t}", "public static HashMap<Integer, String> createDictionary(HashSet<Integer> byteKey, ArrayList<String> bitsValue){\n HashMap<Integer, String> dictionary = new HashMap<>();\n ArrayList <Integer> bytesKey = new ArrayList<>(byteKey);\n for (int i = 0; i < bytesKey.size(); i++) {\n dictionary.put(bytesKey.get(i), bitsValue.get(i));\n }\n return dictionary;\n }", "private void createInternalStorage(int length) {\n\t\tif(internalStorage == null) {\n\t\t\tinternalStorage = new java.util.ArrayList<java.util.HashMap<String,LinkedList<T>>> ();\n\t\t\tfor(int i=0;i<length;i++)\n\t\t\t\tinternalStorage.add(new HashMap<String,LinkedList<T>>());\n\t\t}\n\t\t\n\t}", "protected Pair() {\n\t\t\n\t\tsuper(2);\n\t}", "public Q432() {\n m = new HashMap<>();\n v = new HashMap<>();\n list = new LinkedList<>();\n }", "public WordDictionary() {\n letters = new WordDictionary[26];\n }", "public Pair() {\r\n\t}", "private static java.util.Hashtable init() {\n Hashtable members = new Hashtable();\n members.put(\"fork\", FORK);\n members.put(\"lsf\", LSF);\n members.put(\"pbs\", PBS);\n members.put(\"condor\", CONDOR);\n members.put(\"sge\", SGE);\n members.put(\"ccs\", CCS);\n\n return members;\n }", "public Order() {\n\t\tsuper();\n\t\titems = new HashMap<>();\n\t}", "public HashTable( int size )\n\t{\n\t\ttheLists = new WordList[ size ];\n\t\tfor (int i = 0; i < theLists.length; i++)\n\t\t\ttheLists[i] = new WordList();\n\t}", "public IntObjectHashMap() {\n resetToDefault();\n }", "public MultiKeyMap() {\n this.map = new java.util.HashMap<String,V>();\n return;\n }", "private final Map<String, C1844cm> m447d(List<String> list) {\n return (Map) m446a(new C1837cf(this, list));\n }", "public HashMultiSet() {\r\n\t\tbaseMap = new HashMap<>();\r\n\t}", "public MagicDictionary() {\n\t\troot = new TrieNode();\n\t}", "public HashMultiSet() {\n\t\thMap = new HashMap<T, Integer>();\n\t\tsize = 0;\n\t}" ]
[ "0.75309145", "0.67487067", "0.6615284", "0.647563", "0.6419831", "0.62873524", "0.623641", "0.6140169", "0.60297287", "0.6003227", "0.59901255", "0.5949612", "0.5921554", "0.5919194", "0.590509", "0.58904195", "0.5862454", "0.58187425", "0.57981676", "0.57840586", "0.5753141", "0.5750357", "0.5728825", "0.57266575", "0.5724603", "0.5703601", "0.5695509", "0.5693985", "0.5642744", "0.55816984", "0.55729574", "0.5570775", "0.5568296", "0.55592746", "0.5534509", "0.55251807", "0.550342", "0.54566294", "0.54507494", "0.5449557", "0.54483616", "0.54432726", "0.5442929", "0.5440009", "0.54287755", "0.5409103", "0.54011565", "0.5379246", "0.536837", "0.5362629", "0.5353131", "0.5352844", "0.5352818", "0.53376275", "0.53251684", "0.5322101", "0.532091", "0.5316345", "0.5301916", "0.5283236", "0.52721536", "0.52686155", "0.5260751", "0.5252168", "0.5249516", "0.5235737", "0.52246827", "0.521044", "0.5209663", "0.52036613", "0.52033174", "0.5200821", "0.5195549", "0.51845086", "0.518137", "0.5177886", "0.51704013", "0.5155952", "0.5155952", "0.5155952", "0.514959", "0.5132431", "0.5122466", "0.5105952", "0.51038754", "0.5101368", "0.509372", "0.50843096", "0.5083427", "0.50808567", "0.5072651", "0.50532264", "0.5050777", "0.50457644", "0.5043851", "0.5042227", "0.50365233", "0.50356835", "0.5034174", "0.503267" ]
0.72412765
1
Add key and value to the dictionary pair. It the key exits, update the value.
public void add(K key,V value) { DictionaryPair pair = new DictionaryPair(key,value); int index = findPosition(key); if (index!=DsConst.NOT_FOUND) { list.set(index,pair); } else { list.addLast(pair); this.count++; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public V add(K key, V value)\n { \n checkInitialization();\n if ((key == null) || (value == null))\n throw new IllegalArgumentException();\n else\n { \n V result = null; \n int keyIndex = locateIndex(key); \n if ((keyIndex < numberOfEntries) && \n key.equals(dictionary[keyIndex].getKey()))\n {\n // Key found; return and replace entry's value\n result = dictionary[keyIndex].getValue(); // Get old value\n dictionary[keyIndex].setValue(value); // Replace value \n }\n else // Key not found; add new entry to dictionary\n { \n makeRoom(keyIndex);\n dictionary[keyIndex] = new Entry(key, value);\n numberOfEntries++;\n ensureCapacity(); // Ensure enough room for next add\n } // end if \n return result;\n } // end if\n }", "public void put(Key key, Value val);", "private void put(K key, V value) {\n\t\t\tif (key == null || value == null)\n\t\t\t\treturn;\n\t\t\telse if (keySet.contains(key)) {\n\t\t\t\tvalueSet.set(keySet.indexOf(key), value);\n\t\t\t} else {\n\t\t\t\tkeySet.add(key);\n\t\t\t\tvalueSet.add(keySet.indexOf(key), value);\n\t\t\t\tsize++;\n\t\t\t}\n\t\t}", "void updateEntry(K key, V value);", "void addEntry(K key, V value);", "public void put(Value key, Value value) {\n\t\tstorage.put(key, value);\n\t}", "public void put(K key, V value) {\n\t\tif (key == null || value == null) {\n\t\t\tthrow new IllegalArgumentException(\"At least one of the inputs are null\");\n\t\t} else {\n\t\t\tHashMap<K, V> current = map.get(map.size() - 1);\n\t\t\tcurrent.put(key, value);\n\t\t\tmap.remove(map.size() - 1);\n\t\t\tmap.add(current);\n\t\t}\n\t}", "public void setValue(K key, V value) {\n this.add(key, value);\n }", "void add(K key, V value);", "public boolean put(K key, V value)\r\n\t{\r\n\t\treturn data.addUpdate(new Entry(key, value));\r\n\t}", "public void put(Object key, Object value) {\n\t\tint index = key.hashCode() % SLOTS;\n\t\t// check if key is already present in that slot/bucket.\n\t\tfor(Pair p:table[index]) {\n\t\t\tif(key.equals(p.key)) {\n\t\t\t\tp.value = value; // overwrite value if key already present.\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// if not present, add key-value pair in that slot/bucket.\n\t\tPair pair = new Pair(key, value);\n\t\ttable[index].add(pair);\n\t}", "protected abstract void put(K key, V value);", "void put(K key, V value);", "void put(K key, V value);", "public void put(Key key,Value value){\n\t\troot = insert(root,key,value);\n\t}", "public void add(Key key, Value value) {\n\n\t\tif (2 * this.size > this.capacity) {\n\t\t\tresize(2 * this.capacity);\n\t\t}\n\n\t\t// Add this item to the hash table in the expected location.\n\n\t\tint index = locate(key);\n\t\tthis.keys[index] = key;\n\t\tthis.values[index] = value;\n\t\tthis.size++;\n\t}", "public void addToDictionary(String key, String value, String direction) {\n\t\tdictionary.addToDictionary(key, value, direction);\n\t}", "public void addKeyValue (String key, String value){\r\n\t\tcodebook.put(key, value);\r\n\t}", "void addEntry(String key, Object value) {\n this.storageInputMap.put(key, value);\n }", "public V add(K key, V value);", "public V add(K key, V value)\r\n\t{\r\n\t\tint slot = findSlot(key, false); // check if key already exists\r\n\t\tV oldVal = null;\r\n\t\t\r\n\t\tif (slot >= 0)\r\n\t\t{\r\n\t\t\tMapEntry<K, V> e = table[slot];\r\n\t\t\toldVal = e.setValue(value);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tslot = findSlot(key, true); // find empty slot for adding\r\n\t\t\ttable[slot] = new MapEntry<>(key, value);\r\n\t\t\tcount++;\r\n\t\t\tif (count >= maxCount)\r\n\t\t\t{\r\n\t\t\t\trehash();\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t\treturn oldVal;\r\n\t}", "public void put(int key, int value) {\n store[key] = value; // update operation= overwritten \n }", "public void put(int key, int value) {\n if (get(key) == -1)\n hashMap.add(new int[]{key, value});\n else {\n hashMap.stream().filter(pair -> pair[0] == key)\n .findAny()\n .map(pair -> pair[1] = value);\n }\n }", "Object put(Object key, Object value);", "public void put(K key, V val) {\n int index = findIndex(key);\n // the real reason we bother to check is \n // to know whether or not to increment pairs.\n if (keys[index] == null) {\n keys[index] = key;\n values[index] = val;\n }\n else\n values[index] = val;\n }", "public V put(K key, V value);", "V put(final K key, final V value);", "public void put(Object key,Object value) {\n map.put(key,value);\n hashtable.put(key,value);\n }", "public void addData(Key key, Value value) {\r\n\t\t\tdata.reset();\r\n\t\t\t\r\n\t\t\t//if no data or should be placed first\r\n\t\t\tif (data.size() == 0 || data.get().getKey().compareTo(key) > 0) \r\n\t\t\t\tdata.insert(new KeyValuePair<Key, Value>(key, value));\r\n\t\t\telse {\r\n\t\t\t\t//find insert position\r\n\t\t\t\twhile (data.hasNext()) {\r\n\t\t\t\t\tif (data.next().getKey().compareTo(key) > 0) break;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//if before last\r\n\t\t\t\tif (data.get().getKey().compareTo(key) > 0) \r\n\t\t\t\t\tdata.insert(new KeyValuePair<Key, Value>(key, value));\r\n\t\t\t\t//if after last\r\n\t\t\t\telse\r\n\t\t\t\t\tdata.add(new KeyValuePair<Key, Value>(key, value));\r\n\t\t\t}\r\n\t\t}", "V put(K key, V value);", "public String addItemByKey(String key, String value) throws DictionaryException {\n\t\tSystem.out.println(\"Going to add value : \" + value + \" for Key : \" + key);\n\t\tMap<String, List<String>> dictMap = getDictionary();\n\t\tif (dictMap != null && dictMap.isEmpty() != true) {\n\t\t\t// Check if key exists and add the item\n\t\t\tif (dictMap.containsKey(key)) {\n\t\t\t\tList<String> membersList = dictMap.get(key);\n\t\t\t\tif (membersList.contains(value)) {\n\t\t\t\t\t//Already existing value\n\t\t\t\t\tthrow new DictionaryException(ExceptionConstant.ADD_ERROR);\n\t\t\t\t} else {\n\t\t\t\t\tmembersList.add(value);\n\t\t\t\t\tdictMap.put(key, membersList);\n\t\t\t\t\tdictionary.setMultiValueDict(dictMap);\n\t\t\t\t}\n\t\t\t\t// Code for a fresh key and value insert\n\t\t\t} else {\n\t\t\t\tList<String> valueList = new ArrayList<>();\n\t\t\t\tvalueList.add(value);\n\t\t\t\tdictMap.put(key, valueList);\n\t\t\t}\n\t\t\t// First time entry of items in map\n\t\t} else {\n\t\t\tList<String> valueList = new ArrayList<>();\n\t\t\tvalueList.add(value);\n\t\t\tdictMap.put(key, valueList);\n\n\t\t}\n\t\treturn ApplicationMessage.ADD_SUCCESS_MSG;\n\t}", "public abstract V put(K key, V value);", "public void put(K key, V value) {\n int keyBucket = hash(key);\n \n HashMapEntry<K, V> temp = table[keyBucket];\n while (temp != null) {\n if ((temp.key == null && key == null) \n || (temp.key != null && temp.key.equals(key))) {\n temp.value = value;\n return;\n }\n temp = temp.next;\n }\n \n table[keyBucket] = new HashMapEntry<K, V>(key, value, table[keyBucket]);\n size++;\n }", "public void put(String key, Object value)\n\t{\n\t\tverifyParseState();\n\t\tvalues.put(key, ValueUtil.createValue(value));\n\t}", "public void put(K key, V value) {\n if (null == key) {\n throw new IllegalStateException(\"Null value for key is \" +\n \"unsupported!\");\n }\n\n Node<Pair<K, V>> node = findItem(key);\n\n if (node != null) {\n node.getData().value = value;\n return;\n }\n\n Pair<K, V> entry = new Pair<>(key, value);\n\n int hash1 = hash1(key);\n int hash2 = hash2(key);\n\n int count1 = table[hash1] == null ? 0 : table[hash1].list.getCount();\n int count2 = table[hash2] == null ? 0 : table[hash2].list.getCount();\n\n if (count1 <= count2) {\n if (table[hash1] == null) {\n table[hash1] = new Entry<>();\n }\n\n table[hash1].list.put(entry);\n } else {\n if (table[hash2] == null) {\n table[hash2] = new Entry<>();\n }\n\n table[hash2].list.put(entry);\n }\n\n if (++elementsCount > table.length * OCCUPANCY) {\n rehash();\n }\n }", "void putValue(String key, Object data);", "@Override\r\n\tpublic void addKeyValuePair(String key, String value) {\r\n\t\t\r\n\t\t// if key is empty\r\n if (key == null || key.equals(\" \") || value == null || value.equals(\" \")) {\r\n System.out.println(\"Key cannot be Empty\");\r\n return;\r\n }\r\n // create new Node to be inserted\r\n Node newNode = new Node(new Data(key, value));\r\n // call recursive function traverse from root to correct Position to add newNode\r\n this.root = insertRecursively(this.root, newNode);\r\n return;\r\n\t\t\r\n\t}", "private void put(String aKey, Object aValue) {\n\t\tmData.put(aKey, getValue(aValue));\n\t}", "@Override\n public void add(K key, V value) {\n if(containsKey(key)){\n List<V> v = getValues(key);\n if(v.contains(value)){return;}\n }\n internalGetValue(key).add(value);\n }", "public V put(K key, V value) {\n System.out.println(\"SimpleHashMap.put\");\n return mMap.put(key, value);\n }", "public void setValue(K key, V value);", "public boolean add(K key, V value);", "public void put(K key, V value)\n\t{\n\t\tcheckForNulls(key, value);\n\t\tint n = Math.abs(key.hashCode() % entries.length);\n\t\t\n\t\tif (entries[n] == null)\n\t\t{\n\t\t\tentries[n] = new LinkedList<>();\n\t\t\tentries[n].addFirst(new Entry(key, value));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tEntry e = new Entry(key, value);\n\t\t\t\n\t\t\tif (entries[n].contains(e) == true)\n\t\t\t\tentries[n].remove(e);\n\t\t\t\n\t\t\tentries[n].addFirst(e);\n\t\t}\n\t}", "public void put(K key, V value) {\r\n size++;\r\n checkAndModifySize();\r\n\r\n Node newElement = new Node(key, value);\r\n int currentHash = newElement.hash % data.length;\r\n if (currentHash < 0){\r\n currentHash *= -1;\r\n }\r\n\r\n if (data[currentHash] == null) {\r\n data[currentHash] = newElement;\r\n } else {\r\n Node currentElement = data[currentHash];\r\n while (currentElement.next != null) {\r\n if (currentElement.key == key || currentElement.key.equals(key)) {\r\n currentElement.value = value;\r\n size--;\r\n return;\r\n }\r\n currentElement = currentElement.next;\r\n }\r\n currentElement.next = newElement;\r\n }\r\n }", "public void addToValueAtKey(String aKey, String aValue) {\n if (cars.containsKey(aKey)) {\n cars.get(aKey).add(aValue);\n }\n }", "public void put(int key, int value) {\n int index = keys.indexOf(key);\n if(index >= 0) {\n values.set(index, value);\n } else {\n keys.add(key);\n values.add(value);\n }\n }", "public void putKV(String key, String value) throws Exception;", "public Value put(Key key, Value thing) ;", "@Override\n public T put(String key, T value) {\n T old = null;\n // Do I have an entry for it already?\n Map.Entry<String, T> entry = entries.get(key);\n // Was it already there?\n if (entry != null) {\n // Yes. Just update it.\n old = entry.setValue(value);\n } else {\n // Add it to the map.\n map.put(prefix + key, value);\n // Rebuild.\n rebuildEntries();\n }\n return old;\n }", "public void put (String key, Object value) {\n if (trace) {\n getProfiler().checkPoint(\n String.format(\" %s='%s' [%s]\", key, value, Thread.currentThread().getStackTrace()[2])\n );\n }\n getMap().put (key, value);\n synchronized (this) {\n notifyAll();\n }\n }", "public V put(K key, V value) {\r\n\t\t// if (this.contains(key)){\r\n\t\t// return this.changeValue(key, value);\r\n\t\t// } else {\r\n\t\treturn linearProbing(key, value);\r\n\t}", "public void put(int key, int value) {\n int hashedKey = hash(key);\n Entry entry = map.get(hashedKey);\n if (entry.key == -1){\n // empty entry, insert entry\n entry.key = key;\n entry.value = value;\n }else if (entry.key == key){\n // target entry\n entry.value = value;\n }else{\n // in list, find target entry\n while(entry.key != key && entry.next!=null){\n entry = entry.next;\n }\n if (entry.key == key)\n entry.value = value;\n else\n entry.next = new Entry(key, value);\n }\n }", "public final synchronized void put(final K key, final V value) {\n\t\tmap.put(key, value);\n\t}", "public void put(Key key, Value value) {\n\t\tNode entry = new Node(key, value, current_node);\n\t\tcurrent_node = entry; size++;\n\t}", "public boolean add(K key, V value){\r\n int loc = find(key);\r\n if(needToRehash()){\r\n rehash();\r\n }\r\n Entry<K,V> newEntry = new Entry<>(key,value);\r\n if(hashTable[loc]!= null && hashTable[loc].equals(key))\r\n return false;\r\n else{\r\n hashTable[loc] = newEntry;\r\n size++;\r\n return true;\r\n }\r\n }", "boolean add(Object key, Object value);", "public void putSum(K Key, Double dValue){\n\t\tif(!this.containsKey(Key)){\n\t\t\tthis.put(Key, dValue);\n\t\t}else{\n\t\t\tthis.put(Key, this.get(Key) + dValue);\n\t\t}\n\t}", "void put(String key, Object value);", "public V put(K key, V value) {\n if (null == key) {\n return isertNullKey(key, value);\n } else {\n // inserting other keys\n int location = hashFunction(key.hashCode());\n if (location / capacity >= loadFactor) {\n resize();\n }\n MyEntry<K, V> entry = null;\n entry = bucket[location];\n //if a value exists with same key, we are not overriding that value, just returning the same,\n //in hashMap they actually override the new value\n if (entry != null && key == entry.getKey()) {\n return entry.getValue();\n } else {\n MyEntry ent = new MyEntry();\n ent.setKey(key);\n ent.setValue(value);\n bucket[location] = ent;\n return value;\n }\n\n }\n }", "public void put(K key, V value) {\n int hash = getHash(key.hashCode());\n Entry<K, V> existing = buckets[hash];\n Entry<K, V> entry = new Entry<>(key, value);\n\n if (existing == null) {\n buckets[hash] = entry;\n } else { // using separating chaining collision resolution. Another way is open addressing, resizing the array to reducing collision.\n while(existing.next != null) {\n if (existing.key.equals(key)) {\n existing.value = value;\n return;\n }\n existing = existing.next;\n }\n if (existing.key.equals(key)) {\n existing.value = value;\n } else {\n existing.next = entry;\n }\n }\n }", "@Override\n public void put(K key, V value) {\n root = putHelper(key,value,root);\n }", "public V put(K key, V value) throws InvalidKeyException;", "boolean put(K key, V value);", "void addTransientEntry(K key, V value);", "public void addData(KeyValuePair<Key, Value> newData) {\r\n\t\t\taddData(newData.getKey(), newData.getValue());\r\n\t\t}", "@Override\n public void put(K key, V value) {\n // Note that the putHelper method considers the case when key is already\n // contained in the set which will effectively do nothing.\n root = putHelper(root, key, value);\n size += 1;\n }", "@Override\r\n public void updateEntryValue(Object key, Object value) throws Exception\r\n {\n }", "@Override\n public void put(K key, V value) {\n int index = Math.floorMod(key.hashCode(), entryArr.length);\n if(containsKey(key)) {\n LinkedList<Entry<K, V>> pointer = entryArr[index];\n for(int i = 0; i < pointer.size(); i++) {\n if(pointer.get(i).keyEquals(new Entry<K, V>(key, null))) {\n pointer.get(i).value = value;\n break;\n }\n }\n } else {\n if(loadFactor()>maxLoad) {\n resize();\n }\n if (entryArr[index] == null) {\n entryArr[index] = new LinkedList<Entry<K, V>>();\n }\n entryArr[index].addLast(new Entry<K, V>(key, value));\n size++;\n }\n }", "public void put(K key, V val) {\n if (this.containsKey(key)) {\n this.entries = this.entries.map(kvp -> kvp.left.equals(key) ? new Pair<>(key, val) : kvp);\n } else {\n this.entries = new Cons<>(new Pair<>(key, val), this.entries);\n }\n }", "public static HashMap<JSONObject, JSONObject> addNew (HashMap<JSONObject, JSONObject> map,JSONObject key, JSONObject value){\n\t\tmap.put(key, value);\n\t\treturn map;\n\t}", "@Override\n\tpublic V put(K key, V value) {\n\t\tV v = map.put(key, value);\n\t\tif (map.containsKey(key))\n\t\t\tkeys.add(key);\n\t\t\n\t\treturn v;\n\t}", "private void add(String key) {\n dict = add(dict, key, 0);\n }", "@Override\n public V put(K key, V value) {\n if (!containsKey(key)) {\n keys.add(key);\n }\n\n return super.put(key, value);\n }", "public void put(String key, String value) {\n\n\t\t//get the old value of the key\n\t\tString oldValue = get(key);\n\t\t\n\t\t//get this file's text\n\t\tString text = FileIO.read(this.getPath());\n\t\t\n\t\t//if it's the first time you're putting this key in, add a new key-value line\n\t\tif(oldValue==null) {\n\t\t\ttext+=key+\" : \"+value+\"\\n\";\n\t\t}else {\n\t\t\t//else replace oldValue with new value\n\t\t\ttext = text.replace(key+\" : \"+oldValue, key+\" : \"+value);\n\t\t}\n\t\t\n\t\t//push changes\n\t\tFileIO.write(this.getPath(), text);\n\t\t\n\t}", "public void put(K key, V value) {\n\t\ttable.get(calcIndex(key)).put(key, value);\n\t}", "public void put(String key, JsonObject value)\n\t{\n\t\tverifyParseState();\n\t\tvalues.put(key, ValueUtil.createValue(value));\n\t}", "@Override\n public V put(K key, V value) {\n reverseMap.put(value, key);\n return super.put(key, value);\n }", "public void put(String key, Object value) {\n\t\tgetMap(value.getClass()).put(key, value);\n\t}", "@Override\n public void put(K key, V value) {\n root = put(root, key, value);\n }", "public boolean put(final K key, final V value)\n {\n // Check if it already exists first\n if (this.hashMap.containsKey(key))\n {\n return false;\n }\n\n // Add the new head element\n this.addNewHead(key, value);\n\n return true;\n }", "public void put(K key, V value) {\n int counter = 0;\n for (Table.Entry e : entries) {\n if (e.getKey().equals(key)) {\n entries.set(counter, new Table.Entry<>(key, value));\n return;\n }\n }\n entries.add(new Table.Entry<>(key, value));\n }", "public void put(String key, String value)\n\t{\n\t\tverifyParseState();\n\t\tvalues.put(key, ValueUtil.createValue(value));\n\t}", "@Override\n public V put(final K key, final V value) {\n if (key == null) {\n throw new NullPointerException(\"key\");\n }\n entries.add(new SimpleEntry<K,V>(key, value));\n size = UNKNOWN_SIZE;\n return null;\n }", "public void put(Object key, Object value) throws Exception {\n CacheEntry entry = (CacheEntry)_hash.get(key);\n if (entry != null) {\n entry.setValue(value);\n touchEntry(entry);\n } else {\n\n if (_hash.size() == _max) {\n // purge and recycle entry\n entry = purgeEntry();\n entry.setKey(key);\n entry.setValue(value);\n } else {\n entry = new CacheEntry(key, value);\n }\n addEntry(entry);\n _hash.put(entry.getKey(), entry);\n }\n }", "public void put(final Key key, final Value value) {\n if (value == null) {\n delete(key);\n return;\n }\n int r = rank(key);\n if (r < size && keys[r].compareTo(key) == 0) {\n values[r] = value;\n return;\n }\n if (size == keys.length) {\n resize();\n }\n for (int j = size; j > r; j--) {\n keys[j] = keys[j - 1];\n values[j] = values[j - 1];\n }\n keys[r] = key;\n values[r] = value;\n size++;\n }", "public MutablePair(K key, V value) {\n this.key = key;\n this.value = value;\n }", "@Override\n\tpublic V add(K key, V value) {\n\t\tV result = null;\n\t\tNode currentNode = firstNode;\n\t\t\n\t\tif(currentNode != null && key.equals(currentNode.getKey())){\n\t\t\tresult = (V) currentNode.getValue();\n\t\t\tcurrentNode.setValue(value);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tNode newNode = new Node(key, value);\n\t\t\tif(currentNode == null){\n\t\t\t\tnewNode.setNextNode(firstNode);\n\t\t\t\tfirstNode = newNode;\n\t\t\t}\n\t\t\telse{\n\t\t\t\tfirstNode.setNextNode(newNode);\n\t\t\t}\n\t\tnumberOfEntries++;\t\n\t\t}\n\t\t\n\t\treturn result;\n\t}", "public void put(Object key, Object value) {\n Entry entry = this.cache.get(key);\n\n if (entry == null) {\n // cache is fully used\n if (currentSize >= cacheSize) {\n cache.remove(tail.key);\n removeLast();\n }\n else {\n currentSize++;\n }\n\n entry = new Entry();\n }\n\n // update the K/V in the Entry object\n entry.key = key;\n entry.value = value;\n cache.put(key, entry);\n\n // move to the head of list\n moveToHead(entry);\n }", "public void addKeyValue(String apiName, Object value)\n\t{\n\t\t this.keyValues.put(apiName, value);\n\n\t\t this.keyModified.put(apiName, 1);\n\n\t}", "void put(final Key key, final Value value) {\n if (key == null) {\n throw new IllegalArgumentException(\n \"first argument to put() is null\");\n }\n if (value == null) {\n delete(key);\n return;\n }\n int r = rank(key);\n if (r < size && keys[r].compareTo(key) == 0) {\n values[r] = value;\n return;\n }\n for (int i = size; i > r; i--) {\n keys[i] = keys[i - 1];\n values[i] = values[i - 1];\n }\n keys[r] = key;\n values[r] = value;\n size++;\n }", "abstract protected DataValue updateValue(String key);", "public void insert(Key key, Value value) {\r\n root.insert(key,value);\r\n size++;\r\n }", "@Override\n public V put(K key, V value) {\n\n \tV tempValue = get(key);\n \t\n \tLinkedList<Entry> tempBucket = chooseBucket(key);\n \t\n \tif(tempValue != null) {\n \t\tfor(int i=0;i<tempBucket.size();i++) {\n\t \t\tEntry tempEntry = tempBucket.get(i);\n\t \t\t\n\t \t\tif(tempEntry.getKey() == key) {\n\t \t\t\tV returnValue = tempEntry.getValue();\n\t \t\t\ttempEntry.setValue(value);\n\t \t\t\treturn returnValue;\n\t \t\t}\n\t \t}\n \t} else {\n \t\tsize ++;\n \t\ttempBucket.add(new Entry(key, value));\n \t}\n \t\n \tif(size > buckets.length*ALPHA) {\n \t\trehash(GROWTH_FACTOR);\n \t}\n \t\n return tempValue;\n }", "public void add(K key, V value) {\n Node<K,V> node = root, parent = null;\n int cmp = -1;\n\n while (node != null) {\n cmp = key.compareTo(node.key);\n parent = node;\n if (cmp < 0) {\n node = node.left;\n } else if (cmp > 0) {\n node = node.right;\n } else {\n node.value = value;\n return;\n }\n }\n\n Node<K,V> new_node = new Node<>(key, value);\n if (parent == null) {\n root = new_node;\n } else if (cmp < 0) {\n parent.left = new_node;\n } else {\n parent.right = new_node;\n }\n }", "public int put(K key, V value) {\n return put(key, value, 1);\n }", "public void put(K key, V value) {\n Entry<K, V> entry = segment.put(key, value);\n\n // Time-based eviction strategy is highly important, so creation time\n // tracking is a must. \n long time = System.currentTimeMillis();\n\n //{@see Ticker} is used to reuse timestamp\n // and save some CPU cycles for read opetion. \n ticker.setNextTick(time);\n\n // Update creation time in order to avoid entry removal\n entry.setCreationTime(time);\n\n // Perform a bit of a clean-up. Write performance is critical, so no \n // heavy lifting is supposed to happen here. \n cleanUp();\n }", "@Override\n public void putValue(String key, Object value) {\n\n }", "public void attach(Object key, Object value);", "public V put(K key, V value) {\n System.out.println(\"SimpleTreeMap.put\");\n return mMap.put(key, value);\n }", "public void put(K key, V value) {\n int index = getIndex(getHash(key));\n\n if (table[index] != null) {\n collisionProcessing(key, value, index);\n return;\n }\n\n table[index] = new Entry<>(key, value);\n extend();\n }" ]
[ "0.72074616", "0.7111181", "0.70679516", "0.692424", "0.6875344", "0.6859261", "0.68395656", "0.6832421", "0.6803037", "0.67540437", "0.6735782", "0.6714019", "0.6675324", "0.6675324", "0.6664614", "0.6660028", "0.6657366", "0.66384697", "0.6629542", "0.66178554", "0.66171545", "0.66109514", "0.6592299", "0.6589382", "0.6584986", "0.6537873", "0.65276307", "0.652475", "0.6510356", "0.65068734", "0.650483", "0.6504829", "0.6490899", "0.64833575", "0.64810693", "0.64810187", "0.6476938", "0.64602417", "0.644768", "0.6438913", "0.64339596", "0.6416413", "0.6408956", "0.64075696", "0.63885725", "0.6381429", "0.6344549", "0.63350856", "0.63311213", "0.63258696", "0.6324712", "0.6318526", "0.63036114", "0.62930715", "0.62904704", "0.62837744", "0.62824345", "0.62751794", "0.62512743", "0.62356347", "0.62249404", "0.62204933", "0.62136626", "0.6213369", "0.62104994", "0.6198644", "0.61969405", "0.6196204", "0.61911505", "0.6190043", "0.61870253", "0.61757857", "0.6172545", "0.61695355", "0.6163437", "0.6133545", "0.612708", "0.6126509", "0.61192614", "0.6111905", "0.60978323", "0.6097463", "0.6082879", "0.60791904", "0.6068487", "0.60542655", "0.6052754", "0.6046168", "0.6044967", "0.6044499", "0.60408217", "0.6028824", "0.60282534", "0.60238636", "0.60137516", "0.6013094", "0.6012494", "0.601187", "0.60118175", "0.6009863" ]
0.73446196
0
Sets value. Add key and value to the dictionary pair. It the key exits, update the value.
public void setValue(K key, V value) { this.add(key, value); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setValue(K key, V value);", "public void put(Value key, Value value) {\n\t\tstorage.put(key, value);\n\t}", "public void put(Key key, Value val);", "private void put(K key, V value) {\n\t\t\tif (key == null || value == null)\n\t\t\t\treturn;\n\t\t\telse if (keySet.contains(key)) {\n\t\t\t\tvalueSet.set(keySet.indexOf(key), value);\n\t\t\t} else {\n\t\t\t\tkeySet.add(key);\n\t\t\t\tvalueSet.add(keySet.indexOf(key), value);\n\t\t\t\tsize++;\n\t\t\t}\n\t\t}", "void set(K key, V value);", "public void put(String key, Object value)\n\t{\n\t\tverifyParseState();\n\t\tvalues.put(key, ValueUtil.createValue(value));\n\t}", "public void setValue(String key, Object value)\n {\n if (value != null)\n {\n if (otherDetails == null)\n {\n otherDetails = new Hashtable();\n }\n\n otherDetails.put(key, value);\n }\n }", "public void put(int key, int value) {\n if (get(key) == -1)\n hashMap.add(new int[]{key, value});\n else {\n hashMap.stream().filter(pair -> pair[0] == key)\n .findAny()\n .map(pair -> pair[1] = value);\n }\n }", "public void set(String key, Object value)\n {\n if (value == null) remove(key);\n else if (value instanceof Map)\n {\n DataSection section = createSection(key);\n Map map = (Map) value;\n for (Object k : map.keySet())\n {\n section.set(k.toString(), map.get(k));\n }\n }\n else\n {\n data.put(key, value);\n if (!keys.contains(key)) keys.add(key);\n }\n }", "public Value set(Value key, Value value) {\n\t\tif (get(key) != null)\n\t\t\tput(key, value);\n\t\telse if (parent != null)\n\t\t\tparent.put(key, value);\n\t\telse\n\t\t\tput(key, value);\n\t\treturn value;\n\t}", "public void setDataValue(String key, Object value) {\n\t\t if (value == null) {\n\t\t\t data.remove(key);\n\t\t }else {\n\t\t\t data.put(key, value);\n\t\t }\n\t }", "public void put(Key key,Value value){\n\t\troot = insert(root,key,value);\n\t}", "void putValue(String key, Object data);", "public void put(K key, V value) {\n\t\tif (key == null || value == null) {\n\t\t\tthrow new IllegalArgumentException(\"At least one of the inputs are null\");\n\t\t} else {\n\t\t\tHashMap<K, V> current = map.get(map.size() - 1);\n\t\t\tcurrent.put(key, value);\n\t\t\tmap.remove(map.size() - 1);\n\t\t\tmap.add(current);\n\t\t}\n\t}", "public void put(String key, JsonObject value)\n\t{\n\t\tverifyParseState();\n\t\tvalues.put(key, ValueUtil.createValue(value));\n\t}", "public void put(String key, String value)\n\t{\n\t\tverifyParseState();\n\t\tvalues.put(key, ValueUtil.createValue(value));\n\t}", "public V put(K key, V value) {\n System.out.println(\"SimpleHashMap.put\");\n return mMap.put(key, value);\n }", "public void put(String key, Object value) {\r\n\t\tthis.settings.put(key, value);\r\n\t}", "public void set(String key, String value) {\n if (key.indexOf('=') != -1 || key.indexOf(';') != -1) {\n Log.e(TAG, \"Key \\\"\" + key + \"\\\" contains invalid character (= or ;)\");\n return;\n }\n if (value.indexOf('=') != -1 || value.indexOf(';') != -1) {\n Log.e(TAG, \"Value \\\"\" + value + \"\\\" contains invalid character (= or ;)\");\n return;\n }\n\n mMap.put(key, value);\n }", "public boolean put(K key, V value)\r\n\t{\r\n\t\treturn data.addUpdate(new Entry(key, value));\r\n\t}", "public void setData(@NotNull String key, @NotNull Object value) {\n data.put(key, value);\n }", "public void setData(String key, String value) {\r\n\t\tdata.put(key, value);\r\n\t}", "void put(K key, V value);", "void put(K key, V value);", "public void put(Object key,Object value) {\n map.put(key,value);\n hashtable.put(key,value);\n }", "public final void set(final String key, final Object value) {\n try {\n synchronized (jo) {\n if (value == null) {\n jo.remove(key);\n } else {\n jo.put(key, value);\n }\n }\n } catch (JSONException e) {\n }\n }", "private void put(String aKey, Object aValue) {\n\t\tmData.put(aKey, getValue(aValue));\n\t}", "public V put(K key, V value);", "final void set(String key, String value) {\n set(key, value, false);\n }", "public void put(String key, Object value) {\n\t\tgetMap(value.getClass()).put(key, value);\n\t}", "public void put(int key, int value) {\n int index = keys.indexOf(key);\n if(index >= 0) {\n values.set(index, value);\n } else {\n keys.add(key);\n values.add(value);\n }\n }", "public void set(String key, Object value) {\n set(key, value, 0);\n }", "void set(String key, Object value);", "public final synchronized void put(final K key, final V value) {\n\t\tmap.put(key, value);\n\t}", "public <T> void setValue (String key, T value)\n\t{\n\t\tproperties.get(key).value.setValue(value);\n\t}", "public void \n\tsetData(\n\t\t\tString key, \n\t\t\tObject value) \n\t{\n\t\ttry{\n\t\t\tthis_mon.enter();\n\n\t\t\tif (user_data == null) {\n\t\t\t\tuser_data = new HashMap();\n\t\t\t}\n\t\t\tif (value == null) {\n\t\t\t\tif (user_data.containsKey(key))\n\t\t\t\t\tuser_data.remove(key);\n\t\t\t} else {\n\t\t\t\tuser_data.put(key, value);\n\t\t\t}\n\t\t}finally{\n\t\t\tthis_mon.exit();\n\t\t}\n\t}", "public void setPropertyValue(String key, String value) {\n\t\tthis.configMap.put(key, value);\r\n\t}", "public void setVal(String key, String val) {\n Optional<KeyValList> kv = findKeyVal(key);\n\n if (kv.isPresent()) {\n // Remove already existing value of the same key\n if (kv.get().getCfgVal().equals(val)) {\n // Key and Value are the same, nothing to do\n return;\n }\n\n // Remove the old value\n this.builder.getKeyValList().remove(kv.get());\n }\n\n if (null == this.builder.getKeyValList()) {\n // This is the first key-value pair, need to create list\n this.builder.setKeyValList(new LinkedList<KeyValList>());\n }\n\n // Build the new key-value pair and add to the list\n KeyValListBuilder kvBuilder = new KeyValListBuilder();\n kvBuilder.setCfgKey(key);\n kvBuilder.setCfgVal(val);\n this.builder.getKeyValList().add(kvBuilder.build());\n }", "public void put(K key, V value) {\n int keyBucket = hash(key);\n \n HashMapEntry<K, V> temp = table[keyBucket];\n while (temp != null) {\n if ((temp.key == null && key == null) \n || (temp.key != null && temp.key.equals(key))) {\n temp.value = value;\n return;\n }\n temp = temp.next;\n }\n \n table[keyBucket] = new HashMapEntry<K, V>(key, value, table[keyBucket]);\n size++;\n }", "public void put(int key, int value) {\n store[key] = value; // update operation= overwritten \n }", "public void set(String key, Object value) {\r\n\t\tthis.context.setValue(key, value);\r\n\t}", "V put(final K key, final V value);", "protected abstract void put(K key, V value);", "public void put(Object key, Object value) {\n\t\tint index = key.hashCode() % SLOTS;\n\t\t// check if key is already present in that slot/bucket.\n\t\tfor(Pair p:table[index]) {\n\t\t\tif(key.equals(p.key)) {\n\t\t\t\tp.value = value; // overwrite value if key already present.\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\t// if not present, add key-value pair in that slot/bucket.\n\t\tPair pair = new Pair(key, value);\n\t\ttable[index].add(pair);\n\t}", "@Override\n public void put(K key, V value) {\n root = putHelper(key,value,root);\n }", "@Override\n public void putValue(String key, Object value) {\n\n }", "public void put (String key, Object value) {\n if (trace) {\n getProfiler().checkPoint(\n String.format(\" %s='%s' [%s]\", key, value, Thread.currentThread().getStackTrace()[2])\n );\n }\n getMap().put (key, value);\n synchronized (this) {\n notifyAll();\n }\n }", "public void put(String key, Value val) {\n root = put(root, key, 0, val);\n }", "public static void put(final String key, final Object value) {\r\n\t\tMap<String, String> map = new HashMap<String, String>(data.get());\r\n\t\tif (value == null) {\r\n\t\t\tmap.remove(key);\r\n\t\t} else {\r\n\t\t\tmap.put(key, value.toString());\r\n\t\t}\r\n\t\tdata.set(Collections.<String, String> unmodifiableMap(map));\r\n\t}", "V put(K key, V value);", "public void put(Key key, Value value) {\n\t\tNode entry = new Node(key, value, current_node);\n\t\tcurrent_node = entry; size++;\n\t}", "@Override\n public void put(K key, V value) {\n root = put(root, key, value);\n }", "public MutablePair(K key, V value) {\n this.key = key;\n this.value = value;\n }", "public void put(K key, V value) {\n\t\ttable.get(calcIndex(key)).put(key, value);\n\t}", "void updateEntry(K key, V value);", "public void put(String key, T value) {\r\n\t\troot = put (root, key, value, 0);\r\n\t}", "public void putKV(String key, String value) throws Exception;", "public void put(String key, E value) {\n getOrCreateNode(key).data = value;\n }", "public void set(String key, String value){\n\t\tif(first == null){\n\t\t\tfirst = new ListMapEntry(key, value);\n\t\t}\n\t\tListMapEntry temp = first;\n\t\tListMapEntry prev = null;\n\t\twhile(temp!=null && !temp.getKey().equals(key)){\n\t\t\tprev = temp;\n\t\t\ttemp = temp.getNext();\n\t\t}\n\t\tif(temp==null){\n\t\t\tprev.setNext(new ListMapEntry(key, value));\n\t\t}\n\t\telse{\n\t\t\ttemp.setValue(value);\n\t\t}\n\t}", "public void put(String key, String value){\n if(key != null && value != null) {\n urlParams.put(key, value);\n try {\n\t\t\t\tmJsonmap.put(key, value);\n\t\t\t} catch (JSONException e) {\n\t\t\t}\n }\n }", "public void put(K key, V val) {\n int index = findIndex(key);\n // the real reason we bother to check is \n // to know whether or not to increment pairs.\n if (keys[index] == null) {\n keys[index] = key;\n values[index] = val;\n }\n else\n values[index] = val;\n }", "public V put(K key, V value) {\n System.out.println(\"SimpleTreeMap.put\");\n return mMap.put(key, value);\n }", "public V put(K key, V value) throws InvalidKeyException;", "public V put(K key, V value) {\r\n\t\t// if (this.contains(key)){\r\n\t\t// return this.changeValue(key, value);\r\n\t\t// } else {\r\n\t\treturn linearProbing(key, value);\r\n\t}", "@Override\n public V put(K key, V value) {\n reverseMap.put(value, key);\n return super.put(key, value);\n }", "public void put(K key, V value) {\r\n size++;\r\n checkAndModifySize();\r\n\r\n Node newElement = new Node(key, value);\r\n int currentHash = newElement.hash % data.length;\r\n if (currentHash < 0){\r\n currentHash *= -1;\r\n }\r\n\r\n if (data[currentHash] == null) {\r\n data[currentHash] = newElement;\r\n } else {\r\n Node currentElement = data[currentHash];\r\n while (currentElement.next != null) {\r\n if (currentElement.key == key || currentElement.key.equals(key)) {\r\n currentElement.value = value;\r\n size--;\r\n return;\r\n }\r\n currentElement = currentElement.next;\r\n }\r\n currentElement.next = newElement;\r\n }\r\n }", "public static void put(String key, Object value) {\n synchronized (props) {\n props.put(key, value);\n }\n }", "public void put(K key, V value) {\n if (null == key) {\n throw new IllegalStateException(\"Null value for key is \" +\n \"unsupported!\");\n }\n\n Node<Pair<K, V>> node = findItem(key);\n\n if (node != null) {\n node.getData().value = value;\n return;\n }\n\n Pair<K, V> entry = new Pair<>(key, value);\n\n int hash1 = hash1(key);\n int hash2 = hash2(key);\n\n int count1 = table[hash1] == null ? 0 : table[hash1].list.getCount();\n int count2 = table[hash2] == null ? 0 : table[hash2].list.getCount();\n\n if (count1 <= count2) {\n if (table[hash1] == null) {\n table[hash1] = new Entry<>();\n }\n\n table[hash1].list.put(entry);\n } else {\n if (table[hash2] == null) {\n table[hash2] = new Entry<>();\n }\n\n table[hash2].list.put(entry);\n }\n\n if (++elementsCount > table.length * OCCUPANCY) {\n rehash();\n }\n }", "@Override\r\n\t\tpublic V setValue(V value) {\n\t\t\treturn pair.setSecond(value);\r\n\t\t}", "public void addKeyValue (String key, String value){\r\n\t\tcodebook.put(key, value);\r\n\t}", "public void add(K key,V value) {\n DictionaryPair pair = new DictionaryPair(key,value);\n int index = findPosition(key);\n\n if (index!=DsConst.NOT_FOUND) {\n list.set(index,pair);\n } else {\n list.addLast(pair);\n this.count++;\n }\n }", "public void put(String key, int value)\n\t{\n\t\tverifyParseState();\n\t\tvalues.put(key, ValueUtil.createValue(value));\n\t}", "protected void set(String key, String value)\r\n\t{ this.preferences.put(key, value); }", "public void set(Object key, Object value) {\n if(attributes == null)\n attributes = new HashMap<>();\n attributes.put(key, value);\n }", "@Override\n public void put(K key, V value) {\n // Note that the putHelper method considers the case when key is already\n // contained in the set which will effectively do nothing.\n root = putHelper(root, key, value);\n size += 1;\n }", "Object put(Object key, Object value);", "public abstract V put(K key, V value);", "final <T> void set(String key, T value) {\n set(key, value, false);\n }", "void put(String key, Object value);", "public void put(Object key, Object value) throws Exception {\n CacheEntry entry = (CacheEntry)_hash.get(key);\n if (entry != null) {\n entry.setValue(value);\n touchEntry(entry);\n } else {\n\n if (_hash.size() == _max) {\n // purge and recycle entry\n entry = purgeEntry();\n entry.setKey(key);\n entry.setValue(value);\n } else {\n entry = new CacheEntry(key, value);\n }\n addEntry(entry);\n _hash.put(entry.getKey(), entry);\n }\n }", "public void put(int key, int value) {\n map.put(key,value);\n }", "public void put(final Key key, final Value value) {\n if (value == null) {\n delete(key);\n return;\n }\n int r = rank(key);\n if (r < size && keys[r].compareTo(key) == 0) {\n values[r] = value;\n return;\n }\n if (size == keys.length) {\n resize();\n }\n for (int j = size; j > r; j--) {\n keys[j] = keys[j - 1];\n values[j] = values[j - 1];\n }\n keys[r] = key;\n values[r] = value;\n size++;\n }", "public static void set(int key, int value) {\n\t\t// your code here\n\t\tif (!map.containsKey(key)) {\n\t\t\tif (map.size() == size) {\n\t\t\t\tfor (Integer i : map.keySet()) {\n\t\t\t\t\tmap.remove(i);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tmap.put(key, value);\n\t\t\t}\n\t\t\telse\n\t\t\t\tmap.put(key, value);\n\t\t} else {\n\t\t\tmap.remove(key);\n\t\t\tmap.put(key, value);\n\t\t}\n\n\t}", "@Override\r\n public void updateEntryValue(Object key, Object value) throws Exception\r\n {\n }", "public void put(Object key, Object value) {\n \t\tLog.i(TAG, String.format(\"Cache put key: %s, value: %s\", key, value.toString()));\n \t\tcacheMap.put(key, value);\n \t}", "public void put(String key, String value) {\n\n\t\t//get the old value of the key\n\t\tString oldValue = get(key);\n\t\t\n\t\t//get this file's text\n\t\tString text = FileIO.read(this.getPath());\n\t\t\n\t\t//if it's the first time you're putting this key in, add a new key-value line\n\t\tif(oldValue==null) {\n\t\t\ttext+=key+\" : \"+value+\"\\n\";\n\t\t}else {\n\t\t\t//else replace oldValue with new value\n\t\t\ttext = text.replace(key+\" : \"+oldValue, key+\" : \"+value);\n\t\t}\n\t\t\n\t\t//push changes\n\t\tFileIO.write(this.getPath(), text);\n\t\t\n\t}", "public int put(K key, V value) {\n return put(key, value, 1);\n }", "public void put(int key, int value) {\n int hashedKey = hash(key);\n Entry entry = map.get(hashedKey);\n if (entry.key == -1){\n // empty entry, insert entry\n entry.key = key;\n entry.value = value;\n }else if (entry.key == key){\n // target entry\n entry.value = value;\n }else{\n // in list, find target entry\n while(entry.key != key && entry.next!=null){\n entry = entry.next;\n }\n if (entry.key == key)\n entry.value = value;\n else\n entry.next = new Entry(key, value);\n }\n }", "public void put(K key, V value)\n\t{\n\t\tcheckForNulls(key, value);\n\t\tint n = Math.abs(key.hashCode() % entries.length);\n\t\t\n\t\tif (entries[n] == null)\n\t\t{\n\t\t\tentries[n] = new LinkedList<>();\n\t\t\tentries[n].addFirst(new Entry(key, value));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tEntry e = new Entry(key, value);\n\t\t\t\n\t\t\tif (entries[n].contains(e) == true)\n\t\t\t\tentries[n].remove(e);\n\t\t\t\n\t\t\tentries[n].addFirst(e);\n\t\t}\n\t}", "public V put(final K key, final V value) {\r\n if (key == null) {\r\n return null;\r\n }\r\n\r\n // find the place to put it and stuff it in, overwriting what was\r\n // previously there\r\n int pos = getKeyPosition(key);\r\n V prevValue = null;\r\n CacheData<K, V> cacheData = getCacheData(pos);\r\n if (cacheData != null) {\r\n prevValue = cacheData.getValue();\r\n cacheData.setKeyValue(key,value);\r\n } else {\r\n setCacheData(pos, factory.createPair(key, value));\r\n }\r\n\r\n return (cacheData == null) ? null : prevValue;\r\n }", "abstract protected DataValue updateValue(String key);", "public V add(K key, V value)\n { \n checkInitialization();\n if ((key == null) || (value == null))\n throw new IllegalArgumentException();\n else\n { \n V result = null; \n int keyIndex = locateIndex(key); \n if ((keyIndex < numberOfEntries) && \n key.equals(dictionary[keyIndex].getKey()))\n {\n // Key found; return and replace entry's value\n result = dictionary[keyIndex].getValue(); // Get old value\n dictionary[keyIndex].setValue(value); // Replace value \n }\n else // Key not found; add new entry to dictionary\n { \n makeRoom(keyIndex);\n dictionary[keyIndex] = new Entry(key, value);\n numberOfEntries++;\n ensureCapacity(); // Ensure enough room for next add\n } // end if \n return result;\n } // end if\n }", "public void put(String key, JsonArray value)\n\t{\n\t\tverifyParseState();\n\t\tvalues.put(key, ValueUtil.createValue(value));\n\t}", "public com.opentext.bn.converters.avro.entity.ContentKey.Builder setKeyValue(java.lang.String value) {\n validate(fields()[1], value);\n this.keyValue = value;\n fieldSetFlags()[1] = true;\n return this;\n }", "public void put(K key, V value) {\n int hash = getHash(key.hashCode());\n Entry<K, V> existing = buckets[hash];\n Entry<K, V> entry = new Entry<>(key, value);\n\n if (existing == null) {\n buckets[hash] = entry;\n } else { // using separating chaining collision resolution. Another way is open addressing, resizing the array to reducing collision.\n while(existing.next != null) {\n if (existing.key.equals(key)) {\n existing.value = value;\n return;\n }\n existing = existing.next;\n }\n if (existing.key.equals(key)) {\n existing.value = value;\n } else {\n existing.next = entry;\n }\n }\n }", "public MapBuilder<M, K, V> put(K key, V value)\n {\n map.put(key, value);\n return this;\n }", "public void put(K key, V value) {\n Entry<K, V> entry = segment.put(key, value);\n\n // Time-based eviction strategy is highly important, so creation time\n // tracking is a must. \n long time = System.currentTimeMillis();\n\n //{@see Ticker} is used to reuse timestamp\n // and save some CPU cycles for read opetion. \n ticker.setNextTick(time);\n\n // Update creation time in order to avoid entry removal\n entry.setCreationTime(time);\n\n // Perform a bit of a clean-up. Write performance is critical, so no \n // heavy lifting is supposed to happen here. \n cleanUp();\n }", "boolean put(K key, V value);", "@Override\n\tpublic void set(String key, JsonObject value, final Handler<Void> handler) {\n\t\tthis.store.set(key, value, handler);\n\t}", "void set(String key, String value) {\n if (notAnyEmpty(key, value))\n settings.put(key, value);\n }" ]
[ "0.7777818", "0.7341793", "0.7244698", "0.723383", "0.7110498", "0.70105976", "0.6992011", "0.6790107", "0.6764305", "0.675715", "0.67502606", "0.6746778", "0.6740471", "0.67393017", "0.6716575", "0.6670988", "0.66674", "0.66403437", "0.6639613", "0.66325945", "0.66317284", "0.6622015", "0.6611921", "0.6611921", "0.66034585", "0.66006565", "0.65999365", "0.6584318", "0.6582463", "0.6570238", "0.654148", "0.653955", "0.6527135", "0.65254086", "0.65225136", "0.65151757", "0.6500673", "0.6497182", "0.6483824", "0.6478366", "0.6467107", "0.6460904", "0.64582086", "0.64562035", "0.64410037", "0.64390576", "0.64358276", "0.64015573", "0.6388107", "0.6387586", "0.6368619", "0.63667685", "0.6365536", "0.6339246", "0.63376516", "0.63373715", "0.6334737", "0.6333835", "0.6332498", "0.63248247", "0.63087934", "0.6303329", "0.62916505", "0.62857676", "0.6283187", "0.62790227", "0.6277638", "0.6276565", "0.62741107", "0.62556785", "0.6249278", "0.6243157", "0.62416893", "0.6238019", "0.6221708", "0.6211963", "0.6211383", "0.6201545", "0.61951476", "0.6176426", "0.61724144", "0.61696905", "0.6160151", "0.6160114", "0.61565846", "0.6156123", "0.61531574", "0.6150171", "0.61408746", "0.6133223", "0.6129573", "0.61237663", "0.61218774", "0.6119062", "0.6116635", "0.61163694", "0.61046684", "0.60921055", "0.6087493", "0.6085361" ]
0.7723468
1
Gets value. Input a key, and return the corresponding value. If the key doesn't exist, return null
public V getValue(K key) { int i = findPosition(key); if (i==DsConst.NOT_FOUND) { return null; } DictionaryPair p = list.get(i); return p.getValue(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public V get(K key) {\n if (null == key) {\n throw new IllegalStateException(\"Null value for key is \" +\n \"unsupported!\");\n }\n\n V result = null;\n\n Node<Pair<K, V>> node = findItem(key);\n\n if (node != null) {\n result = node.getData().value;\n }\n\n return result;\n\n }", "public V get(K key) {\r\n\t\t\tif (key == null) {\r\n\t\t\t\tthrow new NullPointerException();\r\n\t\t\t} else if (find(key) == null) {\r\n\t\t\t\treturn null;\r\n\t\t\t} else {\r\n\t\t\t\treturn find(key).value;\r\n\t\t\t}\r\n\t\t}", "public V get(K key)\r\n\t{\r\n\t\tEntry retrieve = data.get(new Entry(key, null));\r\n\t\t\r\n\t\tif(retrieve != null)\r\n\t\t{\r\n\t\t\treturn retrieve.value;\r\n\t\t}\r\n\t\t\r\n\t\treturn null;\r\n\t}", "public Value get(Key key);", "public Value get(String key) {\n Node x = get(root, key, 0);\n if (x == null) return null; //node does not exist\n else return (Value) x.val; //found node, but key could be null\n }", "public Value get(String key)\r\n {\r\n if (key.equals(\"\")) return null_str_val;\r\n Node<Value> x = get(root, key, 0);\r\n return x == null ? null : x.val;\r\n }", "public V get(K key) {\n int index = findIndex(key);\n if (keys[index] == null)\n return null;\n else\n return values[index];\n }", "public V get(K key){\n\t\t\n\n\t\tNode n=searchkey(root, key);\n\n\t\t\n\t\tif(n!=null && n.value!=null){\n\t\t\treturn n.value;\n\t\t}\n\t\telse{\n\t\t\treturn null;\n\t\t}\n\t}", "public V get(K key) {\n if (key == null) {\n MyEntry<K, V> entry = null;\n try {\n entry = bucket[0];\n if (entry != null) {\n return entry.getValue();\n }\n } catch (NullPointerException e) {\n }\n } else {\n // other keys\n MyEntry<K, V> entry = null;\n int location = hashFunction(key.hashCode());\n entry = bucket[location];\n if (entry != null && entry.getKey() == key) {\n return entry.getValue();\n }\n }\n return null;\n }", "V get(final K key);", "public V get(K key) {\n V value = null;\n\n if (key != null) {\n int index = indexFor(key);\n if (container[index] != null) {\n value = (V) container[index].value;\n }\n }\n return value;\n }", "public Object get(Object key){\n\t\tNode tempNode = _locate(key);\r\n\t\tif(tempNode != null){\r\n\t\t\treturn tempNode._value;\r\n\t\t}else{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t}", "public V get(K key)\n\t{\n\t\tcheckForNulls(key);\n\t\tint n = Math.abs(key.hashCode() % entries.length);\n\t\t\n\t\tif (entries[n] == null)\n\t\t\treturn null;\n\t\t\n\t\tfor (Entry e : entries[n])\n\t\t{\n\t\t\tif (key.equals(e.key) == true)\n\t\t\t\treturn e.value;\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "V get(K key);", "V get(K key);", "V get(K key);", "V get(K key);", "V get(K key);", "V get(K key);", "V get(K key);", "public Value get(Key key)\t\t\t\t//Value passed with Key(Null if key is absent)\n\t{\n\t\tNode x=root;\n\t\twhile(x!=null)\n\t\t{\n\t\t\tint cmp=key.compareTo(x.key);\n\t\t\tif(cmp<0)\tx=x.left;\n\t\t\telse if(cmp>0)\tx=x.right;\n\t\t\telse if(cmp==0)\treturn x.val;\n\t\t}\n\t\treturn null;\n\t}", "public V getValue(K key)\r\n\t{\r\n\t\tint slot = findSlot(key, false);\r\n\t\t\r\n\t\tif (slot < 0) \r\n\t\t{\r\n\t\t\treturn null;\r\n\t\t}\r\n\t\tMapEntry<K, V> e = table[slot];\r\n\t\treturn e.getValue();\r\n\t}", "public V getValue(K key);", "public V getValue(K key);", "public Object get(String key)\n\t{\n\t\tverifyParseState();\n\t\t\n\t\tValue value = values.get(key);\n\t\tif(value == null)\n\t\t\treturn null;\n\t\treturn value.value;\n\t}", "private V get(K key) {\n\t\t\tif (keySet.contains(key)) {\n\t\t\t\treturn valueSet.get(keySet.indexOf(key));\n\t\t\t}\n\t\t\treturn null;\n\t\t}", "public V getValue(K key)\n {\n V result = null;\n int keyIndex = locateIndex(key);\n if ((keyIndex < numberOfEntries) && \n key.equals(dictionary[keyIndex].getKey()))\n result = dictionary[keyIndex].getValue();\n return result;\n }", "public Value get(Key key) ;", "public Value get(Key key) {\r\n\t\t\tValue ret = null;\r\n\t\t\t\r\n\t\t\tdata.reset();\r\n\t\t\tfor (int i = 0; i < data.size(); i++) {\r\n\t\t\t\tif (data.get().getKey().compareTo(key) == 0) {\r\n\t\t\t\t\tret = data.get().getValue();\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tdata.next();\r\n\t\t\t}\r\n\t\t\tdata.reset();\r\n\t\t\t\r\n\t\t\treturn ret;\r\n\t\t}", "public V searchValue (K key) {\n\t\tfor (Map.Entry<K, V> entry : this.entrySet()) {\n\t\t\tif (entry.getKey() == key) {\n\t\t\t\treturn entry.getValue();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "private DataValue getValueForKey(String key) {\n DataValue value = valueMap.get(key);\n if (value == null) {\n return DataValue.NO_VALUE;\n } else {\n return value;\n }\n }", "Object get(String key);", "Object get(String key);", "public T getValue(String key) {\r\n\t\tNode node = getNode(root, key, 0);\r\n\t\treturn node == null ? null : node.value;\r\n\t}", "public V get(final K key)\n {\n final StackElement element = this.hashMap.get(key);\n\n if (element != null)\n {\n return element.value;\n }\n\n return null;\n }", "String getValue(String type, String key);", "V get(Object key);", "Object get(Object key);", "public V get(K key);", "public V value(K key) {\n for(MapEntry<K, V> t : this) {\n if (t == null) continue;\n if (t.key().equals(key)) return t.value();\n }\n\n return null;\n }", "public Object lookup(String key){\n ListNode<String,Object> temp = getNode(key);\n if(temp != null)\n return temp.value;\n else\n return null;\n }", "@Override\n\tpublic Optional<Value> get(Key k) {\n\t\treturn bst.find(k);\n\t}", "Optional<V> get(K key);", "public Value get(final Key key) {\n int r = rank(key);\n if (r < size && (keys[r].compareTo(key) == 0)) {\n return values[r];\n }\n return null;\n }", "public AnyType get(AnyType key) {\n \tif (contains(key)) {\n \t\tint currentPos = findPos( key );\n \t\t\treturn ((array[currentPos] != null) ? array[currentPos].value : null); \n \t}\n \telse {\n \t\treturn null;\n \t}\n }", "private Value get(Node node, Key key ) {\n if ( node.key.equals( key ) ) {\n return (Value) node.value;\n }\n\n if ( key.compareTo( (Key)node.key ) < 0 ) {\n return node.left.value == null ? null : get(node.left,key);\n }\n else {\n return node.right.value == null ? null : get(node.right,key);\n }\n }", "public V get(K key) {\n int index = getIndex(getHash(key));\n Entry<K, V> entry = (Entry<K, V>) table[index];\n\n if (entry == null) {\n return null;\n }\n\n if (!entry.hasNext()) {\n return entry.getValue();\n }\n\n while (entry.hasNext()) {\n if (entry.getKey().equals(key))\n return entry.getValue();\n entry = entry.getNext();\n }\n\n if (entry.getKey().equals(key))\n return entry.getValue();\n\n return null;\n }", "public Object get(String key);", "V getValue(final E key) {\r\n for (int i=0;i<kcount;i++) {\r\n if (equal(key, (E)k[i])) return (V)v[i];\r\n }\r\n return null;\r\n }", "@Override\n public V get(K key) {\n if(containsKey(key)) {\n LinkedList<Entry<K, V>> pointer = entryArr[Math.floorMod(key.hashCode(), entryArr.length)];\n return pointer.stream().filter(x->x.key.equals(key))\n .collect(Collectors.toList()).get(0).value;\n }\n return null;\n }", "public Object get(String key) {\n \t\treturn this.get(null, key);\n \t}", "@Override\n\tpublic V getValue(K key) {\n\t\tNode currentNode = firstNode;\n\t\t\n\t\tif(!isEmpty()){\n\t\t\twhile(currentNode.key != key){\n\t\t\t\tif(currentNode.getNextNode() == null){\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\treturn (V)currentNode.value;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t\t\n\t}", "public T get(T key) {\n\t\tNode<T> node = root;\n\t\twhile (node != null) {\n\t\t\tif (key.compareTo(node.value) == 0) {\n\t\t\t\treturn node.value;\n\t\t\t} else if (key.compareTo(node.value) < 0) {\n\t\t\t\tnode = node.right;\n\t\t\t} else {\n\t\t\t\tnode = node.left;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public DataValue lookup(String key) {\n if (validateKey(key)) {\n return getValueForKey(key);\n } else {\n return DataValue.NO_VALUE;\n }\n }", "public String getValue(String key) {\n\t\tfinal Iterator<Map.Entry<String, String>> iter = entries.iterator();\n\t\twhile (iter.hasNext()) {\n\t\t\tfinal Map.Entry<String, String> entry = iter.next();\n\t\t\tif (entry.getKey().equals(key)) {\n\t\t\t\treturn entry.getValue();\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public V get(K key) {\r\n\t\tint place = hash(key.hashCode());\r\n\t\tif (hashMapArray[place] != null) {\r\n\t\t\tLinkedList<KVPair> temp = hashMapArray[place];\r\n\t\t\tfor (KVPair i : temp) {\r\n\t\t\t\tif (i.getKey().equals(key)) {\r\n\t\t\t\t\treturn i.getValue();\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "public V get(String key);", "String get(Integer key);", "@Override\n\t@TimeComplexity(\"O(log n)\")\n\tpublic V get(K key) {\n\t/* TCJ\n\t * Binary search operation: log n\n\t */\n\t\tint j = findIndex(key);\n\t\tif ( j == size() || key.compareTo(map.get(j).getKey()) != 0 ) { return null; }\n\t\treturn map.get(j).getValue();\n\t}", "public V get(Object key) {\r\n\t\tif (key == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tint slotIndex = Math.abs(key.hashCode()) % table.length;\r\n\r\n\t\tif (table[slotIndex] == null) {\r\n\t\t\treturn null;\r\n\t\t}\r\n\r\n\t\tTableEntry<K, V> currentElement = table[slotIndex];\r\n\r\n\t\tdo {\r\n\t\t\tif (currentElement.key.equals(key)) {\r\n\t\t\t\treturn currentElement.value;\r\n\t\t\t}\r\n\r\n\t\t\tcurrentElement = currentElement.next;\r\n\t\t} while (currentElement != null);\r\n\r\n\t\treturn null;\r\n\t}", "public String get(String key) {\n \ttmp = getNode(key);\n \tif (tmp != null) { \n \t\treturn tmp.getVal();\n \t}\n \treturn null;\n }", "public <T> T get(TypedKey<T> key)\n\t{\n\t\tObject value = map.get(Objects.requireNonNull(key));\n\t\treturn (value == null) ? key.getDefaultValue() : key.cast(value);\n\t}", "public V getValue( K key ) {\r\n\t\tint bucketIndex = getBucketIndex( key );\r\n\t\tMapNode<K, V> head = buckets.get(bucketIndex);\r\n\t\twhile( head != null ) {\r\n\t\t\tif( head.key.equals(key)) {\r\n\t\t\t\treturn head.value;\r\n\t\t\t}\r\n\t\t\thead = head.next;\r\n\t\t}\r\n\t\treturn null;\t\r\n\t}", "T get(@NonNull String key);", "public T get(Object key)\n\t{\n\t\tif(root == null || key == null)\n\t\t\treturn null;\n\t\tif(!(key instanceof CharSequence))\n\t\t\treturn null;\n\t\treturn root.get((CharSequence)key,0);\n\t}", "public Value get(Value key) {\n\t\treturn storage.get(key);\n\t}", "protected abstract V get(K key);", "public V get(K key) {\n int hashCode = scaledHashCode(key);\n OwnLinkedList<K, V> list = table[hashCode];\n if (list == null) {\n return null;\n }\n PairNode<K, V> result = list.search(key);\n if (result == null) {\n return null;\n }\n return result.getValue();\n }", "public Value get(Key key){\n\t\tNode x = root;\n\t\twhile(x!=null){\n\t\t\tif(key.compareTo(x.key)<0)\n\t\t\t\tx = x.left;\n\t\t\telse if(key.compareTo(x.key)>0)\n\t\t\t\tx = x.right;\n\t\t\telse\n\t\t\t\treturn x.value;\n\t\t}\n\t\treturn null;\n\t}", "<T> T getValue(DataKey<T> key);", "public String lookup(String key){\n Node N;\n N = findKey(root, key);\n return ( N == null ? null : N.item.value );\n }", "public abstract V get(K key);", "public Object get(Object key) {\n\t\tint index = key.hashCode() % SLOTS;\n\t\t// check if key is already present in that slot/bucket.\n\t\tfor(Pair p:table[index]) {\n\t\t\tif(key.equals(p.key))\n\t\t\t\treturn p.value;\n\t\t}\n\t\t// if not found, return null\n\t\treturn null;\n\t}", "@Override\n\tpublic V get(Object key) {\n\t\treturn map.get(key);\n\t}", "public native V get(K key);", "public T get(K key);", "@Nullable\r\n public Object get(String key) {\r\n if (attributeMap.containsKey(key)) {\r\n return attributeMap.get(key);\r\n } else if (parent.isPresent()) {\r\n return parent.get().get(key);\r\n } else {\r\n return null;\r\n }\r\n }", "public V get(Object key) { return _map.get(key); }", "public V get(K key) throws InvalidKeyException;", "public V get(K key) {\r\n int hash = key.hashCode() % data.length;\r\n if (hash < 0){\r\n hash *= -1;\r\n }\r\n V result = null;\r\n if (data[hash] != null) {\r\n Node currentNode = data[hash];\r\n while (currentNode != null) {\r\n if (currentNode.key == key || currentNode.key.equals(key)) {\r\n result = (V) currentNode.value;\r\n }\r\n currentNode = currentNode.next;\r\n }\r\n }\r\n return result;\r\n }", "public Character get(String key){\r\n\t\tint hash = hash(key);\r\n for(int i = 0; i < M; i++){\r\n \tif(hash + i < M){\r\n if(keys[hash + i] != null && keys[hash + i].equals(key))\r\n return vals[hash + i];\r\n }else{\r\n if(keys[hash + i - M] != null && keys[hash + i - M].equals(key))\r\n return vals[hash + i - M];\r\n }\r\n\t\t}\r\n return null;\r\n\t}", "public Object getValue(String key)\n {\n if (otherDetails == null)\n {\n return null;\n }\n else\n {\n return otherDetails.get(key);\n }\n }", "public V lookup(K key);", "Object get(Object key) throws NullPointerException;", "private V get(TreeNode<K, V> node, K key){\n if(node == null){\r\n return null;\r\n }\r\n \r\n // Compare the key passed into the function with the keys in the tree\r\n // Recursive function calls determine which direction is taken\r\n if (node.getKey().compareTo(key) > 0){\r\n // If the current node has a value greater than our key, go left\r\n return get(node.left, key);\r\n }\r\n else if (node.getKey().compareTo(key) < 0){\r\n // If the current node has a value less than our key, go right\r\n return get(node.right, key);\r\n }\r\n else{\r\n // If the keys are equal, a match is found return the value\r\n return node.getValue();\r\n }\r\n }", "public V get(String key) {\n int index = hashOf(key);\n if (index >= capacity) return null;\n return (V) values[index];\n }", "public V get( K key ) {\n WeakReference<V> valueRef = map.get( key );\n return valueRef == null ? null : valueRef.get();\n }", "public Optional<V> lookup(K key) {\n Optional<V> mt = Optional.empty();\n return this.entries.foldr(((kvp, o)-> kvp.left.equals(key) ? Optional.of(kvp.right) : o) , mt);\n }", "public V get(final K key) {\n expunge();\n final int hash = hash(key);\n final int index = index(hash, entries.length);\n Entry<K, V> entry = entries[index];\n while (entry != null) {\n if (entry.hash == hash && key == entry.get()) {\n return entry.value;\n }\n entry = entry.nextEntry;\n }\n return null;\n }", "public String get(int key) {\n String sql = \"SELECT data_val FROM data_map WHERE data_key = ?\";\n\n String value = null;\n try (Connection con = this.connect();\n PreparedStatement pstmt = con.prepareStatement(sql)) {\n pstmt.setInt(1, key);\n ResultSet rs = pstmt.executeQuery();\n\n if (!rs.isClosed()) {\n value = rs.getString(\"data_val\");\n rs.close();\n }\n }\n catch (SQLException e) {\n value = null;\n }\n\n return value;\n }", "public V get(K searchKey) {\n\t\tint index = hash(searchKey);\n\t\t\n\t\tIterator<WordCode<K, V>> itr = myBuckets.get(index).iterator();\n\t\twhile (itr.hasNext()) {\n\t\t\tWordCode<K, V> itrVal = itr.next();\n\t\t\tif (itrVal.myKey.equals(searchKey)) return itrVal.myValue;\n\t\t}\n\t\t\n\t\treturn null;\n\t}", "T get(String key);", "public String lookup(String key){\n Node N = front;\n while( N != null){\n if( N.key.equals(key)){\n return N.value;\n }\n N = N.next;\n }\n return null;\n }", "@Override\n\tpublic V get(K key) {\n\t\tint h = Math.abs(key.hashCode()) % nrb;// calculam hash-ul asociat cheii\n\t\tfor (int i = 0; i < b.get(h).getEntries().size(); i++) {\n\t\t\t// parcurgerea listei de elemente pentru a gasi cheia ceruta si a\n\t\t\t// intoarte valoarea dorita\n\t\t\tif (b.get(h).getEntries().get(i).getKey().equals(key)) {\n\t\t\t\treturn b.get(h).getEntries().get(i).getValue();\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}", "public V get(Object key) {\r\n if (cacheDelegate != null) {\r\n cacheDelegate.keyLookup(key);\r\n }\r\n\r\n if (key == null) {\r\n return null;\r\n }\r\n\r\n V value;\r\n CacheData<K, V> cacheData = getEntry(key);\r\n if (cacheData != null) {\r\n // see if the key passed in matches this one\r\n if ((value = cacheData.validateKey(key, cacheDelegate)) != null) {\r\n return value;\r\n }\r\n }\r\n // if we made it here and source!=null use the passthrough\r\n if (source!=null) {\r\n value = source.get(key);\r\n put((K)key, value);\r\n return value;\r\n }\r\n return null;\r\n }", "public E get(String key) {\r\n Integer index = keys.get(key);\r\n if (index == null || index >= items.size()) {\r\n return null;\r\n }\r\n return items.get(index);\r\n }", "public <K> Object getSpecific(K key, String valueKey);", "public String getVal(String key) {\n Optional<KeyValList> kv = findKeyVal(key);\n\n if (kv.isPresent()) {\n return kv.get().getCfgVal();\n }\n\n return null;\n }", "public V getValue(K Key){\n\t\tint idx = getIndex(Key);\n\t\tHashNode<K,V> head = myHashTable.get(idx);\n\t\twhile(head!=null){\n\t\t\tif(head.isKey(Key))\n\t\t\t\treturn head.getValue();\n\t\t\thead=head.next();\n\t\t}\n\t\treturn null;\n\t}", "public Object get(Object key) {\n CacheEntry entry = (CacheEntry)_hash.get(key);\n if (entry != null) {\n touchEntry(entry);\n return entry.getValue();\n } else {\n return null;\n }\n }" ]
[ "0.80932856", "0.79579484", "0.7903351", "0.7874939", "0.7773788", "0.77470875", "0.77176225", "0.7670111", "0.76642424", "0.7634628", "0.7629276", "0.7622377", "0.7603847", "0.7595737", "0.7595737", "0.7595737", "0.7595737", "0.7595737", "0.7595737", "0.7595737", "0.7594988", "0.75912565", "0.75849146", "0.75849146", "0.7569544", "0.7560119", "0.75598335", "0.75492924", "0.7527554", "0.75249887", "0.7515494", "0.74986005", "0.74986005", "0.7496147", "0.749613", "0.74769026", "0.74509346", "0.74426895", "0.74264807", "0.74248797", "0.7390019", "0.73736453", "0.73730487", "0.73685724", "0.7352665", "0.73493505", "0.7341002", "0.73396736", "0.73315185", "0.7322247", "0.73218656", "0.73148096", "0.7313894", "0.73096687", "0.7309448", "0.727978", "0.7274845", "0.727298", "0.7244285", "0.7228864", "0.722775", "0.7174753", "0.7166749", "0.71616936", "0.71340096", "0.71324474", "0.7128946", "0.71245956", "0.7105698", "0.7095652", "0.70905197", "0.70837593", "0.708", "0.70737624", "0.70715296", "0.70678705", "0.70676655", "0.7061337", "0.7058419", "0.7052817", "0.7031401", "0.7026854", "0.7021323", "0.7010028", "0.69971293", "0.69970596", "0.69965124", "0.69926417", "0.69921976", "0.69902694", "0.6980323", "0.69753796", "0.69573075", "0.6945451", "0.6936475", "0.69152945", "0.69110525", "0.69109064", "0.6908719", "0.6908485" ]
0.72891587
55
Keys vector. Add all key.
public Vector keys() { Vector<K> temp = new Vector<>(3); for (int i=0;i<this.count;i++) { DictionaryPair p = list.get(i);//(DictionaryPair) data.get(i); temp.addLast(p.getKey()); } return temp; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public IIterator getKeys()\r\n {\r\n return new VectorIterator(m_keys);\r\n }", "public KeySet getKeys();", "@Override\n public Set<K> keySet() {\n return keys;\n }", "@Override\n\tpublic Set<K> keySet() {\n\t\treturn keys;\n\t}", "public ArrayList getKeys() {\r\n return this.keys;\r\n }", "public abstract List<String> getAllKeys();", "public Iterable<Key> keys();", "public Iterable<Key> keys();", "public List<String> getKeys(){\n return Collections.unmodifiableList(keys);\n }", "public Collection< VKeyT > vertexKeys();", "@Override public void setKey(IndexKey key) {\n listOfKeys.add(key);\n\n }", "public List<String> keys()\n {\n return new ArrayList<String>(keys);\n }", "public Set<String> keySet() {\r\n return keys.keySet();\r\n }", "List<String> getKeys();", "Set<String> getKeys();", "private List<String> putKeysInList() {\n List<String> stringList = new LinkedList<>();\n for (String node : registeredNodes.keySet()) {\n stringList.add(node);\n }\n return stringList;\n }", "void keys() {\n for (int i = 0; i < size; i++) {\n System.out.println(keys[i] + \" \" + values[i]);\n }\n }", "Lista<K> keySet();", "public ArrayList<Integer> getKeys() {\r\n return keys;\r\n }", "public Iterable<K> keys();", "@Override\r\n\tpublic Set<K> keySet() {\r\n\t\tSet<K> keySet = new HashSet<K>();\r\n\t\tfor (Object o : buckets) {\r\n\t\t\tBucket b = (Bucket) o;\r\n\t\t\tkeySet.addAll(b.keySet());\r\n\t\t}\r\n\t\treturn keySet;\r\n\t}", "public Set<K> keySet() {\r\n \treturn map.keySet();\r\n }", "public String getKeys() {\r\n return keys;\r\n }", "public String[] getKeys() {\n\t\treturn _keys;\n\t}", "public K[] getKeys() {\n return keys.clone();\n }", "@Override\n public Iterable<E> getAllVertices() {\n return dictionary.keySet();\n }", "@Override\n List<String> keys();", "@Override\n\tpublic Set<K> keySet() {\n\t\t// TODO\n\t\treturn new KeyView();\n\t}", "public Iterator<Key> keys() ;", "public ArrayList<K> keySet() {\n\t\t\treturn claves;\n\t\t}", "@Override\r\n public Iterable<V> vertices() {\r\n LinkedList<V> list = new LinkedList<>();\r\n for(V v : map.keySet())\r\n list.add(v);\r\n return list;\r\n }", "public Set<String> keySet() {\n return map.keySet();\n }", "public Iterable<String> keys() { return keysWithPrefix(\"\"); }", "Set<K> keys();", "public List<K> keys();", "@Override\n\tpublic HashSet<K> getAllKeys() {\n\t\treturn null;\n\t}", "@Override\n\t\t\tpublic Set<String> getKeys() {\n\t\t\t\treturn null;\n\t\t\t}", "public Vector<Word> allKeyValue(){\n\n\tVector<Word> words = new Vector<Word>();\n\tfor(int w = 0; w < theTable.length; w++){\n\t // System.out.println(\"w: \" + w);\n\t // System.out.println(\"theTable[w]: \" + theTable[w]);\n\t if(theTable[w] != null){\n\t\twords.addElement(theTable[w]);\n\t }\n\t}\n\treturn words;\n }", "public ListVS<T> getKeys() {\n return this.keys.getElements();\n }", "public List<String> getKeys()\n\t{\n\t\treturn new ArrayList<>(pairs.keySet());\n\t}", "@Override public IndexKey[] getNodeKeys() {\n return listOfKeys.toArray(new IndexKey[listOfKeys.size()]);\n }", "public Set<String> keySet() {\n return index.keySet();\n }", "Set<Pairof<K, V>> keyVals();", "public KeyPeg[] getKeys() {\n return this.keys;\n }", "public Set keySet() {\n\treturn table.keySet();\n }", "public Iterable<String> keys()\r\n { return keysWithPrefix(\"\"); }", "public Set keyNames() {\n return new LinkedHashSet<>( asList( idName() ) );\n }", "public abstract Enumeration keys();", "private ISet<String> getKeySet(IList<String> words) {\n\t\tISet<String> keySet = new ChainedHashSet<String>();\n\t\tfor (String word: words) {\n\t\t\tkeySet.add(word);\n\t\t}\n\t\treturn keySet;\n }", "@Override\n\tpublic ArregloDinamico<K> keySet() {\n\t\tArregloDinamico<K> respuesta = new ArregloDinamico<K>(N);\n\t\tfor(int i = 0; i<M ; i++)\n\t\t{\n\t\t\tArregloDinamico<NodoTabla<K,V>> temporal = map.darElemento(i).getAll();\n\t\t\tfor(int j=0 ; j < temporal.size() ; j++)\n\t\t\t{\n\t\t\t\tNodoTabla<K,V> elemento = temporal.darElemento(j);\n\t\t\t\tif(elemento != null && elemento.darLlave() != null)\n\t\t\t\t\trespuesta.addLast(elemento.darLlave());\t\n\t\t\t}\n\t\t}\n\t\treturn respuesta;\n\t}", "public Long[] allKeys() {\n\t\tLong[] result = new Long[super.getSize()];\n int ctr = 0;\n for(Entry<C> each : sequence) {\n result[ctr] = each.getKey();\n ctr++;\n }\n insertionSort(result);\n return result;\n }", "public Set keySet() {\n return map.keySet();\n }", "EdgeIteratorState setKeyValues(List<KVStorage.KeyValue> map);", "@Override\n public List<K> keys() {\n List<K> keys = new AList<>();\n for(int i =0; i < capacity; i++){\n Entry n = (Entry) table[i];\n if(n != null && !n.isRemoved())\n keys.add(n.getKey());\n }\n assert keys.size() == size;\n return keys;\n }", "@Override\n public Set keySet() {\n OmaLista palautettava = new OmaLista();\n\n for (int i = 0; i < this.values.length; i++) {\n if (this.values[i] != null) {\n for (int z = 0; z < this.values[i].size(); z++) {\n palautettava.add(this.values[i].value(z).getKey());\n }\n }\n }\n\n return palautettava;\n }", "public void addKeys() {\n String[] keyArray = {\"SPACE\", \"W\", \"A\", \"S\", \"D\", \"RIGHT\", \"LEFT\",\n \"UP\", \"DOWN\", \"control E\", \"R\"};\n GameContainer.input.addInputKey(keyArray);\n }", "public List<NeonKey> getKeys();", "public Set<String> keySet() {\n\t\t\treturn new HashSet<String>( mMap.keySet() );\n\t\t}", "public Set<K> keySet() {\n return map.keySet();\n }", "@Override\n\tpublic Iterable<K> keys() {\n\t\treturn null;\n\t}", "@Override\n\tpublic Set<K> keySet() {\n\t\tArrayList<K> claves = new ArrayList<K>();\n\t\tIterator it = tabla.iterator();\n\t\tint i = 0;\n\t\twhile (it.hasNext()) {\n\t\t\tIterator it2 = tabla.get(i).keySet().iterator();\n\t\t\tit.next();\n\t\t\tint j = 0;\n\t\t\twhile (it2.hasNext()) {\n\t\t\t\tit2.next();\n\t\t\t\tclaves.add(tabla.get(i).keySet().get(j));\n\t\t\t\tj++;\n\t\t\t}\n\t\t\ti++;\n\t\t}\n\t\treturn new HashSet<K>(claves);\n\t}", "@Override\n public Set<K> keySet() {\n Set<K> keySet = new HashSet<K>(size());\n for (LinkedList<Entry<K,V>> list : table) {\n for (Entry<K,V> entry : list) {\n if (entry != null) {\n keySet.add(entry.getKey());\n }\n }\n }\n return keySet;\n }", "java.util.List<com.icare.eai.schema.om.evSORequest.EvSORequestDocument.EvSORequest.Key> getKeyList();", "public Iterable keys() {\n Queue K = new Queue();\n for(int i = 0; i < size; i++) {\n K.enqueue(keys[i]);\n }\n return K;\n }", "public Set<K> keySet() {\r\n\t\t\tSet<K> keySet = new HashSet<K>();\r\n\t\t\tListNode current = header;\r\n\t\t\twhile (current != null) {\r\n\t\t\t\tkeySet.add(current.key);\r\n\t\t\t\tcurrent = current.next;\r\n\t\t\t}\r\n\t\t\treturn keySet;\r\n }", "public Set<K> keySet() {\n\t\treturn adjLists.keySet();\n\t}", "@Override\n\tpublic Set<String> keySet() {\n\t\treturn null;\n\t}", "public static List<KeyValue<String, String>> getAllKeyValues() {\n return keyValueList;\n }", "public Set<K> keySet() {\n Set<K> keys = new HashSet<>();\n if (bucket.length != 0) {\n for (int i = 0; i < bucket.length; i++) {\n keys.add(bucket[i].getKey());\n }\n }\n return keys;\n }", "public Set<String> keySet() {\n return this.index.keySet();\n }", "Listof<K> sortedKeys();", "public ABLKeys Keys() {\r\n\t\treturn new ABLKeys(BrickFinder.getDefault().getKeys());\r\n\t}", "public void setKeys(String keys) {\r\n this.keys = keys;\r\n }", "public Set<String> keySet()\n\t{\n\t\tverifyParseState();\n\t\t\n\t\treturn values.keySet();\n\t}", "public List<KeyInner> keys() {\n return this.keys;\n }", "@Override\n public Set<K> keySet() {\n Set<K> keyset = new TreeSet<>();\n Inorder(root, keyset);\n return keyset;\n }", "Integer[] getKeys();", "StringList keys();", "@Override\n\tpublic Collection<Key> keys() {\n\t\tCollection<Key> c = new ArrayList<Key>();\n\t\tif (!isEmpty()) {\n\t\t\tFork<Key, Value> f = (Fork<Key,Value>) bst;\n\t\t\tEntry<Key, Value> e = new Entry<>(f.getKey().get(), f.getValue().get());\n\t\t\t@SuppressWarnings(\"unchecked\")\n\t\t\tEntry<Key, Value>[] a = (Entry<Key, Value>[]) Array.newInstance(e.getClass(), size());\n\t\t\tbst.saveInOrder(a);\n\t\t\tfor (int i = 0; i < a.length; i++) {\n\t\t\t\tc.add(a[i].getKey());\n\t\t\t}\n\t\t}\n\t\treturn c;\n\t}", "public void addKey(String key){\n itemMap.put(key, new ArrayList<>());\n }", "public ArrayList<K> keyList(ArrayList<K> acc) {\n // Add all the keys from the left to acc\n acc.addAll(this.left.keyList(new ArrayList<K>()));\n // Add this key into acc\n acc.add(this.key);\n // Add all the keys from the right to acc\n acc.addAll(this.right.keyList(new ArrayList<K>()));\n \n return acc;\n }", "public WeatherKey[] getKeys() {\n return this.keys;\n }", "public Iterable<Key> Keys()\n\t{\n\t\tQueue<Key> q=new Queue<>();\n\t\tInorder(root,q);\n\t\treturn q;\n\t}", "public String[] fetchAllKeys();", "private Set<String> getKeys() {\n return bookDB.keySet();\n }", "public Iterable<K> keys()\n {\n return new Iterable<K>()\n {\n public Iterator<K> iterator()\n {\n return ChainedHashTable.this.keysIterator();\n } // iterator()\n }; // new Iterable<K>\n }", "public Set<String> getKeys() {\n return Collections.unmodifiableSet(data.keySet());\n }", "public Collection<Integer> getKeysPressed () {\r\n return Collections.unmodifiableSet(myKeys);\r\n }", "public Set<Identifier> keySet() {\n return Collections.unmodifiableSet(container.keySet());\n }", "public Set<K> keySet() {\n\t\treturn new KeySet();\n\t}", "public synchronized Enumeration<Short> keys() {\n return new Enumerator(KEYS);\n }", "@Override\r\n\t\t\t\t\t\tpublic Enumeration<String> getKeys() {\n\t\t\t\t\t\t\treturn null;\r\n\t\t\t\t\t\t}", "public Iterable<Key> keys() {\n Queue<Key> queue = new Queue<Key>();\n for (int i = 0; i < m; i++) {\n for (Key key : st[i].keys())\n queue.enqueue(key);\n }\n return queue;\n }", "public Iterator<K> keys();", "public Iterator<K> keys();", "@Override\n public Set<K> keySet() {\n if (isEmpty()) return new HashSet<K>();\n return keys(min(), max());\n }", "public List keys() {\n // assign the attributes to the Collection back to the parent\n ArrayList keys = new ArrayList();\n\n keys.add(leagueId);\n\n return (keys);\n }", "public String[] getKeys() {\n Set keySet;\n if( defaultValues != null ) {\n keySet = defaultValues.keySet();\n } else {\n keySet = values.keySet();\n }\n return ( String[] )keySet.toArray( new String[ keySet.size() ] );\n }", "public void generateKeys(){\n\t\t//Apply permutation P10\n\t\tString keyP10 = permutation(key,TablesPermutation.P10);\n\t\tresults.put(\"P10\", keyP10);\n\t\t//Apply LS-1\n\t\tString ls1L = leftShift(keyP10.substring(0,5),1);\n\t\tString ls1R = leftShift(keyP10.substring(5,10),1);\n\t\tresults.put(\"LS1L\", ls1L);\n\t\tresults.put(\"LS1R\", ls1R);\n\t\t//Apply P8 (K1)\n\t\tk1 = permutation(ls1L+ls1R, TablesPermutation.P8);\n\t\tresults.put(\"K1\", k1);\n\t\t//Apply LS-2\n\t\tString ls2L = leftShift(ls1L,2);\n\t\tString ls2R = leftShift(ls1R,2);\n\t\tresults.put(\"LS2L\", ls2L);\n\t\tresults.put(\"LS2R\", ls2R);\n\t\t//Apply P8 (K2)\n\t\tk2 = permutation(ls2L+ls2R, TablesPermutation.P8);\n\t\tresults.put(\"K2\", k2);\n\t}", "void setKeyArray(int i, com.icare.eai.schema.om.evSORequest.EvSORequestDocument.EvSORequest.Key key);" ]
[ "0.6966067", "0.678948", "0.67390376", "0.66332406", "0.6615594", "0.6587651", "0.65866303", "0.65866303", "0.6559737", "0.6542555", "0.65002424", "0.6468771", "0.6440652", "0.6391398", "0.6378318", "0.63683194", "0.6349412", "0.6344787", "0.6302455", "0.62853384", "0.6274292", "0.6271925", "0.62571794", "0.62559706", "0.6251799", "0.62473816", "0.6241517", "0.62327033", "0.6220829", "0.61963606", "0.61844134", "0.61769587", "0.6157078", "0.6155015", "0.6154067", "0.6146721", "0.61464256", "0.61356455", "0.61339426", "0.61278737", "0.61221117", "0.6120327", "0.6102751", "0.6102367", "0.6087682", "0.6083575", "0.6079384", "0.6077256", "0.6064657", "0.6063961", "0.6060541", "0.6052144", "0.6048454", "0.60480547", "0.60473466", "0.60451967", "0.6043425", "0.603213", "0.60306793", "0.60226816", "0.60158885", "0.6005595", "0.60022867", "0.5996851", "0.5983068", "0.59825146", "0.59798574", "0.5977242", "0.5972275", "0.59573174", "0.59558266", "0.59537977", "0.5952721", "0.59522593", "0.5952105", "0.5946422", "0.59464073", "0.5937737", "0.59377205", "0.59320575", "0.59306216", "0.5924239", "0.59207636", "0.59132946", "0.5891527", "0.58857435", "0.58843017", "0.58839124", "0.5864624", "0.5863615", "0.58420503", "0.5838893", "0.58383405", "0.5824856", "0.5824856", "0.58186096", "0.5800885", "0.57891136", "0.57883286", "0.5782411" ]
0.67913955
1
Sets the item the person gives out.
public void setItem(Collectable c) { this.m_item = c; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void setItem(Item item) {\n this.item = item;\n }", "public void setItem (Item item)\n\t{\n\t\tthis.item = item;\n\t}", "public void setItem(Item item) {\n\t\tthis.item = item;\n\t}", "public void setItem(Item item) {\n\t\tthis.item = item;\n\t}", "public void setItem(T item) {\n this.item = item;\n }", "public void giveItem(Item item) {\n\t\tif (hasItem()) return;\n\t\tthis.item = item;\n\t}", "public void setItemWanted(Item item) {\n itemWanted = item;\n }", "public void setItem(ItemType item) {\n\t this.item = item;\n\t}", "public void setItem(ItemType item) {\n\t this.item = item;\n\t}", "public void setItem (Object anObject)\r\n {\r\n // TODO: implement (?)\r\n }", "public void setItem(Item collectibleItem) {\n\t\tthis.item = collectibleItem;\r\n\t}", "@Override\n public void setEquippedItem(IEquipableItem item) {}", "public void useItem() {\n\t\tif (!hasItem()) return;\n\t\titem.activate();\n\t\titem = null;\n\t}", "public void set(Item item) {\r\n if (lastAccessed == null) throw new IllegalStateException();\r\n lastAccessed.item = item;\r\n }", "public void setEditedItem(Object item) {editedItem = item;}", "public void setData(Item i)\r\n\t{\r\n\t\ttheItem = i;\r\n\t}", "public void setITEM(int value) {\r\n this.item = value;\r\n }", "@Override\n public Item vendItem(Item item) {\n allItems.put(item.getItemId(), item);\n return item;\n }", "public void setItem(BudgetItemModel item) { model= item;}", "public void setItemOwned2(Item item) {\n itemOwned2 = item;\n if(itemOwned2 != null){\n items.put(itemOwned2.getName(), itemOwned2);\n }\n }", "public void setItem(Item[] param) {\r\n validateItem(param);\r\n\r\n localItemTracker = true;\r\n\r\n this.localItem = param;\r\n }", "public void pickUp(Item item) {\n this.curItem = item;\n this.curItem.setNonDamagablePlayer(this);\n if (item instanceof PickupableWeaponHolder) {\n this.weapon = ((PickupableWeaponHolder)(item)).getWeapon();\n }\n }", "public void setUserItem(UserItem userItem) {\n attributes.put(KEY_USER_ITEM, userItem);\n this.getHttpRequest().setAttribute(KEY_USER_ITEM, userItem);\n }", "public void hapusItem(Item objItem) {\n arrItem.remove(objItem); //buang item\n }", "public void setItem(Object item, int i)\n {\n items.setElementAt(item, i);\n }", "@Override\r\n\tpublic void sellItem(AbstractItemAPI item) {\n\t\titems.remove(item);\r\n\t\t\r\n\t}", "public void setItemOwned1(Item item) {\n itemOwned1 = item;\n if(itemOwned1 != null){\n items.put(itemOwned1.getName(), itemOwned1);\n }\n }", "public void useItem(Human user){\n user.addEnergy(10);\n user.removefromInv(this); \n }", "public void setItemWriter(ItemWriter itemWriter) {\n this.itemWriter = itemWriter;\n }", "@Override // see item.java\n\tpublic void useItem() {\n\n\t}", "void SetItemNumber(int ItemNumber);", "public void setItem (jkt.hms.masters.business.MasStoreItem item) {\n\t\tthis.item = item;\n\t}", "public Item giveItem(String itemName, Player character) {\n Item item = items.remove(itemName);\n if(item != null) {\n character.items.put(item.getName(), item);\n }\n return item;\n }", "public void setItem(Item item) {\n\t\tthis.item = item;\n\n\t\tif (item.getDate() == null)\n\t\t\tdateField.setText(DateUtil.format(LocalDate.now()));\n\t\telse\n\t\t\tdateField.setText(DateUtil.format(item.getDate()));\n\n\t\tdateField.setPromptText(\"dd.mm.yyyy\");\n\t\tif (item.getCategory() == null)\n\t\t\tcategoryField.getSelectionModel().select(\"Lebensmittel\");\n\t\telse \n\t\t\tcategoryField.getSelectionModel().select(item.getCategory());\n\t\tuseField.setText(item.getUse());\n\t\tamountField.setText(Double.toString(item.getAmount()).replace(\".\", \",\"));\n\t\tif (item.getDistributionKind() == null)\n\t\t\tdistributionKindField.setText(\"Giro\");\n\t\telse\n\t\t\tdistributionKindField.setText(item.getDistributionKind());\n\n\t\tif (useField.getText() == null) {\n\t\t\tPlatform.runLater(new Runnable() {\n\t\t\t\t@Override\n\t\t\t\tpublic void run() {\n\t\t\t\t\tuseField.requestFocus();\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}", "public void use(Consume item)\r\n {\r\n int gain = item.getRating();\r\n health += gain;\r\n \r\n if (health > maxHealth)\r\n health = maxHealth;\r\n \r\n say(\"I gained \" + gain + \" health by using \" + item.getName() + \" and now have \" + health + \"/\" + maxHealth);\r\n \r\n items.remove(item);\r\n }", "public void setItemInHand ( ItemStack item ) {\n\t\tPlayer handle = handle ( );\n\t\t\n\t\tif ( handle != null ) {\n\t\t\ttry {\n\t\t\t\tsafeGetMethod ( PlayerInventory.class , \"setItemInMainHand\" , new Class[] { ItemStack.class } )\n\t\t\t\t\t\t.invoke ( handle.getInventory ( ) , item );\n\t\t\t} catch ( Exception e ) {\n\t\t\t\ttry {\n\t\t\t\t\tsafeGetMethod ( PlayerInventory.class , \"setItemInHand\" , new Class[] { ItemStack.class } )\n\t\t\t\t\t\t\t.invoke ( handle.getInventory ( ) , item );\n\t\t\t\t} catch ( IllegalAccessException | InvocationTargetException ex ) {\n\t\t\t\t\tex.printStackTrace ( );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public Item pickUpItem(String itemName) {\n Item item = currentRoom.removeItem(itemName);\n if(item != null) {\n items.put(item.getName(), item);\n }\n return item;\n }", "@ActionTrigger(action=\"POST-TEXT-ITEM\", item=\"BIRTHDATE\", function=KeyFunction.ITEM_OUT)\n\t\tpublic void birthdate_itemOut()\n\t\t{\n\t\t\t\n\t\t\t\tgetGDateClass().itemOut();\n\t\t\t}", "public void setItem(ArrayOfItem param) {\r\n localItemTracker = param != null;\r\n\r\n this.localItem = param;\r\n }", "public FinalMysteryItem() {\n int randomIndex = new Random().nextInt(7);\n item = new Item(listOfPossibleNames[randomIndex], PRICE_TO_BUY);\n }", "public void setSmeltingOutput(String name, ItemStack item) {\n\t\tif (item != null && item.getItem() != null) {\n\t\t\tsmeltingOutputItem = item;\n\t\t} else {\n\t\t\tItemStack newItem = Utils.getItemStack(name);\n\t\t\tif (newItem != null) {\n\t\t\t\tsmeltingOutputItem = newItem;\n\t\t\t}\n\t\t}\n\t}", "public void removeItem(){\n\t\tthis.item = null;\n\t}", "void updateItem(IDAOSession session, Item item);", "public void setItem(String itemDescription, int weight)\n {\n currentItem = new Item(itemDescription, weight); \n }", "public void setItem(Item item) throws Exception {\n\t\tfor(int i = 0; i < last; ++i)\n\t\t\tif(list[i].getCode() == item.getCode()) {\n\t\t\t\tlist[i].increment(item.getCount());\n\t\t\t\treturn;\n\t\t\t}\n\t\tif(last < size)\n\t\t\tlist[last++] = item;\n\t\telse\n\t\t\tthrow new Exception(\"list full\");\n\t}", "public void setItemOnCursor ( ItemStack item ) {\n\t\texecute ( handle -> handle.setItemOnCursor ( item ) );\n\t}", "public void checkOut(Item chooseItem) {\n\t\tif (chooseItem instanceof Book && chooseItem.inLibrary) {\n\t\t\tchooseItem.setInLibrary(false);\n\t\t} else {\n\t\t\tSystem.out.println(\"This book has already been checked out\");\n\t\t}\n\t}", "private void setItems()\n {\n sewers.setItem(rope); \n promenade.setItem(rope);\n bridge.setItem(potion);\n tower.setItem(potion);\n throneRoomEntrance.setItem(potion);\n depths.setItem(shovel);\n crypt.setItem(shovel);\n }", "public Item getItem() { \n return myItem;\n }", "public Item setHatItem(StatItem hatItem) {\n if (hatItem.getName().equals(\"Shoes\")) {\n if (this.hatItem == null) {\n this.hatItem = hatItem;\n return null;\n } else {\n Item returnItem = this.hatItem;\n this.hatItem = hatItem;\n return returnItem;\n }\n } else {\n return null;\n }\n }", "public void enterItem(DessertItem item)\n {\n dessertList.add(item);\n }", "public boolean checkOutItem(Item item)\n {\n \t return memberItems.add(item);\n }", "public void setItems(){\n }", "@Override\r\n public void setItemId(int itemId) {\n this.itemId = itemId;\r\n }", "public void takeItem(final String pStringItem, final Item pItem){this.aItemsList.takeItem(pStringItem,pItem);}", "public void sendPickupItemPacket(ViewableEntity entity, ViewableEntity item) {\n Object packet = ReflectUtils.newInstance(\"PacketPlayOutCollect\");\n ReflectUtils.setField(packet, \"a\", item.getEntityId());\n ReflectUtils.setField(packet, \"b\", entity.getEntityId());\n ReflectUtils.setField(packet, \"c\", ((Item) item.getEntity()).getItemStack().getAmount());\n sendPacket(packet);\n }", "@Override // see item.java\n\tpublic void pickUp() {\n\n\t}", "private void useItem(String itemToUse) {\n if (itemToUse.equalsIgnoreCase(\"\") || itemToUse.equalsIgnoreCase(\"use\")) {\n System.out.println(\"Use what?\");\n return;\n }\n\n // Get a reference to the item\n Item item = player.getItemFromInventory(itemToUse);\n\n // If the reference is not null (i.e., the Item exists)\n if (item != null) {\n // Display a message\n System.out.println(\"You use the \" + item.getName());\n\n // Check if using the item will destroy a creature\n if (currentRoom.getCreature() != null && currentRoom.getCreature().getItemToDestroy() != null && currentRoom.getCreature().getItemToDestroy() == item) {\n // Display the text for defeating the creature. \n System.out.println(currentRoom.getCreature().getDefeatedText());\n currentRoom.setCreature(null);\n\n // Remove the item from the Player's inventory.\n player.removeItemFromInventory(item);\n }\n } // The player does not have the specified item\n else {\n System.out.println(\"There is no \" + itemToUse + \" in your inventory.\");\n }\n }", "public void additem(String item){\n\t\trep.takeitem(\"take \" + item);\n\t}", "public void throwItem() {\n this.curItem.setState(Item.THROWING);\n this.curItem.setX((int)(this.x));\n this.curItem.setY((int)(this.y));\n this.curItem.setXVel(Item.X_SPEED*this.dir);\n if (this.curItem instanceof PickupableWeaponHolder) {\n this.weapon = this.fist;\n }\n this.curItem = null;\n }", "@Override\n\tpublic ThematicItem changeItem(ThematicItem item) {\n\t\treturn repository.changeItem(item);\n\t}", "private void valivate(Item item) {\n if(item == null)\n throw new IllegalArgumentException(\"the item is null\");\n }", "private void sellItem(ShopItem item) {\n if (!world.ifHasItem(item.getName())) {\n System.out.println(\"You don't have Item : \" + item.getName());\n return;\n }\n world.removeItem(item.getName());\n int gold = world.getCharacter().getGold().get();\n world.getCharacter().setGold(gold + item.getPrice());\n System.out.println(\"You have sold Item : \" + item.getName());\n }", "public UserItem getUserItem() {\n return userItem;\n }", "public int getITEM() {\r\n return item;\r\n }", "public void store(Item item) {\n this.items.add(item);\n }", "public void setItemList(String item)\n {\n this.itemLinkedList.add(new Item(item));\n }", "public Drop(Item item)\n {\n assert item != null : \"Go.Go gets null direction\";\n this.item = item;\n }", "@Override\n public void setChanged() {\n set(getItem());\n }", "public void setItem(@NotNull Usable usable, int i) {\n checkIndex(i);\n\n if (items[i] == null) {\n size++;\n }\n\n items[i] = usable;\n }", "public Item getItem() { return this; }", "public void doStuff(Item seedItem, Item returnItem, int returnMeta) {\n this.seedItem = seedItem;\n this.returnItem = returnItem;\n this.returnMeta = returnMeta;\n }", "void setItemId(String itemId);", "public void setItems(Item[] itemsIn)\n {\n items = itemsIn;\n }", "private void useItem(Command command) \n { \n if(!command.hasSecondWord()) { \n // if there is no second word, we don't know where to go... \n Logger.Log(\"What are you trying to use?\"); \n return; \n } \n \n String itemUsed = command.getSecondWord();\n String secondUsed = itemUsed + \"2\";\n \n Item thisItem = player.getItem(itemUsed);\n Item secondItem = player.getItem(secondUsed);\n \n Creature thisFriend = player.getCompanion(itemUsed);\n \n //Tries to retrieve which item or creature to use. If not, an error message is returned \n if (thisItem == null&&secondItem == null&&thisFriend == null) {\n Logger.Log(\"You don't have a \" + itemUsed);\n }\n else if (player.inventory.containsKey(itemUsed)) { \n player.removeItem(itemUsed); //The item is removed from inventory\n thisItem.UseItem(this);\n }\n else if (player.inventory.containsKey(secondUsed)) {\n player.removeItem(secondUsed); //The item is removed from inventory\n secondItem.UseItem(this);\n }\n else if (player.friends.containsKey(itemUsed)){ \n thisFriend.UseCompanion(this);\n if (thisFriend.flees){\n player.removeCompanion(itemUsed); //Companions do not get removed from inventory unless the flees boolean has been set to true.\n }\n } \n }", "public void useItem(Item i)\n\t{\n\t\tString name = i.getName();\n\t\tPlayer player = GameController.getPlayer();\n\t\t\n\t\tswitch(name)\n\t\t{\n\t\tcase \"Polar Pop\":\n\t\t\tplayer.addHealth(30);\n\t\t\tTextHandler.displayText(\"Mmm, tastes like root beer. You restored 30 HP.\");\n\t\t\tbreak;\n\t\t\t\n\t\tcase \"Klondike Bar\":\n\t\t\tplayer.addHealth(50);\n\t\t\tTextHandler.displayText(\"What would you dooOOOoooo, for a klondike bar? Ha. You restored 50 HP.\");\n\t\t\tbreak;\n\t\t\t\n\t\tcase \"Big tiddy goth GF\":\n\t\t\tplayer.setHealth(player.getMaxHealth());\n\t\t\tplayer.setMana(player.getMaxMana());\n\t\t\tplayer.setXp(player.getMaxXp());\n\t\t\tTextHandler.displayText(\"Very scrumptious. You have regained all life and mana, and have even gained a new level\");\n\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:\n\t\t\t\tTextHandler.displayText(\"There is no use for \" + name + \".\");\n\t\t}\n\t}", "@Override\n public void setItemVO(T itemVO) {\n this.itemVO = itemVO;\n nameLabel.setText(getFirstNameAndLastName(itemVO));\n if (getUsername(itemVO) != null && !getUsername(itemVO).trim().equals(\"\")) {\n usernameLabel.setText(\"- \" + getUsername(itemVO));\n }\n if (getUserAvatarUrl(itemVO) != null && !getUserAvatarUrl(itemVO).trim().equals(\"\")) {\n avatarImage.setUrl(getUserAvatarUrl(itemVO));\n }\n }", "public void dropItem(Item seekItem)\n {\n //get each item from the items's array list.\n for (Item item : items){\n if(item.getName().equals(seekItem.getName())){\n currentRoom.getInventory().getItems().add(item);\n removePlayerItem(item);\n System.out.println(\"You have placed the \"+ item.getName() +\" in the \" + currentRoom.getName() + \".\");\n }\n }\n }", "public void setItem2(Object item) throws InvalidNodeException {\n\t\tif (!isValidNode()) {\n\t\t\tthrow new InvalidNodeException();\n\t\t}\n\t\tthis.item2 = item;\n\t}", "private void itemResult(Item item) {\r\n int bidder = item.getBidderId();\r\n AH_AgentThread agent = AuctionServer.agentSearch(bidder);\r\n if (bidder != -1) {\r\n Message release = new Message.Builder()\r\n .command(Message.Command.TRANSFER)\r\n .balance(item.getCurrentBid())\r\n .accountId(bidder)\r\n .senderId(AuctionServer.auctionId);\r\n Message response = BankActions.sendToBank(release);\r\n assert response != null;\r\n if(response.getResponse() == Message.Response.SUCCESS) {\r\n System.out.println(\"Item Transferred\");\r\n agent.winner(item);\r\n } else {\r\n System.out.println(\"Item Transfer failed\");\r\n }\r\n auctionList.remove(item);\r\n }\r\n }", "private static void setValues( String name, Integer number, Item item ) {\n\t\titem.getItemProperty( \"name\" ).setValue( name );\n\t\titem.getItemProperty( \"number\" ).setValue( number );\n\t\titem.getItemProperty( \"id\" ).setValue( itemId );\n\t\titem.getItemProperty( \"id\" ).setReadOnly( true );\n\t\titemId++;\n\t}", "public void writeItemset(Itemset is)\n throws IOException\n {\n outstream.writeObject(is);\n }", "public void addItemInventory(Item item){\n playerItem.add(item);\n System.out.println(item.getDescription() + \" was taken \");\n System.out.println(item.getDescription() + \" was removed from the room\"); // add extra information to inform user that the item has been taken\n }", "public void setItemView(ItemView itemView){\n listOfTiles.get(listOfTiles.size() - 1).addItemView(itemView);\n }", "public void setItem(SpItem spItem) {\n Assert.notFalse(_spItem == null);\n\n _spItem = spItem;\n _spItem.getAvEditFSM().addObserver(this);\n update(_spItem.getAvEditFSM(), null);\n }", "public void getItem(Item item) throws Exception {\n\t\tfor(int i = 0; i < last; ++i)\n\t\t\tif(list[i].getCode() == item.getCode()) {\n\t\t\t\tif(item.getCount() < list[i].getCount()) {\n\t\t\t\t\tlist[i].decrement(item.getCount());\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse if(item.getCount() == list[i].getCount()) {\n\t\t\t\t\t--last;\n\t\t\t\t\tfor(int j = i; j < last; ++j)\n\t\t\t\t\t\tlist[j] = list[j + 1];\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t\tthrow new Exception(\"insufficient quantity\");\n\t\t\t}\n\t\tthrow new Exception(\"unavailable item\");\n\t}", "private void grabItem(String item)//Made by Justin\n {\n itemFound = decodeItem(item);\n if (itemFound == null)\n {\n System.out.println(\"I don't know of any \" + item + \".\");\n }\n else\n {\n player.inventoryAdd(itemFound, currentRoom);\n }\n }", "public void handleItem(String item) {\r\n switch (item) {\r\n // Restore all health points\r\n case \"potionvie\":\r\n setHealthPoints(5);\r\n System.out.println(\"Vous trouvez une potion de vie!\");\r\n break;\r\n // Restore health points by 1\r\n case \"coeur\":\r\n if (getHealthPoints() < 5) {\r\n setHealthPoints(getHealthPoints() + 1);\r\n }\r\n System.out.println(\"Vous trouvez un coeur!\");\r\n break;\r\n // Increase hexaforce count by 1\r\n case \"hexaforce\":\r\n setHexaforces(getHexaforces() + 1);\r\n System.out.println(\"Vous trouvez un morceau d'Hexaforce!\");\r\n break;\r\n default:\r\n break;\r\n }\r\n }", "private void pickItem() \n {\n if(currentRoom.getShortDescription() == \"in the campus pub\" && i.picked3 == false)\n {\n i.item3 = true;\n i.picked3 = true;\n System.out.println(\"You picked a redbull drink\");\n }\n else if(currentRoom.getShortDescription() == \"in th hallway\" && i.picked2 == false)\n {\n i.item2 = true;\n i.picked2 = true;\n System.out.println(\"You picked a torch\");\n }\n else if(currentRoom.getShortDescription() == \"in the office\" && i.picked1 == false)\n {\n i.item1 = true;\n i.picked1 = true;\n System.out.println(\"You picked a pair of scissors\");\n }\n else\n System.out.println(\"There is no items in the room!\");\n }", "public void setItemNo(int value) {\n this.itemNo = value;\n }", "public void buy(Item item) {\n // remove money from wallet\n try { \n wallet.removeMoney(item.getPrice());\n // remove item from room\n currentRoom.removeItem(item);\n // add item to inventory\n addToInventory(item);\n } catch (IllegalArgumentException e) {\n System.err.println(\"You don't have enough money to purchase \" + item.getDescription());\n }\n\n\n }", "public void toDoWithItem(Item item) throws InvalidChangeException,\n InvalidInputException, InvalidNameException, InvalidTitleException {\n\n toDoWithItemMessage();\n\n String choiceOfChange = getUserResponse();\n\n switch (choiceOfChange) {\n // TODO cannot purchase/put item on hold if quantity is 0\n case \"1\":\n changeQuantityChoice1(item);\n return;\n // TODO change case #2-#4\n case \"2\":\n System.out.println(\"Ok, Correct Quantity\");\n return;\n case \"3\":\n System.out.println(\"Ok, Set New Price\");\n return;\n case \"0\":\n endSearch();\n return;\n default:\n throw new InvalidChangeException();\n }\n }", "public void useItem(OutputStreamWriter out, InputStreamReader newIn) {\r\n InputStreamReader instream = newIn;\r\n BufferedReader in = new BufferedReader(instream);\r\n boolean equipped = false;\r\n if (this.player.getInventory().isEmpty()) {\r\n try {\r\n out.write(\"You have nothing in your inventory you can use..\" + System.lineSeparator());\r\n } catch (IOException ex) {\r\n Logger.getLogger(Game.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n } else {\r\n while (!equipped) {\r\n try {\r\n out.write(this.getPlayerInventory());\r\n out.write(System.getProperty(\"line.separator\"));\r\n out.write(\"Choose an item by pressing a number: \");\r\n out.write(System.getProperty(\"line.separator\"));\r\n out.flush();\r\n try {\r\n int itemNumber = Integer.parseInt(in.readLine());\r\n if (itemNumber >= player.getInventory().size() || itemNumber < 0) {\r\n out.write(\"You do not have that item...\");\r\n out.write(System.getProperty(\"line.separator\"));\r\n out.flush();\r\n } else {\r\n if (player.getInventory().get(itemNumber).getItemType() == 3 || player.getInventory().get(itemNumber).getItemType() == 4) {\r\n out.write(player.useItem(itemNumber));\r\n equipped = true;\r\n out.write(System.getProperty(\"line.separator\"));\r\n out.flush();\r\n } else {\r\n out.write(\"Choose between slot 1 and slot 2 by pressing 1 or 2: \");\r\n out.write(System.getProperty(\"line.separator\"));\r\n out.flush();\r\n int slotNumber = Integer.parseInt(in.readLine());\r\n while (slotNumber != 1 && slotNumber != 2) {\r\n out.write(\"You have to choose between slot 1 and slot 2\" + System.lineSeparator());\r\n out.flush();\r\n slotNumber = Integer.parseInt(in.readLine());\r\n }\r\n out.write(player.equip(itemNumber, slotNumber));\r\n equipped = true;\r\n out.write(System.getProperty(\"line.separator\"));\r\n out.flush();\r\n }\r\n }\r\n } catch (NumberFormatException ex) {\r\n out.write(\"You have to enter a number. Please try again!\" + System.lineSeparator());\r\n out.write(System.getProperty(\"line.separator\"));\r\n out.flush();\r\n equipped = true;\r\n }\r\n } catch (IOException ex) {\r\n Logger.getLogger(Game.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }\r\n }\r\n }", "public Item getItem ()\n\t{\n\t\treturn item;\n\t}", "public void setItems(Item items) {\n this.items = items;\n }", "private void setItem(){\n item = new String[4];\n item[0] = title;\n item[1] = DueDate;\n item[2] = Description;\n item[3] = \"incomplete\";\n }", "public void select(T item) {\n getElement().select(SerDes.mirror(item));\n }", "@Override\n public void pickItem(int position) {\n setProductPicked(-1, position);\n }", "public void transferItem(Items item) throws Exception {\n\t\tif (item.getHolder() instanceof Monsters) {\n\t\t\titem.setHolder(null);\n\t\t\tthis.addAnchor(item);\n\t\t}\n\t\telse if (item.getHolder() instanceof Backpacks) {\n\t\t\titem.setHolder(null);\n\t\t\tthis.addAnchor(item);\n\t\t}\n\t\telse\n\t\t\tthrow new Exception(\"The transaction is only possible between monsters and/or backpacks.\");\n\t}", "public void setItemNo(Integer itemNo) {\n\t\tif (itemNo == 0) {\n\t\t\tthis.itemNo = null;\n\t\t} else {\n\t\t\tthis.itemNo = itemNo;\n\t\t}\n\t}" ]
[ "0.73656243", "0.73582095", "0.72114646", "0.72114646", "0.7171984", "0.7142626", "0.7131456", "0.6965983", "0.6965983", "0.6914667", "0.6691745", "0.6569425", "0.651855", "0.64592355", "0.6410806", "0.6398054", "0.63900644", "0.6366861", "0.6216207", "0.62077135", "0.6197614", "0.6162485", "0.61544055", "0.6103344", "0.609607", "0.6093187", "0.6065935", "0.60640514", "0.6054097", "0.59887886", "0.5967837", "0.5931024", "0.58893627", "0.5885142", "0.58796257", "0.58357775", "0.581479", "0.58096623", "0.57911026", "0.577813", "0.57762384", "0.57684165", "0.5767772", "0.57596964", "0.573706", "0.5728327", "0.5726913", "0.5726755", "0.5719778", "0.56850463", "0.5675661", "0.56566745", "0.5637333", "0.56105244", "0.5609018", "0.5605879", "0.5603316", "0.5596276", "0.5585232", "0.5566116", "0.5565696", "0.5563725", "0.5560474", "0.55515915", "0.5551233", "0.55390143", "0.5538099", "0.5536595", "0.5534662", "0.55272603", "0.5525258", "0.55212605", "0.5521038", "0.55117714", "0.5511492", "0.55084115", "0.55058557", "0.5503727", "0.5500083", "0.54996634", "0.5495802", "0.5495197", "0.5491704", "0.54908276", "0.5475146", "0.5474125", "0.547144", "0.54589236", "0.54556847", "0.5448027", "0.54463565", "0.5439382", "0.5434994", "0.54308313", "0.543069", "0.5421846", "0.54209244", "0.54197705", "0.54108626", "0.53943014" ]
0.604178
29
TODO Autogenerated method stub
@Override public void writeAttributes(XMLStreamWriter writer) throws XMLStreamException { }
{ "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 Types getType() { return GameObject.Types.PERSON; }
{ "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
Method to get Legacy Changes
@com.matrixone.apps.framework.ui.ProgramCallable public MapList getLegacyChanges(Context context, String args[]) throws Exception { MapList sTableData = new MapList(); MapList sResultList = new MapList(); StringList s1 = new StringList(); HashMap programMap = (HashMap)JPO.unpackArgs(args); String strObjectId = (String)programMap.get("objectId"); HashMap requestMap = (HashMap)programMap.get("requestMap"); String filterToolbar = (String)programMap.get("toolbar"); Map tmpMap = UICache.getMenu(context, filterToolbar); MapList filterCmdsList = (MapList)tmpMap.get("children"); Map filterOptCmdMap = (Map)filterCmdsList.get(0); String filterOptCmd = (String)filterOptCmdMap.get("name"); Map commandInfoMap = (Map)UICache.getCommand(context, filterOptCmd); Map commandSetting = (Map)commandInfoMap.get("settings"); String sRangeProgram = (String)commandSetting.get("Range Program"); String sRangeFunction = (String)commandSetting.get("Range Function"); HashMap sRangeProgramResultMap = (HashMap)JPO.invoke(context, sRangeProgram, null, sRangeFunction, JPO.packArgs(new HashMap()), HashMap.class); StringList choicesList = null; String singleSearchType =""; String cmdLabel = ""; String commandName = ""; String sDisplayValue = ""; String sActualValue = ""; String sRegisteredSuite = ""; String strStringResourceFile = ""; String sRequiredCommand = ""; String searchType = ""; String sLegacytype = ""; StringList strList = new StringList(); strList.add(SELECT_NAME); strList.add(SELECT_TYPE); strList.add(SELECT_ID); String wherClause = SELECT_CURRENT + "== 'Active' "; StringBuffer sbSearchType = new StringBuffer(); if(sRangeProgramResultMap!=null){ choicesList = (StringList)sRangeProgramResultMap.get("field_display_choices"); if(choicesList!=null) singleSearchType = (String)choicesList.get(0); } //Getting the ECM Menu details and its commands HashMap menuMap = UICache.getMenu(context, "ECMChangeLegacyMenu"); String sECMMenu = (String)menuMap.get("name"); MapList commandMap = (MapList)menuMap.get("children"); if(commandMap!=null){ Iterator cmdItr = commandMap.iterator(); while(cmdItr.hasNext()) { Map tempMap = (Map)cmdItr.next(); commandName = (String)tempMap.get("name"); HashMap cmdMap = UICache.getCommand(context, commandName); HashMap settingMap = (HashMap)cmdMap.get("settings"); cmdLabel = (String)cmdMap.get("label"); sRegisteredSuite = (String)settingMap.get("Registered Suite"); //strStringResourceFile = UINavigatorUtil.getStringResourceFileId(sRegisteredSuite); StringBuffer strBuf = new StringBuffer("emx"); strBuf.append(sRegisteredSuite); strBuf.append("StringResource"); sDisplayValue =EnoviaResourceBundle.getProperty(context, strBuf.toString(), context.getLocale(),cmdLabel); if(sDisplayValue.equals(singleSearchType)){ sRequiredCommand = commandName; break; } } } if(!UIUtil.isNullOrEmpty(sRequiredCommand)){ HashMap cmdMap = UICache.getCommand(context, sRequiredCommand); String cmdHref = (String)cmdMap.get("href"); HashMap settingsMap = (HashMap)cmdMap.get("settings"); searchType = (String)settingsMap.get("searchType"); } //Getting ECM details if(!UIUtil.isNullOrEmpty(searchType)){ StringList sTypeList = FrameworkUtil.split(searchType, ","); for(int i= 0; i<sTypeList.size(); i++){ String single = (String)sTypeList.get(i); sLegacytype = PropertyUtil.getSchemaProperty(context,single); sbSearchType.append(sLegacytype); if(i!=sTypeList.size()-1) sbSearchType.append(","); } } try{ if(!UIUtil.isNullOrEmpty(sbSearchType.toString())) if(UIUtil.isNullOrEmpty(strObjectId)) sTableData = DomainObject.findObjects(context, sbSearchType.toString(), "*", null, strList); else{ DomainObject partObject=new DomainObject(strObjectId); sResultList= partObject.getRelatedObjects(context, QUERY_WILDCARD, sbSearchType.toString(), strList, null, true, false, (short)1, null, null, 0); Iterator itr = sResultList.iterator(); while (itr.hasNext()) { Map sChangeObject = (Map) itr.next(); String sChangeId = (String) sChangeObject.get(SELECT_ID); if(!s1.contains(sChangeId)){ s1.add(sChangeId); sTableData.add(sChangeObject); } } } } catch (Exception ex) { ex.printStackTrace(); throw new FrameworkException(ex.getMessage()); } if(sTableData!=null) return sTableData; else return new MapList(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private Changelist[] getChanges() {\n String depot = parent.getDepot();\n String counterName = parent.getCounter();\n Client client = Client.getClient();\n\n // Obtain the most recent changelist available on the client\n Changelist toChange = Changelist.getChange(depot, client);\n\n // Obtain the lower boundary for the changelist results\n Counter counter = Counter.getCounter(counterName);\n int counterVal = 0;\n if (counter != null) {\n counterVal = counter.getValue();\n } else {\n counterVal = toChange.getNumber();\n }\n\n return Changelist.getChanges(depot, counterVal, toChange.getNumber());\n }", "public List<DatastreamVersion> listChangedDatastreams();", "private List<DataRecord> loadRefTableChanges() {\n \n final DataSource changesDataSource =\n ProjectUpdateWizardUtilities\n .createDataSourceForTable(ProjectUpdateWizardConstants.AFM_FLDS_TRANS);\n changesDataSource.addRestriction(Restrictions.in(\n ProjectUpdateWizardConstants.AFM_FLDS_TRANS, CHANGE_TYPE, DifferenceMessage.NEW.name()\n + \",\" + DifferenceMessage.REF_TABLE.name()));\n changesDataSource.addRestriction(Restrictions.eq(\n ProjectUpdateWizardConstants.AFM_FLDS_TRANS, CHOSEN_ACTION,\n Actions.APPLY_CHANGE.getMessage()));\n\n return changesDataSource.getRecords();\n }", "public List getChangedEvents() {\n return new ArrayList(originalDnr.keySet());\n }", "public java.lang.String getOldValues_description(){\n return localOldValues_description;\n }", "ChangeData getChangeData(Project.NameKey projectName, Change.Id changeId);", "public CachetIncidentUpdateList getIncidentUpdates() {\n throw new RuntimeException(\"Method not implemented.\");\n }", "@Override\n\tpublic List<String> getVersionDifferences() {\n\t\t\n\t\t\n\t\treturn versionDifferences;\n\t}", "private HashMap< Price, ArrayList<Tradable>> getOldEntries() {\n\t\treturn oldEntries;\n\t}", "@SuppressWarnings(\"unchecked\")\n\tpublic List<String> openDiffs() {\n\t\tString path = getCurrentPath()+slash+\"diffs.xml\";\n\t\tList<String> diffs = (List<String>) JavaIO.getObjectFromXML(path);\n\t\treturn diffs;\n\t}", "public I getChangeInfo(int startSeqNum);", "@Override\n\tpublic OperatorVersion[] getIncompatibleVersionChanges() {\n\t\treturn ExpressionParserUtils.addIncompatibleExpressionParserChange(super.getIncompatibleVersionChanges());\n\t}", "public RebateChanges[] getRebateChanges() {\n return this.rebateChanges;\n }", "public Map<Component, Class> getSourceChanges()\n {\n if (sourceChanges == null)\n {\n sourceChanges = new HashMap<>();\n }\n return sourceChanges;\n }", "IFileDiff[] getDiffs();", "private void fetchOldCalls() {\n fetchCalls(QUERY_OLD_CALLS_TOKEN, false);\n }", "public Collection<TopComponent> getUnchangedDocumentsForNB81() {\n\t\tfinal WindowManager wm = WindowManager.getDefault();\n\t\tfinal LinkedHashSet<TopComponent> result = new LinkedHashSet<TopComponent>();\n\t\tfor (TopComponent tc : getCurrentEditors()) {\n\t\t\tif (!wm.isEditorTopComponent(tc)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t//check for the format of an unsaved file\n\t\t\tboolean isUnsaved = null != tc.getLookup().lookup(SaveCookie.class);\n\t\t\tif (isUnsaved) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tDataObject dob = tc.getLookup().lookup(DataObject.class);\n\t\t\tif (dob != null) {\n\t\t\t\tfinal FileObject file = dob.getPrimaryFile();\n\t\t\t\tObject attribute = file.getAttribute(\"ProvidedExtensions.VCSIsModified\");\n\t\t\t\tif (null != attribute) {\n\t\t\t\t\tif (Boolean.FALSE.equals(attribute)) {\n\t\t\t\t\t\tresult.add(tc);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t//could not determine status, keep this document\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t//close diff windows too\n\t\t\t\tresult.add(tc);\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}", "public List<PodcastEntity> getLegacyPodcasts();", "@Override\n public List<T_ROW_ELEMENT_PM> getRowsWithChanges() {\n return Collections.emptyList();\n }", "ChangeSet getChangeSet();", "List<ChangedFile> getChangedFiles(Project project);", "public Collection getUpdatedTypeNames() {\n if (_payload != PAYLOAD_EXTENTS)\n throw new UserException(s_loc.get(\"nonextent-event\"));\n return (_updates == null) ? Collections.EMPTY_LIST : _updates;\n }", "com.google.ads.googleads.v6.resources.ChangeStatus getChangeStatus();", "private SparseIntArray getChangeOrInsertRecords(Cursor oldCursor, Cursor newCursor) {\n SparseIntArray changes = new SparseIntArray();\n int newCursorPosition = newCursor.getPosition();\n\n if (newCursor.moveToFirst()) {\n int columnIndex = oldCursor.getColumnIndex(\"_id\");\n int cursorIndex = 0;\n\n // loop\n do {\n\n if (oldCursor.moveToFirst()) {\n boolean newRecordFound = false;\n\n // loop\n do {\n\n // we found a record match\n if (oldCursor.getInt(mRowIDColumn) == newCursor.getInt(mRowIDColumn)) {\n newRecordFound = true;\n\n // values are different, this record has changed\n if (!oldCursor.getString(columnIndex).contentEquals(newCursor.getString(columnIndex))) {\n changes.put(cursorIndex, CHANGED);\n }\n break;\n }\n } while (oldCursor.moveToNext());\n\n // new record not found in old cursor, it was newly inserted\n if (!newRecordFound) {\n changes.put(cursorIndex, INSERTED);\n }\n cursorIndex++;\n }\n\n // unable to move the new cursor, all records in new are inserted\n else {\n changes.put(ALL, INSERTED);\n break;\n }\n } while (newCursor.moveToNext());\n }\n\n // unable to move new cursor to first\n else {\n changes.put(ALL, REMOVED);\n }\n newCursor.moveToPosition(newCursorPosition);\n return changes;\n }", "public LinkedList<Diff> getDiff(){\t\n\t\tString modifiedString = \"\";\n\t\ttry {\n\t\t\tmodifiedString = openReadFile(modDoc);\n\t\t} catch (IOException e) {\n\t\t\t// TODO Print to the console\n\t\t\t// \"Could not open the file: '\" + modDoc + \".\" \n\t\t\te.printStackTrace();\n\t\t}\n\t\tLinkedList<Diff> list = dmp.diff_main(baseString, modifiedString, true);\n\t\tbaseString = modifiedString;\n\t\t\n\t\treturn list;\n\t}", "public Collection getUpdatedObjectIds() {\n if (_payload == PAYLOAD_EXTENTS)\n throw new UserException(s_loc.get(\"extent-only-event\"));\n return (_updates == null) ? Collections.EMPTY_LIST : _updates;\n }", "public interface Change {\n\n int getSortingNumber();\n\n @Nonnull\n List<String> getLabels();\n\n @Nonnull\n String getVersion();\n}", "private SparseIntArray diffCursors(Cursor oldCursor, Cursor newCursor) {\n\n SparseIntArray changedOrInserted = getChangeOrInsertRecords(oldCursor, newCursor);\n\n // all records were inserted in new cursor\n if (changedOrInserted.get(ALL) == INSERTED) {\n return changedOrInserted;\n }\n\n SparseIntArray deleted = getDeletedRecords(oldCursor, newCursor);\n\n if (deleted.get(ALL) == INSERTED) {\n return deleted;\n }\n SparseIntArray changes = new SparseIntArray(changedOrInserted.size() + deleted.size());\n\n for (int i = 0; i < changedOrInserted.size(); i++) {\n changes.put(changedOrInserted.keyAt(i), changedOrInserted.valueAt(i));\n }\n\n for (int i = 0; i < deleted.size(); i++) {\n changes.put(deleted.keyAt(i), deleted.valueAt(i));\n }\n return changes;\n }", "public List<OntologyChange> createChanges() {\n\n var to = frameUpdate.getToFrame();\n var toSubject = to.getSubject();\n Frame serverFrame = getFrameForSubject(toSubject);\n if(serverFrame.equals(to)) {\n // Nothing to do\n return Collections.emptyList();\n }\n\n\n // Get the axioms that were consumed in the translation\n var fromAxioms = getAxiomsForFrame(frameUpdate.getFromFrame(), Mode.MAXIMAL);\n\n var ontologyIds = projectOntologiesIndex.getOntologyIds()\n .collect(toList());\n\n var toAxioms = getAxiomsForFrame(frameUpdate.getToFrame(), Mode.MINIMAL);\n\n\n var axiom2OntologyMap = LinkedHashMultimap.<OWLAxiom, OWLOntologyID>create();\n\n // Generate a map of existing axioms so we can ensure they stay in the correct place\n for(OWLOntologyID ontologyId : ontologyIds) {\n for(OWLAxiom fromAxiom : fromAxioms) {\n if(isContainedInOntology(fromAxiom, ontologyId)) {\n axiom2OntologyMap.put(fromAxiom, ontologyId);\n }\n }\n }\n\n\n var mutatedOntologies = Sets.<OWLOntologyID>newLinkedHashSet();\n List<OntologyChange> changes = Lists.newArrayList();\n for(OWLAxiom fromAxiom : fromAxioms) {\n for(OWLOntologyID ontologyId : ontologyIds) {\n if(isContainedInOntology(fromAxiom, ontologyId) && !toAxioms.contains(fromAxiom)) {\n mutatedOntologies.add(ontologyId);\n }\n // We need to add this here in case an axiom containing fresh entities has been added and then\n // removed (caused by a re-edit). The fresh entities will get \"grounded\" and then the axiom added\n // hence, ontology.contains() won't work.\n changes.add(of(ontologyId, fromAxiom));\n }\n }\n\n\n for(OWLAxiom toAxiom : toAxioms) {\n Collection<OWLOntologyID> existingLocations = axiom2OntologyMap.get(toAxiom);\n if(existingLocations.isEmpty()) {\n // Fresh axiom to be placed somewhere\n if(mutatedOntologies.size() == 1) {\n // Assume edit i.e. replacement of axiom in the same ontology.\n changes.add(AddAxiomChange.of(mutatedOntologies.iterator()\n .next(), toAxiom));\n }\n else {\n // Multiple ontologies were affected. We now need to place the fresh axiom in the appropriate\n // ontology\n OWLOntologyID freshAxiomOntology = getFreshAxiomOntology(fromAxioms, ontologyIds);\n changes.add(AddAxiomChange.of(freshAxiomOntology, toAxiom));\n }\n }\n else {\n // Ensure it is still in there\n for(OWLOntologyID ontId : existingLocations) {\n changes.add(AddAxiomChange.of(ontId, toAxiom));\n }\n }\n }\n return changes;\n }", "public JSONObject getGSTFieldsChangedStatus(JSONObject params) throws ServiceException, JSONException {\n Map<String, Object> reqMap = new HashMap();\n if (!StringUtil.isNullOrEmpty(params.optString(\"masterid\"))) {\n reqMap.put(\"masterid\", params.optString(\"masterid\"));\n }\n if (!StringUtil.isNullOrEmpty(params.optString(\"isCustomer\"))) {\n reqMap.put(\"isCustomer\", params.optBoolean(\"isCustomer\"));\n }\n if (!StringUtil.isNullOrEmpty(params.optString(\"productids\"))) {\n String productids = params.optString(\"productids\");\n if (productids.length() > 1) {\n productids = productids.substring(0, productids.length() - 1);\n }\n reqMap.put(\"productids\", productids);\n }\n if (!StringUtil.isNullOrEmpty(params.optString(\"applydate\"))) {\n try {\n reqMap.put(\"applydate\", authHandler.getDateOnlyFormat().parse(params.optString(\"applydate\")));\n reqMap.put(\"transactiondate\", authHandler.getDateOnlyFormat().parse(params.optString(\"transactiondate\")));\n } catch (SessionExpiredException ex) {\n Logger.getLogger(AccEntityGstServiceImpl.class.getName()).log(Level.SEVERE, null, ex);\n } catch (ParseException ex) {\n Logger.getLogger(AccEntityGstServiceImpl.class.getName()).log(Level.SEVERE, null, ex);\n }\n }\n JSONObject data = new JSONObject();\n boolean isdatachanged = false;\n /**\n * Check for customer/vendor history.\n */\n List list = accEntityGstDao.getMasterHistoryForGSTFields(reqMap);\n if (!list.isEmpty() && list.size() > 0) {\n isdatachanged = true;\n return data.put(\"isdatachanged\", isdatachanged);\n }\n /**\n * Check for Product tax class history.\n */\n list = accEntityGstDao.getTaxClassHistoryForGSTFields(reqMap);\n if (!list.isEmpty() && list.size() > 0) {\n isdatachanged = true;\n return data.put(\"isdatachanged\", isdatachanged);\n }\n return data.put(\"isdatachanged\", isdatachanged);\n }", "SolutionChange getPreviousChange();", "public boolean getKeepChangedValues();", "ImmutableList<SchemaOrgType> getDateModifiedList();", "public ImmutableList<T> allExtant() {\n return ImmutableList.<T>builder().addAll(unchanged).addAll(changed).build();\n }", "@Override\n public List<Event> getEvents()\n {\n return Arrays.asList(new DocumentUpdatedEvent());\n }", "public List<ServiceType> getAllByUpdate() {\n\t\t// TODO Auto-generated method stub\n\t\tSession session = HibernateUtil.getSessionFactory().openSession();\n\t\tsession.beginTransaction();\n\t\t@SuppressWarnings(\"unchecked\")\n\t\tList <ServiceType> lst =(List<ServiceType>) session.createCriteria(ServiceType.class)\n\t\t.add(Restrictions.ne(\"updateDate\", \"\"))\n\t\t.list();\n\t\tsession.close();\n\t\treturn lst;\n\t}", "public Timestamp getOriginalServiceData();", "public int getOldValues_descriptionType(){\n return localOldValues_descriptionType;\n }", "public Vector<ESItem> getUnsavedChanges() {\n Vector<ESItem> vars = new Vector<ESItem>();\n Enumeration en = root.depthFirstEnumeration();\n while (en.hasMoreElements()) {\n DefaultMutableTreeNode node = (DefaultMutableTreeNode) en.nextElement();\n Object obj = node.getUserObject();\n if (obj instanceof ESItem) {\n ESItem var = (ESItem) obj;\n if (var.isChanged()) {\n vars.add(var);\n }\n }\n }\n return vars;\n }", "public Iterable<V> iterateToLatest(AbstractSemanticVersion oldVersion) {\n Iterator<V> listIterator = versions.iterator();\n\n //forward to oldVerison\n while (listIterator.hasNext()) {\n if (listIterator.next().compareTo(oldVersion) == 0) {\n break;\n }\n }\n return () -> listIterator;\n }", "public interface Change\n{\n String getDate();\n\n int getRevision();\n\n String getCommitLog();\n\n String getCommitter();\n}", "private indexContainer convertOld2New(indexContainer entries) {\n indexContainer newentries = new indexContainer(entries.getWordHash(), payloadrownew, useCollectionIndex);\r\n Iterator i = entries.entries();\r\n indexRWIEntryOld old;\r\n while (i.hasNext()) {\r\n old = (indexRWIEntryOld) i.next();\r\n newentries.add(new indexRWIEntryNew(old));\r\n }\r\n return newentries;\r\n }", "private SparseIntArray getDeletedRecords(Cursor oldCursor, Cursor newCursor) {\n SparseIntArray changes = new SparseIntArray();\n int newCursorPosition = newCursor.getPosition();\n\n if (oldCursor.moveToFirst()) {\n int cursorIndex = 0;\n\n // loop old cursor\n do {\n\n if (newCursor.moveToFirst()) {\n boolean oldRecordFound = false;\n\n // loop new cursor\n do {\n\n // we found a record match\n if (oldCursor.getInt(mRowIDColumn) == newCursor.getInt(mRowIDColumn)) {\n oldRecordFound = true;\n break;\n }\n } while(newCursor.moveToNext());\n\n if (!oldRecordFound) {\n changes.put(cursorIndex, REMOVED);\n }\n cursorIndex++;\n }\n\n } while (oldCursor.moveToNext());\n }\n\n // unable to move the old cursor to the first record, all records in new were adde\n else {\n changes.put(ALL, INSERTED);\n }\n newCursor.moveToPosition(newCursorPosition);\n return changes;\n }", "@SuppressWarnings(\"unchecked\")\n public <O> List<O> inactiveVersions() {\n return (List<O>) journal.journal\n .retrieve(BarbelQueries.allInactive(journal.id), BarbelQueryOptions.sortAscendingByEffectiveFrom())\n .stream().collect(Collectors.toList());\n }", "public List<Notice> getAllOriginalNotice(){\n\t\tList<Notice> notices = null;\n\t\ttry {\n\t\t\tnotices = noticeRepository.findByIsDeleted(false); \n\t\t} catch (Exception e) {\t\t\t\n\t\t\tthrow new ServerErrorException(\"Exception occured at Service in getAllOriginalNotice(). \"+e);\t\n\t\t}\n\t\t\n\t\treturn notices;\n\t}", "private String getChanges(DbxClientV2 client, String cursor) throws DbxApiException, DbxException, IOException {\n\n\t\t// TODO: remove true\n\t\twhile (true) {\n\t\t\tListFolderResult result = client.files().listFolderContinue(cursor);\n\t\t\tfor (Metadata metadata : result.getEntries()) {\n\t\t\t\tChangeType type;\n\t\t\t\tString details;\n\t\t\t\tif (metadata instanceof FileMetadata) {\n\t\t\t\t\tFileMetadata fileMetadata = (FileMetadata) metadata;\n\t\t\t\t\ttype = ChangeType.FILE;\n\t\t\t\t\tdetails = \"(rev=\" + fileMetadata.getRev() + \")\";\n\t\t\t\t} else if (metadata instanceof FolderMetadata) {\n\t\t\t\t\tFolderMetadata folderMetadata = (FolderMetadata) metadata;\n\t\t\t\t\ttype = ChangeType.FOLDER;\n\t\t\t\t\tdetails = folderMetadata.getSharingInfo() != null ? \"(shared)\" : \"\";\n\t\t\t\t} else if (metadata instanceof DeletedMetadata) {\n\t\t\t\t\ttype = ChangeType.DELETE;\n\t\t\t\t\tdetails = \"\";\n\t\t\t\t} else {\n\t\t\t\t\tthrow new IllegalStateException(\"Unrecognized metadata type: \" + metadata.getClass());\n\t\t\t\t}\n\n\t\t\t\tFileMessage fileMessage = getFileMessage(type, metadata);\n\t\t\t\tupdateFileMessage(client, fileMessage);\n\n\t\t\t\t// channel.send(MessageBuilder.withPayload(fileMessage).build());\n\t\t\t\tint updateListeners = updateListeners(fileMessage);\n\t\t\t\tlogger.debug(updateListeners + \" where updated\");\n\t\t\t\tlogger.debug(\"type:\" + type + \" details:\" + details + \" meta:\" + metadata.getPathLower());\n\t\t\t}\n\t\t\t// update cursor to fetch remaining results\n\t\t\tcursor = result.getCursor();\n\n\t\t\tif (!result.getHasMore()) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn cursor;\n\t}", "Collection<EntityUpdateRequest> pendingUpdates();", "public static void localchangelist(){\r\n\t\t \r\n\t\t\r\n\t\tList<ChangeLocationApplication> l = ChangeLocationApplication.find(\"Locationchangetype =? AND isApproved is false order by timestamp desc\",\"CHANGELOCATIONALONE\").fetch();\r\n\t\t\r\n\t\tSystem.out.println(\"Location Change Applications\"+ l);\r\n\t\t\r\n\t\trender(l);\r\n\t}", "@Override\n public boolean isOutdated() {\n return false;\n }", "public java.util.Enumeration getChangeLogDetailses() throws java.rmi.RemoteException, javax.ejb.FinderException {\n\treturn this.getChangeLogDetailsesLink().enumerationValue();\n}", "public static final ChangeCategory[] getVanillas() {return new ChangeCategory[]{Added, Removed, Attribute_Changes, Objects_Added, Objects_Removed}; }", "private List transformChangeList(List source) {\r\n\t\t\r\n\t\tList target = new ArrayList();\r\n\t\tfor (int i=0; i<source.size(); i++) {\r\n\t\t\tObject change = source.get(i);\r\n\t\t\tif (change instanceof SwoopChange) {\r\n\t\t\t\tSwoopChange swc = (SwoopChange) change;\r\n\t\t\t\t// change SwoopChange to a Description object\r\n\t\t\t\tDescription desc = new Description();\r\n\t\t\t\tdesc.setAuthor(swc.getAuthor());\r\n\t\t\t\tdesc.setCreated(swc.getTimeStamp());\r\n\t\t\t\tdesc.setBody(swc.getDescription());\r\n\t\t\t\tdesc.setBodyType(\"text/html\");\r\n\t\t\t\tdesc.setAnnotatedEntityDefinition(swc.comment);\r\n\t\t\t\t// create annotates URI from\r\n\t\t\t\t// 1. repository URL\r\n\t\t\t\t// 2. owlObjectURI\r\n\t\t\t\t// 3. extra URIs\r\n\t\t\t\tURI[] uris = new URI[2+swc.getExtraSubjects().size()];\r\n\t\t\t\turis[0] = repositoryURI;\r\n\t\t\t\turis[1] = swc.getOwlObjectURI();\r\n\t\t\t\tfor (int j=0; j<swc.getExtraSubjects().size(); j++) {\r\n\t\t\t\t\turis[j+2] = (URI) swc.getExtraSubjects().get(j);\r\n\t\t\t\t}\r\n\t\t\t\tdesc.setAnnotates(uris);\r\n\t\t\t\t// attach single ontology change to description\r\n\t\t\t\tList chngList = new ArrayList();\r\n\t\t\t\tchngList.add(swc.getChange());\r\n\t\t\t\tdesc.setOntologyChangeSet(chngList);\t\t\t\t\r\n\t\t\t\ttarget.add(desc);\r\n\t\t\t}\r\n\t\t\telse if (change instanceof Description) {\r\n\t\t\t\tDescription desc = (Description) change;\r\n\t\t\t\t// change Description to SwoopChange object\r\n\t\t\t\tSwoopChange swc = new SwoopChange();\r\n\t\t\t\tswc.setAuthor(desc.getAuthor());\r\n\t\t\t\tswc.setTimeStamp(desc.getCreated());\r\n\t\t\t\tswc.setDescription(desc.getBody());\r\n\t\t\t\tswc.comment = desc.getAnnotatedEntityDefinition();\r\n\t\t\t\tswc.setCommitted(true); // set committed\r\n\t\t\t\t// get URIs from desc for swc\r\n\t\t\t\tURI[] uris = desc.getAnnotates();\r\n\t\t\t\tswc.setOwlObjectURI(uris[1]);\r\n\t\t\t\tList extraSubjects = new ArrayList(); \r\n\t\t\t\tfor (int j=2; j<uris.length; j++) {\r\n\t\t\t\t\textraSubjects.add(uris[j]);\r\n\t\t\t\t}\r\n\t\t\t\tswc.setExtraSubjects(extraSubjects);\r\n\t\t\t\t// get single ontology change object\r\n\t\t\t\tList chngList = desc.getOntologyChangeSet();\r\n\t\t\t\tswc.setChange((OntologyChange) chngList.iterator().next());\r\n\t\t\t\ttarget.add(swc);\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn target;\t\t\r\n\t}", "public Collection<Document> getAllVersions() {\n throw new UnsupportedOperationException();\n }", "@Override\n public List<Revue> getAll() {\n return null;\n }", "INexusFilterDescriptor[] getFilterDescriptorHistory();", "long getChangeset();", "Collection<ComponentState> getVersions();", "public List<Version> getAllIndexCompatible() {\n return versions.stream()\n .filter(v -> v.lucene.getMajor() >= (currentVersion.lucene.getMajor() - 1))\n .map(v -> v.elasticsearch)\n .toList();\n }", "public String fetchRecentChange(){\n\t\treturn recentChange;\n\t}", "public List<Order> getOrderHistory();", "private List getDescendantChanges(TreeTableNode node) {\r\n\t\tList changes = new ArrayList();\r\n\t\t// start with node and recurse over children\r\n\t\t// dont add the top node which has children\r\n\t\tif (node.children.size()>0) {\r\n\t\t\tfor (Iterator iter = node.children.iterator(); iter.hasNext();) {\r\n\t\t\t\tTreeTableNode child = (TreeTableNode) iter.next();\r\n\t\t\t\tchanges.addAll(getDescendantChanges(child));\r\n\t\t\t}\t\t\t\t\r\n\t\t}\r\n\t\telse if (!node.swoopChange.isTopNode) changes.add(node.swoopChange);\r\n\t\treturn changes;\r\n\t}", "@Override\n\tprotected HashSet<String> getAllChangedFileName(){\n\t\treturn null;\n\t}", "public int getChangeType() {\r\n return changeType;\r\n }", "public List getModifications(Date lastBuild, Date now) {\n //(PENDING) extract buildHistoryCommand, execHistoryCommand\n // See CVSElement\n \n \t\t//call vss, write output to intermediate file\n String[] cmdArray = {\"ss.exe\", \"history\", ssdir, \"-R\", \"-Vd\" +\n formatDateForVSS(now) + \"~\" + formatDateForVSS(lastBuild),\n \"-Y\" + login, \"-I-N\", \"-O\" + VSS_TEMP_FILE};\n \t\ttry {\n \t\t\tProcess p = Runtime.getRuntime().exec(cmdArray);\n \t\t\tp.waitFor();\n \n \t\t\tBufferedReader reader = new BufferedReader(new FileReader(\n new File(VSS_TEMP_FILE)));\n \n \t\t\tString currLine = reader.readLine();\n \t\t\twhile (currLine != null) {\n \t\t\t\tif (currLine.startsWith(\"***** \")) {\n \t\t\t\t\tArrayList vssEntry = new ArrayList();\n \t\t\t\t\tvssEntry.add(currLine);\n \t\t\t\t\tcurrLine = reader.readLine();\n \t\t\t\t\twhile (currLine != null && !currLine.startsWith(\"***** \")) {\n \t\t\t\t\t\tvssEntry.add(currLine);\n \t\t\t\t\t\tcurrLine = reader.readLine();\n \t\t\t\t\t}\n Modification mod = handleEntry(vssEntry);\n if(mod != null)\n modifications.add(mod);\n \t\t\t\t} else {\n \t\t\t\t\tcurrLine = reader.readLine();\n \t\t\t\t}\n \t\t\t}\n \n \t\t\treader.close();\n \t\t\tnew File(VSS_TEMP_FILE).delete();\n \t\t} catch (Exception e) {\n \t\t\te.printStackTrace();\n \t\t}\n \n \t\tif (_property != null && modifications.size() > 0) {\n _properties.put(_property, \"true\");\n \t\t}\n \n \t\treturn modifications;\n \t}", "public OccurrenceInfoCollection getModifiedOccurrences()\n\t\t\tthrows ServiceLocalException {\n\t\treturn (OccurrenceInfoCollection) this.getPropertyBag()\n\t\t\t\t.getObjectFromPropertyDefinition(\n\t\t\t\t\t\tAppointmentSchema.ModifiedOccurrences);\n\t}", "public\tList<ChangedJsMethod>\tgetChangedMethods() {\n\t\t\n\t\treturn\tCollections.unmodifiableList(this.changedMethods);\n\t}", "List<SoldValueByFlag> getSoldValueByFlag(Company company, Date startDate, Date endDate) throws Exception;", "default void showChanges() {\n\t\tthrow new UnsupportedVersionControlSystemSupportException();\n\t}", "String getUpdated();", "public abstract Date getChanged(int lineNumber);", "public Date getDateChanged() {\n\t\treturn null;\n\t}", "@Override\n\tpublic AigaJointDebugChange[] getAigaJointDebugChange(\n\t\t\tDetachedCriteria criteria) throws Exception {\n\t\treturn aigaJointDebugDao.getAigaJointDebugChange(criteria);\n\t}", "IFileDiff[] getDiffs(String sourceFilter, String rightFilter);", "public String getChangeReason() {\n return changeReason;\n }", "com.google.protobuf.Any getOldConfig();", "@GET(\"points-transaction-history?expand=translations&sort=-created_at\")\n Call<HistoryExchangeResponse> getTransactionHistoryAll();", "public ObjectChangeSet getChangeSet() {\n return changeSet;\n }", "public List<Drawing> getChangedDrawings() {\n// Set<String> changedDrawingNames = new HashSet<String>();\n// for (Drawing drawing : _changedDrawings) {\n// changedDrawingNames.add(drawing.getName());\n// }\n return new ArrayList<Drawing>(_changedDrawings);\n }", "public List<Refueling> getPendingRefuelings() throws DataAccessException;", "long getUpdated();", "long getLastChanged();", "@Override\n\tpublic List<AddressChangeReqDetails> findAll() throws SystemException {\n\t\treturn findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);\n\t}", "public synchronized List<Update<V>> getUpdates() {\n if (!isReadOnly() && updates == null) {\n updates = calculateUpdates();\n }\n return updates;\n }", "public static String renderDifferencesWithPreviousVersion(boObject current, long bouiVersion, XMLDocument doc, EboContext newContext)\n {\n \ttry\n\t\t{\n \t\tif (doc == null){\n \t\t\treturn \"Não foi possível aceder ao viewer, ocorreu um erro\"; //FIXME: Internacionalizar\n \t\t}\n \t\t\n \t\t\n\t\t\tEboContext\t\teboCtx = current.getEboContext();\n\t\t\t//Boui of the Ebo_Versioning\n\t\t\t\n\t\t\tboObject\t\tobjectVersion = boObject.getBoManager().loadObject(eboCtx, bouiVersion);\n\t\t\t\n\t\t\tboVersioning\tversioningManager = new boVersioning();\n\t\t\tlong\t\t\tbouiOfObject = objectVersion.getAttribute(\"changedObject\").getValueLong();\n\t\t\tlong\t\t\tversionOfObject = objectVersion.getAttribute(\"version\").getValueLong();\n\t\t\t\n\t\t\t//Create a new context to hold the rollback version\n\t\t\t//which means the original object can be left alone\n\t\t\tversioningManager.rollbackVersion(newContext,bouiOfObject,versionOfObject, true);\n\t\t\t\n\t\t\tboObject\t\trollBackVersion = boObject.getBoManager().loadObject(newContext, bouiOfObject);\n\t\t\t\n\t\t\t//Get the difference between objects\n\t\t\tObjectDifference diffObj = new ObjectDifference(current, rollBackVersion);\n\t\t\t\n\t\t\t//Get the Map of differences of attributes\n\t\t\tHashMap<String,ObjectAttributeValuePair> diffAttributes = diffObj.getAttributeDifferencesOfObjects();\n\t\t\t\n\t\t\t//Get the Map of differences of bridges\n\t\t\tHashMap<String,GridFlashBack> diffBridges = diffObj.getBridgeDifferencesOfObjects();\n\t\t\t\n\t\t\tIterator<String> itDiffAtts = diffAttributes.keySet().iterator();\n\t\t\tElement differences = doc.createElement(\"differences\");\n\t\t\tdifferences.setAttribute(\"label\", BeansMessages.LBL_DIFFERENCES_RESUME.toString());\n\t\t\twhile (itDiffAtts.hasNext())\n\t\t\t{\n\t\t\t\tElement attribute = doc.createElement(\"attribute\");\n\t\t\t\tString attName = itDiffAtts.next();\n\t\t\t\tObjectAttributeValuePair pair = diffAttributes.get(attName);\n\t\t\t\tattribute.setAttribute(\"name\", pair.getAttName());\n\t\t\t\tattribute.setAttribute(\"oldValue\", pair.getOldVal());\n\t\t\t\tattribute.setAttribute(\"newValue\", pair.getNewVal());\n\t\t\t\tdifferences.appendChild(attribute);\n\t\t\t}\n\t\t\tdoc.getDocumentElement().appendChild(differences);\n\t\t\t\n\t\t\t//Update the XML tree with the differences in attributes and bridges\n\t\t\tupdateXMLTreeWithAttributeDifferences(doc, diffAttributes, diffBridges,differences);\n\t\t\t\n\t\t\tString xmlSourceContent = ngtXMLUtils.getXML(doc);\n\t\t\t\n\t\t\t//System.out.println(xmlSourceContent);\n\t\t\t\n\t\t\t//Apply the XSLT\n\t\t\tfinal String XSLT = \"showDifferencesVersion.xsl\";\n\t\t\tInputStream in = Thread.currentThread().getContextClassLoader().getResourceAsStream( XSLT );\n\t\t\tString finalTransformer = ngtXMLUtils.getXML(ngtXMLUtils.loadXML(in));\n\t\t\t\n\t\t\tSource xmlSource = new StreamSource(new StringReader(xmlSourceContent));\n\t Source xsltSource = new StreamSource(new StringReader(finalTransformer));\n\n\t StringWriter pw = new StringWriter();\n \t// the factory pattern supports different XSLT processors\n\t TransformerFactory transFact =\n\t TransformerFactory.newInstance();\n\t Transformer trans = transFact.newTransformer(xsltSource);\n\t trans.transform(xmlSource, new StreamResult(pw));\n\t\t\t\n\t\t\tnewContext.close();\n\t\t\t\n\t\t\treturn pw.toString();\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\te.printStackTrace();\n\t\t\tif (newContext != null)\n\t\t\t\tnewContext.close();\n\t\t} \n\t\t\n\t\t//Show the Logs in case of error \n\t\tString logs = getListOfLogsObject(bouiVersion, current);\n\t\t\n\t\treturn BeansMessages.MSG_ERROR_IN_DIFFERENCES_RENDER.toString()\n\t\t\t\t+ \"<br />\" + logs;\n }", "public static Response getChangesSince(String timestamp) throws JSONException, IOException {\n\t\tString url = BASE_URL + \"&t=\" + timestamp;\n\t\treturn Response.fromJSONString(HTTP.get(url));\n\t}", "com.google.ads.googleads.v6.resources.ChangeEvent getChangeEvent();", "Collection<String> getVersions();", "AbstractList<BalanceChange> recentActivity() {\r\n\t\tArrayList<BalanceChange> activity = new ArrayList<BalanceChange>();\r\n\t\t\r\n\t\tint i=10;\r\n\t\twhile (i > 0) {\r\n\t\t\t//TODO\r\n\t\t\ti--;\r\n\t\t}\r\n\t\t\r\n\t\treturn activity;\r\n\t}", "protected List<RuntimeCheck> getOriginalChecks(Exp e) {\n List<RuntimeCheck> ret = originalChecks.get(e);\n if (ret != null) {\n ret = new ArrayList<RuntimeCheck>(ret);\n }\n return ret;\n }", "@SuppressWarnings(\"unchecked\")\n public <O> List<O> activeVersions() {\n return (List<O>) journal.journal\n .retrieve(BarbelQueries.allActive(journal.id), BarbelQueryOptions.sortAscendingByEffectiveFrom())\n .stream().map(d -> journal.processingState.expose(journal.context, (Bitemporal) d))\n .collect(Collectors.toList());\n }", "public static WTChangeOrder2 getChangeNoticeByNumber(String sCNNumber) throws WTException \r\n\t{\n\t QuerySpec qs = new QuerySpec(WTChangeOrder2.class);\r\n\t SearchCondition condition = new SearchCondition(WTChangeOrder2.class, WTChangeOrder2.NUMBER, SearchCondition.EQUAL, sCNNumber);\r\n\t qs.appendWhere(condition, new int[]{0});\r\n\t QueryResult qr = PersistenceHelper.manager.find((StatementSpec)qs);\r\n\t WTChangeOrder2 cn = null;\r\n\t WTChangeOrder2 cn2 = null;\r\n\t\twhile(qr.hasMoreElements())\r\n\t\t{\r\n\t\t\tcn = (WTChangeOrder2)qr.nextElement();\r\n\t\t\tbreak;\r\n\t\t}\r\n\t\tif(cn != null)\r\n\t\t{\r\n\t\t\tQueryResult qr2 = VersionControlHelper.service.allVersionsOf(cn);\r\n\t\t\tcn2= (WTChangeOrder2)qr2.nextElement();\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t\treturn cn2;\r\n\t}", "private IOperationHistory getOperationHistory() {\n return PlatformUI.getWorkbench().getOperationSupport().getOperationHistory();\n }", "private List<ChangedFile> getChangedFiles(Repository repository, List<DiffEntry> diffs) throws IOException {\n List<ChangedFile> files = new ArrayList<>();\n DiffFormatter diffFormatter = new DiffFormatter(DisabledOutputStream.INSTANCE);\n diffFormatter.setRepository(repository);\n diffFormatter.setContext(0);\n for (DiffEntry entry : diffs) {\n FileHeader header = diffFormatter.toFileHeader(entry);\n files.add(this.getChangedFile(header));\n }\n diffFormatter.close();\n return files;\n }", "java.util.List<com.google.search.now.wire.feed.mockserver.MockServerProto.MockUpdate> \n getMockUpdatesList();", "protected abstract List<Map<String, Object>> getAdmOldContentProperties(Long minNodeId, Long maxNodeId);", "static ImmutableMap<Change.Id, ChangeData> getVisibleChanges(\n @Nullable SearchingChangeCacheImpl searchingChangeCache,\n ChangeNotes.Factory changeNotesFactory,\n ChangeData.Factory changeDataFactory,\n Project.NameKey projectName,\n PermissionBackend.ForProject forProject,\n Repository repository,\n ImmutableSet<Change.Id> changes) {\n Stream<ChangeData> changeDatas;\n if (changes.size() < CHANGE_LIMIT_FOR_DIRECT_FILTERING) {\n logger.atFine().log(\"Loading changes one by one for project %s\", projectName);\n changeDatas = loadChangeDatasOneByOne(changes, changeDataFactory, projectName);\n } else if (searchingChangeCache != null) {\n logger.atFine().log(\"Loading changes from SearchingChangeCache for project %s\", projectName);\n changeDatas = searchingChangeCache.getChangeData(projectName);\n } else {\n logger.atFine().log(\"Loading changes from all refs for project %s\", projectName);\n changeDatas =\n scanRepoForChangeDatas(changeNotesFactory, changeDataFactory, repository, projectName);\n }\n HashMap<Change.Id, ChangeData> result = new HashMap<>();\n changeDatas\n .filter(cd -> changes.contains(cd.getId()))\n .filter(\n cd -> {\n try {\n return forProject.change(cd).test(ChangePermission.READ);\n } catch (PermissionBackendException e) {\n throw new StorageException(e);\n }\n })\n .forEach(\n cd -> {\n if (result.containsKey(cd.getId())) {\n logger.atWarning().log(\n \"Duplicate change datas for the repo %s: [%s, %s]\",\n projectName, cd, result.get(cd.getId()));\n }\n result.put(cd.getId(), cd);\n });\n return ImmutableMap.copyOf(result);\n }", "List<Project> getProjectsWithChanges(List<Project> projects);", "@Override\n public GetDifferencesResult getDifferences(GetDifferencesRequest request) {\n request = beforeClientExecution(request);\n return executeGetDifferences(request);\n }", "public java.util.List<pb4client.ValueChange> getVcList() {\n if (vcBuilder_ == null) {\n return java.util.Collections.unmodifiableList(vc_);\n } else {\n return vcBuilder_.getMessageList();\n }\n }", "@Override\n\tpublic List<Topic> getAllTopicsOld(long date, String forumPatch)\n\t\t\tthrows Exception {\n\t\treturn null;\n\t}" ]
[ "0.6657904", "0.61205745", "0.60166293", "0.5869165", "0.5821728", "0.5661865", "0.56570077", "0.56109655", "0.55925554", "0.558749", "0.5554464", "0.55506617", "0.54991454", "0.54793525", "0.5477846", "0.54757935", "0.5466739", "0.5442674", "0.54173315", "0.5414583", "0.53815573", "0.534826", "0.53446656", "0.5341922", "0.533175", "0.53259635", "0.53223914", "0.53055465", "0.5304089", "0.5301575", "0.52902883", "0.5278079", "0.5271147", "0.52618545", "0.5254351", "0.5222337", "0.52218485", "0.52101856", "0.51997757", "0.51987994", "0.5196835", "0.51901", "0.51647943", "0.5161278", "0.51548016", "0.51512253", "0.5143387", "0.5130034", "0.5123211", "0.51159644", "0.5114537", "0.5111737", "0.51066846", "0.5100213", "0.50986457", "0.5096234", "0.50952595", "0.5077219", "0.50653744", "0.5051973", "0.50406593", "0.5023636", "0.5022114", "0.5018179", "0.50109214", "0.5003242", "0.4990345", "0.49847075", "0.49809283", "0.49687365", "0.49534112", "0.49524155", "0.4952027", "0.49427748", "0.49386528", "0.49365517", "0.49365473", "0.4929027", "0.4920661", "0.49029103", "0.4900692", "0.4899752", "0.48972964", "0.4894548", "0.48943007", "0.489328", "0.487065", "0.48672712", "0.48660797", "0.48612598", "0.48596358", "0.48590177", "0.4853983", "0.48534608", "0.48525107", "0.48472014", "0.4835549", "0.48209816", "0.48182455", "0.48176804" ]
0.6488243
1
Method to customise exception message.
public DukeBadIndexException(int index) { if (index < 0) { super.message = "You can't enter a negative index!!"; } else if (index == 0) { super.message = "There is no index 0 ://"; } else { super.message = "I don't think you have that many tasks my dude."; } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public WeldExceptionStringMessage(String message) {\n // This will not be further localized\n this.message = message;\n }", "public String getMessage ()\n {\n String message = super.getMessage();\n\n if (message == null && exception != null) {\n return exception.getMessage();\n } else {\n return message;\n }\n }", "protected static String setMessage(Exception exception) {\n if (exception != null) {\n if (exception instanceof ProjectCommonException) {\n return exception.getMessage();\n } else if (exception instanceof akka.pattern.AskTimeoutException) {\n return \"Request timed out. Please try again.\";\n }\n }\n return \"Something went wrong while processing the request. Please try again.\";\n }", "protected abstract String defaultExceptionMessage(TransactionCommand transactionCommand);", "public String getExceptionMessage() {\n\t\treturn \"Error while publishing JSON reports. Please contact system administrator or try again later!\";\n\t}", "public String getMessage() {\n return super.getMessage()+\"\\n error code=\"+error_code+\" error value=\"+error_value; //$NON-NLS-1$ //$NON-NLS-2$\n }", "public String getMessage()\n {\n return super.getMessage()+promo_error+\"not found\";\n }", "public String getMessage()\n {\n return super.getMessage() + invoice_error + \" not found\";\n }", "@Override\r\n\tpublic String toString() {\n\t\treturn \"Exception is..\" + msg;\r\n\t}", "public String getMessage() {\n\t\tif (iCause == null) { return super.getMessage(); }\n\t\treturn super.getMessage() + \"; nested exception is: \\n\\t\" + iCause.toString();\n\t}", "@Override\n\tpublic String getMessage()\n\t{\n\t\treturn errMessage;\n\t}", "public String getMessage()\n {\n return super.getMessage()+promo_error.getCode()+\"already exists\";\n }", "protected abstract String getMessage();", "@Override\n\tpublic String getLocalizedMessage() {\n\t\treturn super.getLocalizedMessage();\n\t}", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "java.lang.String getMessage();", "@Override\n public String getMessage() {\n return super.getMessage() + bonus_error + \"Not Found\";\n }", "@Override\n public String getMessage(){\n \n }", "@Override\n public String getMessage()\n {\n return message;\n }", "public String getMessage() {\n return super.getString(Constants.Properties.MESSAGE);\n }", "@Override\n\tpublic String getMessage() {\n\t\treturn \"ATTENZIONE: nel progetto Eccezioni Java si è verificato un errore!\";\n\t}", "private static String buildErrorMessage(String message) {\n return EXCEPTION_PREFIX + ' ' + message;\n }", "@Override\n public String getMessage() {\n return message;\n }", "@Override\n\tpublic String getMessage() {\n\t\treturn null;\n\t}", "@Override\n public String getMessage()\n {\n return message;\n }", "@Override\n public String getMessage() {\n return message;\n }", "private String formatError(String message) {\n return \"error : \" + message;\n }", "@Override\r\n\tpublic String toString() {\n\t\treturn \"com.cg.Exercise4Exception\"+super.getMessage();\r\n\t}", "public notHumanBeingException(String message){// Message parameted created\n super(message);\n \n }", "@Override\r\n\tpublic String getMessage() {\n\t\treturn \"Failed\";\r\n\t}", "@Override\n public String getMessage() {\n return MESSAGE;\n }", "@Override\n\tprotected String generateMessage() {\n\t\treturn \"Script evaluation exception \" + generateSimpleMessage();\n\t}", "String getInvalidMessage();", "@Override\r\n\tpublic String getMessage() {\n\t\treturn \"홀수입력 !!\";\r\n\t}", "public abstract String getMessage();", "protected String doErrorMessage(Exception e){\n\t\treturn \"{ \\\"ERROR\\\": \\\"\"+ e.getMessage() + \"\\\"}\" ;\n\t}", "java.lang.String getReason();", "@Override\n\tpublic String getMessage() {\n\t\treturn message;\n\t}", "@Override\n\tpublic String getMessage() {\n\t\treturn message;\n\t}", "public String getMessage() {\n return null;\n }", "public String getMessage();", "public String getMessage();", "public String getMessage();", "public String getMessage();", "public String getMessage();", "public String getMessage();", "public String getMessage();", "public MyException() {\n super(\"This is my message. There are many like it but this one is mine.\");\n }", "abstract java.lang.String getLocalizedMessage();", "public BadRequestException(String message) {\n super(message);\n if(!message.equals(\"\")){errorText = errorText.concat(\": \" + message);}\n }", "public String getSystemExceptionLabel() {\n\t\treturn systemExceptionLabel;\n\t}", "protected abstract String insufficientParameterExceptionMessage(TransactionCommand transactionCommand);", "@Override\r\n public String getMessage() {\r\n return ErrorMessage.STATUS_FORMATTING_IN_FILE_ERROR;\r\n }", "String message() {\n if (arguments == null || arguments.length == 0) return message; // most case, message is from exception, and without no arguments\n\n var builder = new StringBuilder(256);\n LogManager.FILTER.append(builder, message, arguments);\n return builder.toString();\n }", "public MyCustomException( String message )\n {\n\n\t// Why are we doing this??\n super( message );\n }", "@Override\n public String getMessage() {\n return \"File not found.\";\n }", "@Override\n public String getMessage() {\n return ErrorMessage.INVALID_NEGATIVE_PRICE_ERROR;\n }", "String getException();", "String getException();", "String getCauseException();", "public String getMessage() {\n return NestedThrowable.Util.getMessage(super.getMessage(), nested);\n }", "public String getExceptionMessage(Exception e)\n {\n String s = e.getMessage();\n\n return (s == null) ? \"\" : \": \" + s;\n }", "String getMessage();", "String getMessage();", "String getMessage();", "@Override\r\n\tpublic void displayError(EntityPropertyCode code, String message) {\n\t}", "protected String formatErrorMessage() throws SQLException {\n \tint errCode = SQLite.extendederrcode(getConnection().getSqliteDb());\r\n \tString message = SQLite.errmsg(getConnection().getSqliteDb());\r\n\t\tString s = StringUtil.format(\"Code:{0}\\n{1}\", errCode, message);\r\n\t\treturn s;\r\n\t}", "public void message(String message, Throwable t);", "public MyException(String message)\n { super(message); }", "public String getMessage() {\n\t\treturn \" whose content is a\";\n\t}", "public String getMessage() {\r\n return mContext.getString(mErrorMessageRes);\r\n }", "@Override\n public String getMessage() {\n return \" ** I'm a friendly ENEMY! **\";\n }", "public OLMSException(String message) {\r\n super(message);\r\n }", "String getMessage() {\n return null;\n }", "public String getMessage() {\n return \"☹ OOPS!!! There isn't a task labeled \" + label;\n }", "public String getMessage() throws FIFException {\n return text;\n }", "public BaseException(String message) {\n super(message);\n setErrorCode();\n }", "public String getMessage() {\n return \"Sorry, there isn't any event in the list on the given date.\";\n }", "@Override\r\n\tpublic String getMessage() {\n\t\treturn this.message;\r\n\t}", "public String toString ()\n {\n if (exception != null) {\n return exception.toString();\n } else {\n return super.toString();\n }\n }", "private static String getMessage(int code) {\n switch (code) {\n case ME_DIV_BY_ZERO:\n return \"Attempt to divide by zero.\";\n case ME_ASSIGNLITERAL:\n return \"Attempt to assign to a literal.\";\n case ME_NONVARASSIGN:\n return \"Attempt to assign to a non-variable.\";\n default:\n return \"Unknown error.\";\n }\n }", "public String simple() {\r\n return super.getMessage();\r\n }", "public CustomException(String message, Throwable cause) {\n super(message, cause);\n }", "public FormatException(String message) {\r\n\t\tsuper(message);\r\n\t}", "public MyException(String message) {\r\n\t\tsuper(message);\r\n\t\t// TODO Auto-generated constructor stub\r\n\t}", "private String makeBadSearchMessage(String querytext, String exceptionMsg){\n String rv = \"\";\n try{\n //try to get the column in the search term that is causing the problems\n int coli = exceptionMsg.indexOf(\"column\");\n if( coli == -1) return \"\";\n int numi = exceptionMsg.indexOf(\".\", coli+7);\n if( numi == -1 ) return \"\";\n String part = exceptionMsg.substring(coli+7,numi );\n int i = Integer.parseInt(part) - 1;\n \n // figure out where to cut preview and post-view\n int errorWindow = 5;\n int pre = i - errorWindow;\n if (pre < 0)\n pre = 0;\n int post = i + errorWindow;\n if (post > querytext.length())\n post = querytext.length();\n // log.warn(\"pre: \" + pre + \" post: \" + post + \" term len:\n // \" + term.length());\n \n // get part of the search term before the error and after\n String before = querytext.substring(pre, i);\n String after = \"\";\n if (post > i)\n after = querytext.substring(i + 1, post);\n \n rv = \"The search term had an error near <span class='searchQuote'>\"\n + before + \"<span class='searchError'>\" + querytext.charAt(i)\n + \"</span>\" + after + \"</span>\";\n } catch (Throwable ex) {\n return \"\";\n }\n return rv;\n }" ]
[ "0.74284023", "0.739416", "0.7298313", "0.7113796", "0.70708567", "0.7062908", "0.689752", "0.68658024", "0.6826625", "0.6794737", "0.67832804", "0.67736125", "0.6768242", "0.67099327", "0.6688064", "0.6688064", "0.6688064", "0.6688064", "0.6688064", "0.6688064", "0.6688064", "0.6688064", "0.6688064", "0.6688064", "0.6688064", "0.6688064", "0.6688064", "0.6688064", "0.6688064", "0.6688064", "0.6688064", "0.6677248", "0.6672672", "0.6649086", "0.6641135", "0.663396", "0.6623127", "0.6605106", "0.6597418", "0.65838516", "0.65733033", "0.6549952", "0.65429664", "0.6534956", "0.64922804", "0.6487672", "0.64850396", "0.64790016", "0.6467991", "0.64242256", "0.6412677", "0.63957995", "0.6394749", "0.6394749", "0.6380703", "0.6371353", "0.6371353", "0.6371353", "0.6371353", "0.6371353", "0.6371353", "0.6371353", "0.63469696", "0.63385546", "0.63244826", "0.63172835", "0.6301195", "0.6292856", "0.6220244", "0.62195975", "0.62187105", "0.61930007", "0.61821055", "0.61821055", "0.61784226", "0.61632967", "0.61618304", "0.61524576", "0.61524576", "0.61524576", "0.61415213", "0.6132979", "0.6132285", "0.6131377", "0.6114315", "0.61075336", "0.61008644", "0.60862905", "0.60811085", "0.6079337", "0.6071852", "0.60634273", "0.6050305", "0.604247", "0.6038438", "0.60381025", "0.60374796", "0.6013432", "0.60112554", "0.60042155", "0.60041475" ]
0.0
-1
creating BigInteger object with max value of type long
public static void main(String[] args) { BigInteger number = new BigInteger(Long.MAX_VALUE + ""); number = number.add(BigInteger.ONE); int count = 0; while (count < 5){ if (isPrime(number)){ count++; System.out.println(number); } //increment number by 1 number = number.add(BigInteger.ONE); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static BigInteger valueOf(long val)\n {\n if (val == 0)\n {\n return BigInteger.ZERO;\n }\n\n // store val into a byte array\n byte[] b = new byte[8];\n for (int i = 0; i < 8; i++)\n {\n b[7 - i] = (byte)val;\n val >>= 8;\n }\n\n return new BigInteger(b);\n }", "private BigInteger(long val) {\n if (val < 0) {\n val = -val;\n signum = -1;\n } else {\n signum = 1;\n }\n\n int highWord = (int)(val >>> 32);\n if (highWord == 0) {\n mag = new int[1];\n mag[0] = (int)val;\n } else {\n mag = new int[2];\n mag[0] = highWord;\n mag[1] = (int)val;\n }\n }", "BigInteger getEBigInteger();", "BigInteger getValue();", "public Number getMaximumNumber() {\n/* 221 */ if (this.maxObject == null) {\n/* 222 */ this.maxObject = new Long(this.max);\n/* */ }\n/* 224 */ return this.maxObject;\n/* */ }", "BigInteger getNumber();", "public long getMaximumLong() {\n/* 233 */ return this.max;\n/* */ }", "public static void main(String[] args) {\n int i = 1;\n int n = 100;\n for(;i<=n;i++){\n System.out.println(\"i:\" + i);\n }\n\n BigInteger bigInteger = BigInteger.valueOf(111L);\n bigInteger.longValue();\n }", "java.math.BigInteger getNcbieaa();", "public Long getMaxValue() {\n return maxValue;\n }", "public long maxValue() {\n return 0;\n }", "public static long getMaxLongValueForNumBits(int i) {\n\n if (i >= 64)\n throw new RuntimeException(\"Number of bits exceeds Java long.\");\n else\n return maxValueCache[i];\n\n }", "public BigInt getBigInt() {\n if (this.nativeIsValid) {\n return this.bigInt;\n }\n synchronized (this) {\n if (this.nativeIsValid) {\n return this.bigInt;\n }\n BigInt bigInt2 = new BigInt();\n bigInt2.putLittleEndianInts(this.digits, this.sign < 0);\n setBigInt(bigInt2);\n return bigInt2;\n }\n }", "public abstract BigInteger nextValue();", "java.math.BigInteger getNcbistdaa();", "java.math.BigInteger getNcbi8Aa();", "public long longValue();", "public abstract byte getMaxExponentSize();", "PBBignum(BigInteger value)\n {\n\tsuper(value.toString());\n\tbigIntValue = value;\n }", "public Composite(long val) {\n\t\tthis (BigInteger.valueOf(val));\n\t}", "public BigInteger toBigInteger() {\n return BigInteger.valueOf(nano);\n }", "private BigInteger()\n {\n }", "public abstract void setMaxExponentSize(byte maxExponentSize);", "BigInteger decodeBigInteger();", "public BigInteger getNextBigID() {\n return new BigInteger(Long.toString(++id));\n }", "long mo107678c(Integer num);", "BigInteger multiply(long v) {\n if (v == 0 || signum == 0)\n return ZERO;\n if (v == BigDecimal.INFLATED)\n return multiply(BigInteger.valueOf(v));\n int rsign = (v > 0 ? signum : -signum);\n if (v < 0)\n v = -v;\n long dh = v >>> 32; // higher order bits\n long dl = v & LONG_MASK; // lower order bits\n\n int xlen = mag.length;\n int[] value = mag;\n int[] rmag = (dh == 0L) ? (new int[xlen + 1]) : (new int[xlen + 2]);\n long carry = 0;\n int rstart = rmag.length - 1;\n for (int i = xlen - 1; i >= 0; i--) {\n long product = (value[i] & LONG_MASK) * dl + carry;\n rmag[rstart--] = (int)product;\n carry = product >>> 32;\n }\n rmag[rstart] = (int)carry;\n if (dh != 0L) {\n carry = 0;\n rstart = rmag.length - 2;\n for (int i = xlen - 1; i >= 0; i--) {\n long product = (value[i] & LONG_MASK) * dh +\n (rmag[rstart] & LONG_MASK) + carry;\n rmag[rstart--] = (int)product;\n carry = product >>> 32;\n }\n rmag[0] = (int)carry;\n }\n if (carry == 0L)\n rmag = java.util.Arrays.copyOfRange(rmag, 1, rmag.length);\n return new BigInteger(rmag, rsign);\n }", "public BigInteger getNextBigID() throws IDGenerationException;", "public int getMaxIntValue();", "public void testGetUnsignedLong() throws Exception {\n ByteBuffer bb = ByteBuffer.allocate(8);\n bb.put((byte)0xff).put((byte)0xff).put((byte)0xff).put((byte)0xff);\n bb.put((byte)0xff).put((byte)0xff).put((byte)0xff).put((byte)0xff);\n bb.position(0);\n bb.limit(8);\n BigInteger bi = Unsigned.getUnsignedLong(bb);\n BigInteger uLongMax = new BigInteger(ULONG_MAX);\n for (int i = 0; i < uLongMax.bitCount(); ++i) {\n Assert.assertTrue(\"Bit: \" + i + \" should be: \" + uLongMax.testBit(i),\n uLongMax.testBit(i) == bi.testBit(i));\n }\n Assert.assertEquals(ULONG_MAX, bi.toString());\n\n bb = ByteBuffer.allocate(10);\n bb.put((byte)0x00);\n bb.put((byte)0xff).put((byte)0xff).put((byte)0xff).put((byte)0xff);\n bb.put((byte)0xff).put((byte)0xff).put((byte)0xff).put((byte)0xff);\n bb.put((byte)0x00);\n bb.position(0);\n bb.limit(10);\n bi = Unsigned.getUnsignedLong(bb, 1);\n uLongMax = new BigInteger(ULONG_MAX);\n for (int i = 0; i < uLongMax.bitCount(); ++i) {\n Assert.assertTrue(\"Bit: \" + i + \" should be: \" + uLongMax.testBit(i),\n uLongMax.testBit(i) == bi.testBit(i));\n }\n Assert.assertEquals(ULONG_MAX, bi.toString());\n }", "public static JSONNumber BigInteger(BigInteger bigIntegerVal) {\n\t\tJSONNumber number = new JSONNumber( bigIntegerVal.toString() );\n\t\tnumber.bigIntegerVal = bigIntegerVal;\n\t\treturn number;\n\t}", "public BigInteger nextBigInteger() {\n\t\t\treturn null;\n\t\t}", "public BigInteger nextBigInteger() {\n\t\t\treturn null;\n\t\t}", "public BigInteger nextBigInteger()\n throws IOException\n {\n BigInteger result = BigInteger.ZERO;\n long work = 0;\n int offset = 0;\n long b;\n do {\n b = input.read();\n if (b == -1) {\n throw new OrcCorruptionException(\"Reading BigInteger past EOF from \" + input);\n }\n work |= (0x7f & b) << (offset % 63);\n if (offset >= 126 && (offset != 126 || work > 3)) {\n throw new OrcCorruptionException(\"Decimal exceeds 128 bits\");\n }\n offset += 7;\n // if we've read 63 bits, roll them into the result\n if (offset == 63) {\n result = BigInteger.valueOf(work);\n work = 0;\n }\n else if (offset % 63 == 0) {\n result = result.or(BigInteger.valueOf(work).shiftLeft(offset - 63));\n work = 0;\n }\n }\n while (b >= 0x80);\n if (work != 0) {\n result = result.or(BigInteger.valueOf(work).shiftLeft((offset / 63) * 63));\n }\n // convert back to a signed number\n boolean isNegative = result.testBit(0);\n if (isNegative) {\n result = result.add(BigInteger.ONE);\n result = result.negate();\n }\n result = result.shiftRight(1);\n return result;\n }", "public static final BigInteger generateRandomNumber(BigInteger maxValue, Random random)\r\n\t{\r\n\t\tBigInteger testValue;\r\n\t\tdo{\r\n\t\t\ttestValue = new BigInteger(maxValue.bitLength(), random);\r\n\t\t}while(testValue.compareTo(maxValue) >= 0);\r\n\t\t\r\n\t\treturn testValue;\r\n\t}", "long getLongValue();", "long getLongValue();", "Long mo20729a();", "public static BigInteger factorialBig(BigInteger n) throws NumberOutOfLimitsException{\n \tif(n.compareTo(BigInteger.ZERO)<0){\n \t\tthrow new NumberOutOfLimitsException();\n \t}\n \tif (n.equals(BigInteger.ZERO)){\n \treturn BigInteger.ONE;\n }else{\n \treturn n.multiply(factorialBig(n.subtract(BigInteger.ONE)));\n }\n }", "public long readBoundedLong(final long max) throws IOException {\n final int bits = 0 >= max ? 0 : (int) (Math.floor(Math.log(max) / Math.log(2)) + 1);\n return 0 < bits ? this.read(bits).toLong() : 0;\n }", "@Test\n public void testLargeALargeM() {\n assertEquals(11479907, PiGenerator.powerMod(123456, 2, 42423131));\n }", "public java.math.BigInteger getLimit()\r\n {\r\n synchronized (monitor())\r\n {\r\n check_orphaned();\r\n org.apache.xmlbeans.SimpleValue target = null;\r\n target = (org.apache.xmlbeans.SimpleValue)get_store().find_element_user(LIMIT$6, 0);\r\n if (target == null)\r\n {\r\n return null;\r\n }\r\n return target.getBigIntegerValue();\r\n }\r\n }", "public long getMaximum() {\n\t\treturn this._max;\n\t}", "BigInteger add(long val) {\n if (val == 0)\n return this;\n if (signum == 0)\n return valueOf(val);\n if (Long.signum(val) == signum)\n return new BigInteger(add(mag, Math.abs(val)), signum);\n int cmp = compareMagnitude(val);\n if (cmp == 0)\n return ZERO;\n int[] resultMag = (cmp > 0 ? subtract(mag, Math.abs(val)) : subtract(Math.abs(val), mag));\n resultMag = trustedStripLeadingZeroInts(resultMag);\n return new BigInteger(resultMag, cmp == signum ? 1 : -1);\n }", "BigInteger getLength();", "@Override // com.fasterxml.jackson.databind.JsonDeserializer\n public BigInteger deserialize(JsonParser jVar, DeserializationContext gVar) throws IOException {\n int m = jVar.mo29329m();\n if (m == 3) {\n return (BigInteger) _deserializeFromArray(jVar, gVar);\n }\n switch (m) {\n case 6:\n String trim = jVar.mo29334t().trim();\n if (_isEmptyOrTextualNull(trim)) {\n _verifyNullForScalarCoercion(gVar, trim);\n return (BigInteger) getNullValue(gVar);\n }\n _verifyStringForScalarCoercion(gVar, trim);\n try {\n return new BigInteger(trim);\n } catch (IllegalArgumentException unused) {\n return (BigInteger) gVar.mo31517b(this._valueClass, trim, \"not a valid representation\", new Object[0]);\n }\n case 7:\n switch (jVar.mo29295z()) {\n case INT:\n case LONG:\n case BIG_INTEGER:\n return jVar.mo29249E();\n }\n case 8:\n if (!gVar.mo31509a(DeserializationFeature.ACCEPT_FLOAT_AS_INT)) {\n _failDoubleToIntCoercion(jVar, gVar, \"java.math.BigInteger\");\n }\n return jVar.mo29252H().toBigInteger();\n }\n return (BigInteger) gVar.mo31493a(this._valueClass, jVar);\n }", "public static void main(String[] args) throws IOException {\r\n\t long a = 1182312000;\r\n\t System.out.println((a<<1) + 57596000);\r\n\t System.out.println(Long.MAX_VALUE);\r\n }", "public BigInteger getBigIntegerAttribute();", "public Long getMaximum() {\r\n\t\treturn maximum;\r\n\t}", "private static BIG byte_to_BIG(byte [] array){\n BIG result = new BIG();\n long[] long_ = new long[4];\n for(int i=long_.length; i > 0;i--){\n long_[i-1] =\n ((array[i*7-3] & 0xFFL) << 48) |\n ((array[i*7-2] & 0xFFL) << 40) |\n ((array[i*7-1] & 0xFFL) << 32) |\n ((array[i*7] & 0xFFL) << 24) | \n ((array[i*7+1] & 0xFFL) << 16) | \n ((array[i*7+2] & 0xFFL) << 8) | \n ((array[i*7+3] & 0xFFL) << 0) ; \n }\n int int_ = \n (int) (((array[0] & 0xFFL) << 24) |\n\t\t ((array[1] & 0xFFL) << 16) |\n\t\t ((array[2] & 0xFFL) << 8) |\n\t\t ((array[3] & 0xFFL) << 0)) ;\n \n long[] temp = {long_[3],long_[2],long_[1],long_[0],int_};\n\n result = new BIG(temp);\n return result;\n }", "@Deprecated\n public static BigInteger literalUnsignedLong(final long input) {\n return new BigInteger(1, ByteBuffer.allocate(8).putLong(input).array());\n }", "@Override\n public BigInteger getBigInteger(String key, BigInteger defaultValue) {\n return null;\n }", "private static long zeroTo(final long maximum) {\n return (long) (Math.random() * maximum);\n }", "public abstract T getMaxValue();", "public int getMaximumNumber() {\n\t\treturn 99999;\n\t}", "BigInteger getMax_freq();", "private static BigInteger valueOf(int val[]) {\n return (val[0] > 0 ? new BigInteger(val, 1) : new BigInteger(val));\n }", "private final long get_BIGINT(int column) {\n // @AGG force Little Endian\n if (metadata.isZos())\n return dataBuffer_.getLong(columnDataPosition_[column - 1]);\n else\n return dataBuffer_.getLongLE(columnDataPosition_[column - 1]);\n// return SignedBinary.getLong(dataBuffer_,\n// columnDataPosition_[column - 1]);\n }", "public static int getMaxIntValueForNumBits(int i) {\n\n if (i >= 32)\n throw new RuntimeException(\"Number of bits exceeds Java int.\");\n else\n return (int) maxValueCache[i];\n\n }", "public long peekLongCoord(long max) throws IOException {\n if (1 >= max) return 0;\n int bits = 1 + (int) Math.ceil(Math.log(max) / Math.log(2));\n Bits peek = this.peek(bits);\n double divisor = 1 << peek.bitLength;\n long value = (int) (peek.toLong() * ((double) max) / divisor);\n assert (0 <= value);\n assert (max >= value);\n return value;\n }", "BigInteger getMessage();", "long nextLong();", "long nextLong();", "private BigInteger(int[] val) {\n if (val.length == 0)\n throw new NumberFormatException(\"Zero length BigInteger\");\n\n if (val[0] < 0) {\n mag = makePositive(val);\n signum = -1;\n } else {\n mag = trustedStripLeadingZeroInts(val);\n signum = (mag.length == 0 ? 0 : 1);\n }\n if (mag.length >= MAX_MAG_LENGTH) {\n checkRange();\n }\n }", "public BigInteger toBigInteger() {\n return new BigInteger(1, bytes);\n }", "java.math.BigDecimal getMaximum();", "public static long getLargestPrimeFactor(BigInteger i) {\n\t\tBigInteger sqrt = new BigInteger(String.valueOf((long)Math.sqrt(i.doubleValue())));\n\t\tBigInteger max = new BigInteger(\"0\");\n\t\tBigInteger start = new BigInteger(\"2\");\n\t\t\n\t\twhile(start.compareTo(sqrt) == -1 || start.compareTo(sqrt) == 0) {\n\t\t\tif(i.mod(start).compareTo(new BigInteger(\"0\")) == 0) {\n\t\t\t\tBigInteger otherFactor = i.divide(start);\n\t\t\t\tif(BigIntegerPrime.isBigIntegerPrime(start) && start.compareTo(max) == 1)\n\t\t\t\t\tmax = start;\n\t\t\t\telse if(otherFactor.isProbablePrime(1) && otherFactor.compareTo(max) == 1)\n\t\t\t\t\tmax = otherFactor;\n\t\t\t}\n\t\t\t\n\t\t\tstart = start.add(BigInteger.ONE);\n\t\t\t\n\t\t}\n\t\treturn max.longValue();\n\t}", "private static BigInteger BigIntToBigNbr(int[] GD, int NumberLength) {\r\n\t\tbyte[] Result;\r\n\t\tlong[] Temp;\r\n\t\tint i, NL;\r\n\t\tlong digit;\r\n\r\n\t\tTemp = new long[NumberLength];\r\n\t\tConvert31To32Bits(GD, Temp, NumberLength);\r\n\t\tNL = NumberLength * 4;\r\n\t\tResult = new byte[NL];\r\n\t\tfor (i = 0; i < NumberLength; i++) {\r\n\t\t\tdigit = Temp[i];\r\n\t\t\tResult[NL - 1 - 4 * i] = (byte) (digit & 0xFF);\r\n\t\t\tResult[NL - 2 - 4 * i] = (byte) (digit / 0x100 & 0xFF);\r\n\t\t\tResult[NL - 3 - 4 * i] = (byte) (digit / 0x10000 & 0xFF);\r\n\t\t\tResult[NL - 4 - 4 * i] = (byte) (digit / 0x1000000 & 0xFF);\r\n\t\t}\r\n\t\treturn (new BigInteger(Result));\r\n\t}", "public abstract long nextLong();", "public static void main(String[] args) {\n\r\n\t\tlong ln= 6008514751431L;\r\n\t\tint max=0;\r\n\t\tfor (int i=2; i<= ln;i++)\r\n\t\t\twhile (ln % i == 0)\r\n\t\t\t{\r\n\t\t\t\tif(i>max)\r\n\t\t\t\tmax=i;\r\n\t\t\t\tln/=i;\r\n\t\t\t}\t\r\n\t\tSystem.out.println(\"the greatest prime factor of the given number is :\"+max);\r\n\t\t}", "public Object getMaxValue() {\n\t\treturn null;\n\t}", "public static final long Integer(final Object o) {\n\t\t\n\t\treturn Convert.Any.toLong(o, 0);\n\t}", "public int getMaximumInteger() {\n/* 244 */ return (int)this.max;\n/* */ }", "@In Integer max();", "@In Integer max();", "public BigInteger() {\n\t\tnegative = false;\n\t\tnumDigits = 0;\n\t\tfront = null;\n\t}", "HugeUInt(int arg) {\r\n this(Integer.toString(arg));\r\n }", "public static void main(String arg[]) {\n\t\t\n\t\tlong longNumberWithoutL = 1000*60*60*24*365;\n\t\tlong longNumberWithL = 1000*60*60*24*365L;\n\n\t\tSystem.out.println(longNumberWithoutL);//1471228928\n\t\tSystem.out.println(longNumberWithL);//31536000000\n\n\t\t//31536000000 -- 36 bits\n\t\t// 11101010111101100010010110000000000\n\t\t//max limit of 32 bit int: 2147483647\n\t\t//1010111101100010010110000000000 --> 1471228928\n\t}", "private FibonacciNumber(long value) {\n\t\t\tthis.value = BigInteger.valueOf(value);\n\t\t}", "long mo25071a(long j);", "public long getMaxId(MigrationType type);", "public long longValue() {\r\n return intValue();\r\n }", "public static void main(String[] args) {\n long n = new Long(\"13195\");\n\n System.out.println(new LargestPrimeFactor().solve(n));\n }", "public long getMax() {\n return m_Max;\n }", "int getMaxInt();", "E maxVal();", "@Test\n public void testLargeM() {\n assertEquals(32, PiGenerator.powerMod(2, 5, 42423131));\n }", "public byte get_max() {\n return (byte)getSIntBEElement(offsetBits_max(), 8);\n }", "public static long randomLong() {\n return randomLong(Long.MIN_VALUE, Long.MAX_VALUE);\n }", "long decodeLong();", "public long toLong()\n\t{\n\t\t// holds the int to return\n\t\tlong result = 0;\n\t\t\n\t\t// for every byte value\n\t\tfor (int i = 0; i < bytes.length; i++)\n\t\t{\n\t\t\t// Extract the bits out of the array by \"and\"ing them with the\n\t\t\t// maximum value of\n\t\t\t// a byte. This is done because java does not support unsigned\n\t\t\t// types. Now that the\n\t\t\t// unsigned byte has been extracted, shift it to the right as far as\n\t\t\t// it is needed.\n\t\t\t// Examples:\n\t\t\t// byte array int\n\t\t\t// {0x01, 0x00} = 256\n\t\t\t//\n\t\t\t// byte array int\n\t\t\t// {0x01, 0x8C 0xF0} = 0x018CF0\n\t\t\tresult += (byteToLong(bytes[i]) << (Byte.SIZE * (bytes.length - i - 1)));\n\t\t}\n\t\t\n\t\t// return the int\n\t\treturn result;\n\t}", "public static long inputLong()\n\t{\n\t\treturn(sc.nextLong());\n\t}", "public int getMaxValue() {\n return maxValue;\n }", "public int getMaxValue(){\n\t\treturn maxValue;\n\t}", "public void set_max(byte value) {\n setSIntBEElement(offsetBits_max(), 8, value);\n }", "private static BigInteger largePrime(int bitLength, int certainty, Random rnd) {\n BigInteger p;\n p = new BigInteger(bitLength, rnd).setBit(bitLength-1);\n p.mag[p.mag.length-1] &= 0xfffffffe;\n\n // Use a sieve length likely to contain the next prime number\n int searchLen = getPrimeSearchLen(bitLength);\n BitSieve searchSieve = new BitSieve(p, searchLen);\n BigInteger candidate = searchSieve.retrieve(p, certainty, rnd);\n\n while ((candidate == null) || (candidate.bitLength() != bitLength)) {\n p = p.add(BigInteger.valueOf(2*searchLen));\n if (p.bitLength() != bitLength)\n p = new BigInteger(bitLength, rnd).setBit(bitLength-1);\n p.mag[p.mag.length-1] &= 0xfffffffe;\n searchSieve = new BitSieve(p, searchLen);\n candidate = searchSieve.retrieve(p, certainty, rnd);\n }\n return candidate;\n }", "public static long withMax(long n, long max) {\r\n\t\tif (n > max) {\r\n\t\t\treturn max;\r\n\t\t} else {\r\n\t\t\treturn n;\r\n\t\t}\r\n\t}", "BIG createBIG();", "public void testPutUnsignedLong() throws Exception {\n ByteBuffer bb = ByteBuffer.allocate(8);\n BigInteger uLongMax = new BigInteger(ULONG_MAX);\n Unsigned.putUnsignedLong(bb, uLongMax);\n for (int i = 0; i < 8; ++i) {\n Assert.assertTrue(\"Byte: \" + i + \" should be 0xff, was: \" + bb.get(i),\n (bb.get(i) & (short)0xff) == 0xff);\n }\n\n bb = ByteBuffer.allocate(10);\n Unsigned.putUnsignedLong(bb, uLongMax, 1);\n int offset = 1;\n for (int i = 0; i < 8; ++i) {\n Assert.assertTrue(\"Byte: \" + i + \" should be 0xff, was: \" +\n bb.get(offset+i), (bb.get(offset+i) & (short)0xff) == 0xff);\n }\n }", "public M csmiIdMax(Object max){this.put(\"csmiIdMax\", max);return this;}", "public static final long Integer(final Object o, final Object defaultValue) {\n\t\t\n\t\treturn Convert.Any.toLong(o, Convert.Any.toLong(defaultValue, 0));\n\t}" ]
[ "0.7068334", "0.6906552", "0.68643105", "0.67866343", "0.6732203", "0.6717791", "0.66904527", "0.6646537", "0.63104343", "0.6243461", "0.62152284", "0.6187847", "0.6174511", "0.6150578", "0.61113507", "0.61080897", "0.6070816", "0.60395056", "0.6035864", "0.6027642", "0.59687436", "0.59542394", "0.59406", "0.5934078", "0.5886981", "0.58828884", "0.58718866", "0.58693224", "0.58644044", "0.5859374", "0.58384085", "0.58348125", "0.58348125", "0.57890105", "0.578722", "0.5786332", "0.5786332", "0.578488", "0.5781215", "0.57713825", "0.57673156", "0.5763814", "0.5763109", "0.57625157", "0.57507384", "0.5748395", "0.57384276", "0.5730205", "0.5726211", "0.5711598", "0.5708399", "0.5706147", "0.56837755", "0.5682209", "0.56664497", "0.56626904", "0.5644853", "0.5640426", "0.5638118", "0.56314415", "0.5629441", "0.5629431", "0.5629431", "0.5620502", "0.5617793", "0.56151146", "0.56120986", "0.5597281", "0.55926764", "0.5582198", "0.5579703", "0.5562741", "0.5550135", "0.5548358", "0.5548358", "0.55417365", "0.55406505", "0.55348533", "0.5497515", "0.5490285", "0.5481019", "0.5479663", "0.5478565", "0.5476648", "0.5475386", "0.5471378", "0.5459163", "0.5456018", "0.5448449", "0.5435138", "0.54298437", "0.54285485", "0.54228216", "0.54203266", "0.5412592", "0.5411949", "0.5399169", "0.5395344", "0.5389796", "0.53874683", "0.53830415" ]
0.0
-1
check is BigInteger object prime number
public static boolean isPrime(BigInteger number){ BigInteger two = new BigInteger("2"); BigInteger border = number.divide(two); BigInteger start; for (start = two; start.compareTo(border) <= 0; start = start.add(BigInteger.ONE)){ if (number.remainder(start).equals(BigInteger.ZERO)){ return false; } } return true; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static boolean isPrime(BigInteger n) {\n\t\tglobalLog.stepIn(\"isPrime(\" + n.toString() + \")\");\n\t\tprimeLog.stepIn(\"isPrime(\" + n.toString() + \")\");\n\t\t// Use some other function if n is sufficiently small (n<=10^10)\n\t\tif (n.compareTo(BigInteger.valueOf(10000000000l)) <= 0) {\n\t\t\tprimeLog.log(\"The number \" + n.toString() + \" is small enough to be checked normally.\");\n\t\t\treturn isPrime(n.longValue());\n\t\t} else if (!n.testBit(0)) {\n\t\t\tprimeLog.log(\"The number \" + n.toString() + \" is even so it is composite.\");\n\t\t\treturn false;\n\t\t}\n\t\tprimeLog.log(\n\t\t\t\t\"The number \" + n.toString() + \"is too large and will be checked with Rabin Miller primality test.\");\n\n\t\t// Find values to the equation n=2^s*m where s is as large as possible\n\t\tint s = 0;\n\t\t// Find out how many times we can divide (n-1) by 2\n\t\tBigInteger nMinusOne = n.subtract(BigInteger.ONE);\n\t\twhile (!nMinusOne.testBit(s)) {\n\t\t\ts++;\n\t\t}\n\t\t// Find k by calculating n>>s\n\t\tBigInteger m = nMinusOne.shiftRight(s);\n\t\tprimeLog.log(n.toString() + \" - 1 = 2^\" + s + \" * \" + m.toString());\n\n\t\tint prime = 0;\n\t\tint composite = 0;\n\n\t\t// Check to see if n is prime using base a\n\t\tlong maxValue = n.bitLength() > 63 ? Long.MAX_VALUE : n.longValue();\n\t\tfor (int i = 0; i < PRIMALITY_CHECK_ITERATIONS; i++) {\n\t\t\tprimeLog.stepIn(\"Trial \" + i);\n\t\t\tBigInteger a = BigInteger.valueOf(randomLong(2, maxValue - 2));\n\t\t\tprimeLog.log(\"Checking if n is prime using a=\" + a.toString() + \".\");\n\t\t\t// First iteration is a^m % n\n\t\t\tBigInteger res = a.modPow(m, n);\n\t\t\tprimeLog.log(\"a^m % n = \" + res.toString());\n\t\t\t// On first iteration if |a^m mod n| = 1 then say it is prime\n\t\t\tif (res.equals(BigInteger.ONE) || res.equals(nMinusOne)) {\n\t\t\t\tprimeLog.log(\"We can declare that \" + n.toString() + \" is prime.\");\n\t\t\t\tprimeLog.stepOut();\n\t\t\t\tprime++;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tboolean flag = false;\n\t\t\tfor (int j = 1; !flag && j < s; j++) {\n\t\t\t\tres = res.modPow(BigInteger.valueOf(2), n);\n\t\t\t\tprimeLog.log(\"a^(2^\" + j + \" * m) % n = \" + res.toString());\n\t\t\t\tif (res.equals(BigInteger.ONE)) {\n\t\t\t\t\t// If a^[(2^j)*m] % n = 1 then we say is is composite\n\t\t\t\t\tprimeLog.log(\"We can declare that \" + n.toString() + \" is composite.\");\n\t\t\t\t\tcomposite++;\n\t\t\t\t\tflag = true;\n\t\t\t\t} else if (res.equals(nMinusOne)) {\n\t\t\t\t\tprimeLog.log(\"We can declare that \" + n.toString() + \" is prime.\");\n\t\t\t\t\t// If a^[(2^j)*m] % n = -1 then we say is is prime\n\t\t\t\t\tprime++;\n\t\t\t\t\tflag = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!flag) {\n\t\t\t\tprimeLog.log(\"We can declare that \" + n.toString() + \" is composite.\");\n\t\t\t\tcomposite++;\n\t\t\t}\n\t\t\tprimeLog.stepOut();\n\t\t}\n\t\tprimeLog.log(\"Out of \" + (prime + composite) + \" trials, \" + prime + \" trials claimed n was prime.\");\n\t\tprimeLog.log(\"n is prime: \" + (prime > composite));\n\t\tglobalLog.appendToCurrent(\": \" + (prime > composite));\n\t\tglobalLog.stepOut();\n\t\tprimeLog.appendToCurrent(\": \" + (prime > composite));\n\t\treturn prime > composite;\n\t}", "public static boolean isPrime(BigInteger n) {\n if (primes.contains(n)) {\n return true;\n } else if (n.compareTo(last(primes)) < 0) {\n return false;\n }\n for (BigInteger i = last(primes).add(ONE); i.compareTo(n) <= 0; i =\n i.add(ONE)) {\n if (i.mod(new BigInteger(\"10000\")).compareTo(ZERO) == 0) System.out.println(i);\n for (BigInteger x : primes) {\n if (i.mod(x).compareTo(ZERO) == 0) {\n break;\n } else if (x.multiply(x).compareTo(i) > 0) {\n primes.add(i);\n break;\n }\n }\n }\n return last(primes).compareTo(n) == 0;\n }", "private boolean isPrime(long n) {\n return BigInteger.valueOf(n).isProbablePrime(10);\n }", "public boolean isPrime(BigInteger number) {\n\n\t\tBigInteger one = new BigInteger(\"1\");\n\t\tBigInteger counter = one.add(one); //two\n\n\n\t\t//while counter < number\n\t\twhile(counter.compareTo(number) <0) {\n\t\t\tif(isDivisible(number, counter)) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t//increment the counter\n\t\t\tcounter = counter.add(one);\n\t\t}\n\n\t\treturn true;\n\t}", "public static boolean isPrime(MyInteger number1){\r\n\t\tfor (int i = 2; i<number1.getInt(); i++){\r\n\t\t\tif(number1.getInt()/i==0){\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 boolean isprime(long i) {\n\t\t\n\t\tif(i<=2) \n\t\treturn true;\n\t\tfor(long n = 2;n< i;n++) {\n\t\t\tif(i%n ==0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}", "static boolean isPrime(long n) {\n long sqrt = (long)Math.sqrt((double)n);\n int idx = Collections.binarySearch(SMALL_PRIMES, sqrt);\n return !IntStream.range(0, idx > 0 ? idx + 1 : (-idx - 1))\n .mapToLong(SMALL_PRIMES::get)\n .anyMatch(p -> n % p == 0L);\n }", "public static boolean isPrime(MyInteger n1){\n return n1.isPrime();\n }", "public static boolean isPrime(int broj){\r\n\t\t// Ako je broj djeljiv sa prethodnim brojevima\r\n\t\t// onda nije prost.\r\n\t\tfor (int i = 2; i < broj; i++){\r\n\t\t\tif (broj % i == 0){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public boolean isPrime(int n) {\n return new BigInteger(String.valueOf(n)).isProbablePrime(8);\n }", "public boolean isPrime()\r\n\t{\r\n\t\tif (currentNumber == 2 || currentNumber == 0)\r\n\t {\r\n\t \tprocessLastDigit();\r\n\t\t\treturn true;\r\n\t }\r\n\t\telse if (currentNumber % 2 == 0)\r\n\t {\r\n\t \treturn false;\r\n\t }\r\n \r\n\t for (int factor = 3; factor <= Math.sqrt(currentNumber); factor += 2)\r\n\t {\r\n\t if(currentNumber % factor == 0)\r\n\t {\r\n\t \treturn false;\r\n\t }\r\n\t }\r\n \tprocessLastDigit();\r\n\t return true;\r\n\t}", "public boolean isPrime()\n\t{\n\t\treturn isPrime(value);\n\t}", "@Test\n public void testInversePrime() {\n final GaloisPrimeField field = new GaloisPrimeField(13);\n final GaloisElement element = field.element(9);\n final GaloisElement inverse = galoisInverse.invert(element);\n Assertions.assertEquals(BigInteger.valueOf(3), inverse.value());\n }", "public static boolean is_prime(long n){\n if(n == 1) return false;\n if(n == 2) return true;\n if(n % 2 == 0) return false;\n else{\n long sqrt = (long)Math.sqrt(n);\n boolean result = true;\n for(long i = 2; i <= sqrt; i++)\n if(n % i == 0)\n return false;\n }\n return true;\n }", "private boolean isPrime(long num) {\n if (num < 2) // prime numbers are positive and above 1\n return false;\n long max = (long) sqrt(num); // get the rounded square root of the number to check for primality\n for (int j = 2; j <= max; j++) {\n if (num % j == 0) {\n return false; // not a prime number as is divisible\n }\n }\n return true; // optimus prime :-)\n }", "public boolean isPrime() {\n\t\tNode current_node = this.head;\n\t\tif(current_node.next == null) {\n\t\t\tif(current_node.factor != 1){\n\t\t\t\tif(current_node.power == 1){\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}", "private boolean confirmPrimes(BigInteger p, BigInteger q)\n\t{\t\t\n\t\tif(p.compareTo(q) == 0) return false;\n\t\tif(p.mod(TWO) == ZERO || q.mod(TWO) == ZERO) return false;\n\t\tif((p.subtract(ONE)).gcd(E) == ONE || (q.subtract(ONE)).gcd(E) == ONE) return false;\n\t\t\n\t\treturn true;\n\t}", "public static boolean Prime(int numb) {\n\n\t\t// petlja koja prolazi sve brojeve do datog broja i koja provejrava da\n\t\t// li je broj prost\n\t\tfor (int n = 2; n < numb; n++) {\n\t\t\t// uslov ukoliko je broj djeljiv sa nekim drugim brojem osim sa 1 i\n\t\t\t// sam sa sobom vracamo false\n\t\t\tif (numb % n == 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}\n\t\t// ukoliko uslov nije tacan vracamo true tj da je broj prost\n\t\treturn true;\n\t}", "public static boolean isPrime(MyInteger value)\n\t{\n\t\treturn isPrime(value.getValue());\n\t}", "public boolean isPrime(){\r\n\t\tfor (int i = 2; i<value; i++){\r\n\t\t\tif(value/i==0){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "boolean isPrime (int i) { //isCrossedOut()\n if(i == 2){\n return true;\n }\n if(i % 2 == 0 || i == 1){\n return false;\n }\n\n //Finn position i arrayet\n int bitIndex = (i-1) / 2;\n int arrayIndex = bitIndex / 8;\n bitIndex = bitIndex % 8;\n //System.out.println(\"isPrime(\"+ i +\")\");\n\n if((bitArr[arrayIndex] & bitMask[bitIndex]) == 0){\n return false;\n }\n return true;\n }", "public static boolean isPrime(int num){\n if(num<=1){\n return false;\n }\n for(int i=2;i<=(long)Math.sqrt(num) ; i++){\n if(num%i==0){\n return false;\n }\n }\n return true;\n }", "static boolean isPrime(int a){ //isPrime function evaluates if the int is prime takes int and returns boolean\n //logic:\n //a number is prime if no other number is divisible by it other than 1 and itself.\n //algorithim: modulos every number until n to see if is divisible and modulos == 0 \n //faster way: check everynumber up until half of the the number. ( int division will cut off the decimal ) since if it is double, it will also be divisible by 2\n //not, start the loop after 1 because 1 is neither prime nor composite\n if ( a == 1){\n System.out.println(\"Error: 1 is neither prime nor composite\");\n return false;\n }//end if\n for(int i = 2; i <= (a/2); i++){\n if(a % i == 0)//if the number is divisible by any number other than itself then it is not prime.\n return false;\n }//end for\n return true; //if the number succesfully passes through the loop then it is a prime number and return true\n \n }", "private static boolean isPrime(int number) {\n\n\t\tif (number <= NUMBER_ONE) {\n\t\t\treturn false; \n\t\t}\n\n\t\tfor (int i = NUMBER_TWO; i < number; i++) {\n\t\t\tif (number % i == NUMBER_ZERO) { \n\t\t\t\treturn false; \n\t\t\t}\n\t\t}\n\t\treturn true; \n\t}", "private static boolean checkPrime(int size){\n boolean prime = true;\n //if can divide by two then it is not prime\n if (size%2==0) prime = false;\n //if not, then just check the odds as all even numbers are divisible by 2\n for(int i = 3; i*i <= size; i += 2) {\n if(size % i == 0)\n prime = false;\n }\n return prime;\n }", "@Test\n public void euclidesAreCoprimeTest_pseudoprimeCoprimes() {\n BigInteger a = new BigInteger(\"33153\");\n // pseudoprime (151 * 331)\n BigInteger b = new BigInteger(\"49981\");\n boolean result = Algo.euclidesAreCoprime(a, b);\n assertTrue(result);\n }", "boolean equals( BigInt number );", "public boolean isPrime()\n\t{\n\t\treturn ! exactDivision;\n\t}", "private boolean isPrime(int x) {\n for (int i = 2; i <= x / i; i++) {\n if (x % i == 0) {\n return false;\n }\n }\n return true;\n }", "private boolean isItPrime(int checkPrime) {\n\t\tint i;\n\t\t// We dont devide the number by itself or one\n\t\tfor (i = 2; i < checkPrime; i++) {\n\n\t\t\tif (checkPrime % i == 0) {\n\t\t\t\t// If there is no rest after modulus, the number is divisible\n\t\t\t\tSystem.out.println(\"\\nSorry, not a prime number\");\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"\\nLooks like you found a prime buddy!\");\n\t\treturn true;\n\t}", "@Override\n public boolean isPrime(int value){\n if (value == 0 || value == 1){\n return false;\n }\n // Check all numbers up to the square root of the number\n for (int i = 2; i*i < value+1; i++) {\n if (value % i == 0) {\n return false;\n }\n }\n return true;\n }", "static boolean isPrime(long num) {\n\t\tif(num==1)\n\t\t\treturn false;\n\t\tif(num==2 || num==3)\n\t\t\treturn true;\n\t\t\n\t\tif(num%2==0 || num%3==0)\n\t\t\treturn false;\n\t\t\n\t\tfor(int value=5; value*value<=num; value+=6)\n\t\t\tif(num%value==0 || num%(value+2)==0)\n\t\t\t\treturn false;\n\t\t\n\t\treturn true;\n\t}", "private boolean isPrime(long candidate) {\n\n\t\t\tlong sqrt = (long) Math.sqrt(candidate);\n\n\t\t\tfor (long i = 3; i <= sqrt; i += 2) {\n\t\t\t\tif (candidate % i == 0) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t}", "public boolean isAPrimeNumber(int x){\n for(int i = 1; i <= x;i++){\n\n //if the mod = 0 then it is a divisor\n if(x % i == 0) {\n\n //increment count\n count++;\n\n }\n //if count is greater than 2 we return true because prime numbers\n //Can only be divisble by 1 and itself\n if(count > 2){\n\n return false;\n }\n\n\n\n }\n\n //If the entire loop finishes then we return true\n return true;\n }", "public static boolean isPrime(int x){ \n\t\t\n\t\tfor(int i = 2; i <= Math.sqrt(x); i++){\n\t\t\tif(x%i == 0){\n\t\t\t return false; \n\t\t\t}\n\t\t}\t\n\t\treturn true; \t\n\t}", "public boolean primeCheck(Long n){\n\t\t//checks whether an int is prime or not.\n\t\t\n\t\t //check if n is a multiple of 2\n\t\t if (n%2==0) return false;\n\t\t //if not, then just check the odds\n\t\t for(int i=3;i*i<=n;i+=2) {\n\t\t if(n%i==0)\n\t\t return false;\n\t\t }\n\t\t \n\t\t return true;\n\t\t\n\t}", "public boolean isPrime(Integer number) {\n int end = number / 2;\n for(int i = 2; i <= end; i++)\n if(number % i == 0)\n return false;\n return true;\n }", "public static boolean isPrime(int i) {\n\t\t\n\t\treturn false;\n\t}", "@Override\n public boolean isPrimeNumber(int number) {\n if (number < 2) return false;\n int sqrt = (int) Math.sqrt(number);\n for (int i = 2; i <= sqrt; i++) {\n if (number % i == 0) {\n return false;\n }\n }\n return true;\n }", "static boolean isPrime(String number)\n {\n int num = Integer.valueOf(number);\n\n for(int i = 2; i * i <= num; i++)\n {\n if ((num % i) == 0)\n return false;\n }\n return num > 1 ? true : false;\n }", "static private boolean checkPrimality(long n) {\n // first, check if even\n if (n % 2 == 0)\n return false;\n\n // now, check against odd numbers\n for (int i = 3; i < n / 2; i += 2)\n if (n % i == 0)\n return false;\n\n return true;\n }", "private static boolean isPrimeNumber(double number) {\n\t\tif(number <= 0)\n\t\t\treturn false;\n\t\tif(number == 1)\n\t\t\treturn true;\n\t\t\t\n\t\tfor (double i = 2; i < number; i++) {\t\t\t\n\t\t\tif((number%i == 0))\n\t\t\t\treturn false;\t\t\t\t\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "private static boolean isPrime(int number){\n for(int divisor = 2; divisor <= number / 2; divisor++){\n if(number % divisor == 0){ // If true. number is not prime\n return false;\n }\n }\n return true; // Number is prime\n }", "public static boolean isPrime(final long n){\n if (n<=0){\r\n throw new IllegalArgumentException(\"Error in n: can't procces negative numbers.\");\r\n }\r\n if (n == 1){\r\n return false;\r\n }\r\n\r\n // Testing for all numbers\r\n for (long i = 2; i < n; i++) {\r\n if (n%i == 0){\r\n return false;\r\n }\r\n }\r\n //TODO: probando el TODO\r\n return true;\r\n\r\n }", "private static boolean isPrime(int x) {\n if (x<=1)\n return false;\n else\n return !isDivisible(x, 2);\n }", "public static boolean isPrime(int value) {\n /* counter keep track of number of modulo operation\n in prime number,the modulus returns 0 two times only\n 1.when it is devided by 1\n 2.when it is devided by it self \n */\n int counter = 0;\n // zero , one is not prime\n if (value == 0 || value == 1) {\n counter = 0;\n } else {\n // starting from 2,doing modulus operation\n for(int i = 2;i<=value;i++){\n if (value%i==0) {\n counter++;\n }\n }\n }\n // checking the counter,we done modulus starting from 2,so we don't have to consider 1st case\n // counter is one means the value is only devisible by it self(2nd case)\n if (counter==1) {\n return true;\n }\n // if the number is devisible by numbers other than one and the number it self,then it is not prime\n else{\n return false;\n } \n }", "public static boolean isPrime(int number){\r\n\t\tfor (int i = 2; i<number; i++){\r\n\t\t\tif(number/i==0){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static int is_prime(int num) {\n\t\t\n\t\t /* Initializes recursion */\n\t\treturn check_if_prime(num, firstprime);\n\t}", "@Test\n public void euclidesAreCoprimeTest_notCoprimesWithNegative() {\n BigInteger a = new BigInteger(\"-10000021\");\n // pseudoprime (3 * 43 * 257)\n BigInteger b = new BigInteger(\"33153\");\n boolean result = Algo.euclidesAreCoprime(a, b);\n\n assertTrue(result);\n }", "@Test\n public void euclidesAreCoprimeTest_pseudoprimeCoprimesWithNegative() {\n BigInteger a = new BigInteger(\"-33153\");\n // pseudoprime (151 * 331)\n BigInteger b = new BigInteger(\"49981\");\n boolean result = Algo.euclidesAreCoprime(a, b);\n\n assertTrue(result);\n }", "public static boolean isPrime(int n) \n{ \n//base case \nif (n <= 1) \nreturn false; \n//loop executes from 2 to n-1 \nfor (int i = 2; i < n; i++) \nif (n % i == 0) \n//returns false if the condition returns true \nreturn false; \n//returns true if the condition returns false \nreturn true; \n}", "static boolean isPrime(int number)\n {\n // Loop through and check if it is dividable with divisors\n for(int divisor = 2; divisor <= number / 2; divisor++)\n {\n if(number % divisor == 0)\n return false; // if it can be divided return false\n }\n\n return true; // if it cannot be divided return true\n }", "private boolean isPrime(int number) {\n if (number < 2) return false;\n if (number == 2) return true;\n if (number % 2 == 0) return false;\n for (int i = 3; i * i <= number; i += 2)\n if (number % i == 0) return false;\n return true;\n }", "public boolean isPrime() {\n boolean isPrime = true;\n for (int i = 2; i < value; i++) {\n if (value % i == 0) {\n isPrime = false;\n }\n }\n return isPrime;\n }", "public static boolean isInt(Object value) {\n\t\treturn value instanceof BigInteger;\n\t}", "private static boolean isPrime(int num) {\n\t\tfor(int divisor=2;divisor<=num/2;divisor++){\n\t\t\tif(num%divisor==0) return false;\n\t\t}\n\t\treturn true;\n\t}", "private static boolean isProbablePrime(BigInteger n, int k) {\n if (n.compareTo(ONE) == 0)\n return false;\n if (n.compareTo(THREE) < 0)\n return true;\n int s = 0;\n BigInteger d = n.subtract(ONE);\n while (d.mod(TWO).equals(ZERO)) {\n s++;\n d = d.divide(TWO);\n }\n for (int i = 0; i < k; i++) {\n BigInteger a = uniformRandom(TWO, n.subtract(ONE));\n BigInteger x = a.modPow(d, n);\n if (x.equals(ONE) || x.equals(n.subtract(ONE)))\n continue;\n int r = 0;\n for (; r < s; r++) {\n x = x.modPow(TWO, n);\n if (x.equals(ONE))\n return false;\n if (x.equals(n.subtract(ONE)))\n break;\n }\n if (r == s) // None of the steps made x equal n-1.\n return false;\n }\n return true;\n }", "public static boolean prime(long n) {\n\t\t\t//is n a multiple of 2?\n\t\t\tif (n == 1) return false;\n\t\t if (n % 2 == 0) return false;\n\t\t //if it isnt, check odd numbers\n\t\t for (int i = 3; i * i <= n; i += 2) {\n\t\t if(n % i == 0)\n\t\t return false;\n\t\t }\n\t\t return true; //n is prime\n\t\t}", "private static boolean isPrime(long n) {\n\t\tboolean isPrime = true;\n\t\tif (n < 2) {\n\t\t\tisPrime = false;\n\t\t} else if (n == 2) {\n\t\t\tisPrime = true;\n\t\t} else if (n % 2l == 1) {\n\t\t\tisPrime = false;\n\t\t\tprimeLog.log(n + \" is divisible by 2\");\n\t\t}\n\t\t// Check n against all odd numbers greater than 2\n\t\tfor (int i = 3; isPrime && i * i <= n; i += 2) {\n\t\t\t// If n is divisible by i then n is not prime\n\t\t\tif (n % i == 0) {\n\t\t\t\tprimeLog.log(n + \" is divisible by \" + i);\n\t\t\t\tisPrime = false;\n\t\t\t}\n\t\t}\n\t\tglobalLog.appendToCurrent(\": \" + isPrime);\n\t\tglobalLog.stepOut();\n\t\tprimeLog.appendToCurrent(\": \" + isPrime);\n\t\treturn isPrime;\n\t}", "public void primeNumber(int a)\n { boolean result = false;\n int i;\n if(a!=1)\n {\n for( i=2;i<a;i++)\n {\n if(a%i==0)\n {\n break;\n }\n\n }\n if(a==i)\n {\n System.out.println(i);\n result=true;\n }\n }\n }", "public static boolean isPrime(int num) {\n for (int i = 2; i < num; i++) {\r\n if (num % i == 0) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "private static boolean isPrime(int i) {\n\t\tif(i == 1) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tfor (int j = 2; j <= i / 2; j++) {\n\t\t\tif (i % j == 0) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t\treturn true;\n\t}", "public static boolean isPrimeNumber(int num) {\r\n\t\t\t\r\n\t\tif(num<=1) {\r\n\t\treturn false;\r\n\t\t}\r\n\t\tfor(int i=2;i<num;i++) {\r\n\t\t\t\r\n\t\t\tif(num%i==0) {\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\treturn true;\r\n\t\t\r\n\t\t}", "@Test\n public void testInverseStressPrime() {\n final GaloisPrimeField field = new GaloisPrimeField(15_485_863);\n final GaloisElement element = field.element(1_000_000);\n final GaloisElement inverse = galoisInverse.invert(element);\n Assertions.assertEquals(BigInteger.valueOf(2_540_812), inverse.value());\n }", "@Test\n public void testPrimeNumberChecker() {\n System.out.println(\"Parameterized Number is : \" + inputNumber);\n assertEquals(expectedResult,\n primo.validate(inputNumber));\n }", "private boolean esPrimo(int n)\r\n {\r\n for (int i = 3; i < (int) Math.sqrt(n); i+=2) {\r\n if (n%i == 0) return false;\r\n }\r\n return true;\r\n }", "@Test\n // boundary\n public void testIsPrime2_2() {\n NaturalNumber n = new NaturalNumber2(2);\n boolean truth = true;\n assertEquals(truth, CryptoUtilities.isPrime2(n));\n }", "@Test\n // boundary\n public void testIsPrime1_2() {\n NaturalNumber n = new NaturalNumber2(2);\n boolean truth = true;\n assertEquals(truth, CryptoUtilities.isPrime1(n));\n }", "private boolean determinePrime(int num) {\n int temp;\n boolean isPrime = true;\n \n if(num <= 1)\n {\n isPrime = false;\n }\n else\n {\n for(int i = 2;i<=num/2; i++)\n {\n //divide the number by i, get the remainder \n temp = num % i;\n \n //if remainder is 0, the number is not prime\n if(temp == 0)\n {\n isPrime = false;\n break;\n }\n }\n }\n \n return isPrime;\n }", "public static boolean isPrime(int number){\r\n\t\t//Start loop from too to exclude division by 1\r\n\t\tint i = 2;\r\n\t\twhile(i < number){\r\n\t\t\tif(number % i == 0){\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\ti++;\r\n\t\t}\r\n\t\treturn true;\r\n\t}", "public static BigInteger generatePrimeNumber(BigInteger primeDivisor) {\n boolean foundPrime;\n BigInteger primeNumber;\n do {\n Random random = new Random();\n do {\n primeNumber = new BigInteger(352, random);\n } while (primeNumber.compareTo(BigInteger.ONE) <= 0);\n primeNumber = primeNumber.multiply(primeDivisor);\n primeNumber = primeNumber.add(BigInteger.ONE);\n foundPrime = checkIfPassesMillerRabin(primeNumber, 60);\n } while (!foundPrime);\n\n return primeNumber;\n }", "private boolean isPrime(int n) {\r\n for (int divisor = 2; divisor < n; divisor++) {\r\n if (n % divisor == 0) {\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public static boolean isPrime(int n) {\n for(int i=2;i<n;i++) {\n if(n%i==0)\n return false;\n }\n return true;\n }", "static void checkPrime(){\n\t\tint n1=78;\r\n\t}", "private boolean isPrime(List<Long> primes, long i) {\n if (i < 2)\n return false;\n for (long prime : primes)\n if (prime > 1) {\n if (i % prime == 0) {\n return false;\n }\n }\n return true;\n }", "public Boolean isPrime(int n) {\n if (n == 2) {\n return false;\n }\n if (n == 3) {\n return true;\n }\n if (n%2 == 0) {\n return false;\n }\n if (n%3 == 0) {\n return false;\n }\n\n int a = 5;\n int b = 2;\n\n while (a*a <= n) {\n if (n%a == 0) {\n return false;\n }\n a += b;\n b = 6 - b;\n }\n return true;\n }", "private static boolean isPrime(int n) {\n if (n%2==0) return false;\r\n //if not, then just check the odds\r\n for(int i=3;i*i<=n;i+=2) {\r\n if(n%i==0)\r\n return false;\r\n }\r\n return true;\r\n }", "public static void primeNumber() {\n\t\tboolean isprimeNumber = false;\n\t\tSystem.out.println(\"prime numbers between 1 and 1000 are\");\n\n\t\tfor (int i = 2; i <1000; i++) {\n\t\tif(calculation(i)==true)\n\t\t{\n\t\t\tSystem.out.println(i);\n\t\t\tprime++;\n\t\t}\n\t\t\n\t}\n\t\tSystem.out.println(prime+\" numbers are prime\");\n\t}", "private static boolean isPrime(int n) {\n\t if(n == 2 || n == 3)\n\t return true;\n\n\t if(n == 1 || n % 2 == 0)\n\t return false;\n\n\t for (int i = 3; i * i <= n; i += 2) {\n\t if (n % i == 0)\n\t return false;\n\t }\n\t return true;\n\t }", "boolean ePrimo(int n) {\n \n if (n < 2) {\n return false;\n }\n \n \n // Guarda o numero de divisores de n. Inicialmente eh 1. Todos os numeros\n // sao divisiveis por 1\n \n int numeroDeDivisores = 1;\n \n // O primeiro candidato a divisor nao trivial eh 2.\n \n int candidatoADivisor = 2;\n \n // Testa a divisao por todos os numeros menores ou iguais a n/2 ou ate \n // encontrar o primeiro divisor.\n \n while((candidatoADivisor <= Math.sqrt(n)) && (numeroDeDivisores == 1)) {\n if (n % candidatoADivisor == 0) {\n // o resto da divisao eh zero. Logo, candidatoADivisor eh um divisor de n. \n // Por isso, que o numero de divisores eh incrementado em 1.\n numeroDeDivisores = numeroDeDivisores + 1;\n }\n candidatoADivisor = candidatoADivisor + 1;\n }\n \n if (numeroDeDivisores == 1) {\n return true;\n }\n else {\n return false;\n }\n }", "public static boolean isPrimeNumber(int num) {\n\t\t//edge/corner condition\n\t\twhile(num<=1) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tfor(int i=2;i<num;i++) {\n\t\t\tif(num%i==0)\n\t\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}", "static boolean isPrime(long n)\n {\n // Corner cases\n if (n <= 1)\n return false;\n if (n <= 3)\n return true;\n \n // This is checked so that we can skip\n // middle five numbers in below loop\n if (n % 2 == 0 || n % 3 == 0)\n return false;\n \n for (int i = 5; i * i <= n; i = i + 6)\n if (n % i == 0 || n % (i + 2) == 0)\n return false;\n \n return true;\n }", "public static boolean isPrime(int num) {\n\n if (num <= 1) {\n return false;\n }\n\n if (num == 2) {\n return true;\n }\n\n for (int i = 3; i < num; i++) {\n\n if (num % i == 0) {\n return false;\n }\n\n }\n\n return true;\n\n }", "private static BigInteger comprime(BigInteger input) {\n \t\n \t//krenemo od dva\n BigInteger candidate = BigInteger.valueOf(2);\n while (true) {\n \t\n \t//kada nadjemo odgovarajuci vratimo ga\n if (input.gcd(candidate).equals(BigInteger.ONE)) {\n return candidate;\n }\n candidate = candidate.add(BigInteger.ONE);\n }\n }", "public static boolean isPrime(int number) {\n if (number <= 1) {\n return false;\n }\n for (int i = 2; i <=Math.sqrt(number); i++) {\n if (number % i == 0) {\n return false;\n }\n }\n return true;\n }", "public boolean isPrime(int myNumber) {\n for (int i = 2; i < myNumber/2; i++) {\n if (myNumber % i == 0) {\n System.out.println(myNumber + \" can be divided by \" + i);\n return false;\n }\n }\n return true;\n }", "private static boolean isPrime(int n) {\n\t\t\n\t\tif (n <= 1) return false;\n\t\tfor (int i = 2; i * i <= n; i++) {\n\t\t\tif (n % i == 0) return false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}", "public static boolean isPrime(int x) {\n boolean isPrime = false;\n if (x > 1) {\n isPrime = true;\n for (int i = 2; i <= x / 2; ++i) {\n if (x % i == 0) {\n isPrime = false;\n break;\n }\n }\n }\n return isPrime;\n }", "public static PerformOperation isPrime() {\n return (num) -> {\n if (num < 2) { return false; }\n if (num == 2) { return true; }\n if (num % 2 == 0) { return false; }\n if (num < 9) { return true; }\n\n int max = (int) Math.sqrt(num);\n for (int i = 3; i <= max; i+=2) {\n if (num % i == 0) { return false; };\n }\n return true;\n };\n }", "public static boolean isPrime(int number) {\n for (int j = 2 ; j < number ; j++) {\n if (number % j == 0) {\n return false; // number is divisible so its not prime\n }\n }\n return true; // number is prime now\n }", "private boolean esPrimo(int pNumero)\r\n\t{\r\n\t\tboolean esPrimo = true;\r\n\t\tfor(int i=2; i<=pNumero/2 && esPrimo;i++)\r\n\t\t{\r\n\t\t\tif(pNumero%i == 0)\r\n\t\t\t{\r\n\t\t\t\tesPrimo = false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn esPrimo;\r\n\t}", "static boolean checkIsPrime(int n) {\n for (int i = 2; i <= Math.sqrt(n); i++) {\n if (n % i == 0) {\n return false;\n }\n }\n return true;\n }", "private boolean isPrime(int candidate) {\r\n\t\t\tboolean isPrime = true;\r\n\r\n\t\t\t// numbers <= 1 or even are not prime\r\n\t\t\tif ((candidate <= 1))\r\n\t\t\t\tisPrime = false;\r\n\t\t\t// 2 or 3 are prime\r\n\t\t\telse if ((candidate == 2) || (candidate == 3))\r\n\t\t\t\tisPrime = true;\r\n\t\t\t// even numbers are not prime\r\n\t\t\telse if ((candidate % 2) == 0)\r\n\t\t\t\tisPrime = false;\r\n\t\t\t// an odd integer >= 5 is prime if not evenly divisible\r\n\t\t\t// by every odd integer up to its square root\r\n\t\t\t// Source: Carrano.\r\n\t\t\telse {\r\n\t\t\t\tfor (int i = 3; i <= Math.sqrt(candidate) + 1; i += 2)\r\n\t\t\t\t\tif (candidate % i == 0) {\r\n\t\t\t\t\t\tisPrime = false;\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn isPrime;\r\n\t\t}", "public interface CheckPrimeInterface {\n\tpublic String checkNumber(int value);\n}", "private synchronized void verifyNumbersPrime() {\n\t\tint primeIndex = 1;\n\t\tfor (int j = NUMBER_TWO; j <= Integer.MAX_VALUE && primeIndex < primes.length; j++) {\n\t\t\tif(isPrime(j)) {\n\t\t\t\tprimes[primeIndex++] = j;\n\t\t\t}\n\t\t}\n\t}", "private static boolean isPrime( int n )\n {\n if( n == 2 || n == 3 )\n return true;\n\n if( n == 1 || n % 2 == 0 )\n return false;\n\n for( int i = 3; i * i <= n; i += 2 )\n if( n % i == 0 )\n return false;\n\n return true;\n }", "public static boolean isPrime(int n)\n {\n for(int i = 1; i < n/2; i++)\n {\n if(n%i == 0)\n return false;\n }\n return true;\n }", "public static boolean isPrime(final BigInteger candidatePrime) {\n\t\treturn candidatePrime.isProbablePrime(PRIMALITY_TEST_STRENGTH);\n\t}", "public static boolean esPrimo (int num) {\n\t\tboolean primo = true;\n\t\tint i;\n\t\t\n\t\t// Bucle hasta la mitad - 1 de num (si no se ha podido dividir entre 2 los demas numeros despues de su mitad tampoco se podra\n\t\tfor (i = 2; i < (num / 2) && primo; i++) {\n\t\t\tif (num % i == 0) {\n\t\t\t\tprimo = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn primo;\n\t}", "private static boolean isPrime(int n) {\r\n if (n == 2)\r\n return true;\r\n if (n <= 1 || n % 2 == 0)\r\n return false;\r\n for (int i = 3; i <= Math.sqrt(n); i+=2) {\r\n if (n % i == 0)\r\n return false;\r\n }\r\n return true;\r\n }" ]
[ "0.71072865", "0.7019281", "0.69764787", "0.6839801", "0.6732929", "0.6721", "0.6694725", "0.66845846", "0.6618356", "0.6607378", "0.65311813", "0.65040356", "0.6467195", "0.6453646", "0.64520127", "0.64278036", "0.6423645", "0.6420988", "0.6407282", "0.6406775", "0.6405803", "0.6383401", "0.6365539", "0.63575804", "0.6352716", "0.6352147", "0.63480204", "0.6335034", "0.6327335", "0.63135946", "0.6311109", "0.6272476", "0.6265951", "0.6256691", "0.62543005", "0.62436235", "0.62206036", "0.62189794", "0.61971253", "0.61957484", "0.619225", "0.6185331", "0.61624944", "0.6161691", "0.6157665", "0.6150602", "0.61489373", "0.61420196", "0.61336493", "0.6118694", "0.6108923", "0.61060184", "0.61027056", "0.6098555", "0.60873973", "0.6084571", "0.6082783", "0.6067894", "0.60652107", "0.6050302", "0.6047934", "0.6047184", "0.6046606", "0.60196435", "0.6014254", "0.59877187", "0.59827286", "0.5979964", "0.59696215", "0.59681", "0.5960534", "0.5945047", "0.59445745", "0.59442115", "0.5940401", "0.5938797", "0.5933206", "0.5924909", "0.5913848", "0.5907063", "0.5905715", "0.59052914", "0.59033805", "0.59032524", "0.5900579", "0.58948034", "0.5893722", "0.58844876", "0.58839196", "0.58822846", "0.5881168", "0.5866234", "0.5865223", "0.5855053", "0.58459103", "0.5842576", "0.5842274", "0.5841541", "0.58411545", "0.58251613" ]
0.6962843
3
For Method Get All
public List<CategoriaUsuario> findall(){ return categoriaUsuarioRepository.findAll(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "Map getAll();", "List<T> getAll();", "List<T> getAll();", "List<T> getAll();", "List<T> getAll();", "List<T> getAll();", "public abstract List<Object> getAll();", "public List<R> getAll();", "@Override\n\tpublic ResultWrapper<List<Todos>> getAll() {\n\t\tResultWrapper<List<Todos>> rs = new ResultWrapper<List<Todos>>();\n\t\tList<Todos> todosList = todosRepo.findAllTodos();\n\t\tif (todosList.size() > 0) {\n\t\t\trs.succeedGet(todosList);\n\t\t\treturn rs;\n\t\t} else {\n\t\t\trs.setResult(todosList);\n\t\t\trs.setStatus(Result.SUCCESS);\n\t\t\trs.setMessage(\"List is empty\");\n\t\t\treturn rs;\n\t\t}\n\t}", "@Override\n\tpublic Response getAll() {\n\t\treturn null;\n\t}", "@Override\n\tpublic List<T> getAll() {\n\t\treturn getDao().findAll();\n\t}", "@GetMapping(\"/listAll\")\n\tpublic ResponseEntity<?> findAll(){\n\t\treturn new ResponseEntity<>(catService.listAll(),HttpStatus.OK);\n\t}", "@Override\r\n\tpublic List<?> getAll() {\n\t\treturn null;\r\n\t}", "@GetMapping(\"/all\")\n public ResponseEntity<?> findAllData() {\n logger.info(\"Start controller call get All Data \");\n ServiceResult serviceResult = new ServiceResult();\n serviceResult.setMessage(\"Get All Data Success\");\n try {\n List<AdCampaign> lstAdCampaigns = adCampaignService.findAll();\n serviceResult.setData(lstAdCampaigns);\n serviceResult.setStatus(ServiceResult.Status.SUCCESS);\n }catch (Exception ex){\n logger.error(\"Error get All Data\");\n serviceResult.setMessage(\"Error\");\n serviceResult.setStatus(ServiceResult.Status.FAILED);\n }\n\n logger.info(\"End controller call get All Data \");\n return new ResponseEntity<ServiceResult>(serviceResult,new HttpHeaders(), HttpStatus.OK);\n }", "@GetMapping(\"/all\")\n public List<CityInfo> getAll(){\n return service.getAll();\n }", "@RequestMapping(value = \"/all\")\n public List<Account> getAll(){\n return new ArrayList<>(accountHelper.getAllAccounts().values());\n }", "public List<Ejemplar> getAll();", "@GetMapping(value=\"/getAll\")\n\tpublic List<Question> getAll(){\n\t\tLOGGER.info(\"Viewing all questions\");\n\t\treturn questionObj.viewAllQuestions();\n\t}", "@RequestMapping(method = RequestMethod.GET, value = \"/user/getAll\")\n @ApiOperation(value = \"Getting all the products\")\n public Iterable<User> getAll(){\n return userService.getAll();\n }", "List<T> obtenerAll();", "@Override\n public List<R> getAll() {\n return onFindForList(getSession().createCriteria(entityClass).list());\n }", "@GetMapping(path=\"/all\",produces = MediaType.APPLICATION_JSON_VALUE)\r\n public @ResponseBody\r\n Iterable<UserEntity> getAllUsers() {\n return userService.getAllUsers();\r\n }", "E[] getAll();", "org.naru.park.ParkController.CommonAction getAll();", "org.naru.park.ParkController.CommonAction getAll();", "public Result all(String id);", "public List<T> getAll() {\n\t\treturn this.getAll(new ArrayList<String>(), false);\n\t}", "public abstract List<Company> getAll();", "@ApiOperation(value = \"Route Get mapping to fetch all routes\", response = List.class)\n\t@GetMapping(\"/all\")\n\tpublic ResponseEntity<List<RouteDto>> viewAllRoutes() {\n\t \n\t List<Route> routeList = this.routeServices.viewRouteList();\n\t\tList<RouteDto> routeDtoList = new ArrayList<>();\n\t\tfor (Route r : routeList) {\n\t\t\tRouteDto routedto = modelMapper.map(r, RouteDto.class);\n\t\t\trouteDtoList.add(routedto);\n\t\t}\n\t\tif (!(routeDtoList.isEmpty())) {\n\t\t\treturn new ResponseEntity<>(routeDtoList, HttpStatus.OK);\n\t\t} else {\n\t\t\treturn new ResponseEntity<>(routeDtoList, HttpStatus.NOT_FOUND);\n\t\t}\n\t}", "@GetMapping(\"/getall\")\n public List<Task> getAll() {\n return taskService.allTasks();\n\n }", "public abstract List<CarTO> listAll();", "@GetMapping(\"/all\")\n public List<Admin> getAll(){\n return adminService.getAll();\n }", "@RequestMapping(value = \"/estados\",\n method = RequestMethod.GET,\n produces = MediaType.APPLICATION_JSON_VALUE)\n @Timed\n public List<Estado> getAll() {\n log.debug(\"REST request to get all Estados\");\n return estadoRepository.findAll();\n }", "@GetMapping(path=\"/all\")\n\tpublic @ResponseBody Iterable<Resource> getAllUsers() {\n\t\treturn resourceRepository.findAll();\n\t}", "@GetMapping(\"/all/id\")\n public List<String> getAllId(){\n return productService.getAllId();\n }", "@RequestMapping(value=\"/getbooks\", method=RequestMethod.GET, produces = \"application/json\")\n\tpublic List<Book> getAll() {\n\t\tList<Book> books = new ArrayList<>();\n\t\tbooks = bookDao.getAllFromDB();\n\t\t\n\t\treturn books;\n\t}", "@Override\n @Transactional\n public List getAll() {\n return routDAO.getAll();\n }", "@GetMapping(\"/api/todoItems\")\n\t public ResponseEntity<?> fetchAllTodoItems (){\n\t\t \n\t\t \n\t\t \n\t\t \n\t }", "@GetMapping(\"api/books\")\n public List<Book> getallBooks() {\n return bookService.all().getPayload();\n }", "public abstract List<T> all();", "public List getAll() throws FileNotFoundException, IOException;", "@Override\r\n\tpublic List<Trainee> getAll() {\n\t\treturn dao.getAll();\r\n\t}", "@GetMapping(\"/methods\")\n @Timed\n public List<MethodsDTO> getAllMethods() {\n log.debug(\"REST request to get all Methods\");\n return methodsService.findAll();\n }", "@Override\n\tpublic void getAll() {\n\t\tfor (int i = 0; i < dto.length; i++) {\n\t\t\tSystem.out.println(dto[i]);\n\t\t}\n\n\t}", "@Override\n public String[] listAll() {\n return list();\n }", "@GetMapping(\"/api/obd\")\n public List<Obd> readAll() {\n return obdRepository.findAll();\n }", "@RequestMapping(\"/user/all\")\n public @ResponseBody Iterable<Tbl_Web_User_Info> getAllUsers(){\n \treturn userRepository.findAll();\n }", "@Override\r\n\tpublic List<Ngo> getAll() {\n\t\treturn null;\r\n\t}", "@RequestMapping(\"/all\")\n\tpublic @ResponseBody Iterable<Loan> getAllLoans(){\n \treturn loanRepository.findAll();\n\t}", "@GetMapping(value=\"/all\",produces= { MediaType.APPLICATION_JSON_VALUE })\n\tpublic List<TaskDTO> getAllTasks()\n\t{ \t\n\t\treturn taskService.getAllTasks();\n\t}", "@RequestMapping(value=\"/book/all\",method=RequestMethod.GET)\n\t\t public @ResponseBody ResponseEntity<List<Books>> getAllBooks(){\n\t\t\t List<Books> books=(List<Books>) booksDAO.findAll();\n\t\t\t return new ResponseEntity<List<Books>>(books,HttpStatus.OK);\n\t\t }", "public List<Empleado> getAll();", "@GET\n\t@Path(\"all\")\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getAll() {\n\t\treturn Response.ok(taxBusiness.getAllTaxes()).build();\n\n\t}", "public static String getAll() {\n Result r = new Result();\n int status = 0;\n if((status = doGetList(r)) != 200) return \"Error from server \"+ status;\n return r.getValue();\n }", "@Override\n public List<CategoryDTO> listAll() {\n List<CategoryDTO> result = new ArrayList<>();\n List<Category> listCategory = categoryRepository.findAll();\n for (Category category: listCategory){\n result.add(categoryConverter.toDTO(category));\n }\n return result;\n }", "@Override\n\t\tpublic List<Carrera> getAll() {\n\t\t\t\treturn null;\n\t\t}", "ArrayList<E> getAll();", "@Override\n\tpublic List<item> findAll() {\n\t\treturn donkyClientFeign.lista().stream().map(p -> new item(p,1)).collect(Collectors.toList());\n\t}", "List<Order> getAll();", "@Override\n public List<DuLieuBaoCaoDTO> findAll() {\n log.debug(\"Request to get all DuLieuBaoCaos\");\n return duLieuBaoCaoRepository.findAll().stream()\n .map(duLieuBaoCaoMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "@GetMapping(path=\"/getall\")\r\n\tpublic @ResponseBody Iterable<MyClass> getAllAdmins() {\n\t\treturn classRepository.findAll();\r\n\t}", "@GetMapping(path = \"/all\")\n public @ResponseBody\n Iterable<User> getAllUsers() {\n LOG.info(\"Displays all the users from the database\");\n return userRepository.findAll();\n }", "List<Receta> getAllWithUSer();", "@RestAPI\n \t@PreAuthorize(\"hasAnyRole('A')\")\n \t@RequestMapping(value = {\"/api/\", \"/api\"}, method = RequestMethod.GET)\n \tpublic HttpEntity<String> getAll() {\n \t\treturn toJsonHttpEntity(agentManagerService.getAllVisibleAgentInfoFromDB());\n \t}", "@RequestMapping(method = RequestMethod.GET)\n\tpublic List<User> getAll() {\n\t\tList<User> users = dao.getAll();\n\t\treturn users;\n\t}", "@Override\r\n\tpublic List<Producto> getAll() throws Exception {\n\t\treturn productRepository.buscar();\r\n\t}", "@RequestMapping(method=RequestMethod.GET)\n\tpublic ResponseEntity<List<PetSrvReq>> getAll() {\n\t\t\n\t\tList<PetSrvReq> psList = psService.getAll();\n\t\t\n\t\tif (psList.size() == 0) {\n\t\t\t\n\t\t\tSystem.out.println(\"In PetSrvReqController:getAll() -> there is no data\");\n\t\t\t\n\t\t\tpsList = null;\n\t\t\treturn new ResponseEntity<List<PetSrvReq>>(psList, HttpStatus.NOT_FOUND);\n\t\t\t\n\t\t} else {\n\t\t\t\n\t\t\tSystem.out.println(\"In PetSrvReqController:getAll() -> there is data\");\n\t\t\t\n\t\t\treturn new ResponseEntity<List<PetSrvReq>>(psList, HttpStatus.OK);\n\t\t\t\n\t\t}\n\t\t\n\t}", "@GetMapping(\"/all\")\n public List<Country> getAll(){\n return countryRepository.findAll();\n }", "public List<ParamIntervento> getAll()\n {\n\t System.out.println(\"chiamo getAll: \");\n System.out.flush();\n CriteriaQuery<ParamIntervento> criteria = this.entityManager.getCriteriaBuilder().createQuery(ParamIntervento.class);\n return this.entityManager.createQuery(criteria.select(criteria.from(ParamIntervento.class))).getResultList();\n }", "public List<Type> getAll();", "public List getAll(){\n\t\tList<Person> personList = personRepository.getAll();\n\t\treturn personList;\n\t}", "@RequestMapping(value = \"/\")\n public Map<String, Object> showAll() {\n// Get all invoices\n List<Invoice> invoices = invoiceService.findAll();\n// Build response\n Map<String, Object> response = new LinkedHashMap<String, Object>();\n response.put(\"totalInvoices\", invoices.size());\n response.put(\"invoices\", invoices);\n// Send to client\n return response;\n }", "@PreAuthorize(\"hasAnyRole('ADMIN')\")\n\t@RequestMapping(method=RequestMethod.GET) \n\tpublic ResponseEntity<List<ClienteDTO>> findAll() {\n\t\t\n\t\tList<Cliente> list = service.findAll();\n\t\t\n\t\t//veja que o stream eh para percorrer a lista, o map eh para dizer uma funcao q vai manipular cada elemento da lista\n\t\t//nesse caso, para elemento na lista ele sera passado para a categoriadto \n\t\t//e no fim eh convertida novamente para uma lista\n\t\tList<ClienteDTO> listDTO = list.stream().map(obj->new ClienteDTO(obj)).collect(Collectors.toList());\n\t\t\n\t\t//o ok eh p/ operacao feita com sucesso e o corpo vai ser o obj\n\t\treturn ResponseEntity.ok().body(listDTO); \n\t\t\n\t}", "@Override\r\n public List<Anggota> getAll() {\r\n List<Anggota> datas = new ArrayList<>();\r\n String query = \"SELECT *From Anggota\";\r\n try {\r\n\r\n PreparedStatement preparedStatement = connection.prepareStatement(query);\r\n ResultSet rs = preparedStatement.executeQuery();\r\n\r\n while (rs.next()) {\r\n Anggota anggota = new Anggota();\r\n anggota.setKdAnggota(rs.getString(1));\r\n anggota.setNmAnggota(rs.getString(2));\r\n anggota.setTelepon(rs.getString(3));\r\n anggota.setAlamat(rs.getString(4));\r\n datas.add(anggota);\r\n }\r\n\r\n } catch (SQLException ex) {\r\n Logger.getLogger(AnggotaDAO.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n\r\n return datas;\r\n\r\n }", "@Override\n\tpublic List<Dispositivo> getAll() {\n\t\treturn (List<Dispositivo>) dispositivoDao.findAll();\n\t}", "@GetMapping(\"/all\")\r\n\tpublic List<Users> findAll()\r\n\t{\r\n\t\treturn userJPARepository.findAll(); //findAll() method is implemented ins Spring JpaRepository, which fetch and returns all the records from database using the give entity \r\n\t}", "@RequestMapping(value = \"/listallentities\", method = RequestMethod.GET)\n\tpublic @ResponseBody String listAllEntities() {\n\t\ttry {\n\t\t\t// System.out.println(\"USER ID FROM SESSION : \" +\n\t\t\t// session.getAttribute(\"userId\"));\n\t\t\tString requestURI = request.getRequestURI();\n\n\t\t\tSystem.out.println(\"Called list entity : \" + requestURI);\n\n\t\t\tString requestFromMethod = \"listAllEntities\";\n\t\t\treturn entityService.listEntities(null, requestFromMethod);\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\n\t}", "public List<ModelObject> readAll();", "@GetMapping(\"/all\")\r\n\tpublic String getAll(Model model) {\r\n\t\tList<Product> list=service.getAllProducts();\r\n\t\tmodel.addAttribute(\"list\", list);\r\n\t\treturn \"ProductData\";\r\n\t}", "public List<Item> getAll()\r\n {\r\n\r\n CriteriaQuery<Item> criteria = this.entityManager\r\n .getCriteriaBuilder().createQuery(Item.class);\r\n return this.entityManager.createQuery(\r\n criteria.select(criteria.from(Item.class))).getResultList();\r\n }", "@GetMapping(path=\"/all\")\n\tpublic @ResponseBody Iterable<User> getAllUsers() {\n\t\t// This returns a JSON or XML with the users\n\t\treturn userRepository.findAll();\n\t}", "public List<ItemTypeDTO> getAll();", "@RequestMapping(value=\"/user/all\",method=RequestMethod.GET)\n\t\t public @ResponseBody ResponseEntity<List<User>> getAllUsers(){\n\t\t\t List<User> user=(List<User>) userDAO.findAll();\n\t\t\t return new ResponseEntity<List<User>>(user,HttpStatus.OK);\n\t\t }", "@RequestMapping(method=RequestMethod.GET)\n\tpublic List<User> getAll() {\n\t\treturn repo.findAll();\n\t}", "@Override\n @Transactional(readOnly = true)\n public List<WilayaDTO> findAll() {\n log.debug(\"Request to get all Wilayas\");\n return wilayaRepository.findAll().stream()\n .map(wilayaMapper::toDto)\n .collect(Collectors.toCollection(LinkedList::new));\n }", "@GetMapping \t\t\t\t\t\t\t\t\t\t\t//anotation informando que esse método responde a requisição do tipo GET do HTTP\n\tpublic ResponseEntity<List<User>> finAll() {\t\t\t//método que serve de endpoint para acessar os usuarios (especifico do spring, para retornar respostas de requisições web) nomeando de findAll()\n\t\tList<User> List = service.findAll(); \t\t\t\t//chamando o servico na operacao finAll que retorna uma lista com todos os usuarios\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//User u = new User(1L, \"Maria\", \"[email protected]\", \"9999999\", \"12345\"); instanciando um usuário manualmente e passando seus parametros\n\t\treturn ResponseEntity.ok().body(List); \t\t\t\t//ok pra retornar a resposta com sucesso no HTTP, body retornando no corpo da resposta o usuario instanciado contido na lista List\n\t}", "private void getAllProducts() {\n }", "@GetMapping(\"all\")\r\n public List<Resident> getAllResidents() {\r\n\r\n return residentService.findAllResident();\r\n }", "@GetMapping(\"/receta/all\")\t\n\tpublic List<Receta> listarReceta(){\n\t\t\treturn this.recetaService.findAll();\n\t}", "public static Result readAll() {\n List<Thing> things = Thing.find.all();\n JsonNode json = mapper.valueToTree(things);\n return ok(json);\n }", "@GET\n\t@Produces(MediaType.APPLICATION_JSON)\n\tpublic Response getAll() {\n\t\tEmployeeFacade employeeFacade = new EmployeeFacade();\n\n\t\tGenericEntity<List<EmployeeVO>> generic = new GenericEntity<List<EmployeeVO>>(employeeFacade.findAll()) {};\n\t\treturn Response.status(200).header(\"Access-Control-Allow-Origin\", CorsFilter.DEFAULT_ALLOWED_ORIGINS).entity(generic).build();\n\t}", "@GetMapping(\"getAll\")\n\tpublic ServiceResponse<ContactAllResponse> getAll() {\n\t\treturn contactService.getAll();\n\t}", "Collection<Book> getAll();", "@GetMapping(\"/\")\n public ResponseEntity<List<BillProjection>> getBillAll() {\n List<BillProjection> bills = billController.getBillAll();\n if (bills.size() > 0) {\n return ResponseEntity.ok().body(bills);\n } else {\n return ResponseEntity.noContent().build();\n }\n }", "Collection<Order> getAll();", "public abstract List<LocationDto> viewAll();", "@Override\n public List<T> getAll() throws SQLException {\n\n return this.dao.queryForAll();\n\n }", "public List<String> getAllData(){\n\t}", "@RequestMapping(method = RequestMethod.GET)\r\n public Callable<ResponseObject> findAll() {\r\n return new Callable<ResponseObject>() {\r\n @Override\r\n public ResponseObject call() throws Exception {\r\n return candidateService.findAll();\r\n }\r\n };\r\n }", "public List<ContentInterventoBOBean> execGetAll() {\n System.out.println(\"InterventoLogics - execGetAll\");\n InterventoClient client = new InterventoClient(new ContentInterventoRequestBean());\n try {\n client.getAll();\n return BOFactory.convertWorkableToBOInterventi(client.getResList());\n }catch(Exception e){\n e.printStackTrace();\n }\n return null;\n }", "public java.util.List<Todo> findAll();" ]
[ "0.8147736", "0.7703698", "0.7703698", "0.7703698", "0.7703698", "0.7703698", "0.7663137", "0.7331237", "0.7266823", "0.7244633", "0.7224617", "0.7199688", "0.71535325", "0.7105602", "0.70877665", "0.7076607", "0.7067433", "0.705949", "0.70554286", "0.7050709", "0.7047929", "0.7037105", "0.7032686", "0.7008077", "0.7008077", "0.6998753", "0.69877857", "0.6979718", "0.6968102", "0.69241893", "0.6902996", "0.69011456", "0.68984675", "0.6881341", "0.6876823", "0.6875204", "0.68700236", "0.68651474", "0.6858099", "0.68261844", "0.678985", "0.67888176", "0.67883635", "0.67845047", "0.67746013", "0.67708933", "0.676616", "0.6763362", "0.67552316", "0.6750543", "0.6731541", "0.6725322", "0.67061883", "0.6691558", "0.6688218", "0.6677386", "0.66722614", "0.66702855", "0.6669826", "0.66688913", "0.6668561", "0.666235", "0.6658011", "0.66573566", "0.6656877", "0.66370416", "0.6621085", "0.6620847", "0.6620149", "0.6616867", "0.6615115", "0.6611613", "0.65986246", "0.6595459", "0.6593871", "0.65937084", "0.65896976", "0.6589279", "0.657736", "0.65710706", "0.65694785", "0.65687704", "0.656825", "0.65673876", "0.65590125", "0.65587795", "0.65565", "0.6556266", "0.6551056", "0.6543406", "0.65398014", "0.65342104", "0.65331966", "0.65294635", "0.65244704", "0.65239376", "0.65236896", "0.6521888", "0.65217394", "0.65197116", "0.65186816" ]
0.0
-1
For Method specific find id
public Optional<CategoriaUsuario> findid(Long id){ return categoriaUsuarioRepository.findById(id); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\tpublic void find(Integer id) {\n\r\n\t}", "public abstract T findByID(ID id) ;", "T findById(ID id) ;", "public void findById() {\n String answer = view.input(message_get_id);\n if (answer != null){\n try{\n long id = Long.parseLong(answer);\n Customer c = model.findById(id);\n if(c!=null)\n view.showCustomerForm(c);\n else\n view.showMessage(not_found_error);\n }catch(NumberFormatException nfe){\n view.showMessage(\"ID must be number\");\n }\n }\n }", "public abstract T findOne(int id);", "private Answer<BdmDocument> getFindOneAnswer(String id) {\n\t\treturn invocation -> {\n\t\t\tAssert.assertEquals(id, invocation.getArguments()[0]);\n\t\t\treturn new BdmDocument(this.getTestBdm());\n\t\t};\n\t}", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "String getId();", "public Student findStudent(int id);", "public abstract T findEntityById(int id);", "@Test\n\tpublic void findById() {\n\t\tICallsService iCallsService = new CallsServiceImpl(new ArrayList<>());\n\t\tiCallsService.addCallReceived(new Call(1l));\n\t\tAssert.assertTrue(1l == iCallsService.findById(1l).getId().longValue());\n\t}", "protected void checkFindByPrimaryKey(DetailAST aAST)\n {\n if (!Utils.hasPublicMethod(aAST, \"findByPrimaryKey\", false, 1))\n {\n final DetailAST nameAST = aAST.findFirstToken(TokenTypes.IDENT);\n log(\n aAST.getLineNo(),\n nameAST.getColumnNo(),\n \"missingmethod.bean\",\n new Object[] {\"Home interface\", \"findByPrimaryKey\"});\n }\n }", "Object getId();", "public abstract T byId(ID id);", "@Override\n public T findById(Long id) {\n return manager.find(elementClass, id);\n }", "T getbyId(I id);", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "int getId();", "void checkNotFound(Integer id);", "public Info_laboral findByID(int cod){\n ConexionBD con = new ConexionBD();\n Connection c = con.conOracle();\n Info_laboral IL = new Info_laboral();\n try{\n CallableStatement cs = c.prepareCall(\"{? = call F_BUSNOMINFO(?)}\");\n cs.registerOutParameter(1, Types.VARCHAR);\n cs.setInt(2, cod);\n cs.execute();\n //IL.setId(cod);\n //IL.setJefe(cs.getString(1));\n System.out.println(cs.getString(1));\n con.CerrarCon();\n return IL;\n }catch(SQLException e){\n System.out.println(\"erorrrr findbyid \"+e);\n con.CerrarCon();\n return null;\n }\n \n }" ]
[ "0.7079428", "0.6647047", "0.62179065", "0.60990185", "0.6031263", "0.60219777", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.6000941", "0.5980411", "0.5974371", "0.5969638", "0.59646124", "0.5964466", "0.59552693", "0.5941101", "0.5929414", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5915186", "0.5910857", "0.5891357" ]
0.0
-1
For Method Put (update) specific id
public CategoriaUsuario update(CategoriaUsuario categoriaUsuario){ return categoriaUsuarioRepository.save(categoriaUsuario); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@RequestMapping(value = \"/{id}\", method = RequestMethod.PUT)\n public void put(@PathVariable(\"id\") String id, HttpServletRequest req){\n throw new NotImplementedException(\"To be implemented\");\n }", "@RestAPI\n \t@PreAuthorize(\"hasAnyRole('A')\")\n \t@RequestMapping(value = \"/api/{id}\", params = \"action=update\", method = RequestMethod.PUT)\n \tpublic HttpEntity<String> update(@PathVariable(\"id\") Long id) {\n \t\tagentManagerService.update(id);\n \t\treturn successJsonHttpEntity();\n \t}", "void updateOfProductById(long id);", "E update(ID id, E entity, RequestContext context);", "@PUT\n @Path(\"/update\")\n public void put() {\n System.out.println(\"PUT invoked\");\n }", "public static int doPut(String name, String id) {\n int status = 0;\n try {\n URL url = new URL(\"https://intense-lake-93564.herokuapp.com/menusection/\");\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setRequestMethod(\"PUT\");\n conn.setDoOutput(true);\n // make the request info as an json message\n JSONObject objJson = new JSONObject();\n JSONObject objJsonSend = new JSONObject();\n try {\n objJson.put(\"id\", id);\n objJson.put(\"name\", name);\n objJsonSend.put(\"name\", name);\n } catch (JSONException ex) {\n Logger.getLogger(RestaurantApiClient.class.getName()).log(Level.SEVERE, null, ex);\n }\n String ans = objJson.toString();\n System.out.println(\"Request Body:\");\n System.out.println(objJsonSend.toString());\n OutputStreamWriter out = new OutputStreamWriter(conn.getOutputStream());\n out.write(ans);\n out.close();\n // wait for response\n status = conn.getResponseCode();\n conn.disconnect(); \n }\n catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return status;\n }", "@GetMapping(\"/{id}\")\n public ResponseEntity updateOne(@PathVariable Long id){\n Employee employee=hr_service.findById(id);\n\n return new ResponseEntity<>(employee, HttpStatus.OK);\n }", "@PutMapping(\"/{id}\")\n public ResponseEntity<Post> updatePost(@PathVariable Long id, @RequestBody Post updatePostById){\n Post post = postService.updatePost(id, updatePostById);\n return ResponseEntity.ok(post);\n }", "@Override\n @PUT\n @Path(\"/update/{id}\")\n public void update(@PathParam(\"id\") int id, Author author) {\n EntityManager em = PersistenceUtil.getEntityManagerFactory().createEntityManager();\n AuthorDao authorDao = new AuthorDao(em);\n authorDao.update(id,author);\n }", "@PutMapping(\"/{id}\")\n public ResponseEntity<User> update(@PathVariable Long id, @Valid @RequestBody User user) {\n if (!userService.findById(id).isPresent()) {\n log.error(\"Id \" + id + \" is not existed\");\n ResponseEntity.badRequest().build();\n }\n return ResponseEntity.ok(userService.save(user));\n }", "@BodyParser.Of(play.mvc.BodyParser.Json.class)\n public static Result update(Long id) throws JsonParseException, JsonMappingException, IOException {\n JsonNode json = request().body().asJson();\n Thing thing = mapper.treeToValue(json, Thing.class);\n thing.cachedJson = json.toString();\n Logger.debug(\"Content: \" + thing.content);\n Logger.debug(\"Content: \" + thing.content);\n thing.update();\n return ok();\n }", "@Override\n public final void doPut() {\n try {\n checkPermissions(getRequest());\n if (id == null) {\n throw new APIMissingIdException(getRequestURL());\n }\n\n final String inputStream = getInputStream();\n if (inputStream.length() == 0) {\n api.runUpdate(id, new HashMap<String, String>());\n return;\n }\n\n Item.setApplyValidatorMandatoryByDefault(false);\n final IItem item = getJSonStreamAsItem();\n api.runUpdate(id, getAttributesWithDeploysAsJsonString(item));\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n\n }\n }", "void update(Serializable objectId);", "default E update(ID id, E entity) {\n return update(id, entity, null);\n }", "boolean updateById(T entity);", "@RequestMapping(path = \"/employee/{id}/{name}\", method = RequestMethod.PUT)\r\n\t@ResponseBody\r\n\tpublic String updateEmployeeById(@PathVariable int id, @PathVariable String name) {\r\n\t\ter.save(new Employee(id, name));\r\n\t\treturn \"Employee updated with id: \" + id;\r\n\t}", "@PutMapping(\"/update/{id}\")\n public ResponseEntity<Void> updateBook(@RequestBody Book book,\n @PathVariable(\"id\") Long id) throws BookNotFoundException {\n bookService.updateBook(book, id);\n\n return ResponseEntity.status(HttpStatus.OK).build();\n }", "T edit(long id, T obj);", "@PUT\n @Produces({ \"application/json\" })\n @Path(\"{id}\")\n @CommitAfter\n public abstract Response update(Person person);", "@PutMapping(value = \"/update\", produces = \"application/json\")\n void update(@RequestParam int id, @RequestBody Patient patient);", "@Override\r\n @PutMapping(\"{id}\")\r\n public Action update(@Valid @RequestBody Action newObj, @PathVariable Long id) {\r\n Action action = findById(id);\r\n action.setUrl(null);\r\n action.setOverviewId(null);\r\n action.setPath(null);\r\n action.setType(newObj.getType());\r\n\r\n switch (action.getType()) {\r\n case External_Url:\r\n action.setUrl(newObj.getUrl());\r\n break;\r\n case Overview:\r\n action.setOverviewId(newObj.getOverviewId());\r\n break;\r\n case Path:\r\n action.setPath(newObj.getPath());\r\n break;\r\n }\r\n return service.save(action);\r\n }", "@Test\n public void putId() throws Exception {\n Role role = create(new Role(\"roleName\"));\n\n //Change a field of the object that has to be updated\n role.setName(\"roleNameChanged\");\n RESTRole restRole = new RESTRole(role);\n\n //Perform the put request to update the object and check the fields of the returned object\n try {\n mvc.perform(MockMvcRequestBuilders.put(\"/auth/roles/{id}\", UUIDUtil.UUIDToNumberString(role.getUuid()))\n .header(\"Content-Type\", \"application/json\")\n .header(\"Authorization\", authPair[0])\n .header(\"Function\", authPair[1])\n .content(TestUtil.convertObjectToJsonBytes(restRole))\n )\n .andExpect(status().isOk())\n .andExpect(jsonPath(\"$.name\", equalTo(restRole.getName())));\n } catch (AssertionError e) {\n remove(role.getUuid());\n throw e;\n }\n\n //Test if changes actually went in effect in the database\n try {\n role = get(role.getUuid());\n try {\n assertEquals(\"name field not updated correctly\", \"roleNameChanged\", role.getName());\n } finally {\n //Clean up database for other tests\n remove(role.getUuid());\n }\n } catch (ObjectNotFoundException e) {\n fail(\"Could not retrieve the put object from the actual database\");\n }\n }", "@PUT\n\t@Path(\"{id}\")\n\tpublic Response putStation(@PathParam(\"id\") int id, Station update) throws SQLException, JsonProcessingException{\n\t\tConnection conn = establishConnection();\n\t\tMap<String,Object> stationMap = StationDataService.getStation(conn,id);\n\t\tObjectMapper mapper = new ObjectMapper();\n\t\tStation currentStation = mapper.convertValue(stationMap.get(0),Station.class);\n\t\tint response = StationDataService.updateStationEntry(conn, id, update);\n\t\tif(response == 0) return Response.status(Status.INTERNAL_SERVER_ERROR).entity(\"UPDATE statment failed.\").build();\n\t\telse return Response.ok().build();\n\t}", "@RequestMapping(value=\"/{id}\",method=RequestMethod.PUT,consumes=MediaType.APPLICATION_JSON_VALUE)\r\n\t\tpublic void updateDoctor(@RequestBody Doctor doctor){\r\n\t\t\t\r\n\t\t\tdoctorService.updateDoctor(doctor);\r\n\t\t\t\r\n\t\t}", "@Test\n public void updateById() {\n User user = new User();\n user.setId(1259474874313797634L);\n user.setAge(30);\n boolean ifUpdate = user.updateById();\n System.out.println(ifUpdate);\n }", "interface WithId {\n /**\n * Specifies id.\n * @param id Resource ID\n * @return the next update stage\n */\n Update withId(String id);\n }", "@Override\n public void update(Object object, Object id) throws DAOException {\n\n }", "@Override\n\t\tpublic boolean update(Carrera entity, int id) {\n\t\t\t\treturn false;\n\t\t}", "@RequestMapping(method=RequestMethod.PUT,value=\"/{id}\")\r\n\t@JsonView(Views.Admin.class)\r\n\tpublic ResponseEntity<?> putScheduleById(@RequestBody ScheduleDTO se,@PathVariable String id){\r\n\t\treturn scheduleDao.putScheduleById(se,id);\r\n\t}", "@Override\n public Long updateById(Store t, long id) {\n return null;\n }", "@PutMapping(\"/products/{id}\")\r\n\tpublic Employee update(@RequestBody Employee employee, @PathVariable Integer id) {\r\n\t \r\n\t Employee exitEmployee= empService.get(id);\r\n\t empService.save(employee); \r\n\t return exitEmployee;\r\n\t}", "@PutMapping(path = \"/v1/update\")\n public JsonData updateUser(@RequestBody User user) { int webId = user.getId();\n// User searchUser = userService.findById(Long.valueOf(webId));\n//\n userService.update(user);\n return new JsonData(\"200\", \"修改成功!\", \"\");\n }", "Product update(Product product, long id);", "@RequestMapping(value=\"/{id}\", method=RequestMethod.PUT)\n\tpublic ResponseEntity<Void> update(@Valid @RequestBody ClienteDTO objDto, @PathVariable Integer id) {\n\t\t//Garantir que a categoria que vai ser atualizada é a que eu passar o código na URL\n\t\t//Criei um metodo que transforma uma Cliente em ClienteDTO\n\t\t//Que contem as validação.\n\t\tCliente obj = servico.fromDTO(objDto);\n\t\tobj.setId(id);\n\t\tobj = servico.update(obj);\n\t\t//conteudo vázio = noContent.\n\t\treturn ResponseEntity.noContent().build();\n\t}", "@GetMapping(\"/update/{id}\")\n public String showSocioToUpdate(@PathVariable Integer id, Model model) {\n List<Cargo> cargos = cargoService.getCargos();\n Persona persona = personaService.getById(id);\n model.addAttribute(\"cargos\", cargos);\n model.addAttribute(\"persona\", persona);\n return \"/backoffice/socioFormEdit\";\n }", "int updateEstancia(final Long srvcId);", "@RequestMapping(value = \"/customer/{id}\",method=RequestMethod.PUT)\n @ResponseStatus(HttpStatus.NO_CONTENT)\n public void updateCustomer(@PathVariable(\"id\") int id, @RequestBody @Valid CustomerViewModel customerViewModel){\n //check if the id matches the request body. Path variable and the\n //user passed data (customerId) must match to proceed.\n //so you need to input in both path variable and the requestbody\n if(id != customerViewModel.getCustomerId()){\n //throw illegal arguement\n }\n\n //if it does match, update that customer\n service.updateCustomer(customerViewModel);\n }", "public CompletionStage<Result> updateItem(Long id) {\n MessageDispatcher jdbcDispatcher = AkkaDispatcher.jdbcDispatcher;\n\n JsonNode nItem = request().body().asJson();\n ItemEntity item = Json.fromJson( nItem , ItemEntity.class ) ;\n ItemEntity itemViejo = ItemEntity.FINDER.byId(id);\n return CompletableFuture.supplyAsync(\n ()->{\n if(itemViejo == null)\n {\n return itemViejo;\n }else\n { item.setId(id);\n item.update();\n return item;\n }\n }\n ).thenApply(\n itemEntity -> {\n if(itemEntity == null)\n {\n return notFound();\n }else\n {\n return ok(Json.toJson(itemEntity));\n }\n }\n\n );\n }", "@Headers({\n \"Content-Type:application/json\"\n })\n @PUT(\"users/{id}\")\n Call<Void> updateUser(\n @retrofit2.http.Path(\"id\") String id, @retrofit2.http.Body UserResource userResource\n );", "@PutMapping(value=\"/ticket/{ticketId}\")\n\tpublic Ticket updateTicket(@RequestBody Ticket ticket,@PathVariable(\"ticketId\") Integer ticketId){\n return ticketBookingService.updateTicket(ticket,ticketId);\t\t\n\t}", "@Override\n\tpublic int update(int id) {\n\t\treturn rolDao.update(id);\n\t}", "public static boolean edit(String name, String id) {\n Boolean flag = true;\n if(doPut(name,id) == 200) {\n System.out.println(\"Response Body:\");\n String res = \"\";\n String print = read(id);\n try {\n JSONObject json = new JSONObject(print);\n json.put(\"success\", flag);\n res = json.toString();\n } catch (JSONException ex) {\n Logger.getLogger(RestaurantApiClient.class.getName()).log(Level.SEVERE, null, ex);\n }\n System.out.println(res);\n return true;\n }\n \n return false;\n }", "@PutMapping(\"{id}\")\n public Lesson updateLesson(@RequestBody Lesson lesson,\n @PathVariable long id) {\n //code\n return null;\n }", "@Override\n\tpublic Result<VoteCandidate> update(@PathVariable(\"id\") long id, VoteCandidate newEntity) {\n\t\treturn null;\n\t}", "int updateUserById( User user);", "@Override\n\tpublic void update(Serializable id) {\n\t\t\n\t\tNote n = this.findById(id);\n\t\tif(n==null){\n\t\t\tthrow new RuntimeException(\"笔记id为空\");\n\t\t}\n\t\tthis.update(n);\n\t}", "@Override\r\n\tpublic SverResponse<String> updateParam(String name, Integer id) {\n\t\tif (name==null||id==null) {\r\n\t\t\treturn SverResponse.createByErrorMessage(\"参数错误!\");\r\n\t\t}\r\n\t\tint rs = actionParamsDao.updateParam(name, id);\r\n\t\tif (rs>0) {\r\n\t\t\treturn SverResponse.createRespBySuccessMessage(\"产品参数修改成功!\");\r\n\t\t}\r\n\t\treturn SverResponse.createByErrorMessage(\"产品参数修改失败!\");\r\n\t}", "@Override\n protected Response doUpdate(Long id, JSONObject data) {\n return null;\n }", "public String update(String id, String datetime, String description, String request, String status);", "int updateId(T data, ID newId) throws SQLException, DaoException;", "@PutMapping(\"/{id}\")\n public ResponseEntity<Food> putFood(@PathVariable int id, @RequestBody Food food){\n Food foodToRename = foodDao.findById(id);\n\n if(foodToRename == null){\n return new ResponseEntity<>(HttpStatus.NOT_FOUND);\n }\n\n food.setId(id);\n foodDao.save(food);\n return new ResponseEntity<>(food, HttpStatus.OK);\n }", "@RequestMapping(value = \"{id}\", method = RequestMethod.PUT)\n public User update(@PathVariable Long id, @RequestBody final User user)\n {\n //TODO: Add validation that checks that all attributes are listed in the JSON object. Return 400 bad payload if not\n User existingUser = userRepo.getOne(id);\n BeanUtils.copyProperties(user, existingUser, \"userID\");\n return userRepo.saveAndFlush(user);\n }", "@Override\n\tpublic ResponseEntity<?> put(Deposit data, Long id) {\n\t\treturn ResponseEntity.ok(service.deposit.put(data, id));\n\t}", "void updateUser(int id, UpdateUserDto updateUserDto);", "@PutMapping(\"/{id}\")\n @PreAuthorize(\"hasRole('ADMIN') or hasRole('USER')\")\n public ResponseEntity<RecipeDto> update(@Valid @RequestBody RecipeDto recipeDto, @PathVariable(\"id\") int id) {\n return new ResponseEntity<>(RecipeDto.from(recipeService.updateRecipe(id, Recipe.from(recipeDto))), HttpStatus.OK);\n }", "@RequestMapping(value=\"/{id}\", method=RequestMethod.PUT)\n\tpublic ResponseEntity<Void> atualizar(@RequestBody Livro livro, @PathVariable(\"id\") Long id ){\n\t\tlivro.setId(id);\n\t\tlivrosService.atualizar(livro);\t\n\t\treturn ResponseEntity.noContent().build();\n\t}", "public void updatePost(Long id, BlogPost post);", "@PUT\n @Path(\"/{id}\")\n @Produces(MediaType.APPLICATION_JSON)\n @Consumes(MediaType.APPLICATION_JSON)\n public Response updateBike(@PathParam(\"id\") int id, Bike bike) {\n return Response.ok()\n .entity(dao.updateBike(id, bike))\n .build();\n }", "@PutMapping(\"/{id}\")\n public User update(@PathVariable(\"id\") final int id, @RequestBody final User user) {\n return userService.update(id, user);\n }", "@PutMapping(\"/update/{id}\")\n public String upadtegetRestaurant(@RequestBody Restaurant restaurant, @PathVariable String id) throws RestaurantAlreadyException, RestaurantNotFound {\n restaurant.setRestaurantId(id);\n restaurantServiceImpl.updataData(restaurant);\n return \"Updated successfully\";\n\n }", "@Update(UPDATE_BY_ID)\n @Override\n int updateById(Object position);", "@Path(\"/{ID}\")\n @PUT\n @Consumes(MediaType.APPLICATION_JSON)\n @Produces(MediaType.APPLICATION_JSON)\n public Response update(@PathParam(\"ID\") String ID, Person person) \n throws NotFoundException, MissingInformationException {\n if(person == null) \n throw new MissingInformationException(\"No Person were found\");\n \n Document found = fetchByObjectId(ID);\n \n UpdateResult result = getCollection().updateOne(found, \n new Document(\"$set\", toDocument(person)));\n if(result.getModifiedCount() == 0)\n return Response.status(Response.Status.GONE).build();\n \n // Indicates nothing was modified at all\n return Response.status(Response.Status.ACCEPTED).build();\n }", "@Authorized(\"ADMIN\")\n @PutMapping(path = \"/{id}\")\n public Response<Object> update\n (\n @PathVariable(\"id\") Long id,\n @Valid @RequestBody StoreAndUpdateFacultyRequest putRequest,\n Errors errors\n )\n {\n FacultyDTO facultyDTO = new FacultyDTO()\n .setName(this.sanitize(putRequest.getName()))\n .setCampusId(putRequest.getCampusId());\n\n try {\n return Response.ok().setPayload(this.facultyService.update(id, facultyDTO));\n } catch (FacultyNotFoundException e) {\n return Response.exception().setErrors(e.getMessage());\n }\n }", "public void setId(int id){ this.id = id; }", "public void setId(String id) {\n this.id = id;\n }", "public void update(K id, Update<P> update);", "Product updateProductById(Long id);", "public abstract <T> void update(String id, Map<String, Object> objectMap, Class<T> clazz);", "@RequestMapping(value = \"{id}\", method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_UTF8_VALUE)\n public ResponseEntity<?> put(@PathVariable long id, @Valid @RequestBody SaveTodoDto dto) {\n Todo todo = getTodoOrThrow(id);\n\n todo.setDescription(dto.getDescription());\n todo.setTitle(dto.getTitle());\n\n todo = repository.save(todo);\n\n return ResponseEntity.ok(dtoConverter.convert(todo));\n }", "public void setId(Long id) {this.id = id;}", "public void setId(Long id) {this.id = id;}", "@Override\n\tpublic String update(Integer id, Model m) throws Exception {\n\t\treturn null;\n\t}", "@Override\n\tpublic String update(Integer id, Model m) throws Exception {\n\t\treturn null;\n\t}", "@Override\r\n\tpublic ResponseEntity<String> update(@Valid @RequestBody Pais updateMODEL, Integer id) {\n\t\treturn null;\r\n\t}", "@PutMapping(\"/{id}\")\n public void update(@PathVariable Long id, @RequestBody SignUpPayload payload) {\n\n }", "@Override\n public void update(long id) {\n try (Session session = createSessionFactory().openSession()) {\n\n Transaction transaction = session.getTransaction();\n transaction.begin();\n\n File findItem = (File) findById(id);\n findItem.setName(\"new_novel\");\n findItem.setSize(10);\n //action\n session.update(findItem);\n //close session/tr\n transaction.commit();\n throw new IOException();\n } catch (HibernateException e) {\n System.out.println(\"Nothing update!\" + e.getMessage());\n }\n catch (IOException e){\n System.out.println(\"Something wrong in File update method\");\n e.printStackTrace();\n }\n\n }", "public WriteResult updateObject(String id, String name) {\n\t\treturn null;\n\t}", "public void updateProductByRest(long id, HttpServletRequest request) {\n // set URL\n String url = String.format(\"%s://%s:%d/products/\" + id, request.getScheme(), request.getServerName(), request.getServerPort());\n // execute rest api update product request using RestTemplate.put method\n HttpEntity<Product> entity = getHttpEntity(request);\n RestTemplate restTemplate = new RestTemplate();\n restTemplate.put(url, entity, id);\n }", "public static void update( Long id ) {\n Application.currentUserCan( 1 );\n \n String title = params.get( \"course[title]\", String.class );\n String content = params.get( \"course[content]\", String.class );\n Long old_id = params.get( \"course[title]\", Long.class );\n Course course = Course.findById( id );\n if( !id.equals(old_id) && course != null ) {\n course.setTitle(title);\n course.setContent(content);\n course.save();\n }\n edit(id);\n }", "@Override\n\tpublic T update(T t, long id) {\n\t\treturn null;\n\t}", "public void update(RutaPk pk, Ruta dto) throws RutaDaoException;", "@PutMapping(\"/updateEmployee/{id}\")\n\tpublic ResponseEntity<Employee> updateEmployee(@PathVariable Long id, @RequestBody Employee employee){\n\t\tEmployee save = repo.save(employee);\n\t\treturn ResponseEntity.ok(save);\n\t}", "int updateByPrimaryKey(Body record);", "@RequestMapping(value = \"/{id}\", method = RequestMethod.PUT)\n\t\tpublic ResponseEntity<Void> atualizar(@RequestBody Pedido obj, @PathVariable Integer id) {\n\t\t\ttry {\n\t\t\t\tobj = service.atualiza(obj);\n\t\t\t} catch (Exception e) {\n\t\t\t\tobj = null;\n\t\t\t}\n\n\t\t\treturn ResponseEntity.noContent().build();\n\t\t}", "public void setId( Long id );", "@Override\n\tpublic String update(Long id, Model m) throws Exception {\n\t\treturn null;\n\t}", "@Override\n\tpublic String update(Long id, Model m) throws Exception {\n\t\treturn null;\n\t}", "public ResponseTranslator put() {\n setMethod(\"PUT\");\n return doRequest();\n }", "@RequestMapping(method = RequestMethod.PUT, value = \"/{id}\",\n produces = \"application/json\", headers = \"Accept=application/json\" )\n public ResponseEntity<?> updateInventoryByProductId(@PathVariable(\"id\") Integer id,\n @Valid @RequestBody InventoryUpdateRequest inventoryUpdateRequest){\n Inventory inventory = inventoryService.getInventoryItemByProductId(id);\n inventory.setAmount(inventoryUpdateRequest.getAmount());\n inventoryService.updateInventoryItem(inventory);\n\n return ResponseEntity.noContent().build();\n }", "Update withIdProvider(String idProvider);", "public abstract void setId(T obj, long id);", "int updTravelById(Travel record) throws TravelNotFoundException;", "@PutMapping(\"/books/{id}\")\n\tpublic ResponseEntity<Book> updateBook(@PathVariable Long id,@RequestBody Book bookDetails)\n\t{\n\t\tBook book = bookRepository.findById(id)\n\t\t\t\t.orElseThrow(() -> new ResourceNotFoundException(\"Book Not found with id\" + id));\n\t\tbook.setTitle(bookDetails.getTitle());\n\t\tbook.setAuthors(bookDetails.getAuthors());\n\t\tbook.setYear(bookDetails.getYear());\n\t\tbook.setPrice(bookDetails.getPrice());\n\t\t\n\t\tBook updatedBook = bookRepository.save(book);\n\t\treturn ResponseEntity.ok(updatedBook);\n\t}", "@PUT(\"/{id}\")\n @Consumes(\"application/json\")\n @PermitAll\n public Person upsert(String id, Person person) {\n logger.debug(\"upsert({}, {})\", id, person);\n Person upsert = personService.upsert(id, person);\n logger.debug(\"created/updated {}: {}\", id, upsert);\n return upsert;\n }", "public void setId(int id) { this.id = id; }", "public void setId(int id) { this.id = id; }", "@Restrict(@Group(Application.ADMIN_ROLE))\n public CompletionStage<Result> updateCampo(Long id) {\n MessageDispatcher jdbcDispatcher = AkkaDispatcher.jdbcDispatcher;\n\n JsonNode nCampo = request().body().asJson();\n CampoEntity campo = Json.fromJson( nCampo , CampoEntity.class ) ;\n CampoEntity campoViejo = CampoEntity.FINDER.byId(id);\n return CompletableFuture.supplyAsync(\n ()->{\n if(campoViejo == null)\n {\n return campoViejo;\n }else\n { campo.setId(id);\n campo.update();\n return campo;\n }\n }\n ).thenApply(\n campoEntity -> {\n if(campoEntity == null)\n {\n return notFound();\n }else\n {\n return ok(Json.toJson(campoEntity));\n }\n }\n\n );\n }", "int updRouteById(Route record) throws RouteNotFoundException;", "@RequestMapping(value=\"/put\", method = RequestMethod.POST, produces=MediaType.APPLICATION_JSON_VALUE)\n\t@ResponseStatus(value = HttpStatus.OK)\n\tpublic void put(@RequestBody ArticleEntity detail) {\n\t\tserviceFactory.getArticleService().update(convertEntity2Vo(detail));\n\t}", "void setId(ID id);", "@RequestMapping(method = RequestMethod.PUT, consumes = MediaType.APPLICATION_JSON_VALUE)\n //Request Body is requesting the student parameter\n public void updateStudent(@RequestBody Student student){\n studentService.updateStudent(student);\n }" ]
[ "0.7546944", "0.7482072", "0.7080999", "0.7057817", "0.7035054", "0.69465196", "0.69091386", "0.69072455", "0.68781745", "0.68561214", "0.6855867", "0.6848351", "0.68130577", "0.67535496", "0.67323107", "0.6721144", "0.6692389", "0.6683201", "0.6668602", "0.66632", "0.66404307", "0.6614092", "0.65864813", "0.6573775", "0.6567894", "0.6567336", "0.6558183", "0.6556563", "0.65473807", "0.6545092", "0.65319633", "0.65123063", "0.6503409", "0.64923954", "0.6485663", "0.64800966", "0.6471226", "0.645074", "0.64469594", "0.6444652", "0.64326286", "0.6431982", "0.64239186", "0.64122415", "0.6412034", "0.64053315", "0.6397818", "0.6395852", "0.6389118", "0.63782483", "0.63762146", "0.63728523", "0.6364349", "0.6361715", "0.6350026", "0.63484263", "0.63411844", "0.6340336", "0.6340219", "0.6332534", "0.63309777", "0.6327363", "0.632425", "0.63216084", "0.63175213", "0.63169867", "0.63168406", "0.6312272", "0.6310728", "0.63093114", "0.63093114", "0.6303577", "0.6303577", "0.6294244", "0.62806135", "0.62773883", "0.62753314", "0.62751925", "0.627472", "0.6274346", "0.6273261", "0.6267916", "0.626734", "0.62615967", "0.62607914", "0.6260589", "0.6260589", "0.62570435", "0.6251465", "0.6251317", "0.62495524", "0.624794", "0.624685", "0.624665", "0.6246067", "0.6246067", "0.6244645", "0.6242497", "0.62346673", "0.62325585", "0.6230888" ]
0.0
-1
For Delete specific drop reg in DB
public void delete(Long id){ try { categoriaUsuarioRepository.deleteById(id); }catch (Exception e){ System.out.println(e); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void drop(String accountNo) {\n\t\t\n\t}", "public void dyrepdelete(int repno) {\n\t\tDBConn dbconn = DBConn.getDB();\n\t\tConnection conn = null;\n\t\t\n\t\ttry {\n\t\t\tconn=dbconn.getConn();\n\t\t\tconn.setAutoCommit(false);\n\t\t\t\n\t\t\tDYBoardDAO dao = DYBoardDAO.getdao();\n\t\t\tdao.dyrepdelete(conn,repno);\n\t\t\t\n\t\t\tconn.commit();\n\t\t}catch(NamingException | SQLException e){\n\t\t\tSystem.out.println(e);\n\t\t\ttry {conn.rollback();}catch(SQLException e2) {}\n\t\t}finally {\n\t\t\tif(conn!=null)try {conn.close();}catch(SQLException e) {}\n\t\t}\n\t}", "public void dropDB() throws SQLException {\n\t \t\tStatement stmt = cnx.createStatement();\n\t \t\tString[] tables = {\"account\", \"consumer\", \"transaction\"};\n\t \t\tfor (int i=0; i<3;i++) {\n\t \t\t\tString query = \"DELETE FROM \" + tables[i];\n\t \t\t\tstmt.executeUpdate(query);\n\t \t\t}\n\t \t}", "public void del(Connection con) \n throws qdbException\n {\n try {\n PreparedStatement stmt = con.prepareStatement(\n \" DELETE From DisplayOption WHERE \" \n + \" dpo_res_id = ? AND \" \n + \" dpo_view = ? \" );\n \n stmt.setLong(1,dpo_res_id);\n stmt.setString(2,dpo_view); \n \n stmt.executeUpdate(); \n stmt.close();\n \n } catch(SQLException e) {\n throw new qdbException(\"SQL Error: \" + e.getMessage()); \n }\n }", "public static void dropMysqlUser(Eleve e) {\n Session session = HibernateUtils.getSessionFactory().openSession();\r\n String SQLRequest = \"DROP USER '\" + e.getAbreviation() + \"'@'%' ; \";\r\n System.out.println(SQLRequest);\r\n session.beginTransaction();\r\n session.createSQLQuery(SQLRequest).executeUpdate();\r\n session.getTransaction().commit();\r\n session.close();\r\n\r\n }", "public void testDrop() {\n\t\ttry {\n\t\t\tServerParameterTDG.create();\n\t\t\tassertTrue(DbRegistry.hasTable(ServerParameterTDG.TABLE));\n\t\t\tServerParameterTDG.drop();\n\t\t\tassertFalse(DbRegistry.hasTable(ServerParameterTDG.TABLE));\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail();\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tServerParameterTDG.drop();\n\t\t\t} catch (SQLException e) {\n\t\t\t}\n\t\t}\n\t}", "void dropDatabase();", "int deleteByPrimaryKey(String taxregcode);", "private void dropDBProcedure() {\r\n try {\r\n Class.forName(myDriver);\r\n Connection conn = DriverManager.getConnection(myUrl, myUser, myPass);\r\n DatabaseMetaData md = conn.getMetaData();\r\n String[] types = {\"TABLE\"};\r\n ResultSet rs = md.getTables(null, \"USERTEST\", \"%\", types);\r\n while (rs.next()) {\r\n String queryDrop\r\n = \"DROP TABLE \" + rs.getString(3);\r\n Statement st = conn.createStatement();\r\n st.executeQuery(queryDrop);\r\n System.out.println(\"TABLE \" + rs.getString(3).toLowerCase() + \" DELETED\");\r\n st.close();\r\n }\r\n rs.close();\r\n conn.close();\r\n } catch (ClassNotFoundException | SQLException ex) {\r\n System.out.println(ex.toString());\r\n }\r\n }", "public void doDropTable();", "@Override\r\n\tpublic void eliminar(Long idRegistro) {\n\t\t\r\n\t}", "int deleteByPrimaryKey(String registerId);", "public static void scriptDelete() {\n List<BeverageEntity> beverages = (List<BeverageEntity>) adminFacade.getAllBeverages();\n for (int i = 0; i < beverages.size(); i++) {\n System.out.println(\"delete : \" + beverages.get(i));\n adminFacade.removeBeverage(beverages.get(i));\n }\n List<DecorationEntity> decos = (List<DecorationEntity>) adminFacade.getAllDecorations();\n for (int i = 0; i < decos.size(); i++) {\n System.out.println(\"delete : \" + decos.get(i));\n adminFacade.removeDecoration(decos.get(i));\n }\n\n /* Check that there isn't any other cocktails, and delete remaining */\n List<CocktailEntity> cocktails = (List<CocktailEntity>) adminFacade.getAllCocktails();\n if (cocktails.size() > 0) {\n System.err.println(\"Les cocktails n'ont pas été tous supprimés... \"\n + cocktails.size() + \" cocktails restants :\");\n }\n for (int i = 0; i < cocktails.size(); i++) {\n CocktailEntity cocktail = adminFacade.getCocktailFull(cocktails.get(i));\n System.err.println(cocktail.getName() + \" : \"\n + cocktail.getDeliverables());\n adminFacade.removeCocktail(cocktail);\n }\n\n /* Remove client accounts */\n List<ClientAccountEntity> clients = (List<ClientAccountEntity>) adminFacade.getAllClients();\n for (int i = 0; i < clients.size(); i++) {\n adminFacade.removeClient(clients.get(i));\n }\n\n /* Remove addresses */\n List<AddressEntity> addresses = (List<AddressEntity>) adminFacade.getAllAddresses();\n for (int i = 0; i < addresses.size(); i++) {\n adminFacade.removeAddress(addresses.get(i));\n }\n\n /* TODO :\n * * Remove orders\n */\n }", "int deleteByPrimaryKey(Long idreg);", "public void dropTable();", "public boolean deleteDB(String qryExp, RequestBox rBox) throws Exception {\n\t\treturn false;\n\t}", "public boolean deleteDB(String qryExp, RequestBox rBox) throws Exception {\n\t\treturn false;\n\t}", "public void deleteEquipoComunidad(EquipoComunidad equipoComunidad);", "private void processDrop() throws HsqlException {\n\n String token;\n boolean isview;\n\n session.checkReadWrite();\n session.checkAdmin();\n session.setScripting(true);\n\n token = tokenizer.getSimpleToken();\n isview = false;\n\n switch (Token.get(token)) {\n\n case Token.INDEX : {\n processDropIndex();\n\n break;\n }\n case Token.SCHEMA : {\n processDropSchema();\n\n break;\n }\n case Token.SEQUENCE : {\n processDropSequence();\n\n break;\n }\n case Token.TRIGGER : {\n processDropTrigger();\n\n break;\n }\n case Token.USER : {\n processDropUser();\n\n break;\n }\n case Token.ROLE : {\n database.getGranteeManager().dropRole(\n tokenizer.getSimpleName());\n\n break;\n }\n case Token.VIEW : {\n isview = true;\n } //fall thru\n case Token.TABLE : {\n processDropTable(isview);\n\n break;\n }\n default : {\n throw Trace.error(Trace.UNEXPECTED_TOKEN, token);\n }\n }\n }", "public void dropDataBase(String databaseName);", "public static void removeEleveOnSchema(Eleve e, Bdd d) {\n Session session = HibernateUtils.getSessionFactory().openSession();\r\n String SQLRequest = \"REVOKE all PRIVILEGES ON \" + d.getNom() + \".* from '\" + e.getAbreviation() + \"'@'%';\";\r\n session.beginTransaction();\r\n session.createSQLQuery(SQLRequest).executeUpdate();\r\n session.getTransaction().commit();\r\n session.close();\r\n\r\n }", "@Override\n public void run() {\n\n String filename = \"PurgeTable\";\n\n PreparedStatement stmt1 = null;\n try {\n stmt1 = conn.prepareStatement(\"delete from \" + filename);\n stmt1.executeUpdate();\n System.out.println(\"Deletion successful\");\n } catch (SQLException e) {\n e.printStackTrace();\n }\n\n }", "public void eliminar(){\n conexion = base.GetConnection();\n try{\n PreparedStatement borrar = conexion.prepareStatement(\"DELETE from usuarios where Cedula='\"+this.Cedula+\"'\" );\n \n borrar.executeUpdate();\n // JOptionPane.showMessageDialog(null,\"borrado\");\n }catch(SQLException ex){\n System.err.println(\"Ocurrió un error al borrar: \"+ex.getMessage());\n \n }\n }", "public static void deleteReminder()\n {\n System.out.print(\"Select event number reminder to delete: \");\n String evNum = CheckInput.getString();\n try\n {\n PreparedStatement pstmt = null;\n String str = \"delete from reminder where eventnumber = ?\";\n pstmt = conn.prepareStatement(str);\n pstmt.setString(1,evNum);\n pstmt.executeUpdate();\n }\n catch(Exception e)\n {\n e.printStackTrace();\n }\n }", "@Override\r\n public void damdelete(Integer[] da_id) {\n userMapper.damdelete(da_id);\r\n }", "private static void removeDB()\n {\n if(getStatus().equals(\"no database\"))\n return;\n\n dropTable(\"myRooms\");\n dropTable(\"myReservations\");\n }", "public int Rejectbroker(Long id) throws SQLException {\n\tint i=DbConnect.getStatement().executeUpdate(\"delete from login where loginid=\"+id+\"\");\r\n\treturn i;\r\n}", "public static void deleteSchema(Bdd bd) {\n\r\n Session session = HibernateUtils.getSessionFactory().openSession();\r\n String SQLRequest = \"DROP SCHEMA \" + bd.getNom() + \" ;\";\r\n session.beginTransaction();\r\n session.createSQLQuery(SQLRequest).executeUpdate();\r\n session.getTransaction().commit();\r\n session.close();\r\n bd = null;\r\n BddDAO bddDao = new BddDAO();\r\n bddDao.deleteBdd(bd);\r\n\r\n }", "@After\r\n public void tearDown() {\r\n try {\r\n Connection conn=DriverManager.getConnection(\"jdbc:oracle:thin:@//localhost:1521/XE\",\"hr\",\"hr\");\r\n Statement stmt = conn.createStatement();\r\n stmt.execute(\"DELETE FROM Packages WHERE Pkg_Order_Id=-1\");\r\n stmt.execute(\"DELETE FROM Packages WHERE Pkg_Order_Id=-2\");\r\n } catch (Exception e) {System.out.println(e.getMessage());}\r\n }", "public int deleteRegulation(int Regulationid) {\n\t\tString info = null;\r\n\t\tSqlSession session = MybatisSqlSessionFactory.getSqlSession();\r\n\t\tSystem.out.println(Regulationid);\r\n\t\tint i = session.delete(\"deleteregulation\",Regulationid);\r\n\t\tif(i>0)\r\n\t\t{\r\n\t\t\tinfo=\"删除成功\";\r\n\t\t\tsession.commit();\r\n\t\t}else{\r\n\t\t\tinfo=\"删除失败\";\r\n\t\t\tsession.rollback();\r\n\t\t}\r\n\t\tSystem.out.println(\"delete: \"+i);\r\n\t\tMybatisSqlSessionFactory.closeSqlSession();\r\n\t\treturn i;\r\n\t}", "public void dydelete(int bno) {\n\t\t\n\t\tDBConn dbconn = DBConn.getDB();\n\t\tConnection conn=null;\n\t\ttry {\n\t\t\tconn=dbconn.getConn();\n\t\t\tconn.setAutoCommit(false);\n\t\t\t\n\t\t\tDYBoardDAO dao = DYBoardDAO.getdao();\n\t\t\tdao.dydelete(conn,bno);\n\t\t\t\n\t\t\tconn.commit();\n\t\t}catch(NamingException | SQLException e) {\n\t\t\tSystem.out.println(e);\n\t\t}finally {\n\t\t\tif(conn!=null)try {conn.close();}catch(SQLException e) {}\n\t\t}\n\t}", "@Test\n @DisplayName(\"Testataan tilausten poisto tietokannasta\")\n void deleteReservation() {\n TablesEntity table = new TablesEntity();\n table.setSeats(2);\n tablesDao.createTable(table);\n\n ReservationsEntity reservation = new ReservationsEntity(\"Antero\", \"10073819\", new Date(System.currentTimeMillis()), table.getId(), new Time(1000), new Time(2000));\n reservationsDao.createReservation(reservation);\n\n // Confirm that the reservation is in DB\n ReservationsEntity reservationFromDb = reservationsDao.getReservation(reservation.getId());\n assertEquals(reservation, reservationFromDb);\n\n // Delete reservation and confirm that it's not in the DB\n reservationsDao.deleteReservation(reservation);\n\n reservationFromDb = reservationsDao.getReservation(reservation.getId());\n assertEquals(null, reservationFromDb);\n\n }", "@Override\n protected void doClean() throws SQLException {\n for (String dropStatement : generateDropStatements(name, \"V\", \"VIEW\")) {\n jdbcTemplate.execute(dropStatement);\n }\n\n // aliases\n for (String dropStatement : generateDropStatements(name, \"A\", \"ALIAS\")) {\n jdbcTemplate.execute(dropStatement);\n }\n\n for (Table table : allTables()) {\n table.drop();\n }\n\n // slett testtabeller\n for (String dropStatement : generateDropStatementsForTestTable(name, \"T\", \"TABLE\")) {\n jdbcTemplate.execute(dropStatement);\n }\n\n\n // tablespace\n for (String dropStatement : generateDropStatementsForTablespace(name)) {\n jdbcTemplate.execute(dropStatement);\n }\n\n // sequences\n for (String dropStatement : generateDropStatementsForSequences(name)) {\n jdbcTemplate.execute(dropStatement);\n }\n\n // procedures\n for (String dropStatement : generateDropStatementsForProcedures(name)) {\n jdbcTemplate.execute(dropStatement);\n }\n\n // functions\n for (String dropStatement : generateDropStatementsForFunctions(name)) {\n jdbcTemplate.execute(dropStatement);\n }\n\n // usertypes\n for (String dropStatement : generateDropStatementsForUserTypes(name)) {\n jdbcTemplate.execute(dropStatement);\n }\n }", "int deleteByPrimaryKey(String ipAddress, String module, String ne);", "public void deleteDrinkBills(Bill deleteDrink) {\n\tString sql =\"DELETE FROM bills WHERE Id_drink = ?\";\n\t\n\ttry {\n\t\tPreparedStatement preparedStatement = ConnectionToTheBase.getConnectionToTheBase().getConnection().prepareStatement(sql);\n\t\tpreparedStatement.setInt(1, deleteDrink.getId());\n\t\tpreparedStatement.execute();\n\t} catch (SQLException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\n\t\n}", "String getDropSql(String type, String name);", "public void annulerDemande (int idGroupe) throws RemoteException {\r\n\t\t\t\r\n\t\t String requete = \"delete from demande where d_idGroupe = \" + idGroupe + \" and d_idEtudiant = \" + \r\n\t\t \t\t\t\t _etudiant.getId(); \r\n\t\t System.out.println(\"requete annulerDemande : \" + requete);\r\n\t\t database.executeUpdate(requete);\r\n\t\t \r\n\t\t}", "public void eliminar(Long id) throws AppException;", "@Override\n\tpublic void delete(String... args) throws SQLException {\n\t\t\n\t}", "public int Rejectcomp(Long id) throws SQLException {\n\tLong idd=null;\r\n\trs=DbConnect.getStatement().executeQuery(\"select login_id from company where comp_id=\"+id+\"\");\r\n\tif(rs.next())\r\n\t{\r\n\t\tidd=rs.getLong(1);\r\n\t}\r\n\tSystem.out.println(idd);\r\n\tint i=DbConnect.getStatement().executeUpdate(\"delete from login where login_id=\"+idd+\"\");\r\n\treturn i;\r\n}", "private static void deleteDB(String dbName) {\n\t\tString url = SERVER_URI_ADMIN_API + \"/\" + dbName + \"/\";\n\t\tSystem.out.println(\"url: \" + url);\n\n\t\tRestTemplate restTemplate = new RestTemplate();\n\n\t\ttry {\n\t\t\trestTemplate.delete(url);\n\t\t} catch (RestClientException e1) {\n\t\t\tSystem.out.println(\"Db was not deleted in sync gateway\");\n\t\t\t// e1.printStackTrace();\n\t\t}\n\n\t\tString urlcouchdb = \"http://@localhost:8091/pools/default/buckets/\"\n\t\t\t\t+ dbName;\n\t\t// flus database should be enabled\n\t\t/*\n\t\t * String urlServerCouch =\n\t\t * \"http://localhost:8091/pools/default/buckets/grocery-sync/controller/doFlush\"\n\t\t * ;\n\t\t * //\"http://admin:a1a2a3@localhost:8091/pools/default/buckets/\"+dbName+\n\t\t * \"/controller/doFlush\"; try{ restTemplate.delete(urlServerCouch);\n\t\t * }catch(RestClientException e){ e.printStackTrace(); }\n\t\t */\n\t\t// RestTemplate restTemplate = new RestTemplate();\n\t\tResponseEntity<String> response;\n\n\t\tHttpHeaders httpHeaders = createHeaders(\"user\", \"pass\");\n\n\t\tresponse = restTemplate.exchange(urlcouchdb, HttpMethod.DELETE,\n\t\t\t\tnew HttpEntity<Object>(httpHeaders), String.class);\n\n\t}", "@Override\n\tpublic void delete(Brand brand) {\n \tsql=\"delete from brands where id=?\";\n \ttry {\n\t\t\tquery=connection.prepareStatement(sql);\n\t\t\tquery.setInt(1, brand.getId());\n\t\t\tquery.executeUpdate();\n\t\t} catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\tnew Exception(e);\n\t\t}\n\t}", "@Override\n\tpublic void delete(Integer deptno) {\n\t\t\n\t}", "public void deldrumentry(String idi) {\n\t\tourDatabase.delete(DATABASE_TABLE, Drum_RowID + \"=\" +idi, null);\n\t\t\t\n\t}", "public int delete( Conge conge ) ;", "boolean dropTable();", "public void operationDelete() {\n\r\n\t\tstatusFeldDelete();\r\n\t}", "public boolean eliminarRegistro(int codigoCiclo, int codigoPlan, int codigoMeta) {\n/* */ try {\n/* 484 */ String s = \"delete from cal_plan_metas\";\n/* 485 */ s = s + \" where codigo_ciclo=\" + codigoCiclo;\n/* 486 */ s = s + \" and codigo_plan=\" + codigoPlan;\n/* 487 */ s = s + \" codigo_meta=\" + codigoMeta;\n/* 488 */ return this.dat.executeUpdate(s);\n/* */ \n/* */ }\n/* 491 */ catch (Exception e) {\n/* 492 */ e.printStackTrace();\n/* 493 */ Utilidades.writeError(\"CalPlanMetasFactory:eliminarRegistro\", e);\n/* */ \n/* 495 */ return false;\n/* */ } \n/* */ }", "@Override\n public void removeFromDb() {\n }", "int deleteByPrimaryKey(String licFlow);", "public void dropTable() {\n }", "@Override\n\tpublic void eliminar() {\n\t\tLOG.info(\"Se elimino el usuario de la bd\");\n\t}", "private void delete() {\n\n\t}", "@Override\r\n\tpublic void deleteDatabase() {\r\n\t\tlog.info(\"Enter deleteDatabase\");\r\n\r\n\t\t\r\n\t\tConnection connection = null;\t\t\r\n\t\ttry {\r\n\t\t\tconnection = jndi.getConnection(\"jdbc/libraryDB\");\t\t\r\n\t\t\t\r\n\r\n\t\t\t \r\n\t\t\t\tPreparedStatement pstmt = connection.prepareStatement(\"Drop Table Users_Table; \"); \r\n\t\t\t\tpstmt.executeUpdate();\r\n\t\t\t\t\r\n\t\t\t\tpstmt = connection.prepareStatement(\"Drop Table Cams_Table; \"); \r\n\t\t\t\tpstmt.executeUpdate();\r\n\t\t\t\t\r\n\t\t\t\tpstmt = connection.prepareStatement(\"Drop Table User_Cam_Mapping_Table; \"); \r\n\t\t\t\tpstmt.executeUpdate();\r\n\t\t\t\t\r\n\t\t\t\tpstmt = connection.prepareStatement(\"Drop Table Cam_Images_Table; \"); \r\n\t\t\t\tpstmt.executeUpdate();\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Datenbank wurde erfolgreich zurueckgesetzt!\");\t\t\t\t\r\n\t\t\t\t\r\n\t\t} catch (Exception e) {\r\n\t\t\tSystem.out.println(\"Fehler: \"+e.getMessage());\r\n\t\t\tlog.error(\"Error: \"+e.getMessage());\r\n\t\t} finally {\r\n\t\t\tcloseConnection(connection);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "@FXML\r\n public void deleteTreatmentButton(){\r\n int sIndex = treatmentTabletv.getSelectionModel().getSelectedIndex();\r\n String sID = treatmentData.get(sIndex).getIdProperty();\r\n\r\n String deleteTreatment = \"delete from treatment where treatmentID = ?\";\r\n try{\r\n ps = mysql.prepareStatement(deleteTreatment);\r\n ps.setString(1,sID);\r\n ps.executeUpdate();\r\n ps.close();\r\n ps = null;\r\n\r\n } catch (SQLException e) {\r\n e.printStackTrace();\r\n //maybe more in this exception\r\n }\r\n\r\n treatmentData.remove(sIndex);\r\n }", "public static void drop() throws SQLException{\n\t\t \n\t\t\n\t\t String sid = new String();\n\t\t String classid = new String();\n\n\t\t try{\n \t\tSystem.out.println(\"Please enter the sid(starting with 'B')\\n\"); \n\t\t \tBufferedReader br = new BufferedReader(new InputStreamReader(System.in )); \n\t\t \n\n\t\t\tsid = br.readLine();\n\n\t\t \tSystem.out.println(\"Please enter the classid(starting with 'c')\\n\"); \n\t\t\n\t\t\tclassid=br.readLine();\n//Connection to Oracle server\n OracleDataSource ds = new oracle.jdbc.pool.OracleDataSource();\n ds.setURL(\"jdbc:oracle:thin:@grouchoIII.cc.binghamton.edu:1521:ACAD111\");\nConnection conn = ds.getConnection(\"vbobhat1\", \"BingData\");\nCallableStatement cs = conn.prepareCall (\"begin StudRegSys.delete_enrollments(:1,:2,:3); end;\");\n\t \t \n\t \t\tcs.setString(1,sid);\n\t \t\tcs.setString(2,classid);\n\t\t\tcs.registerOutParameter(3,Types.VARCHAR);\n\t \t\tcs.executeQuery();\n\t\t\tString output = new String(cs.getString(3));\n\t\t\tSystem.out.println(\"MESSAGE:\" + output);\n\t\t\tSystem.out.println(\"\\n\\n\");\n\t\t \n\t\t }\ncatch (SQLException ex) { System.out.println (\"\\n*** SQLException caught ***\\n\" + ex.getMessage());}\n catch (Exception e) {System.out.println (\"\\n*** other Exception caught ***\\n\");}\n }", "public void dropDatabase(String dbName) throws Exception;", "void deleteReservation(int id) throws DataAccessException;", "public int Delbroker(Long broker_id, String firstname, String lastname,\r\n\t\tString address, String gender, String eMail, Long phone,\r\n\t\tString experience) throws SQLException {\n\tint i=DbConnect.getStatement().executeUpdate(\"delete from broker where broker_id=\"+broker_id+\"\");\r\n\treturn i;\r\n}", "@Override\n\tpublic void execute(HttpServletRequest req, HttpServletResponse res) throws Exception {\n\t\tSystem.out.println(\"DeleteRegisterAction의 execute()...\");\n\t\tString snum = req.getParameter(\"snum\");\n\t\tif (snum == null || snum.trim().isEmpty()) {\n\t\t\tthis.setViewPage(CommonUtil.addMsgBack(req, \"잘못된 경로입니다.\"));\n\t\t\tthis.setRedirect(false);\n\t\t}\n\n\t\tStudentDAOMyBatis dao = new StudentDAOMyBatis();\n\n\t\tint n = dao.deleteRest(snum);\n\t\tthis.setViewPage(\"checkregisterRest.do\");\n\t\tthis.setRedirect(true);\n\t}", "@Test\n public void deleteTest() throws SQLException {\n manager = new TableServizioManager(mockDb);\n manager.delete(1);\n Servizio servizio= manager.retriveById(1);\n assertNull(servizio,\"Should return true if delete Servizio\");\n }", "@Test\n public void delete() {\n try{\n repo.save(s);\n repot.save(t);\n repon.save(n);\n Tema t2 = new Tema(2, 0, 6, \"GUI\");\n Student s2 = new Student(2,221, \"Pop Ion\",\"[email protected]\",\"prof\");\n Nota n2 = new Nota(2,2,\"prof\", 3, \"cv\");\n repo.save(s2);\n repot.save(t2);\n repon.save(n2);\n repot.delete(2);\n repo.delete(2);\n repon.delete(\"22\");\n assert repo.size() == 1;\n assert repot.size() == 1;\n assert repon.size() == 1;\n }\n catch (ValidationException e){\n }\n }", "public void elimina(DTOAcreditacionGafetes acreGafete) throws Exception;", "public Integer DeletarTodos(){\n\n //REMOVENDO OS REGISTROS CADASTRADOS\n return databaseUtil.GetConexaoDataBase().delete(\"tb_log\",\"log_ID = log_ID\",null);\n\n }", "@Override\n\tpublic boolean delete( String uname,String upasswords,int rid) throws RemoteException{\n\t\tboolean result=false;\n\t\tif(uname!=null&upasswords!=null&rid>0){\n\t\t\ttry{\n\t\t\tConnection con1=jdbcconnect.connnect();\n\t\t\tString sql1=\"select upasswords from users where uname='\"+uname+\"'\";\n\t\t\t//System.out.println(sql1);\n\t\t\tStatement st1=con1.createStatement();\n\t\t\tResultSet res= st1.executeQuery(sql1);//\n\t\t\t//System.out.println(\"there is not exe\");\n\t\t\tres.next();\n\t\t\tString upws=res.getString(\"upasswords\");\n\t\t\t//System.out.println(upws);\n\t\t\tres.close();\n\t\t\tst1.close();\n\t\t\tcon1.close();\n\t\t\tjdbcconnect.jdbcclose();\n\t\t\tif(upasswords.equals(upws)){\n\t\t\t\tString sql=\"delete from records where rid=\"+rid;\n\t\t\t\tString sqlmember=\"delete from members where rid=\"+rid;\n\t\t\t\t\tConnection conn=jdbcconnect.connnect();\n\t\t\t\tStatement stmt;\n\t\t\t\tSystem.out.println(sql);\n\t\t\t\tSystem.out.println(sqlmember);\n\t\t\t\tstmt=conn.createStatement();\n\t\t\t\tif(stmt.executeUpdate(sqlmember)>0) {\n\t\t\t\t\tif(stmt.executeUpdate(sql)>0){System.out.println(\"delete succeed!\");result= true;}\n\t\t\t\t}\n\t\t\t\telse System.out.println(\"fail to delete!\");\n\t\t\t\tstmt.close();\n\t\t\t\tjdbcconnect.jdbcclose();\n\t\t\t\t}\n\t\t\t}catch(Exception e){System.out.println(e);}\n\t\t}\n\t\treturn result;\n\t}", "public int deletePack(String name)\n {\n dbObj=new dbFlashCards(userId);\n \n return dbObj.deletePack(name);\n \n \n }", "@Override\n\tpublic void doDelete(String product) throws SQLException {\n\t\t\n\t}", "@Override\r\n\tpublic void delete(Plant plant) throws Exception {\n\r\n\t}", "public int delete( Integer idConge ) ;", "@Override\r\n\tpublic void delete(TQssql sql) {\n\r\n\t}", "public void dropUser(String userName) throws Exception;", "public void testDelete() {\n\t\ttry {\n\t\t\tServerParameterTDG.create();\n\n\t\t\t// insert\n\t\t\tServerParameterTDG.insert(\"paramName\", \"A description\", \"A value\");\n\t\t\t// delete\n\t\t\tassertEquals(1, ServerParameterTDG.delete(\"paramName\"));\n\t\t\t\t\n\t\t\tServerParameterTDG.drop();\n\t\t} catch (SQLException e) {\n\t\t\te.printStackTrace();\n\t\t\tfail();\t\n\t\t} finally {\n\t\t\ttry {\n\t\t\t\tServerParameterTDG.drop();\n\t\t\t} catch (SQLException e) {\n\t\t\t}\n\t\t}\n\t}", "public void deleteByName(String nume) {\n\t\tConnection connection = null;\n\t\tPreparedStatement st = null;\n\t\tString query = deleteQuery(\"nume\");\n\t\ttry {\n\t\t\tconnection = ConnectionFactory.createCon();\n\t\t\tst = connection.prepareStatement(query);\n\t\t\tst.setString(1, nume);\n\t\t\tst.executeUpdate();\n\t\t}catch(SQLException e) {\n\t\t\tLOGGER.fine(type.getName() + \"DAO:deleteByName\" + e.getMessage());\n\t\t}\n\t}", "private void Drop(String[]p){\n List<DeputyTableItem> dti;\n dti = Drop1(p);\n for(DeputyTableItem item:dti){\n deputyt.deputyTable.remove(item);\n }\n }", "@Override\r\n\tpublic void delete(String kodeDetail) {\n\t\tString query = \"delete from TR_DETAIL_PENJUALAN where kode_detail=?\";\r\n\t\tConnection con = null;\r\n\t\tPreparedStatement ps = null;\r\n\t\ttry {\r\n\t\t\tcon = dataSource.getConnection();\r\n\t\t\tps = con.prepareStatement(query);\r\n\t\t\tps.setString(1, kodeDetail);\r\n\r\n\t\t\tint out = ps.executeUpdate();\r\n\t\t\tif (out != 0) {\r\n\t\t\t\tSystem.out.println(\"delete berhasil\");\r\n\t\t\t} else {\r\n\t\t\t\tSystem.out.println(\"not found\");\r\n\t\t\t}\r\n\t\t} catch (SQLException e) {\r\n\t\t\t// TODO: handle exception\r\n\t\t\te.printStackTrace();\r\n\t\t} finally {\r\n\t\t\ttry {\r\n\t\t\t\tps.close();\r\n\t\t\t\tcon.close();\r\n\t\t\t} catch (SQLException e) {\r\n\t\t\t\t// TODO: handle exception\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "@Override\r\n public int deptDelete(int dept_seq) {\n return sqlSession.delete(\"deptDAO.deptDelete\", dept_seq);\r\n }", "public void deleteExempleDirect(ExempleDirect exempleDirect) throws DaoException;", "@Test\n public void cleanWithRecycleBin() throws Exception {\n assertEquals(0, recycleBinCount());\n\n // in SYSTEM tablespace the recycle bin is deactivated\n jdbcTemplate.update(\"CREATE TABLE test_user (name VARCHAR(25) NOT NULL, PRIMARY KEY(name)) tablespace USERS\");\n jdbcTemplate.update(\"DROP TABLE test_user\");\n assertTrue(recycleBinCount() > 0);\n\n flyway.clean();\n assertEquals(0, recycleBinCount());\n }", "public void deleteFoodBill(Bill deleteFood) {\nString sql =\"DELETE FROM bills WHERE Id_food = ?\";\n\t\n\ttry {\n\t\tPreparedStatement preparedStatement = ConnectionToTheBase.getConnectionToTheBase().getConnection().prepareStatement(sql);\n\t\tpreparedStatement.setInt(1, deleteFood.getId());\n\t\tpreparedStatement.execute();\n\t} catch (SQLException e) {\n\t\t// TODO Auto-generated catch block\n\t\te.printStackTrace();\n\t}\n\t\n}", "int deleteByPrimaryKey(PersonRegisterDo record);", "public void eliminar(String sentencia){\n try {\n Statement stmt = Conexion.getInstancia().createStatement();\n stmt.executeUpdate(sentencia);\n }\n catch (Exception ex){\n ex.printStackTrace();\n }\n }", "@Override\n\tpublic int delete(String name) {\n\t\treturn super.getJdbcTemplate().update(\"DELETE FROM GOODSINFO WHERE NAME=?\", new Object[] { name });\n\t}", "public int Rejbr(Long broker_id) throws SQLException {\n\tint i=DbConnect.getStatement().executeUpdate(\"delete from login where login_id=\"+broker_id+\"\");\r\n\treturn i;\r\n\t\r\n}", "@Override\r\n\tpublic boolean pdsdelete(int seq) {\n\t\treturn pdsdao.pdsdelete(seq);\r\n\t}", "int deleteByPrimaryKey(String depCode);", "public int Rejectuser(Long id) throws SQLException {\n\tint i=DbConnect.getStatement().executeUpdate(\"delete from login where loginid=\"+id+\"\");\r\n\treturn i;\r\n\r\n}", "public void drop(Connection db, boolean dropSequence) throws SQLException {\n Statement st = db.createStatement();\n\n //drop the table\n st.executeUpdate(\"DROP TABLE \" + tableName);\n\n if (dbType == DatabaseUtils.POSTGRESQL) {\n if (hasSequence() && dropSequence) {\n //TODO: Not all versions of postgres supported by centric, supports IF EXISTS. Need a better solution\n //drop the sequence\n st.executeUpdate(\"DROP SEQUENCE IF EXISTS \" + sequenceName);\n }\n }\n st.close();\n }", "public void removeFromLab(String lid) throws SQLException {\r\n\t\t\tthis.stmt=this.conn.createStatement();\r\n\t\t\t\r\n\t\t\tString deleteQuery=\"delete from \"+Subject.LAB_INFO_TABLE_NAME+\" where \"+Subject.LAB_ID+\"='\"+lid+\"'\";\r\n\t\t\tint i=stmt.executeUpdate(deleteQuery);\r\n\t\t\t/*if(i>0)\r\n\t\t\t\tSystem.out.println(\"Removed-> \"+lid);\r\n\t\t\telse\r\n\t\t\t\tSystem.out.println(\"NotAvailabel-> \"+lid);*/\r\n\t\t\t\r\n\t\t\tstmt.close();\r\n\t\t}", "public void deletePortal(Connection dbConn, int id) throws Exception {\n Statement ps = null;\n try {\n String sql = \"delete from PORTAL where SEQ_ID=\" + id;\n ps = dbConn.createStatement();\n ps.executeUpdate(sql);\n } catch (Exception ex) {\n throw ex;\n } finally {\n T9DBUtility.close(ps, null, log);\n }\n }", "public Boolean deleteGroupSupplier(GroupSupplier sm){\n\t\tTblGroupSupplier tblsm = new TblGroupSupplier();\n\t\tSession session = HibernateUtils.getSessionFactory().openSession();\n\t\tTransaction tx = null;\n\t\ttry{\n\t\t\ttblsm.convertToTable(sm);\n\t\t\ttx = session.beginTransaction();\n\t\t\tsession.delete(tblsm);\n\t\t\ttx.commit();\n\t\t}catch(HibernateException e){\n\t\t\tSystem.err.println(\"ERROR IN LIST!!!!!!\");\n\t\t\tif (tx!= null) tx.rollback();\n\t\t\te.printStackTrace();\n\t\t\tsession.close();\n\t\t\tthrow new ExceptionInInitializerError(e);\n\t\t}finally{\n\t\t\tsession.close();\n\t\t}\n\t\treturn true;\n\t\t\n\t}", "@Override\n\tpublic void delete() {\n\t\tSystem.out.println(\"Mysql DB 서버에 접속해서 삭제를 하다.\");\n\t}", "@Override\r\n\tpublic int deleteDBInfo(AgentDBInfoVO vo){\n\t\treturn sqlSession.getMapper(CollectMapper.class).deleteDBInfo(vo);\r\n\t}", "int deleteByExample(AdminTabExample example);", "public abstract void drop();", "public void deleteRepairOrder(int rid) throws Exception {\r\n PreparedStatement stmt = null;\r\n try {\r\n stmt = conn.prepareStatement(\"delete from repairOrder where RID = ?\");\r\n //stmt.setInt(1, repairOrder.RID);\r\n stmt.setInt(1, rid);\r\n stmt.execute();\r\n } finally {\r\n conn.close(stmt, null);\r\n }\r\n }", "@Override\r\n public boolean delete(int opc) {\r\n Connection conexao = mysql.getConnection();\r\n try {\r\n PreparedStatement stm = conexao.prepareStatement(deleteSQL);\r\n\r\n stm.setInt(1, opc);\r\n\r\n int registros = stm.executeUpdate();\r\n\r\n return registros > 0 ? true : false;\r\n\r\n } catch (final SQLException ex) {\r\n System.out.println(\"Falha de conexão com a base de dados!\");\r\n ex.printStackTrace();\r\n } catch (final Exception ex) {\r\n ex.printStackTrace();\r\n } finally {\r\n try {\r\n conexao.close();\r\n } catch (final Exception ex) {\r\n ex.printStackTrace();\r\n }\r\n }\r\n return false;\r\n }", "private static boolean transactionDeleteGame(Transaction tx, String name) {\n HashMap<String, Object> parameters = new HashMap<>();\n parameters.put(\"name\", name);\n List<ArticleBean> articleDelete = new ArrayList<>();\n\n //Elimino il gruppo, con tutti i suoi post, be_part, referred\n String eliminaGroups = \"MATCH (gr:Group)-[:REFERRED]->(g:Game{name:$name})\" +\n \" DETACH DELETE gr\";\n //Elimino il gioco e tutto quello che è collegato ad esso\n String eliminaTutto = \"MATCH (g:Game{name:$name}) \" +\n \" DETACH DELETE g\";\n\n tx.run(eliminaGroups, parameters);\n tx.run(eliminaTutto, parameters);\n\n return true;\n }", "@Delete({\n \"delete from t_address\",\n \"where addrid = #{addrid,jdbcType=VARCHAR}\"\n })\n int deleteByPrimaryKey(String addrid);", "public void deleteScelle(long numeroScelle){\n\t\t\n\t}", "@Override\n\tpublic void deleteGerant(Gerant g) {\n\t\t\n\t}", "@Override\r\n\tpublic void delete() {\n\t\tString delete=\"DELETE FROM members WHERE id =?\";\r\n\t\t try(Connection connection=db.getConnection();) {\r\n\t\t\t\t\r\n\t\t\t\tpreparedStatement=connection.prepareStatement(delete);\r\n\t\t\t\tpreparedStatement.setString(1, super.getIdString());\r\n\t\t \tpreparedStatement.executeUpdate();\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Transaction successful\");\r\n\t\t\t\t\r\n\t\t\t} catch (Exception e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t\tJOptionPane.showMessageDialog(null, \"Something went wrong\");\r\n\t\t\t}\r\n\t}" ]
[ "0.6399673", "0.6344634", "0.62025625", "0.6200621", "0.6101256", "0.60913205", "0.60404027", "0.6026072", "0.601378", "0.59857225", "0.5975297", "0.59631133", "0.5937346", "0.5907329", "0.588723", "0.58698785", "0.58698785", "0.5863771", "0.58526", "0.5849639", "0.5842922", "0.58315945", "0.58226866", "0.5822281", "0.5821108", "0.5814407", "0.5812167", "0.5805016", "0.58041126", "0.57943726", "0.5793984", "0.579358", "0.5789028", "0.5786081", "0.57853556", "0.57840955", "0.57788575", "0.5773638", "0.5771265", "0.5770763", "0.576756", "0.57529354", "0.57435536", "0.5736423", "0.5730984", "0.57257", "0.5703114", "0.57016456", "0.5699733", "0.5696747", "0.569259", "0.5686681", "0.5686186", "0.568193", "0.56799793", "0.56769", "0.5671888", "0.56648123", "0.5663132", "0.565778", "0.565477", "0.5654302", "0.56535465", "0.56525654", "0.56511503", "0.5649994", "0.56462556", "0.5642458", "0.56421465", "0.56416374", "0.5640609", "0.5640551", "0.56404996", "0.563986", "0.56336784", "0.5633203", "0.56326777", "0.56306416", "0.5628773", "0.56283015", "0.56107235", "0.5601113", "0.5599312", "0.55972034", "0.5596217", "0.5594346", "0.5580444", "0.5572386", "0.5571954", "0.55702865", "0.5570022", "0.5568408", "0.55663997", "0.5563972", "0.55614746", "0.5561353", "0.55610377", "0.5556563", "0.5556182", "0.5551264", "0.5550796" ]
0.0
-1
Called when there is a new intent or it is the first intent received
private void actUponIntent(Intent intent){ BusinessesFragmentViewModel model = ViewModelProviders.of(this).get(BusinessesFragmentViewModel.class); boolean isAdvancedSearchIntent = false; if(intent != null){ // Trying to see if we came from the advanced search activity and need to perform a search AdvancedSearchInput advancedSearchInput = intent.getParcelableExtra(ADVANCED_SEARCH_INPUT_KEY); if(advancedSearchInput != null){ // Indicating the list of businesses was loaded and there is no need to load all businesses isAdvancedSearchIntent = true; model.getAdvancedSearchBusinesses(advancedSearchInput).observe(this, new Observer<List<Business>>() { @Override public void onChanged(@Nullable List<Business> businesses) { //Toast.makeText(getApplicationContext(),"onChanged from search", Toast.LENGTH_SHORT).show(); } }); } } // The intent is not advanced search intent if(!isAdvancedSearchIntent){ // Loading all businesses model.getAllBusinesses().observe(this, new Observer<List<Business>>() { @Override public void onChanged(@Nullable List<Business> businesses) { //Toast.makeText(getApplicationContext(),"onChanged from all", Toast.LENGTH_SHORT).show(); } }); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public void onNewIntent(Intent intent) {\n setIntent(intent);\n handleIntent(intent);\n }", "@Override\n public void onNewIntent(Intent intent) {\n setIntent(intent);\n }", "@Override\n public void onNewIntent(Intent intent) {\n setIntent(intent);\n }", "@Override\n public void onNewIntent(Intent intent) {\n setIntent(intent);\n }", "public void onNewIntent(Intent intent) {\n super.onNewIntent(intent);\n handleIntent(intent);\n }", "@Override\n\tpublic void onNewIntent(Intent intent) {\n\t\tsetIntent(intent);\n\t}", "@Override\r\n public void onNewIntent(Intent intent){\r\n super.onNewIntent(intent);\r\n\r\n //changes the intent returned by getIntent()\r\n setIntent(intent);\r\n }", "@Override\n protected void onNewIntent(Intent intent){\n handleIntent(intent);\n }", "@Override\n protected void onNewIntent(Intent intent) {\n super.onNewIntent(intent);\n handleIntent(intent);\n }", "public void onNewIntent(Intent intent) {\n }", "@Override\n\tprotected void onNewIntent(Intent intent) {\n\t\tsuper.onNewIntent(intent);\n\t\tsetIntent(intent);\n\t}", "@Override\n public void onNewIntent(Intent intent) {\n }", "@Override\n protected void onNewIntent(Intent intent) {\n }", "@Override\n protected void onNewIntent(Intent intent) {\n super.onNewIntent(intent);\n Log.e(TAG, \"onNew Intent \" + this.getClass().getName());\n }", "@Override\n public void onNewIntent(Activity activity, Intent data) {\n }", "public void onNewIntent(Intent intent) {\n this.eventDelegate.onNewIntent(intent);\n }", "public void onNewIntent(Intent intent) {\n super.onNewIntent(intent);\n initParams(intent);\n }", "@Override\r\nprotected void onNewIntent(Intent intent) {\n\tsuper.onNewIntent(intent);\r\nSystem.out.println(\"onNewIntent\");\r\n}", "@Override\r\n\tprotected void onNewIntent(Intent intent) {\n\t\tXSDK.getInstance().onNewIntent(intent);\r\n\t\tsuper.onNewIntent(intent);\r\n\t}", "@Override\n\t\t\t\tpublic void onNewIntent(TiRootActivity activity, Intent intent)\n\t\t\t\t{\n\t\t\t\t\tTiActivity.this.onNewIntent(intent);\n\t\t\t\t}", "public void onNewIntent(Intent intent) {\n AppMethodBeat.m2504i(16653);\n super.onNewIntent(intent);\n setIntent(intent);\n if (this.ggF != null) {\n this.ggF.dismiss();\n this.ggF = null;\n }\n if (!anB()) {\n finish();\n }\n AppMethodBeat.m2505o(16653);\n }", "public void intentHandler() {\n Intent intent = getIntent();\n if (intent.hasExtra(\"DATA\")) {\n data = (String[]) getIntent().getSerializableExtra(\"DATA\");\n recievedPosition = (int) getIntent().getSerializableExtra(\"POS\");\n if(recievedPosition != 0){\n IOException e = new IOException();\n try {\n itemArrAdapt.updateItem(recievedPosition, data, e);\n this.setPrefs();\n } catch (IOException e1) {\n e1.printStackTrace();\n }\n }\n } else {\n // Start Normal\n }\n }", "public void onNewIntent(Intent intent) {\n C0938a.m5002a(\"SR/SoundRecorder\", \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~onNewIntent\");\n m6632c(intent);\n }", "@Override \n protected void onNewIntent(Intent intent) {\n super.onNewIntent(intent); \n \n initData();\n }", "@Override\r\n\tprotected void onNewIntent(Intent intent) {\n\t\tUtils.printLog(TAG, \"onNewIntent\");\r\n\t\tif (!getPlayList(intent)) {\r\n\t\t\texitPlayforNoPlayList();\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\tif (mVideoContrl != null && mVideoContrl.isFinishInit()) {\r\n\t\t\tmVideoContrl.setFinishInit(false);\r\n\t\t\tisOnNewIntent = true;\r\n\t\t\tmVideoContrl.releaseMediaPlayer();\r\n\t\t}\r\n\t\tsuper.onNewIntent(intent);\r\n\t\tUtils.printLog(TAG, \"onNewIntent end\");\r\n\t}", "@Override\n protected void onNewIntent(Intent intent) {\n super.onNewIntent(intent);\n System.out.println(\"Has Match Status : One \");\n if (intent.hasExtra(\"matchStatus\")){\n System.out.println(\"Has Match Status : Two \");\n sessionManager.setRefreshChatFragment(true);\n viewPager.setCurrentItem(2,true);\n }\n }", "@Override\n\tprotected void onNewIntent(Intent intent)\n\t{\n\t\tif (checkIntentForSearch(intent))\n\t\t\tfillData();\n\t}", "public void onNewIntent(Intent intent) {\n AppMethodBeat.i(79441);\n super.onNewIntent(intent);\n setIntent(intent);\n if (this.ggF != null) {\n this.ggF.dismiss();\n this.ggF = null;\n }\n aVh();\n AppMethodBeat.o(79441);\n }", "protected void onNewIntent(android.content.Intent intent) {\n java.lang.String referrer = intent.getStringExtra(\"referrer\");\n android.util.Log.d(\"TRACKING\", \"Reffff: \" + referrer);\n android.content.Intent i = new android.content.Intent();\n i.setAction(\"RRR_AAA_FFF\");\n i.putExtra(\"r\", referrer);\n this.context.sendBroadcast(i);\n super.onNewIntent(intent);\n }", "private void handleIntent(Intent intent, boolean isOnNewIntent) {\n handleIntent(intent.getAction(), intent.getExtras(), intent.getData(), isOnNewIntent);\n }", "@Override\n\tprotected void onHandleIntent(Intent arg0) {\n\t\t\n\t}", "@Override\n\tprotected void onHandleIntent(Intent intent) {\n\n\t}", "@Override\n protected void onHandleIntent(Intent intent) {\n\n }", "@Override\n\tprotected void onNewIntent(Intent intent) {\n\t\tsuper.onNewIntent(intent);\n\t\tToast.makeText(MainActivity.this, \"player\", Toast.LENGTH_SHORT).show();\n\t}", "@Override\n protected void onNewIntent(Intent intent) {\n Log.d(TAG, getString(R.string.debug_key) + \"TagWriter intent filter success\");\n this.setIntent(intent);\n }", "void intentHasBeenReceivedThroughTheBroadCast(Intent intent);", "@Override\r\n\tpublic void onCreate(Bundle savedInstanceState) {\r\n\t\tsuper.onCreate(savedInstanceState);\r\n\r\n\t\thandleIntent(getIntent());\r\n\t}", "@Override\n\tpublic void onNewIntent(Intent intent) {\n\t\tsuper.onNewIntent(intent);\n\t\tfinal Uri uri = intent.getData();\n\t\tpreferencias = this.getSharedPreferences(\"TwitterPrefs\", MODE_PRIVATE);\n\t\n\t\tif (uri != null && uri.toString().indexOf(TwitterData.CALLBACK_URL) != -1) {\n\t\t\tLog.i(\"MGL\", \"Callback received : \" + uri);\n\t\t\n\t\t\tnew RetrieveAccessTokenTask(this, getConsumer(), getProvider(),\n\t\t\t\t\tpreferencias).execute(uri);\n\t\t}\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n intent = getIntent();\n }", "private void handleIntent(Intent intent) {\n if (intent == null) {\n return;\n }\n\n // read intent\n String action = intent.getAction();\n Uri launchUri = intent.getData();\n\n // if app was not launched by the url - ignore\n if (!Intent.ACTION_VIEW.equals(action) || launchUri == null) {\n Log.d(TAG, \"launchUri is null or action != VIEW\");\n return;\n }\n\n\n // store message and try to consume it\n storedEvent = createEventFromUrl(launchUri);\n tryToConsumeEvent();\n }", "private void handleIntent() {\n // Get the intent set on this activity\n Intent intent = getIntent();\n\n // Get the uri from the intent\n Uri uri = intent.getData();\n\n // Do not continue if the uri does not exist\n if (uri == null) {\n return;\n }\n\n // Let the deep linker do its job\n Bundle data = mDeepLinker.buildBundle(uri);\n if (data == null) {\n return;\n }\n\n // See if we have a valid link\n DeepLinker.Link link = DeepLinker.getLinkFromBundle(data);\n if (link == null) {\n return;\n }\n\n // Do something with the link\n switch (link) {\n case HOME:\n break;\n case PROFILE:\n break;\n case PROFILE_OTHER:\n break;\n case SETTINGS:\n break;\n }\n\n String msg;\n long id = DeepLinker.getIdFromBundle(data);\n if (id == 0) {\n msg = String.format(\"Link: %s\", link);\n } else {\n msg = String.format(\"Link: %s, ID: %s\", link, id);\n }\n\n Toast.makeText(this, msg, Toast.LENGTH_LONG).show();\n }", "@Override\n protected void onHandleIntent(Intent workIntent) {\n }", "@Override\r\n public void onNewIntent(Intent intent){\r\n \t\r\n \tthis.activateExamBoard(intent);\r\n }", "@Override\r\n\tprotected void onNewIntent(Intent intent) {\n\t\tsuper.onNewIntent(intent);\r\n\t\tboolean isNotifHandeled = MyNotification.handleNotificationIfNeeded(this, intent);\r\n\t\tif(isNotifHandeled){\r\n\t\t\tmHomeFragment.getCardDetails(false);\r\n\t\t}\r\n\t}", "public void onNewIntent(Intent intent) {\n NetworkDiagnosticsActivity.super.onNewIntent(intent);\n this.mFrom = getIntent().getStringExtra(EXTRA_FROM);\n }", "@Override\n public boolean activityStarting(Intent intent, String pkg) throws RemoteException {\n Log.i(TAG, String.format(\"Starting %s in package %s\", intent, pkg));\n currentPackage = pkg;\n currentIntent = intent;\n return true;\n }", "@Override\n protected void onNewIntent(Intent intent) {\n super.onNewIntent(intent);\n //get the retrieved data\n Uri twitURI = intent.getData();\n //make sure the url is correct\n if (twitURI != null && twitURI.toString().startsWith(TWIT_URL)) {\n //is verifcation - get the returned data\n String oaVerifier = twitURI.getQueryParameter(\"oauth_verifier\");\n new RetrieveAuthData().execute(oaVerifier);\n }\n }", "@Override\r\n\tprotected void onNewIntent(Intent intent) {\n\t\tsuper.onNewIntent(intent);\r\n\t\tString message = intent.getStringExtra(PARAM_NAME_CALLER_MESSAGE);\r\n\t\t\r\n\t\tmessageView.setText(\"onNewIntent : caller message - \" + message + \"\\n\"\r\n\t\t\t\t+ \"activity \" + this.toString());\r\n\t}", "public void updateIntent(Intent intent) {\n clear();\n\n if (mContext == null || intent == null || !Intent.ACTION_VIEW.equals(intent.getAction())) {\n return;\n }\n\n mIsCustomTabIntent = LaunchIntentDispatcher.isCustomTabIntent(intent);\n boolean checkIsToChrome = true;\n // All custom tabs VIEW intents are by design explicit intents, so the presence of package\n // name doesn't imply they have to be handled by Chrome explicitly. Check if external apps\n // should be checked for handling the initial redirect chain.\n if (mIsCustomTabIntent) {\n boolean sendToExternalApps = IntentUtils.safeGetBooleanExtra(intent,\n CustomTabIntentDataProvider.EXTRA_SEND_TO_EXTERNAL_DEFAULT_HANDLER, false);\n checkIsToChrome = !(sendToExternalApps\n && ChromeFeatureList.isEnabled(ChromeFeatureList.CCT_EXTERNAL_LINK_HANDLING));\n }\n\n if (checkIsToChrome) mIsInitialIntentHeadingToChrome = isIntentToChrome(mContext, intent);\n\n // A copy of the intent with component cleared to find resolvers.\n mInitialIntent = new Intent(intent).setComponent(null);\n Intent selector = mInitialIntent.getSelector();\n if (selector != null) selector.setComponent(null);\n }", "@Override\n\tprotected void onHandleIntent(Intent intent) {\n\t\tConnectivityManager cm = (ConnectivityManager)getSystemService(Context.CONNECTIVITY_SERVICE);\n\t\t\n\t\t@SuppressWarnings(\"deprecation\")\n\t\t// getBackgroundDataSetting check for older versions of Android\n\t\tboolean isNetworkAvailable = cm.getBackgroundDataSetting() && cm.getActiveNetworkInfo() != null;\n\t\tif (!isNetworkAvailable) return;\n\t\t\n\t\tLog.i(TAG, \"Received an intent: \" + intent);\n\t\t\n\t\tSharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(this);\n\t\tString query = prefs.getString(FlickrFetchr.PREF_SEARCH_QUERY, null);\n\t\tString lastResultId = prefs.getString(FlickrFetchr.PREF_LAST_RESULT_ID, null);\n\t\t\n\t\tArrayList<GalleryItem> items;\n\t\tif (query != null) {\n\t\t\titems = new FlickrFetchr().search(query);\n\t\t} else {\n\t\t\titems = new FlickrFetchr().fetchItems(1);\n\t\t}\n\t\t\n\t\tif (items.size() == 0)\n\t\t\treturn;\n\t\t\n\t\tString resultId = items.get(0).getmId();\n\t\t\n\t\tif (!resultId.equals(lastResultId)) {\n\t\t\tLog.i(TAG, \"Got a new result: \" + resultId);\n\t\t} else {\n\t\t\tLog.i(TAG, \"Got an old result: \" + resultId);\n\t\t}\n\t\t\n\t\tprefs.edit()\n\t\t\t.putString(FlickrFetchr.PREF_LAST_RESULT_ID, resultId)\n\t\t\t.commit();\n\t}", "void startNewActivity(Intent intent);", "@Override\n public void onRebind(Intent intent) {\n Log.d(TAG, TAG + \" onRebind\");\n }", "protected void onFirstTimeLaunched() {\n }", "private void handleIntent() {\n\t\tif (getIntent() != null && getIntent().getAction() != null) {\n\t\t\tif (getIntent().getAction().equals(Intent.ACTION_SEARCH)) {\n\t\t\t\tLog.d(\"MainActivityantivirus\", \"Action search!\");\n\t\t\t\tif (mCurrentFragmentType == NavigationElement.TYPE_APPS) {\n\t\t\t\t\tfinal String query = getIntent().getStringExtra(SearchManager.QUERY);\n\t\t\t\t\tif (query != null) {\n\t\t\t\t\t\t((AppsFragment) mCurrentFragment).onSearch(query);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void openNextActivity(Intent intent) {\n\n String message = intent.getStringExtra(\"phase\");\n\n Log.d(\"STATE\", \"Waiting activity, phase is -> \" + message );\n if(message != null) {\n if (message.equals(\"USER_JOINED\")) { //TODO: This should be for ready to vote.\n Log.d(\"STATE\", \"Waiting activity, USER JOINED\" );\n\n Intent i = new Intent(this, VoteActivity.class);\n startActivity(i);\n } else if (message.equals(\"result\")) { //TODO: Change this to the new \"phase\" value\n Log.d(\"STATE\", \"Waiting activity. Meadle is ready\" );\n //Notification has been received that alerts meadle is complete\n MeadleDataManager.setHasResult(this);\n\n Intent i = new Intent(this, ResultsActivity.class);\n startActivity(i);\n } else if(message.equals(\"VOTING_FINISHED\")){\n Log.d(\"Votiing Finished\",intent.getExtras().toString());\n Intent i = new Intent(this,MeetingPointActivity.class);\n i.putExtras(intent.getExtras());\n startActivity(i);\n }\n }\n }", "@Override\r\n public void onRebind(Intent intent) {\r\n\r\n }", "void onCreate(Intent intent);", "@Override\n public void handleNewIntent(Intent intent) {\n if (!mUi.isWebShowing()) {\n mUi.showWeb(false);\n }\n mIntentHandler.onNewIntent(intent);\n }", "@Override\n public List<ReportingMessage> onActivityCreated(Activity activity, Bundle bundle) {\n merchant.trackIncomingIntent(applicationContext, activity.getIntent());\n return null;\n }", "@Override\n public void onMessageReceived(MessageEvent messageEvent) {\n if (messageEvent.getPath().equals(START_ACTIVITY_PATH)) {\n // Create intent and start activity\n Intent startIntent = new Intent(this, MainActivity.class); // Intent to main activity\n startIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); // Does not start new Activity just brings it to front\n startActivity(startIntent); // Start activity\n\n // Send confirmation message back to the node\n Wearable.getMessageClient(this).sendMessage(messageEvent.getSourceNodeId(), ACTIVITY_STARTED_PATH,\n null);\n }\n }", "@Override\n\t\tpublic void onReceive(Context context, Intent intent) {\n\t\t\tSystem.out.println(\"instakk\");\n\t\t}", "@Override\n\tpublic void onReceive(Context context, Intent intent) {\n\t\tif (intent.getAction() != null) {\n\t\t\tif ( intent.getAction().equals(Intent.ACTION_USER_PRESENT)) {\n\t\t\t\tIntent s = new Intent(context, FdActivity.class);\n\t\t\t\ts.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\n\t\t\t\tcontext.startActivity(s);\n\t\t\t}\n\t\t}\n\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\tonIntentClass(activity, MainActivity.class, true);\n\t\t\t}", "void mo21580A(Intent intent);", "@Override\n protected void onNewIntent(Intent intent){\n\n //If the new intent matches the filtered NFC intent, read in the tag's raw data.\n if(NfcAdapter.ACTION_TAG_DISCOVERED.equals(intent.getAction())) {\n mytag = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);\n //Display a visible notification showing the object has been found.\n Toast.makeText(this, \"Object Found.\", Toast.LENGTH_LONG).show();\n\n //If the new story is ready to be written\n if (newStoryReady) {\n\n //Initialize success boolean which returns true only if the nfc interaction has been successful\n boolean success = false;\n success = nfcInteraction.doWrite(mytag, tag_data);\n\n //If the nfc write process has succeeded, take the following action\n if (success) {\n\n //Return the value of newStoryReady to false as current ready story has been written\n newStoryReady = false;\n //Stop the clickability of the current range of image views\n disableViewClickability();\n //Stop any active commentary\n commentaryInstruction.stopPlaying();\n //Cancel idleSaveStoryToArchiveHandler which automatically saves the current story to the archive\n cancelIdleStoryCountdown();\n //Reset the camera to a new preview\n resetCamera();\n //Release current camera instance\n releaseCamera();\n// nfcInteraction.Complete(success);\n //Complete the process by navigating to back to HomeScreen activity which will play the new story\n Complete(success);\n } else {\n\n newStoryReady = true;\n }\n }\n }\n }", "public void onIntentReceived(final String payload) {\n this.WriteLine(\"--- Intent received by onIntentReceived() ---\");\n this.WriteLine(payload);\n this.WriteLine();\n }", "private void getIncomingIntent()\n {\n if(getIntent().hasExtra(\"Title\")\n && getIntent().hasExtra(\"Time\")\n && getIntent().hasExtra(\"Date\")\n && getIntent().hasExtra(\"Duration\")\n && getIntent().hasExtra(\"Location\")\n && getIntent().hasExtra(\"EventDetails\"))\n {\n Title = getIntent().getStringExtra(\"Title\");\n Time = getIntent().getStringExtra(\"Time\");\n Date = getIntent().getStringExtra(\"Date\");\n Duration = getIntent().getStringExtra(\"Duration\");\n Location = getIntent().getStringExtra(\"Location\");\n EventDetails = getIntent().getStringExtra(\"EventDetails\");\n\n setData(Title,Time,Date,Duration,Location,EventDetails);\n }\n }", "@Override\n public void run() {\n startActivity(intent);\n }", "@Override\n public void onRebind(Intent intent) {\n // TODO: Return the communication channel to the service.\n if(org.mcopenplatform.muoapi.BuildConfig.DEBUG)Log.d(TAG,\"onRebind\");\n if(startIntent != null){\n intent=startIntent;\n }\n engine.newClient(intent,this,true);\n }", "@Override\n\tprotected void onResume() {\n\t\tsuper.onResume();\n\t\tIntent intent = getIntent();\n\t\tif (intent != null) {\n\t\t\tif (action == null) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif (action.equals(ACTION_NEWS)) {\n\n\t\t\t} else if (action.equals(ACTION_FORM)) {\n\t\t\t\tintent.setClass(this, BalanceActivity.class);\n\t\t\t\tintent.putExtra(BalanceActivity.META_TYPE, id);\n\t\t\t\tintent.setAction(BalanceActivity.ACTION_PUSH);\n\t\t\t\tstartActivity(intent);\n\t\t\t}\n\t\t}\n\t\tfinish();\n\t}", "private void handleIntent(Intent intent) {\n\t\t// TODO Auto-generated method stub\n\t\tif (Intent.ACTION_VIEW.equals(intent.getAction())) {\n\t\t\tIntent paintingIntent = new Intent(this, PaintingActivity.class);\n\t\t\tpaintingIntent.setData(intent.getData());\n\t\t\tstartActivity(paintingIntent);\n\t\t} else if (Intent.ACTION_SEARCH.equals(intent.getAction())) {\n\t\t\tString query = intent.getStringExtra(SearchManager.QUERY);\n\t\t\tLog.v(\"Debug\", \"Search started\");\n\t\t\tshowResults(query);\n\t\t}\n\t}", "@Override\n\tprotected void getIntentData(Bundle savedInstanceState) {\n\n\t}", "public void onNewIntent(Intent intent) {\n ArrayList<Object> blaubotComponents = new ArrayList<>();\n blaubotComponents.addAll(getAdapters());\n blaubotComponents.addAll(getConnectionStateMachine().getBeaconService().getBeacons());\n for(Object component : blaubotComponents) {\n if (component instanceof IBlaubotAndroidComponent) {\n final IBlaubotAndroidComponent androidComponent = (IBlaubotAndroidComponent) component;\n androidComponent.onNewIntent(intent);\n }\n }\n }", "@Override\r\n\tprotected void onNewIntent(Intent intent) {\n\t\tsuper.onNewIntent(intent);\r\n\t\t\r\n//\t\tinputUtil = new InputUtil(iv_sign, layout_footer_scan, layout_footer);\r\n\t\tsetUI();\r\n\t\tinitData();\r\n\t}", "@Override\n\t\tpublic void onReceive(Context context, Intent intent) {\n\t\t}", "@Override\n\tpublic void onReceive(Context context, Intent intent) {\n\t\tsuper.onReceive(context, intent);\n\n\t\tLog.d(TAG, \"onReceive==============>\");\n\t\t\n\t\tif (intent.getAction().equals(CLICK_ACTION)) {\n\t\t\tToast.makeText(context, \"OK!!!!!\", Toast.LENGTH_LONG).show();\n\n\t\t\t// final Intent intent2 = new Intent(context, MainActivity.class);\n\t\t\t// intent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t\t// context.startActivity(intent2);\n\n\t\t\tIntent intent2 = new Intent(Intent.ACTION_MAIN);\n\t\t\tintent2.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n\t\t\tintent2.putExtra(\"scene\", \"news\");\n\t\t\tComponentName cn = new ComponentName(\"com.youhao.DoctorOnline\",\n\t\t\t\t\t\"com.youhao.DoctorOnline.DoctorOnlineActivity\");\n\t\t\tintent2.setComponent(cn);\n\t\t\tcontext.startActivity(intent2);\n\n\t\t\t// Intent intent1 = new\n\t\t\t// Intent(\"com.example.helloandroidtest.start\");\n\t\t\t// context.startService(intent1);\n\t\t}\n\t}", "@Override\n public void onReceive(Context context, Intent intent) {\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n }", "@Override\n public IBinder onBind(Intent arg0) {\n intent=arg0;\n return null;\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n if (intent.getAction().equals(\"SELECTSTUDIO\")) {\n Studiotype startingstudio = Studiotype.valueOf(intent.getStringExtra(\"launchstudio\"));\n switch (startingstudio) {\n case RiskFactor:\n Intent i = new Intent(context, RiskFactor.class);\n i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(i);\n return;\n case Product:\n case Simulation:\n case Scenario:\n case Dashboard:\n Log.w(\"kek\", \"lololol unimplemented hohohoho\");\n return;\n default:\n Log.w(\"kek\", \"not even a choice bro\");\n return;\n }\n }\n }", "@Override\n public void startActivity(Intent intent) {\n startActivity(intent, null);\n }", "public void onButtonMyReceiverIntent(View view) {\n\n Intent myCustomIntent = new Intent(this, CustomIntent.class);\n startActivity(myCustomIntent);\n\n\n }", "public void getintent() {\n Intent intent = this.getIntent();\n acceptDetailsModel = (AcceptDetailsModel) intent.getSerializableExtra(\"menu_item\");\n }", "@Override\n protected void onHandleIntent(Intent intent) {\n Log.d(TAG, \"onHandleIntent()\");\n YambaClient yambaClient = YambaApplication.getYambaApp(this).getYambaClient();\n if (yambaClient == null) {\n Log.w(TAG, \"Ignoring request to refresh when the client is missing\");\n } else {\n this.maxCreatedAt = TimelineUtil.getStatusMaxCreatedAt(contentResolver);\n try {\n yambaClient.fetchFriendsTimeline(this);\n } catch (YambaClientException e) {\n Log.wtf(TAG, \"Failed to fetch timeline\", e);\n }\n }\n }", "@Override\n protected void onHandleIntent(Intent intent) {\n if (intent == null) {\n return;\n }\n final String action = intent.getAction();\n if (ACTION_SCHEDULE_NEXT_ALARM.equals(action)) {\n scheduleNextAlarm();\n } else if (ACTION_SCHEDULE_NEXT_RESET.equals(action)) {\n scheduleNextReset();\n } else if (ACTION_SCHEDULE_SNOOZE.equals(action)) {\n scheduleSnooze(intent.getIntExtra(EXTRA_SNOOZE_DURATION, 5));\n }\n }", "@Override\r\n public void onReceive(Context context, Intent intent) {\n Log.e(\"BROADCAST GOT\", intent.toString());\r\n\r\n Intent startLoginScreen = new Intent(context, MainActivity.class);\r\n Bundle b = intent.getExtras();\r\n if (b != null && !b.isEmpty())\r\n startLoginScreen.putExtras(b);\r\n\r\n startLoginScreen.putExtra(\"request\", intent.getAction());\r\n\r\n context.startActivity(startLoginScreen);\r\n\r\n }", "@Override\r\n\tpublic void onReceive(Context context, Intent intent) {\r\n\t}", "public static void m1a(Intent intent) {\n reciver(intent);\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n boolean entering = intent.getBooleanExtra(LocationManager.KEY_PROXIMITY_ENTERING, false);\n if (entering) {\n if (intent.getIntExtra(TAG_QUIZ_ID, -1) != Route.getCurrentQuizId()) return;\n\n if (!LocalBroadcastManager.getInstance(context).sendBroadcast(new Intent(NavigationActivity.ACTION_NOTIFY_ARRIVED_AT_WAYPOINT))) {\n Intent openQuizActivity = new Intent(context, QuizActivity.class);\n openQuizActivity.putExtra(QuizActivity.TAG_QUIZ_ID, Route.getCurrentQuizId());\n\n PendingIntent pendingIntent = TaskStackBuilder.create(context)\n .addNextIntentWithParentStack(openQuizActivity)\n .getPendingIntent(0, PendingIntent.FLAG_UPDATE_CURRENT);\n\n NotificationCompat.Builder builder = new NotificationCompat.Builder(context)\n .setSmallIcon(R.mipmap.ic_launcher)\n .setContentTitle(String.format(\n context.getResources().getString(R.string.notification_arrived_at_waypoint_title)\n , intent.getStringExtra(TAG_WAYPOINT_NAME)))\n .setContentText(String.format(\n context.getResources().getString(R.string.notification_arrived_at_waypoint_detail)\n , intent.getStringExtra(TAG_WAYPOINT_NAME)\n ))\n .setAutoCancel(true)\n .setContentIntent(pendingIntent);\n ((NotificationManager)context.getSystemService(Context.NOTIFICATION_SERVICE)).notify(0, builder.build());\n\n Route.setArrivedAtCurrentDestination(true);\n }\n }\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n\n Intent intentMessage = new Intent(context, MessageActivity.class);\n intentMessage.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n context.startActivity(intentMessage);\n }", "protected void onHandleIntent(Intent intent) {\n long endTime = System.currentTimeMillis() + 5*1000;\n while (System.currentTimeMillis() < endTime) {\n synchronized (this) {\n try {\n wait(endTime - System.currentTimeMillis());\n } catch (Exception e) {\n }\n }\n }\n }", "@Override\n protected void onHandleIntent(Intent intent) {\n if (intent != null) {\n final String action = intent.getAction();\n if (ACTION_GET_LOCATION.equals(action)) {\n handleActionGetLocation((ResultReceiver) intent.getParcelableExtra(\"receiverTag\"));\n }\n }\n }", "@Override\n protected void onHandleIntent(Intent intent) {\n GeofencingEvent geofencingEvent = GeofencingEvent.fromIntent(intent);\n if (geofencingEvent.hasError()) {\n Log.d(TAG, \"geofencing event error.\");\n return;\n }\n\n // Get the transition type.\n int geofenceTransition = geofencingEvent.getGeofenceTransition();\n\n // Test that the reported transition was of interest.\n if (geofenceTransition == Geofence.GEOFENCE_TRANSITION_ENTER) {\n\n // Get the geofences that were triggered. A single event can trigger\n // multiple geofences.\n List<Geofence> triggeringGeofences = geofencingEvent.getTriggeringGeofences();\n new GeofencingManager(this).HandleTriggeringGeofences(triggeringGeofences);\n }\n }", "private void m6613a(Intent intent) {\n C0938a.m5002a(\"SR/SoundRecorder\", \"<parseIntentFromListFragment>\");\n if (intent != null) {\n String stringExtra = intent.getStringExtra(\"startMode\");\n if (stringExtra != null && stringExtra.contains(\"startFromSelf\")) {\n C0938a.m5002a(\"SR/SoundRecorder\", \"startMode: startFromSelf\");\n if (this.f5435p == 0 && !this.f5427l && !C1413m.m6844f()) {\n this.f5384D.mo6532a(getResources().getString(R.string.pause), R.drawable.btn_play_15);\n }\n this.f5444ta.sendEmptyMessageDelayed(5, 350);\n } else if (!this.f5427l) {\n this.f5444ta.sendEmptyMessageDelayed(6, 350);\n }\n }\n }", "@Override\r\n protected void onNewIntent(Intent intent) {\n super.onNewIntent(intent);\r\n Tag tagFromIntent = intent.getParcelableExtra(NfcAdapter.EXTRA_TAG);\r\n DataDevice ma = (DataDevice) getApplication();\r\n ma.setCurrentTag(tagFromIntent);\r\n }", "public void onIntentReceived(final String payload) {\n }", "@Override\r\n protected void onNewIntent(Intent intent) {\r\n\r\n if (Intent.ACTION_SEARCH.equals(intent.getAction())) {\r\n\r\n MergeFragment mergeFragment = (MergeFragment) fragmentManager\r\n .findFragmentByTag(MERGE_FRAGMENT_TAG);\r\n\r\n if (mergeFragment != null) {\r\n mergeFragment.handleIntent(intent);\r\n }\r\n }\r\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n }", "@Override\n public void onReceive(Context context, Intent intent) {\n }", "@Override\n protected void onHandleIntent(@Nullable Intent intent) {\n GeofencingEvent geofencingEvent = GeofencingEvent.fromIntent(intent);\n\n // Handling errors\n if (geofencingEvent != null && geofencingEvent.hasError()) {\n String errorMsg = getErrorString(geofencingEvent.getErrorCode());\n Log.e(TAG, errorMsg);\n return;\n }\n // Retrieve GeofenceTransition\n if (geofencingEvent != null) {\n int geoFenceTransition = geofencingEvent.getGeofenceTransition();\n\n switch (geoFenceTransition) {\n case Geofence.GEOFENCE_TRANSITION_ENTER:\n break;\n case Geofence.GEOFENCE_TRANSITION_EXIT:\n // Get the geofence that were triggered\n List<Geofence> triggeringGeofences = geofencingEvent.getTriggeringGeofences();\n\n String geofenceTransitionDetails = getGeofenceTrasitionDetails(geoFenceTransition, triggeringGeofences);\n Intent lbcIntent = new Intent(Constants.BroadCastReceiver.sBroadCastName); //Send to any reciever listening for this\n LocalBroadcastManager.getInstance(this).sendBroadcast(lbcIntent);\n break;\n }\n\n }\n }" ]
[ "0.817108", "0.7988496", "0.78789043", "0.78789043", "0.7861457", "0.785104", "0.7847534", "0.78299195", "0.78288776", "0.7641862", "0.7633209", "0.7624444", "0.7567786", "0.7452437", "0.7366898", "0.7302838", "0.7287378", "0.7256273", "0.7254402", "0.7148836", "0.7115568", "0.7090432", "0.7028937", "0.70009995", "0.69892544", "0.69815016", "0.6910423", "0.68841", "0.6877564", "0.68601567", "0.68362784", "0.6830723", "0.6813843", "0.67990696", "0.6678911", "0.66693664", "0.66576576", "0.6632238", "0.6569379", "0.6543892", "0.6530535", "0.6509509", "0.6489251", "0.6480441", "0.64801586", "0.64422715", "0.6439669", "0.64381105", "0.6390255", "0.6377833", "0.637382", "0.63476163", "0.63292545", "0.62529707", "0.62438506", "0.6222979", "0.6222476", "0.6171631", "0.617035", "0.61439514", "0.6141667", "0.61283886", "0.60998595", "0.6090955", "0.6087283", "0.60863495", "0.60804313", "0.6080111", "0.60770667", "0.6063558", "0.6058209", "0.60554886", "0.6031181", "0.60120845", "0.60111976", "0.6010453", "0.6009141", "0.6009141", "0.6009141", "0.60048544", "0.60033244", "0.6002726", "0.60026723", "0.60019606", "0.59991497", "0.5993837", "0.59913737", "0.5989596", "0.59868824", "0.5986634", "0.59865355", "0.5958038", "0.59472734", "0.5936448", "0.5930856", "0.5929158", "0.5907775", "0.5905093", "0.59028995", "0.59028995", "0.5898802" ]
0.0
-1
Toast.makeText(getApplicationContext(),"onChanged from search", Toast.LENGTH_SHORT).show();
@Override public void onChanged(@Nullable List<Business> businesses) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n public boolean onQueryTextChange(String newText) {\n currentSearchData = new ArrayList<String>();\n getCurrentSearchData(newText);\n RelativeLayout searchDataRelativeView = (RelativeLayout) findViewById(R.id.search_relative_view);\n searchDataRelativeView.setOnClickListener(new View.OnClickListener() {\n @Override\n public void onClick(View v) {\n\n\n }\n });\n showCurrentData();\n System.out.println(\"\");\n return false;\n }", "@Override\n public void onSearchOpened() {\n Log.v(\"SearchBox\", \"onSearchOpened()\");\n }", "@Override\n public void onSearchTermChanged() {\n }", "public void onSearchStarted();", "private void searchQuery() {\n edit_search.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n if (paletteComposition.getVisibility() == View.VISIBLE){\n paletteComposition.setVisibility(View.GONE);\n setComposer.setVisibility(View.VISIBLE);\n }\n }\n\n @Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n setContactThatNameContains(s.toString().trim());\n }\n\n @Override\n public void afterTextChanged(Editable s) {\n\n }\n });\n }", "@Override\n public void onSearchOpened() {\n }", "@Override\n public void onSearchOpened() {\n }", "@Override\n public void onSearchOpened() {\n }", "public interface OnSearchTextChangedListener {\n\n void onTextChanged(String text);\n\n}", "@Override\n public void onSearchTermChanged(String term) {\n }", "@Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n search(searchIput.getText().toString()); // search user\n }", "private TextWatcher makeTextWatcher(){\n TextWatcher textWatcher = new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n if(s != null){\n //adapter.getFilter().filter(s);\n //updateArtistList(s.toString());\n }\n\n //updateArtistList(s.toString());\n }\n\n @Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n if(s != null){\n\n }\n //updateArtistList(s.toString());\n\n }\n\n // shows toast if not artist are found when searching.\n @Override\n public void afterTextChanged(Editable s) {\n //updateArtistList(s.toString());\n\n /*if(adapter.isEmpty()){\n Context context = getActivity();\n String text = \"no artist found\";\n int duration = Toast.LENGTH_SHORT;\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n\n }*/\n\n }\n };\n\n\n return textWatcher;\n\n\n }", "@Override\n\tpublic boolean onQueryTextChange(String newText) {\n\t\tLog.v(\"query\",\"onQueryTextChange\");\n\t\tmTextView.setText(\"Searching for \" + newText);\n\t\treturn false;\n\t}", "public void onEditSearch(ActionEvent event) {\r\n \tgetController().onEditSearch( event ); \t\r\n }", "@Override\n public void afterTextChanged(Editable s) {\n //updateArtistList(s.toString());\n\n /*if(adapter.isEmpty()){\n Context context = getActivity();\n String text = \"no artist found\";\n int duration = Toast.LENGTH_SHORT;\n Toast toast = Toast.makeText(context, text, duration);\n toast.show();\n\n }*/\n\n }", "@Override\n public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {\n countryAdapter.getFilter().filter(cs);\n //Toast.makeText(CovidCountry.this,cs,Toast.LENGTH_SHORT).show();\n }", "@Override\n public void onSearchClosed() {\n Log.v(\"SearchBox\", \"onSearchOpened()\");\n }", "@Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n getCategoryName = searchBarCategory.getText();\n seeSearchCategory(getCategoryName);\n }", "public void setUpTextWatcher(EditText searchFriendText) {\n searchFriendText.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {\n Log.i(TAG,\"beforeTextChanged\");\n }\n\n @Override\n public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {\n Log.i(TAG,\"onTextCHanged\");\n Log.i(TAG,charSequence.toString());\n if (charSequence.length() == 0) {\n searchRecyclerview.setVisibility(View.INVISIBLE);\n } else {\n searchRecyclerview.setVisibility(View.VISIBLE);\n }\n Query query = databaseReference.orderByChild(\"UserData/displayname\")\n .startAt(charSequence.toString())\n .endAt(charSequence.toString() + \"\\uf8ff\");\n query.addValueEventListener(valueEventListener);\n }\n\n @Override\n public void afterTextChanged(Editable editable) {\n Log.i(TAG,\"afterTextChanged\");\n }\n });\n }", "public interface OnSearch {\n void onSearch(String newText);\n}", "@Override\n\tpublic void onClick(View v) {\n\t\tString text_from_search = text_search.getText().toString();\n\t\tToast.makeText(SearchActivity.this,text_from_search,Toast.LENGTH_SHORT).show();\n\t\t\n\t\t\n\t\t\n//\t\tSharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(MainActivity.this);\n// pref.edit().putString(\"autoSave\", text_search.getText().toString()).commit();\n//\t\ttext_search=;\n\t}", "@Override\n public void onSearchConfirmed(CharSequence text) {\n startSearch(text);\n\n }", "@Override\n public void onClick(View v) {\n EditText searchBar = (EditText) findViewById(R.id.searchBar);\n String searchTerms = searchBar.getText().toString();\n\n //Perform the search\n new SearchStationsAsync(getBaseContext(), searchTerms).execute();\n }", "private void showSearch() {\n\t\tonSearchRequested();\n\t}", "@Override\n public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {\n\n\n }", "public void onChanged() {\n }", "@Override\n public void onMenuClick() {\n Toast.makeText(SearchActivity_.this, \"Menu click\", Toast.LENGTH_LONG).show();\n }", "@Override\n public void onSearchConfirmed(CharSequence text) {\n startSearch(text);\n }", "@Override\n public void onTextChanged(CharSequence text) {\n }", "@Override\n\t\t\tpublic void onTextChanged(CharSequence s, int start, int before, int count) {\n\t\t\t\tsearchFucntion();\n\t\t\t}", "public void searchLocation(View v){\n EditText locationSearch = findViewById(R.id.location);\n String location = locationSearch.getText().toString();\n search(location);\n }", "@Override\n public void onChanged(List<Words> words) {\n mWordAdapter.setWord(words);\n // Toast.makeText(getApplicationContext() , \" on changed work \" , Toast.LENGTH_LONG).show();\n }", "@Override\n public void afterTextChanged(Editable s) {\n filter(s.toString());\n //you can use runnable postDelayed like 500 ms to delay search text\n }", "@Override\n public boolean onQueryTextChange(String s) {\n searchRecyclerview(s);\n return false;\n }", "interface SearchListener {\r\n void onSearch(String searchTerm);\r\n }", "@Override\n public void onSearchConfirmed(CharSequence text) {\n startSearch(text);\n\n }", "@Override\n public void onSearchConfirmed(CharSequence text) {\n startSearch(text);\n\n }", "@Override\r\n public void onTextChanged(CharSequence arg0, int arg1, int arg2,\r\n int arg3) {\n\r\n }", "@Override\n public void afterTextChanged(Editable s) {\n String text = edtSearch.getText().toString();\n searchForMatch(text);\n }", "@Override\n public void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {\n\n }", "@Override\n public void onTextChanged(CharSequence s, int start, int before,\n int count) {\n\n mSearchEditText.setSelection(s.toString().length());\n\n if (s.toString().equals(\"\")) {\n tvSearchHint.setVisibility(View.VISIBLE);\n tvSearchInputHint.setText(R.string.search_info);\n showEmptyView(true);\n// mbtnClean.setVisibility(View.GONE);\n// mvoiceLayout.setVisibility(View.VISIBLE);\n// mbtnVoice.setVisibility(View.VISIBLE);\n\n } else {\n tvSearchHint.setVisibility(View.GONE);\n showEmptyView(false);\n tvSearchInputHint.setText(R.string.no_file);\n// mbtnClean.setVisibility(View.VISIBLE);\n// mvoiceLayout.setVisibility(View.GONE);\n// mbtnVoice.setVisibility(View.GONE);\n\n }\n\n //\n if (!s.equals(mSearchFileName)) {\n onStartSearchFile(s.toString());\n }\n\n }", "public void initSearchWidget(){\n\n searchview.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n @Override\n public boolean onQueryTextSubmit(String query) {\n\n //Closes the keyboard once query is submitted\n searchview.clearFocus();\n return false;\n }\n\n @Override\n public boolean onQueryTextChange(String newText) {\n\n //New arraylist for filtered products\n List<product> filteredList = new ArrayList<>();\n\n //Iterating over the array with products and adding every product that matches\n //the query to the new filtered list\n for (product product : listOfProducts){\n if (product.getProductName().toLowerCase().contains(newText.toLowerCase())){\n filteredList.add(product);\n }\n }\n\n //Hides the product list and display \"not found\" message when can't find match\n if (filteredList.size()<1){\n recyclerView.setVisibility(View.GONE);\n noResults.setVisibility(View.VISIBLE);\n }else {\n recyclerView.setVisibility(View.VISIBLE);\n noResults.setVisibility(View.GONE);\n }\n\n //Sets new adapter with filtered products to the recycler view\n productAdapter = new Adapter(MainActivity.this,filteredList);\n recyclerView.setAdapter(productAdapter);\n\n return true;\n }\n });\n }", "public void onSearchStarted() {\n mActivity.invalidateOptionsMenu();\n }", "@Override\r\n public void onTextChanged(CharSequence a, int b,\r\n int c, int d) {\n\r\n }", "@Override\n public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {\n Search.this.adapter.getFilter().filter(cs);\n }", "@Override\r\n public void onFailure(Call<SearchResponse> call, Throwable t) {\n Toast.makeText(getApplicationContext(), \"Failed\", Toast.LENGTH_LONG).show();\r\n }", "@Override\n public void afterTextChanged(Editable arg0) {\n String text = editsearch.getText().toString().toLowerCase(Locale.getDefault());\n adapter.filter(text);\n }", "@Override\n public void afterTextChanged(Editable arg0) {\n String text = editsearch.getText().toString().toLowerCase(Locale.getDefault());\n adapter.filter(text);\n }", "public void searchByUser(View v){\n if(connection.isOnline(this)){\n new SearchByUserAsync().execute();\n }\n hideFABToolbar(new View(getApplicationContext()));\n }", "@Override\r\n\t\t\tpublic void onClick(View v) {\n\r\n\t\t\t\tonQuery();\r\n\t\t\t}", "@Override\n\t\t\tpublic void onTextChanged(CharSequence cs, int arg1, int arg2,\n\t\t\t\t\tint arg3) {\n\n\t\t\t\tString text = searchText.getText().toString()\n\t\t\t\t\t\t.toLowerCase(Locale.getDefault());\n\t\t\t\t((CustomAdapterSearchPatientByAdmin) adapter).filter(text);\n\n\t\t\t}", "public void onSearch(View view){\n List<Address> addressList = null;\n EditText location_tf = (EditText) findViewById(R.id.TFaddress);\n String location = location_tf.getText().toString();\n if(location!=null || location.equals(\"\")){\n Geocoder geocoder = new Geocoder(this);\n try {\n addressList = geocoder.getFromLocationName(location, 1);\n } catch (IOException e) {\n e.printStackTrace();\n }\n Address address = addressList.get(0);\n LatLng latLng = new LatLng(address.getLatitude(), address.getLongitude());\n marker = mMap.addMarker(new MarkerOptions().position(latLng).title(\"Marker\"));\n mMap.addMarker(new MarkerOptions().position(latLng).title(\"Marker\"));\n mMap.animateCamera(CameraUpdateFactory.newLatLng(latLng));\n mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng,17));\n\n }\n\n }", "@Override\r\n\tpublic void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {\n\r\n\t}", "void searchUI();", "public void searchFunction() {\n textField_Search.textProperty().addListener(new ChangeListener<String>() {\n @Override\n public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {\n tableView.setPredicate(new Predicate<TreeItem<EntryProperty>>() {\n @Override\n public boolean test(TreeItem<EntryProperty> entryTreeItem) {\n Boolean flag = entryTreeItem.getValue().titleProperty().getValue().toLowerCase().contains(newValue.toLowerCase()) ||\n entryTreeItem.getValue().usernameProperty().getValue().toLowerCase().contains(newValue.toLowerCase());\n return flag;\n }\n });\n }\n });\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n if (newText.length() >= 2) {\n Intent intent = new Intent(ACTION_QUERY_CHANGED);\n intent.putExtra(\"query\", newText);\n LocalBroadcastManager.getInstance(SearchQueryActivity.this).sendBroadcast(intent);\n }\n return false;\n }", "@Override\r\n public boolean onCreateOptionsMenu(Menu icon){\n\r\n MenuInflater expand = getMenuInflater();\r\n\r\n expand.inflate(R.menu.top_menu, icon); //Referencing to the specific menu\r\n\r\n MenuItem search = icon.findItem(R.id.search_bar);\r\n\r\n SearchView searchView = (SearchView) search.getActionView(); //Displays the search view button\r\n\r\n searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\r\n\r\n\r\n @Override\r\n public boolean onQueryTextSubmit(String s) {//Begins filtering here\r\n\r\n adapterDevices.getFilter().filter(s);\r\n\r\n return false;\r\n }\r\n //Sends typed string in search bar to trigger search\r\n\r\n\r\n //Method is triggered if there is text change\r\n @Override\r\n public boolean onQueryTextChange(String s) {\r\n\r\n if(s.equals(\"\")){ //When search bar is empty again the page is reloaded\r\n\r\n Intent refresh = new Intent(getApplicationContext(), MyDevicesActivity.class);\r\n\r\n startActivity(refresh);\r\n\r\n finish();\r\n\r\n }\r\n return false;\r\n }\r\n });\r\n\r\n\r\n return true;\r\n\r\n\r\n }", "@Override\n public void onSearchConfirmed(CharSequence text) {\n if (text!=null) {\n adapter.stopListening();\n StartSearch(text);\n searchAdapter.startListening();\n }\n }", "@Override\n\t\t public boolean onKey(View v, int keyCode, KeyEvent event) {\n\n\t\t Log.d(\"SEARCH\", \"Search onkey\");\n\t\t return false;\n\t\t }", "@Override\r\n public boolean onQueryTextChange(String s) {\r\n\r\n if(s.equals(\"\")){ //When search bar is empty again the page is reloaded\r\n\r\n Intent refresh = new Intent(getApplicationContext(), MyDevicesActivity.class);\r\n\r\n startActivity(refresh);\r\n\r\n finish();\r\n\r\n }\r\n return false;\r\n }", "void eventChanged();", "@Override\r\n\tpublic void searchObjectListener(ActionEvent e) {\n\t\t\r\n\t}", "@Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_main);\n\n searchListView =(ListView)findViewById(R.id.list_view_search);\n searchButton=(Button)findViewById(R.id.search_button);\n searchEditText=(EditText)findViewById(R.id.search_song_edittext);\n textView1=(TextView)findViewById(R.id.textview1);\n\n\n\n searchButton.setOnClickListener(new View.OnClickListener(){\n @Override\n public void onClick(View v) {\n\n // textView1.setText(searchEditText.getText().toString().trim());\n\n // call_1();\n call_1(searchEditText.getText().toString().trim());\n }\n });\n\n}", "@Override\n public boolean onQueryTextChange(String newText) {\n Log.i(TAG, \"on text chnge text: \" + newText);\n\n\n rvAdapter.getFilter().filter(newText);\n rv.scrollToPosition(0);\n\n return true;\n }", "@Override\r\n public boolean onQueryTextChange(String newText) {\n adapter.getFilter().filter(newText);\r\n return true;\r\n }", "@Override\n public boolean onQueryTextSubmit(String query) {\n Log.e(\"Search View\", \"Called\");\n return false;\n }", "@Override\n public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {\n MainActivity.this.adapter.getFilter().filter(cs);\n listView.setVisibility(View.VISIBLE);\n\n }", "@Override\n public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {\n toolbar.setTitle(\"To \" + cs);\n SearchFriendFragment.this.adapter.getFilter().filter(cs);\n }", "@Override\n public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {\n MainActivity.this.adapter.getFilter().filter(cs);\n }", "public void onSearch(View view)\n {\n PlacePicker.IntentBuilder builder = new PlacePicker.IntentBuilder();\n\n try {\n startActivityForResult(builder.build(this), PLACE_PICKER_REQUEST);\n } catch (GooglePlayServicesRepairableException e) {\n e.printStackTrace();\n } catch (GooglePlayServicesNotAvailableException e) {\n e.printStackTrace();\n }\n }", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.main_menu, menu);\n\n // final SearchView searchView = (SearchView) MenuItemCompat.getActionView(menu.findItem(R.id.action_search));\n // SearchManager searchManager = (SearchManager) getSystemService(SEARCH_SERVICE);\n // searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));\n\n /* final MenuItem searchItem = menu.findItem(R.id.action_search);\n final SearchView searchView = MenuItemCompat.getActionView(searchItem);\n searchView.setOnQueryTextListener(this);\n*/\n return true;\n }", "@Override\r\n\t public void afterTextChanged( Editable arg0) {\n\t HomeFragment.this.adapter.getFilter().filter(arg0);\r\n\r\n\t }", "@Override\n \t\t\t\tpublic void onClick(View v) {\n \t\t\t\t\tEditText searchBar = (EditText) findViewById(R.id.search_bar);\n \t\t\t\t\tif(searchBar.getText().equals(\"\"))\n \t\t\t\t\t{\n \t\t\t\t\t\tsearchBar.setText(\"Please enter nonempty query\");\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tsearchGuide(searchBar, true);\n \t\t\t\t\t}\n \t\t\t\t}", "@Override\n public View onCreateView(LayoutInflater inflater, ViewGroup container,\n Bundle savedInstanceState) {\n View view = inflater.inflate(R.layout.fragment_search_category, container, false);\n\n categorytRef = FirebaseDatabase.getInstance().getReference().child(\"Products\");\n\n searchBarCategory = view.findViewById(R.id.category_search);\n\n searchCategoryRecycler = view.findViewById(R.id.buyer_category_recycler);\n\n searchBarCategory.addTextChangeListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n\n }\n\n @Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n// Toast.makeText(getActivity(), \"Category is :\" + searchBarCategory.getText(), Toast.LENGTH_SHORT).show();\n getCategoryName = searchBarCategory.getText();\n seeSearchCategory(getCategoryName);\n }\n\n @Override\n public void afterTextChanged(Editable s) {\n\n }\n });\n\n\n// searchBarCategory.setOnSearchActionListener(new MaterialSearchBar.OnSearchActionListener() {\n// @Override\n// public void onSearchStateChanged(boolean enabled) {\n//\n// }\n//\n// @Override\n// public void onSearchConfirmed(CharSequence text) {\n//\n// }\n//\n// @Override\n// public void onButtonClicked(int buttonCode) {\n//\n// }\n// });\n\n return view;\n }", "@Override\n public void onClick(View v) {\n if (searchTerm.getText().length() > 0) {\n String searchWord =searchTerm.getText().toString().replace(\" \", \"%20\");\n MainActivity.searchTerm = searchWord;\n new PhotoSearch(fragment).execute(MainActivity.searchTerm);\n\n } else\n Toast.makeText(getContext(), \"Enter a travel search term.\", Toast.LENGTH_SHORT).show();\n }", "@Override\n \t\t\t\tpublic void onClick(View v) {\n \t\t\t\t\tEditText searchBar = (EditText) findViewById(R.id.search_bar);\n \t\t\t\t\tif(searchBar.getText().equals(\"\"))\n \t\t\t\t\t{\n \t\t\t\t\t\tsearchBar.setText(\"Please enter nonempty query\");\n \t\t\t\t\t}\n \t\t\t\t\telse\n \t\t\t\t\t{\n \t\t\t\t\t\tsearchGuide(searchBar, false);\n \t\t\t\t\t}\n \t\t\t\t}", "void onDataChanged();", "@Override\n\t\t\tpublic void onClick(View v) {\n\t\t\t\t\n\t\t\t\tConstants.searchText = txtSearchBox.getText().toString();\n\t\t\t\tseachExhibitions();\n\t\t\t\t\n\t\t\t}", "public interface EdittextListener {\n void onQuery(String s);\n\n void onClear();\n\n void onContentChange(String s);\n}", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n\n getMenuInflater().inflate(R.menu.menu_main, menu);\n\n // Associate searchable configuration with the SearchView\n SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);\n SearchView searchView = (SearchView) menu.findItem(R.id.menuSearch).getActionView();\n searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));\n\n searchView.setIconifiedByDefault(false);\n searchView.setFocusable(true);\n searchView.setIconified(false);\n\n\n\n if( Intent.ACTION_VIEW.equals(getIntent().getAction())){\n Intent i = new Intent(SearchActivity.this, SearchActivity.class);\n query = getIntent().getStringExtra(SearchManager.QUERY);\n i.setAction(Intent.ACTION_SEARCH);\n i.putExtra(\"query\", query);\n startActivity(i);\n\n Toast.makeText(SearchActivity.this, query, Toast.LENGTH_SHORT).show();\n }\n\n searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n @Override\n public boolean onQueryTextSubmit(String query) {\n // INPUT CODE HERE\n Toast.makeText(SearchActivity.this, query, Toast.LENGTH_SHORT).show();\n return false;\n }\n\n @Override\n public boolean onQueryTextChange(String newText) {\n // INPUT CODE HERE\n// String[] q = {\"promotion_name\"};\n// String[] t = {newText};\n// MySuggestionProvider suggestion = new MySuggestionProvider();\n// suggestion.query(Uri.parse(\"database.it.kmitl.ac.th/it_35\"), q, \"promotion_name LIKE %?%\", t, null);\n return false;\n }\n });\n return true;\n }", "private void postSearch (String status) {\n if (status.equals(\"NO_RESULT_FOUND\")) {\n Context context = getActivity();\n CharSequence text = getString(R.string.search_artist_field_no_result_found);\n int duration = Toast.LENGTH_SHORT;\n\n Toast toast = Toast.makeText(context, text, duration);\n toast.setGravity(Gravity.TOP, (int) getActivity().findViewById(R.id.artist_detail_listview).getX(),\n (int)getActivity().findViewById(R.id.artist_detail_listview).getY());\n toast.show();\n }\n }", "public void onSearchSubmit(String queryTerm);", "@Override\n public boolean onCreateOptionsMenu(Menu menu) {\n getMenuInflater().inflate(R.menu.menu_main, menu);\n\n SearchManager searchManager = (SearchManager) getSystemService(Context.SEARCH_SERVICE);\n searchView = (SearchView) menu.findItem(R.id.action_search).getActionView();\n searchMenuItem = menu.findItem(R.id.action_search);\n searchView.setSearchableInfo(searchManager.getSearchableInfo(getComponentName()));\n searchView.setIconifiedByDefault(false);\n\n SearchView.OnQueryTextListener textChangeListener = new SearchView.OnQueryTextListener() {\n @Override\n public boolean onQueryTextChange(String newText) {\n // this is your adapter that will be filtered\n //dataAdapter.getFilter().filter(newText);\n Log.i(TAG, \"on text chnge text: \" + newText);\n\n\n rvAdapter.getFilter().filter(newText);\n rv.scrollToPosition(0);\n\n return true;\n }\n\n @Override\n public boolean onQueryTextSubmit(String query) {\n // this is your adapter that will be filtered\n //dataAdapter.getFilter().filter(query);\n Log.i(TAG, \"on query submit: \" + query);\n return true;\n }\n };\n searchView.setOnQueryTextListener(textChangeListener);\n\n\n return true;\n }", "@Override\n public void onSearchCleared() {\n }", "@Override\n public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {\n \tSystem.out.println(cs);\n \tsearchTxt = cs; \n \tif(searchTxt.length() == 0) {\n \t\tMainActivity.this.adapter.getFilter().filter(null);\n \t}\n }", "@Override\n public void onTextChanged(CharSequence cs, int arg1, int arg2, int arg3) {\n MainActivity.this.mAdapter.getFilter().filter(cs);\n }", "public void onClick(View v) {\n\t\t\t\tString searchInput = searchField.getText().toString();\n\t\t\t\tsavedString = searchInput;\n\t\t\t\tlist.setFilterText(searchInput);\n\t\t\t}", "@Override\n\tpublic void onTextChanged(CharSequence arg0, int arg1, int arg2, int arg3) {\n\t\t\n\t}", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "@Override\n public void afterTextChanged(Editable s) {\n\n }", "void onRecommendationChanged();", "@Override\n public boolean onQueryTextChange(String s) {\n\n FetchSearchData(s);\n //return false;\n if (data_list.size() == 0) {\n tv_nofound.setVisibility(View.VISIBLE);\n recyclerView.getRecycledViewPool().clear();\n } else {\n tv_nofound.setVisibility(View.GONE);\n }\n\n return true;\n }", "@Override\n public boolean onQueryTextChange(String newText) {\n // store the search query being entered in a global object that will be used to persist data\n // note: intentionally we use another string instead of @searchQueryToRestore, as SearchView\n // query is at first set to null (at the time SearchView is initialised), before setQuery()\n // method is called\n searchQueryToListen = newText;\n return false;\n }", "@Override\n public void onChange() {\n java.lang.String callbackArg_0 = android.databinding.adapters.TextViewBindingAdapter.getTextString(mboundView1);\n // localize variables for thread safety\n // viewModel.obName != null\n boolean viewModelObNameJavaLangObjectNull = false;\n // viewModel.obName.get()\n java.lang.String viewModelObNameGet = null;\n // viewModel\n ys.app.pad.viewmodel.ModifyServiceDetailViewModel viewModel = mViewModel;\n // viewModel.obName\n android.databinding.ObservableField<java.lang.String> viewModelObName = null;\n // viewModel != null\n boolean viewModelJavaLangObjectNull = false;\n\n\n\n viewModelJavaLangObjectNull = (viewModel) != (null);\n if (viewModelJavaLangObjectNull) {\n\n\n viewModelObName = viewModel.obName;\n\n viewModelObNameJavaLangObjectNull = (viewModelObName) != (null);\n if (viewModelObNameJavaLangObjectNull) {\n\n\n\n\n viewModelObName.set(((java.lang.String) (callbackArg_0)));\n }\n }\n }", "public void searchFunction1() {\n textField_Search.textProperty().addListener(new ChangeListener<String>() {\n @Override\n public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {\n tableView_recylce.setPredicate(new Predicate<TreeItem<EntryProperty>>() {\n @Override\n public boolean test(TreeItem<EntryProperty> entryTreeItem) {\n Boolean flag = entryTreeItem.getValue().titleProperty().getValue().toLowerCase().contains(newValue.toLowerCase()) ||\n entryTreeItem.getValue().usernameProperty().getValue().toLowerCase().contains(newValue.toLowerCase());\n return flag;\n }\n });\n }\n });\n }", "@Override\n public void onTextChanged(CharSequence s, int i, int i1, int i2) {\n\n try {\n adapterStat.getFilter().filter(s);\n\n\n } catch (Exception e) {\n e.printStackTrace();\n }\n }", "@Override\n public void onSearchConfirmed(CharSequence text) {\n startSearchResults(text);\n }", "public boolean onQueryTextSubmit(String query) {\n Intent i=new Intent(getApplicationContext(),SearchActivity.class);\n i.putExtra(\"search-key\",query);\n\n startActivity(i);\n searchView.setQuery(\"\", false);\n searchView.setIconified(true);\n return false;\n\n\n }", "public interface ISearch {\n void onTextQuery(String text);\n\n}", "@Override\n public void onClick(View v) {\n EditText searchBox = (EditText) getActivity().findViewById(R.id.destSearch);\n String searchString = searchBox.getText().toString();\n\n //Send it to search activity\n Intent searchIntent = new Intent(getActivity(), SearchActivity.class);\n searchIntent.putExtra(\"searchString\", searchString);\n startActivity(searchIntent);\n }", "@Override\n public void onCreateOptionsMenu(Menu menu,MenuInflater menuInflater) {\n\n menuInflater.inflate(R.menu.menu_search, menu);\n MenuItem menuItem = menu.findItem(R.id.action_search);\n SearchView searchView = null;\n if (menuItem != null)\n searchView = (SearchView) menuItem.getActionView();\n\n if (searchView != null) {\n searchView.setQueryHint(Tag.ENTER_PRODUCT);\n searchView.setOnQueryTextListener(new SearchView.OnQueryTextListener() {\n\n @Override\n public boolean onQueryTextSubmit(String query) {\n if (UtilityFunctions.isNetworkAvailable(getActivity())) {\n //searching is done in async task\n searchQuery = query;\n UtilityFunctions.onProgressBarShow(getActivity());\n MyAsyncTaskDownloadDetails myAsyncTaskDownloadDetails = new MyAsyncTaskDownloadDetails();\n myAsyncTaskDownloadDetails.execute(new String[]{Tag.PLP_URL + query, Tag.PLP, \"\"});\n } else {\n Toast.makeText(getActivity(), Tag.NO_INTERNET, Toast.LENGTH_SHORT).show();\n }\n return true;\n }\n\n\n @Override\n public boolean onQueryTextChange(String newText) {\n return true;\n }\n });\n }\n super.onCreateOptionsMenu(menu, menuInflater);\n }" ]
[ "0.7472048", "0.7264972", "0.70373124", "0.68573314", "0.67848414", "0.67528224", "0.67528224", "0.67528224", "0.67137825", "0.6684374", "0.6655278", "0.6630099", "0.66021514", "0.65985984", "0.65685683", "0.6564724", "0.65641344", "0.6520936", "0.6496067", "0.6458754", "0.6415125", "0.6382135", "0.6379114", "0.6359193", "0.6352028", "0.63504994", "0.63289547", "0.6305111", "0.62694436", "0.62379473", "0.62355363", "0.6228304", "0.622818", "0.6223748", "0.6214381", "0.6201328", "0.6201328", "0.6187564", "0.618089", "0.61749727", "0.61591554", "0.61433065", "0.61306083", "0.61292166", "0.61287063", "0.61250365", "0.6124283", "0.6124283", "0.6123239", "0.6121928", "0.6114633", "0.60964674", "0.6092102", "0.60849243", "0.6084832", "0.60836995", "0.6069758", "0.606771", "0.6065126", "0.605521", "0.6049762", "0.6046776", "0.6045621", "0.60438347", "0.6034852", "0.6026537", "0.60225767", "0.60141104", "0.6013096", "0.60105115", "0.60097986", "0.5998229", "0.5995728", "0.5992805", "0.59896946", "0.59779745", "0.59763277", "0.59646225", "0.5954057", "0.5948197", "0.5947826", "0.59445643", "0.5940627", "0.59398735", "0.5937691", "0.5931378", "0.59269786", "0.5922354", "0.59103626", "0.59103626", "0.59070873", "0.5906109", "0.59039164", "0.5902461", "0.5901721", "0.5895372", "0.5895041", "0.5892775", "0.5886166", "0.5874014", "0.58724636" ]
0.0
-1
Toast.makeText(getApplicationContext(),"onChanged from all", Toast.LENGTH_SHORT).show();
@Override public void onChanged(@Nullable List<Business> businesses) { }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void onChanged() {\n }", "void onDataChanged();", "@Override\n public void onChanged() {\n }", "public void alert(){\n\t\tfor (ChangeListener l : listeners) {\n\t\t\tl.stateChanged(new ChangeEvent(this));\n\t\t}\n\t}", "public void onDataChanged();", "@Override\n public void eventsChanged() {\n }", "public void onDataChanged(){}", "protected void onAppsChanged() {\n\t\t\n\t}", "void eventChanged();", "@Override\n public void onChange() {\n java.lang.String callbackArg_0 = android.databinding.adapters.TextViewBindingAdapter.getTextString(mboundView1);\n // localize variables for thread safety\n // viewModel.obName != null\n boolean viewModelObNameJavaLangObjectNull = false;\n // viewModel.obName.get()\n java.lang.String viewModelObNameGet = null;\n // viewModel\n ys.app.pad.viewmodel.ModifyServiceDetailViewModel viewModel = mViewModel;\n // viewModel.obName\n android.databinding.ObservableField<java.lang.String> viewModelObName = null;\n // viewModel != null\n boolean viewModelJavaLangObjectNull = false;\n\n\n\n viewModelJavaLangObjectNull = (viewModel) != (null);\n if (viewModelJavaLangObjectNull) {\n\n\n viewModelObName = viewModel.obName;\n\n viewModelObNameJavaLangObjectNull = (viewModelObName) != (null);\n if (viewModelObNameJavaLangObjectNull) {\n\n\n\n\n viewModelObName.set(((java.lang.String) (callbackArg_0)));\n }\n }\n }", "protected void onUpdate() {\r\n\r\n\t}", "@Override\n public void onDataChanged() {\n }", "@Override\n public void onDataChanged() {\n }", "@Override\n public void onChanged(@Nullable List<Event> events) {\n adapter.setEvents(events);\n for (Event event:events) {\n Log.e(\"** EVENT **\", \"CATEGORY: \" +event.getCategoryId() + \", Event : \" + event.getName());\n }\n }", "void onRefresh() {\n\t}", "@Override\n public void onChange() {\n java.lang.String callbackArg_0 = android.databinding.adapters.TextViewBindingAdapter.getTextString(mboundView3);\n // localize variables for thread safety\n // viewModel.obTypeName.get()\n java.lang.String viewModelObTypeNameGet = null;\n // viewModel.obTypeName\n android.databinding.ObservableField<java.lang.String> viewModelObTypeName = null;\n // viewModel\n ys.app.pad.viewmodel.ModifyServiceDetailViewModel viewModel = mViewModel;\n // viewModel != null\n boolean viewModelJavaLangObjectNull = false;\n // viewModel.obTypeName != null\n boolean viewModelObTypeNameJavaLangObjectNull = false;\n\n\n\n viewModelJavaLangObjectNull = (viewModel) != (null);\n if (viewModelJavaLangObjectNull) {\n\n\n viewModelObTypeName = viewModel.obTypeName;\n\n viewModelObTypeNameJavaLangObjectNull = (viewModelObTypeName) != (null);\n if (viewModelObTypeNameJavaLangObjectNull) {\n\n\n\n\n viewModelObTypeName.set(((java.lang.String) (callbackArg_0)));\n }\n }\n }", "public interface OnChangedListener {\n abstract void OnChanged(boolean CheckState);\n}", "@Override\n public void update(Observable observable, Object data) {\n Toast.makeText(this, \"I am notified\" + myBase.getObserver().getValue(), 0).show();\n btn.setText(\"value: \" + myBase.getObserver().getValue());\n\n }", "@Override\n public void onChanged(List<Words> words) {\n mWordAdapter.setWord(words);\n // Toast.makeText(getApplicationContext() , \" on changed work \" , Toast.LENGTH_LONG).show();\n }", "@Override\r\n public void onStatusChanged(String provider, int status, Bundle extras) {\n\r\n }", "@Override\npublic void onStatusChanged(String provider, int status, Bundle extras) {\n\n}", "public void onRefresh() {\n }", "public void onContentChanged() {\n }", "@Override\n public void onLocationChanged(Location location) {\n Toast.makeText(getApplicationContext(), location.toString() + \"\", Toast.LENGTH_SHORT).show();\n Log.i(TAG, \"onLocationChanged: \" + location.toString());\n }", "@Override\n public void onDataChanged() {\n\n }", "private void ObserveAnyChange(){\n movieListViewModel.getMovies().observe(getViewLifecycleOwner(), new Observer<List<MovieModel>>() {\n @Override\n public void onChanged(List<MovieModel> movieModels) {\n\n if (movieModels != null){\n for (MovieModel movieModel: movieModels){\n // get data in Log\n Log.v(TAG, \" onChanged: \"+ movieModel.getTitle());\n movieRecyclerAdapter.setmMovieModels(movieModels);\n }\n }\n\n }\n });\n }", "public void onStatusChanged(String provider, int status, Bundle extras) {\n\n\n\n }", "@Override\r\n\tpublic void on() {\n\r\n\t}", "public void events(View v){\n }", "public void onSensorChanged() {\n\t\tsensorChanged();\n\t}", "@Override\n\tpublic void onUpdate() {\n\t\t\n\t}", "@Override\n public void onRemovedAll() {\n Toast.makeText(this, R.string.removed_all_recordings, Toast.LENGTH_SHORT).show();\n setResult(RESULT_OK);\n finish();\n }", "@Override\n public void onChange() {\n java.lang.String callbackArg_0 = android.databinding.adapters.TextViewBindingAdapter.getTextString(mboundView5);\n // localize variables for thread safety\n // viewModel.obServiceVipPrice != null\n boolean viewModelObServiceVipPriceJavaLangObjectNull = false;\n // viewModel.obServiceVipPrice\n android.databinding.ObservableField<java.lang.String> viewModelObServiceVipPrice = null;\n // viewModel.obServiceVipPrice.get()\n java.lang.String viewModelObServiceVipPriceGet = null;\n // viewModel\n ys.app.pad.viewmodel.ModifyServiceDetailViewModel viewModel = mViewModel;\n // viewModel != null\n boolean viewModelJavaLangObjectNull = false;\n\n\n\n viewModelJavaLangObjectNull = (viewModel) != (null);\n if (viewModelJavaLangObjectNull) {\n\n\n viewModelObServiceVipPrice = viewModel.obServiceVipPrice;\n\n viewModelObServiceVipPriceJavaLangObjectNull = (viewModelObServiceVipPrice) != (null);\n if (viewModelObServiceVipPriceJavaLangObjectNull) {\n\n\n\n\n viewModelObServiceVipPrice.set(((java.lang.String) (callbackArg_0)));\n }\n }\n }", "void onArgumentsChanged();", "public void onLocationChanged(Location location){\n\n }", "@Override\n public void onChange() {\n java.lang.String callbackArg_0 = android.databinding.adapters.TextViewBindingAdapter.getTextString(mboundView4);\n // localize variables for thread safety\n // viewModel.obRealAmt\n android.databinding.ObservableField<java.lang.String> viewModelObRealAmt = null;\n // viewModel.obRealAmt != null\n boolean viewModelObRealAmtJavaLangObjectNull = false;\n // viewModel\n ys.app.pad.viewmodel.ModifyServiceDetailViewModel viewModel = mViewModel;\n // viewModel != null\n boolean viewModelJavaLangObjectNull = false;\n // viewModel.obRealAmt.get()\n java.lang.String viewModelObRealAmtGet = null;\n\n\n\n viewModelJavaLangObjectNull = (viewModel) != (null);\n if (viewModelJavaLangObjectNull) {\n\n\n viewModelObRealAmt = viewModel.obRealAmt;\n\n viewModelObRealAmtJavaLangObjectNull = (viewModelObRealAmt) != (null);\n if (viewModelObRealAmtJavaLangObjectNull) {\n\n\n\n\n viewModelObRealAmt.set(((java.lang.String) (callbackArg_0)));\n }\n }\n }", "@Override\n public void addChangeListener(ChangeListener l) {}", "public void setChangeListener();", "protected void onDataChanged(V item) {\n\n }", "@Override\r\n\tpublic void valuesChanged() {\r\n\t}", "@Override\n public void onClick(View v) {\n Toast.makeText(getContext(), \"Not Ready Yet :(\", Toast.LENGTH_SHORT).show();\n }", "@Override\n\tpublic void staticByActivityListener() {\n\t\tsb.setOnSeekBarChangeListener(this);\n\t}", "@Override\n public void onChanged(@Nullable final String name) {\n if (name != null) {\n Toast.makeText(ctx, \"Hello \" + name + \"!\", Toast.LENGTH_LONG).show();\n } else {\n showLoginForm();\n }\n }", "public interface OnCustomerListChangedListener {\n\n void onNoteListChanged(ArrayList<String> weathers);\n}", "@Override\n public void addOnPropertyChangedCallback(OnPropertyChangedCallback callback) {\n }", "@Override\n public void onChanged(List<VehicleDataFirebase> vehicleDataFirebases) {\n if (adapter==null){\n Log.d(constants.YOURVEHICLETAG, vehicleDataFirebases.get(0).getRegistrationNumber());\n setupUI(vehicleDataFirebases);\n }\n Log.d(constants.YOURVEHICLETAG, vehicleDataFirebases.get(0).getRegistrationNumber());\n //Update data\n adapter.updateVehicles(vehicleDataFirebases);\n vehicles = vehicleDataFirebases;\n }", "@Override\n public void addChangeListener(ChangeListener l) {\n }", "@Override\n public void addChangeListener(ChangeListener l) {\n }", "void onModelChange();", "void onListenerChanged(ListenerUpdate update);", "@Override\n\t\tpublic void onChanged() {\n\t\t\tsuper.onChanged();\n\t\t\tinitChildViews();\n\t\t}", "@Override\n public void onClick(View v) {\n Toast.makeText(getContext(),\"hey uuuu clicked me \",Toast.LENGTH_SHORT).show();\n }", "public void stateChanged( ChangeEvent event )\n {\n \n }", "@Override\n public void onClick(View v) {\n CustomToast.show(getContext(),\"Service will be available Soon\");\n }", "@Override\r\n\tpublic void onCustomUpdate() {\n\t\t\r\n\t}", "@Override\n public void onRefresh() {\n }", "@Override\n public void onStatusChanged(String s, int i, Bundle bundle) {\n }", "@Override\n public void onStatusChanged(String s, int i, Bundle bundle) {\n }", "public void on() {\n\n\t}", "@Override\n public void onChanged(@Nullable final List<User_Values> vals) {\n }", "@Override\n\tpublic void setOnChangeEvent(String functionName) {\n\t\t\n\t}", "@Override\n public void onTabChanged(LinearLayout selectedTab, int selectedIndex, int oldIndex) {\n Toast.makeText(MainActivity.this,\"Tab \"+ selectedIndex+\" Selected.\",Toast.LENGTH_SHORT).show();\n }", "@Override\r\n\tpublic void onRefresh() {\n\r\n\t}", "@Override\n public void toastText(String s){\n Toast.makeText(getApplicationContext(), s, Toast.LENGTH_SHORT).show();\n }", "@Override\n\tpublic void onUpdate() {\n\t\tlistener.onUpdate();\n\t}", "public interface OnStateChangedListener {\n void onChanged(int state);\n}", "@Override\n\tpublic void onRefresh() {\n\n\t}", "@Override\r\n\tpublic void operations() {\n\t\tSystem.out.println(\"update self!\"); \r\n notifyObservers(); \r\n\r\n\t}", "protected void childrenChanged() {\n\n }", "public interface OnCustomerListChangedListener {\n void onNoteListChanged(List<Customer> customers);\n}", "@Override\r\n\t\t\tpublic void onRefresh() {\n\r\n\t\t\t}", "@Override\n protected void onDataChanged() {\n }", "@Override\n public void run() {\n try {\n Station currentStation = stations.get(position);\n Log.i(TAG, \"onChanged: test2\" + stations);\n Toast.makeText(MainActivity.this, \"Lenght is \"+ listSize+\" position is \"+ position+ \" onChanged \" + currentStation.getName(), Toast.LENGTH_SHORT).show();\n AccessData();\n }catch (Exception r){\n\n }\n }", "public void menuItemHasChanged(Object sender, MenuItem item) {\n // Called every time any menu item changes\n }", "public void onLocationChanged(Location location) {\n }", "void onRecommendationChanged();", "@Override\n public void onStateChanged(boolean changed, BranchError error) {\n int credits = Branch.getInstance(getApplicationContext()).getCredits();\n Toast.makeText(getApplicationContext(), \"You have : \" + credits + \" credits.\",\n Toast.LENGTH_LONG).show();\n }", "public void atacar() {\n notifyObservers();\n }", "@Override\n\tpublic void onMyRefresh() {\n\t\t\n\t}", "@Override\n\tpublic void onMyRefresh() {\n\t\t\n\t}", "public void onStockpriceChanged();", "@Override\nprotected void onResume() {\n\tsuper.onResume();\n\t//Toast.makeText(getApplicationContext(), \"onResume\", 1).show();\n}", "@Override\n\tpublic void onLocationChanged(android.location.Location arg0) {\n\t\t\n\t}", "@Override\n public void onCheckedChanged(CompoundButton buttonView,\n boolean isChecked) {\n\n\n\n }", "@Override\n public void onUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) {\n super.onUpdate(context, appWidgetManager, appWidgetIds);\n// Log.d(\"로그\", \"위젯 onUpdate\");\n for (int appWidgetId : appWidgetIds) {\n updateAppWidget(context, appWidgetManager, appWidgetId);\n }\n\n }", "@Override\n\tpublic void NotifyObserver() {\n\n\t}", "@Override\n public void onSuccess(Void aVoid) {\n Toast.makeText(getApplicationContext(), \"Success!\",\n Toast.LENGTH_LONG).show();\n }", "@Override\n\tpublic void stateChanged() {\n\t\t\n\t}", "public void onPersonListChanged();", "public void onDataSetChanged();", "void onVariableChanged(Object... newValue);", "public void notifyChange()\r\n {\r\n setChanged();\r\n notifyObservers();\r\n }", "@Override\n\tpublic void onModeChange() {\n\t}", "@Override\n public void onLocationChanged(Location location) {\n\n }", "@Override\n public void onLocationChanged(Location location) {\n\n }", "void instanceChanged();", "@Override\r\n public void onUpdate() {\n super.onUpdate();\r\n }", "@Override\r\n public void onDataChange(DataSnapshot dataSnapshot) {\n\r\n\r\n }", "public interface OnValueChangeListener {\n void onChanged(String fieldName, Object oldValue, Object newValue);\n}", "public interface OnDatabaseChangedListener{\n void onNewDatabaseEntryAdded();\n void onDatabaseEntryRenamed();\n}", "private void onFullBattery() {\n\n }" ]
[ "0.7169314", "0.669539", "0.6694601", "0.65896595", "0.6527132", "0.65035695", "0.6497463", "0.64525867", "0.64275193", "0.61386454", "0.61153615", "0.610512", "0.610512", "0.6098044", "0.60887426", "0.6081577", "0.60793173", "0.60533583", "0.6044771", "0.60426354", "0.6038831", "0.6018688", "0.60120356", "0.59949446", "0.5991792", "0.59835976", "0.59814215", "0.59781617", "0.59192973", "0.5904329", "0.58827126", "0.5875946", "0.5872169", "0.5866978", "0.5851816", "0.58389515", "0.58349335", "0.58304393", "0.58245444", "0.58226156", "0.5799676", "0.57979363", "0.5796588", "0.5794388", "0.5790131", "0.5771321", "0.57636595", "0.57636595", "0.575313", "0.5748808", "0.5744547", "0.5744476", "0.57374364", "0.5733192", "0.57311803", "0.5727551", "0.57237047", "0.57237047", "0.57206374", "0.57205373", "0.5718586", "0.571404", "0.56978476", "0.5696269", "0.5687166", "0.56859547", "0.56815356", "0.56716657", "0.5660458", "0.5654589", "0.5653499", "0.5649965", "0.5641226", "0.5635843", "0.56352943", "0.5635097", "0.56332636", "0.5632766", "0.5630205", "0.5630205", "0.56203145", "0.56181127", "0.5616689", "0.56156087", "0.56108177", "0.56099075", "0.5609762", "0.5604571", "0.56012917", "0.5598638", "0.5598399", "0.559578", "0.55954295", "0.5595165", "0.5595165", "0.5594772", "0.5594245", "0.5588529", "0.55855846", "0.5580986", "0.5580759" ]
0.0
-1
TODO Autogenerated method stub
@Override public Tutorial insert(Tutorial t) { return cotizadorRepository.save(t); }
{ "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
return ith item of the IntList: iternation
public int iterativeGet(int i) { int val = 0; val = this.first; IntList p = this.rest; while (i > 0) { val = p.first; p = p.rest; i--; } return val; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int get(int i)\n {\n if(integerList != null)\n return integerList[i];\n else\n return -1;\n }", "public Integer get(int index){\n return list.get(index);\n }", "public Item get(int i);", "int getItems(int index);", "public int get(int i) throws ArrayIndexOutOfBoundsException {\n if (i >= 0 && i < count) {\n return list[i];\n } else {\n throw new ArrayIndexOutOfBoundsException();\n }\n }", "public int nextInt() {\n int temp = results.get(index);\n index = index + 1;\n System.out.println(index);\n return temp;\n }", "int getItem(int index);", "@Override\n public int element() {\n isEmptyList();\n return first.value;\n }", "public int get(int i) {\n if (i==0) {\n return first;\n }\n return rest.get(i - 1);\n }", "E get(int i) throws IndexOutOfBoundsException;", "public int get(int index);", "public int i(int index) {\n if (get(index) == null) return 0;\n return this.adapter.get(index).intValue();\n }", "public T returnItem(int i) {\n return a[i];\n }", "abstract int get(int index);", "public Integer at(int i){\n\t\tint cont = 0;\n\t\tNodo aux = first;\n\t\twhile(i<this.size()){\n\t\t\tif(cont == i){\n\t\t\t\treturn aux.getInfo();\n\t\t\t}else{\n\t\t\t\taux = aux.getNext();\n\t\t\t\tcont++;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public TypeHere get(int i) {\n return items[i];\n }", "public int getIntLE(int index)\r\n/* 383: */ {\r\n/* 384:397 */ ensureAccessible();\r\n/* 385:398 */ return _getIntLE(index);\r\n/* 386: */ }", "public I next(){\n return (I) listI.get(index++);\n }", "public Object get(int i)\n {\n if(_list!=null)\n return _list.get(i);\n return null;\n }", "public int get(int i) {\n // YOUR CODE HERE\n return 1;\n }", "private static int getDigit(ArrayList<Integer> num, int index) {\n return index < num.size() ? num.get(index) : 0;\n }", "public E get(int i) {\n\t\tif (size == 0) {\n\t\t\tthrow new IllegalArgumentException(\"List is empty, cannot retrieve item.\");\n\t\t}\n\n\t\tif (i < 0 || i >= size) {\n\t\t\tthrow new IndexOutOfBoundsException(\"Requested index is out of bounds.\");\n\t\t}\n\n\t\treturn list[i];\n\n\t}", "public int getElementAt(int i)\n\t{\n\t\tint elem = 0;\n\t\tint index = -1;\n\t\tSinglyLinkedListNode nextNode = head;\n\t\tSinglyLinkedListNode prevNode = null;\n\t\tif((i < 0 || i >= size()))\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\twhile(true)\n\t\t{\n\t\t\tindex = index + 1;\n\t\t\tif(index == i)\n\t\t\t{\n\t\t\t\telem = nextNode.getData();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tprevNode = nextNode;\n\t\t\t\tnextNode = prevNode.getNext();\n\t\t\t}\n\t\t}\t\t\n\t\treturn elem;\n\t}", "public Item get(int i) {\n return items[i];\n }", "int getFirst(int list) {\n\t\treturn m_lists.getField(list, 0);\n\t}", "public T get(int i);", "T getElementFromIndex(int index) throws ListException;", "public int getFirst();", "public int getInt(int index)\r\n/* 372: */ {\r\n/* 373:386 */ ensureAccessible();\r\n/* 374:387 */ return _getInt(index);\r\n/* 375: */ }", "int get(int idx);", "@Override\n public Integer next() {\n return nums.get(index++);\n }", "int index();", "default V item( int i ) { return getDataAt( indexOfIndex( i ) ); }", "@Override\n\tpublic E get(int i) {\n\t\tif (i < 0 || i >= this.numberOfElements) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\telse {\n\t\t\treturn this.arrayList[i];\n\t\t}\n\t}", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "public Item get(int i) {\n return items[i - 1];\n }", "public item getI() {\n return i;\n }", "public PostingsEntry get( int i ) {\n\t return list.get(i);\n }", "public static int get(int indexInList, boolean useRankedList)\n\t{\n\t\tif (useRankedList)\n\t\t{\n\t\t\treturn indexInList;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn -1 - indexInList;\n\t\t}\n\t}", "public ItemStack get(int paramInt)\r\n/* 26: */ {\r\n/* 27: 41 */ return this.a[paramInt];\r\n/* 28: */ }", "public final i getItem(int i) {\n return (i) this.kLz.get(i);\n }", "public int getIndex();", "public int getIndex();", "public int getIndex();", "public int index();", "int getFirstItemOnPage();", "public int get(int i) {\n\t\tassert i < size();\n\t\treturn arr[i];\n\t}", "private int next(int index)\n\t{\n\t\tif (index == list.length - 1)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn index + 1;\n\t\t}\n\t}", "protected abstract Object getNthObject(int n);", "int getListSnId(int index);", "T get(int i);", "public int getIntLE(int index)\r\n/* 775: */ {\r\n/* 776:784 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 777:785 */ return super.getIntLE(index);\r\n/* 778: */ }", "private int findNextElement() {\n\t\tif (hasNext()) {\n\t\t\tint value = this.index + 1;\n\t\t\treturn value;\n\n\t\t}\n\t\treturn -1;\n\t}", "int getIndexOfElement(T value);", "private int elementNC(int i) {\n return first + i * stride;\n }", "public T get(int i) {\n if (i == 0) {\n return this.first;\n }\n else {\n return this.rest.get(i--);\n }\n }", "private int getInternalListIndex(int index) {\n return index-1;\n }", "Object get(int i);", "private static void retriveElementInArrayList() {\n\t\tLinkedList<Integer> list = new LinkedList<Integer>();\n\t\tlist.add(10);\n\t\tlist.add(20);\n\t\tlist.add(30);\n\t\tlist.add(40);\n\t\tlist.add(50);\n\t\tSystem.out.println(\"LinkedList is : \" + list);\n\t\tSystem.out.println(list.get(3));\n\n\t}", "public Integer get(int i){\n\t\treturn body[i];\n\t}", "private int getIndex() {\n\t\treturn this.index;\r\n\t}", "public short elementIdAt(int i)\n\t{\n\t\treturn m_elems[i];\n\t}", "public E get(int i) {\n\t\tcheckIndex(i);\n\t\tListNode<E> current = hop(i);\n\t\treturn current.value;\n\t}", "@Override\n\tpublic Integer next() {\n\t return iterator.next();\n\t}", "public int getNumber() {\n\t\treturn i;\r\n\t}", "public Integer next() {\n if (list.isEmpty()){\n return iterator.next();\n }else {\n Integer integer = list.get(list.size() - 1);\n list.remove(list.size()-1);\n return integer;\n }\n\n }", "private static int getCustomerIndex(List<Integer> customer){\n return customer.get(0);\n }", "public static void Search(ArrayList<Integer> list, int val)\n{\n // Your code here\n int result = -1;\n for(int i=0; i<list.size(); i++)\n {\n if(list.get(i) == val)\n {\n result = i;\n break;\n }\n }\n System.out.print(result + \" \");\n \n}", "@Override\r\n\t\t\tpublic Object getItem(int i) {\n\t\t\t\treturn i;\r\n\t\t\t}", "public static int fetch(ArrayList<Integer> a, int i, int j){\n\t\treturn a.get(i)/(int)Math.pow(10,j) & 1;\n\t}", "public int getIndex()\n {\n return index;\n }", "@Test\n public void elementLocationTestIterative() {\n int elementNumber = 3;\n System.out.println(nthToLastReturnIterative(list.getHead(), elementNumber).getElement());\n }", "int getIndex(){\r\n\t\treturn index;\r\n\t}", "public int getIndex(){\r\n \treturn index;\r\n }", "private static int getMinIndex(List<Integer> list) {\n return IntStream.range(0, list.size())\n .boxed()\n .min(Comparator.comparingInt(list::get)).\n orElse(list.get(0));\n }", "public int getIndex(\n )\n {return index;}", "protected int _getIntLE(int index)\r\n/* 389: */ {\r\n/* 390:403 */ return HeapByteBufUtil.getIntLE(this.array, index);\r\n/* 391: */ }", "public int getIndice() {\n\t\treturn this.indice;\n\t}", "public int getIndex()\n {\n return m_index;\n }", "public Object elementAt(int n) {\r\n\t\treturn elements.get(n);\r\n\t}", "java.util.List<java.lang.Integer> getItemList();", "public int getIndex(){\n return index;\n }", "public int getIndex(){\n return index;\n }", "@TimeComplexity(\"O(1)\")\n\tpublic int index()\n\t{\n\t\t//TCJ: the cost does not vary with input size so it is constant\n\t\treturn index;\n\t}", "public Object get(int i) {\n return elementAt(i);\n }", "public int getValue() {\r\n return index;\r\n }", "public int getInt(int index)\r\n/* 173: */ {\r\n/* 174:190 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 175:191 */ return super.getInt(index);\r\n/* 176: */ }", "@Override\n public final Integer get(final int index) {\n if (!checkRange(index)) {\n throw new IndexOutOfBoundsException();\n } else {\n return arrayList[index];\n }\n }" ]
[ "0.7198615", "0.68228513", "0.6720617", "0.67174274", "0.66636896", "0.662633", "0.66060156", "0.65407264", "0.6521927", "0.6440333", "0.64207244", "0.63867396", "0.6386017", "0.6345841", "0.63456756", "0.6335271", "0.6294827", "0.6293243", "0.62843335", "0.6261813", "0.6260608", "0.62578756", "0.6222397", "0.62102747", "0.6166272", "0.61588556", "0.61588126", "0.61520416", "0.6148439", "0.6145881", "0.61456114", "0.61427695", "0.6136146", "0.6132052", "0.61201817", "0.61201817", "0.61201817", "0.61201817", "0.61201817", "0.61201817", "0.61201817", "0.61201817", "0.61201817", "0.61201817", "0.61201817", "0.61201817", "0.61201817", "0.61087704", "0.6084523", "0.6072154", "0.6056975", "0.6049359", "0.60472023", "0.6041811", "0.6041811", "0.6041811", "0.6034678", "0.60208416", "0.6019777", "0.6011287", "0.5979278", "0.5977807", "0.59773606", "0.5973433", "0.5970451", "0.5956156", "0.595062", "0.59315467", "0.5928206", "0.5918683", "0.59158456", "0.59113", "0.5905957", "0.5900162", "0.5887469", "0.5885405", "0.58845246", "0.58812636", "0.58714706", "0.5864857", "0.5858166", "0.5858157", "0.5855795", "0.5845232", "0.58395", "0.58311826", "0.5829817", "0.5822883", "0.5819507", "0.5815457", "0.58135974", "0.5797567", "0.5796686", "0.57953775", "0.57953775", "0.5795362", "0.5794895", "0.57926255", "0.5790619", "0.5784739" ]
0.7037354
1
return ith item of the IntList: recursion
public int get(int i) { if (i==0) { return first; } return rest.get(i - 1); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public int iterativeGet(int i) {\n int val = 0;\n val = this.first;\n IntList p = this.rest;\n while (i > 0) {\n val = p.first;\n p = p.rest;\n i--;\n }\n return val;\n }", "public int get(int i)\n {\n if(integerList != null)\n return integerList[i];\n else\n return -1;\n }", "int getItems(int index);", "public Item get(int i);", "public int nextInt() {\n int temp = results.get(index);\n index = index + 1;\n System.out.println(index);\n return temp;\n }", "public Integer get(int index){\n return list.get(index);\n }", "@Test\n public void elementLocationTestIterative() {\n int elementNumber = 3;\n System.out.println(nthToLastReturnIterative(list.getHead(), elementNumber).getElement());\n }", "public Integer at(int i){\n\t\tint cont = 0;\n\t\tNodo aux = first;\n\t\twhile(i<this.size()){\n\t\t\tif(cont == i){\n\t\t\t\treturn aux.getInfo();\n\t\t\t}else{\n\t\t\t\taux = aux.getNext();\n\t\t\t\tcont++;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}", "public int get(int i) {\n // YOUR CODE HERE\n return 1;\n }", "int getFirstItemOnPage();", "protected abstract Object getNthObject(int n);", "@Override\n public int element() {\n isEmptyList();\n return first.value;\n }", "private static int getDigit(ArrayList<Integer> num, int index) {\n return index < num.size() ? num.get(index) : 0;\n }", "int getItem(int index);", "public Item recursivHelper(StuffNode x, int index) {\n if (index == 0) {\n return x.item;\n } else {\n return recursivHelper(x.next, index-1);\n }\n }", "public int getElementAt(int i)\n\t{\n\t\tint elem = 0;\n\t\tint index = -1;\n\t\tSinglyLinkedListNode nextNode = head;\n\t\tSinglyLinkedListNode prevNode = null;\n\t\tif((i < 0 || i >= size()))\n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\twhile(true)\n\t\t{\n\t\t\tindex = index + 1;\n\t\t\tif(index == i)\n\t\t\t{\n\t\t\t\telem = nextNode.getData();\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tprevNode = nextNode;\n\t\t\t\tnextNode = prevNode.getNext();\n\t\t\t}\n\t\t}\t\t\n\t\treturn elem;\n\t}", "public static void Search(ArrayList<Integer> list, int val)\n{\n // Your code here\n int result = -1;\n for(int i=0; i<list.size(); i++)\n {\n if(list.get(i) == val)\n {\n result = i;\n break;\n }\n }\n System.out.print(result + \" \");\n \n}", "public T returnItem(int i) {\n return a[i];\n }", "@Test\n public void elementLocationTestRecursive() {\n ReverseCount reverseCount = new ReverseCount();\n int elementNumber = 3;\n System.out.println(nthToLastReturnRecursive(list.getHead(), elementNumber, reverseCount).getElement());\n }", "public int findNum(int x){\n\t\t\tif(this.list.length == 0){\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t\treturn findNumRec(x, 0, list.length-1);\n\t\t}", "private int next(int index)\n\t{\n\t\tif (index == list.length - 1)\n\t\t{\n\t\t\treturn 0;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn index + 1;\n\t\t}\n\t}", "public ItemStack get(int paramInt)\r\n/* 26: */ {\r\n/* 27: 41 */ return this.a[paramInt];\r\n/* 28: */ }", "public int getFirst();", "private int findNthElement(int index) {\n if (head == null)\n return 0;\n ListNode pointer1 = head;\n ListNode pointer2 = head;\n int count = 0;\n while (count < index) {\n pointer1 = pointer1.next;\n count++;\n }\n while (pointer1.next != null) {\n pointer1 = pointer1.next;\n pointer2 = pointer2.next;\n }\n return pointer2.data;\n }", "public int get(int i) throws ArrayIndexOutOfBoundsException {\n if (i >= 0 && i < count) {\n return list[i];\n } else {\n throw new ArrayIndexOutOfBoundsException();\n }\n }", "abstract int get(int index);", "T getElementFromIndex(int index) throws ListException;", "E get(int i) throws IndexOutOfBoundsException;", "private int helper(List<List<Integer>> res, TreeNode root) {\n if (root == null) return -1;\n int left = helper(res, root.left);\n int right = helper(res, root.right);\n int curr = Math.max(left, right) + 1;\n if (res.size() == curr) res.add(new ArrayList<>());\n res.get(curr).add(root.val);\n return curr;\n }", "public int getIntLE(int index)\r\n/* 383: */ {\r\n/* 384:397 */ ensureAccessible();\r\n/* 385:398 */ return _getIntLE(index);\r\n/* 386: */ }", "protected abstract int solve(List<Integer> myList);", "int getFirst(int list) {\n\t\treturn m_lists.getField(list, 0);\n\t}", "public I next(){\n return (I) listI.get(index++);\n }", "public static int getNth(ListNode head, int index){\n\t\tif(head == null){\n\t\t\tthrows new IllegalAugumentException(\"Empty List\");\n\t\t} \n\t\t\n\t\tListNode current = head;\n\t\t//int count = 0;\n\t\twhile(current != null){\n\t\t\tfor(int count = 0; count < index; count++){\n\t\t\t\tcurrent = current.next;\n\t\t\t}\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tif(current = null){\n\t\t\tthrows new IndexOutOfBountException();\n\t\t}else{\n\t\t\treturn current.value;\n\t\t}\n\t}", "private static int getMinIndex(List<Integer> list) {\n return IntStream.range(0, list.size())\n .boxed()\n .min(Comparator.comparingInt(list::get)).\n orElse(list.get(0));\n }", "public E get(int i) {\n\t\tif (size == 0) {\n\t\t\tthrow new IllegalArgumentException(\"List is empty, cannot retrieve item.\");\n\t\t}\n\n\t\tif (i < 0 || i >= size) {\n\t\t\tthrow new IndexOutOfBoundsException(\"Requested index is out of bounds.\");\n\t\t}\n\n\t\treturn list[i];\n\n\t}", "public T get(int i) {\n if (i == 0) {\n return this.first;\n }\n else {\n return this.rest.get(i--);\n }\n }", "int index();", "T get(int i);", "public Object get(int index) \r\n throws ListIndexOutOfBoundsException {\r\n\t\t\t\t\tif (index >= 0 && index <= numItems) { // If statement to catch out of bounds exception\r\n\t\t\t\t\t\t Node curr = head; // states curr is at head posistion\r\n\t\t\t\t\t\t for (int i = 1; i < index; i++) { // for loop to get to the current posistion that is equivelnt to i\r\n\t\t\t\t\t\t\t curr = curr.getNext();\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\t\t return curr.getItem(); // returns item in current node\r\n\t\t\t\t\t\t }\r\n\t\t\t\t\telse {\r\n\t\t\t\t\t\t throw new ListIndexOutOfBoundsException (\"List index out of bounds\"); // else throws an index out of bounds exception\r\n\t\t\t\t\t}\r\n }", "public T get(int i);", "public Integer peek() {\n\t\tif (list == null || list.size() == 0) { return -1; }\n\t\treturn list.peek();\n\t}", "public Object get(int i)\n {\n if(_list!=null)\n return _list.get(i);\n return null;\n }", "public int findItem(int value) {\n return find(value, root);\n }", "public static int get(int indexInList, boolean useRankedList)\n\t{\n\t\tif (useRankedList)\n\t\t{\n\t\t\treturn indexInList;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn -1 - indexInList;\n\t\t}\n\t}", "@Override\n public Integer next() {\n return nums.get(index++);\n }", "public int get(int index);", "public int getInt(int index)\r\n/* 372: */ {\r\n/* 373:386 */ ensureAccessible();\r\n/* 374:387 */ return _getInt(index);\r\n/* 375: */ }", "private int _Index(int level) {\r\n long current = m_thisCheckTime; \r\n current >>= (LIST1_BITS + level * LIST_BITS);\r\n return (int)(current & (LIST_SIZE - 1));\r\n }", "public E get(int i) {\n\t\tcheckIndex(i);\n\t\tListNode<E> current = hop(i);\n\t\treturn current.value;\n\t}", "int getIndexOfElement(T value);", "private int getInternalListIndex(int index) {\n return index-1;\n }", "private int indexOf(int[] list, int item)\n\t{\n\t\t// Search the list for the item and return the index when found\n\t\tfor(int i = 0; i < listSize; i++)\n\t\t{\n\t\t\tif(list[i] == item) \n\t\t\t{ \n\t\t\t\treturn i;\n\t\t\t}\n\t\t}\n\n\t\t// We should never get here, if we do something is wrong so throw a fatal error\n\t\tSystem.out.println(\"Fatal Error: \" + item + \" does not exist on both lists!\");\n\t\tSystem.exit(1);\n\t\treturn -1;\n\t}", "int get(int idx);", "private int findNextElement() {\n\t\tif (hasNext()) {\n\t\t\tint value = this.index + 1;\n\t\t\treturn value;\n\n\t\t}\n\t\treturn -1;\n\t}", "public Integer next() {\n if (list.isEmpty()){\n return iterator.next();\n }else {\n Integer integer = list.get(list.size() - 1);\n list.remove(list.size()-1);\n return integer;\n }\n\n }", "public int getIntLE(int index)\r\n/* 775: */ {\r\n/* 776:784 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 777:785 */ return super.getIntLE(index);\r\n/* 778: */ }", "public TypeHere get(int i) {\n return items[i];\n }", "public int getIntegerItem(String subExpression, int i) {\n int result = 0;\n try {\n NodeList nl = (NodeList)xp.evaluate(contextNode + \"/\" + subExpression, source, XPathConstants.NODESET);\n if (i < nl.getLength()) result = Integer.parseInt(nl.item(i).getTextContent());\n } catch(Exception e) {\n Util.log(\"XML error: can't read node \" + subExpression + \".\");\n Util.logException(e);\n }\n return result;\n }", "int getListSnId(int index);", "public item getI() {\n return i;\n }", "private void getInventoryNumber(ArrayList list){}", "public T first(int x)throws EmptyCollectionException, \n InvalidArgumentException;", "String getFirstInt();", "public int nextInt() {\n\t\t\n\t\tif (numsLeft != 0) {\n\t\t\t\n\t\t\t// Generate a random index\n\t\t\tint randIndex = (int)(Math.random() * numsLeft);\n\t\t\tnumsLeft--;\n\t\t\t\n\t\t\t// Get the number at the index, then removes the number from the array\n\t\t\tint retval = listOfNums.get(randIndex);\n\t\t\tlistOfNums.remove(randIndex);\n\t\t\t\n\t\t\t// Return number\n\t\t\treturn retval;\n\t\t}\n\t\t\n\t\treturn 0;\n\t}", "public static int fetch(ArrayList<Integer> a, int i, int j){\n\t\treturn a.get(i)/(int)Math.pow(10,j) & 1;\n\t}", "private int searchIndex(int listIndex) {\n int currentTreeIndex = this.indexCorrespondingToTheFirstElement;\n Node<T> currentNode = getHelper(currentTreeIndex);\n for (int i = 0; i < listIndex; i++) {\n currentTreeIndex = currentNode.nextIndex;\n currentNode = getHelper(currentTreeIndex);\n }\n return currentTreeIndex;\n }", "public abstract int start(int i);", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "public static int getNumberToAddInList() {\n\t\tint input = scanner.nextInt();\n\t\treturn input;\n\t}", "public int i(int index) {\n if (get(index) == null) return 0;\n return this.adapter.get(index).intValue();\n }", "private static int getCustomerIndex(List<Integer> customer){\n return customer.get(0);\n }", "@Test\n public void testIndexOf_Overflow() {\n SegmentedOasisList<Integer> instance = new SegmentedOasisList<>(2, 2);\n Collection c = Arrays.asList(1, 1, 7, 7, 1, 1, 1);\n instance.addAll(c);\n Integer arg = 7;\n\n int result = instance.indexOf(arg);\n int expResult = 2;\n\n assertEquals(expResult, result);\n\n }", "public int get(int index) {\n if(index<0 || head==null)\n return -1;\n ListNode p=head;\n int count=0;\n while (p!=null && count!=index){\n p=p.next;\n count++;\n }\n if(p==null)\n return -1;\n return p.val;\n }", "public int next() {\r\n\t\tif (currentPosition <= list.length &&list[currentPosition]==-1) {\r\n\t\t\tcurrentPosition = 0;\r\n\t\t\treturn list[currentPosition];\r\n\t\t}\r\n\t\treturn list[currentPosition++];\r\n\t}", "short getFirstOpenIndexInArgument(UUID id);", "java.util.List<java.lang.Integer> getItemsList();", "public synchronized int search(Object arg)\n {\n int result = -1;\n for (int i=0; i<dataList.size(); i++)\n {\n Object testItem = dataList.get(i);\n if (arg.equals(testItem))\n {\n // calculate the 1-based index of the last item\n // in the List (the top item on the stack)\n result = i + 1;\n break;\n }\n }\n return result;\n }", "private int elementNC(int i) {\n return first + i * stride;\n }", "public static int divideRecursion(List<List<Integer>> R) {\r\n\t\tList<Integer> seq = new ArrayList<Integer>();\r\n\t\tseq.add(0);\r\n\t\tseq.add(1);\r\n\t\tif(R.size() != 0) {\r\n\t\t\treturn divideRecursion(R, R.size(), seq);\r\n\t\t} else {\r\n\t\t\treturn -1;\r\n\t\t}\r\n\t}", "public int get(int index) {\n if (index >= this.size || index < 0) {\n return -1;\n }\n\n ListNode curr = this.head;\n\n for (int i = 0; i < index + 1; ++i) {\n curr = curr.next;\n }\n return curr.val;\n }", "public Item get(int i) {\n return items[i - 1];\n }", "java.util.List<java.lang.Integer> getItemList();", "Object get(int i);", "public abstract T forEntry(int i);", "public int getInt(int index)\r\n/* 173: */ {\r\n/* 174:190 */ recordLeakNonRefCountingOperation(this.leak);\r\n/* 175:191 */ return super.getInt(index);\r\n/* 176: */ }", "private Node getNth(int index) \n { \n int currIndex = 0;\n Node currNode = this.head.next;\n while(currIndex < index)\n {\n currNode = currNode.getNext();\n currIndex++;\n }\n return currNode;\n }", "public static Spliterator.OfInt spliterator(PrimitiveIterator.OfInt paramOfInt, long paramLong, int paramInt) {\n/* 508 */ return new IntIteratorSpliterator(Objects.<PrimitiveIterator.OfInt>requireNonNull(paramOfInt), paramLong, paramInt);\n/* */ }" ]
[ "0.72769254", "0.64461476", "0.61465645", "0.6096954", "0.6032204", "0.5956715", "0.5905903", "0.5897758", "0.5896339", "0.5857332", "0.58521307", "0.58397", "0.58236736", "0.5816525", "0.58015", "0.5794941", "0.5756095", "0.57556015", "0.57220715", "0.5680737", "0.5676425", "0.56686556", "0.56633407", "0.5655325", "0.56410927", "0.5629823", "0.562541", "0.5624057", "0.5622106", "0.56201065", "0.5618336", "0.5593001", "0.55914927", "0.55647594", "0.5545895", "0.55453545", "0.5531155", "0.55223227", "0.5519793", "0.5519654", "0.5519162", "0.55102503", "0.55083007", "0.55007243", "0.54918844", "0.5484396", "0.54822624", "0.54785806", "0.54766697", "0.54576886", "0.54343116", "0.54320955", "0.5427474", "0.5426915", "0.5418966", "0.5413584", "0.5412605", "0.5407947", "0.53949994", "0.5392498", "0.5382535", "0.5380474", "0.53779525", "0.53756374", "0.5373772", "0.5370923", "0.53684145", "0.5366314", "0.53654146", "0.53654146", "0.53654146", "0.53654146", "0.53654146", "0.53654146", "0.53654146", "0.53654146", "0.53654146", "0.53654146", "0.53654146", "0.53654146", "0.53654146", "0.5362846", "0.5357919", "0.5354023", "0.5341279", "0.53392816", "0.5330447", "0.53294027", "0.53278005", "0.5321601", "0.5313813", "0.53117543", "0.5302935", "0.53025013", "0.5300876", "0.529969", "0.529629", "0.52956074", "0.52848935", "0.5284042" ]
0.61091083
3
Get a few urls, and then download web page by http request
static Page Download(){ // TODO: reference to fetch to download webpages WebURL url = queue.poll(); // call http request to get the web page return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void getLinks() {\n\n var client = HttpClient.newBuilder()\n .followRedirects(HttpClient.Redirect.ALWAYS)\n .build();\n\n HttpRequest request = HttpRequest.newBuilder()\n .uri(URI.create(URL_PREFIX))\n .build();\n client.sendAsync(request, HttpResponse.BodyHandlers.ofLines())\n .thenApply(HttpResponse::body)\n .thenApply(this::processLines)\n .thenApply(versions -> tasks(versions))\n .join();\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "protected String doInBackground(Object... urls) {\n try {\n String st = downloadUrl((String) urls[0]);\n return st;\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "String wget(String url);", "@Override\n protected String doInBackground(String... urls) {\n try {\n return ayudanteConeccionMySql.downloadUrl(urls[0]);\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n protected String doInBackground(String... urls) {\n OkHttpClient client = new OkHttpClient();\n Request request =\n new Request.Builder()\n .url(urls[0])\n .build();\n Response response = null;\n try {\n response = client.newCall(request).execute();\n if (response.isSuccessful()) {\n return response.body().string();\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n return \"Download failed\";\n }", "private String getURL(String feedUrl) {\n\tStringBuilder sb = null;\n\ttry {\n for(int i = 3; i>0; i--) {\n\t sb = new StringBuilder();\n URL url = new URL(feedUrl);\n//User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.22) Gecko/20110902 Firefox/3.6.22 GTB7.1 ( .NET CLR 3.5.30729)\n//Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\n//Accept-Language: en-us,en;q=0.5\n//Accept-Encoding: gzip,deflate\n//Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7\n//Keep-Alive: 115\n//Connection: keep-alive\n//\tHttpsURLConnection uc = (HttpsURLConnection) url.openConnection();\n\tHttpURLConnection uc = (HttpURLConnection) url.openConnection();\n\tuc.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.22) Gecko/20110902 Firefox/3.6.22 GTB7.1 ( .NET CLR 3.5.30729)\");\n//Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\n\tuc.setRequestProperty(\"Accept\", \"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\");\n\tuc.setRequestProperty(\"Accept-Language\", \"en-us,en;q=0.5\");\n\tuc.setRequestProperty(\"Accept-Encoding\", \"gzip,deflate\");\n\tuc.setRequestProperty(\"Accept-Charset\", \"ISO-8859-1,utf-8;q=0.7,*;q=0.7\");\n\tuc.setRequestProperty(\"Keep-Alive\", \"115\");\n\tuc.setRequestProperty(\"Connection\", \"keep-alive\");\n//Keep-Alive: 115\n//Connection: keep-alive\n//\tif (userName != null && password != null) {\n//\t\tuc.setRequestProperty(\"Authorization\", \"Basic \" + encodedAuthenticationString);\n//\t}\n\t// ori setting??\n//\tuc.setReadTimeout(TIME_OUT);\n//\tuc.setFollowRedirects(true);\n//\tuc.setInstanceFollowRedirects(true);\n//\tuc.setAllowUserInteraction(true);\n\tuc.setDoOutput(true);\n\tuc.setDoInput(true);\n\tuc.setUseCaches(false);\n\tuc.setRequestMethod(\"POST\");\n\tuc.setRequestProperty(\"Content-Type\", \"text/xml\");\n\t\n\tBufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));//uc.getInputStream()\n\tString inputLine;\n//\t'aa7c.com')\" onmouseout=\"menuLayers.hide()\">Available</a>\n\tboolean refreshAgain = false;\n\twhile ((inputLine = in.readLine()) != null) {\n//\t\tSystem.out.println(inputLine);\n\t\tsb.append(inputLine);\n\t\tif( inputLine.contains(\"Refresh\") ) {\n\t\t\trefreshAgain = true;\n\t\t\tSystem.out.println(\"Refresh\");\n\t\t}\n\t}\n\tin.close();\n\tuc.disconnect();\t\t\n//\tRefresh\n\tif( refreshAgain ) {\n\t Thread.sleep(1000);\n\t}\n\telse break;\n }\n }catch(Exception ee){}\nreturn sb.toString();\n}", "@Override\n protected String doInBackground(String... urls) {\n String response = \"\";\n HttpURLConnection urlConnection = null;\n for (String url : urls) {\n try {\n URL urlObject = new URL(url);\n urlConnection = (HttpURLConnection) urlObject.openConnection();\n\n InputStream content = urlConnection.getInputStream();\n\n BufferedReader buffer = new BufferedReader(new InputStreamReader(content));\n String s = \"\";\n while ((s = buffer.readLine()) != null) {\n response += s;\n }\n\n } catch (Exception e) {\n response = \"Unable to download the list of posts, Reason: \"\n + e.getMessage();\n }\n finally {\n if (urlConnection != null)\n urlConnection.disconnect();\n }\n }\n return response;\n\n }", "public static void httpDownload(String url, FileOutputStream file) throws Exception {\r\n \t\tDefaultHttpClient client = new DefaultHttpClient();\r\n \t\tHttpResponse response = client.execute(new HttpGet(url));\r\n \t\tif(response.getStatusLine().getStatusCode() < 400){\r\n \t\t\tBufferedOutputStream writer = null;\r\n \t\t\tBufferedInputStream reader = null;\r\n \t\t\ttry {\r\n \t\t\t\twriter = new BufferedOutputStream(file);\r\n \t\t\t\treader = new BufferedInputStream(response.getEntity().getContent());\r\n \r\n \t\t\t\tbyte[] buffer = new byte[BUF_SIZE];\r\n \t\t\t\tint bytesRead = reader.read(buffer);\r\n \r\n \t\t\t\twhile (bytesRead > 0) {\r\n \t\t\t\t\twriter.write(buffer, 0, bytesRead);\r\n \t\t\t\t\tbytesRead = reader.read(buffer);\r\n \t\t\t\t}\r\n \t\t\t} finally {\r\n \t\t\t\tif (writer != null) {\r\n \t\t\t\t\twriter.close();\r\n \t\t\t\t}\r\n \t\t\t\tif (reader != null) {\r\n \t\t\t\t\treader.close();\r\n \t\t\t\t}\r\n \t\t\t}\r\n \t\t}\r\n \t}", "private InputStream downloadUrl(String urlString) throws IOException {\n URL url = new URL(urlString);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n //conn.setReadTimeout(10000 /* milliseconds */);\n // conn.setConnectTimeout(15000 /* milliseconds */);\n conn.setRequestMethod(\"GET\");\n conn.setDoInput(true);\n conn.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 ( compatible ) \");\n conn.setRequestProperty(\"Accept\", \"*/*\");\n // Starts the query\n conn.connect();\n\n return conn.getInputStream();\n }", "private InputStream downloadUrl(String urlString) throws IOException {\n \tSystem.out.println(\"Inside downloadURL\");\n URL url = new URL(urlString);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n \n conn.setReadTimeout(10000 /* milliseconds */);\n conn.setConnectTimeout(15000 /* milliseconds */);\n conn.setRequestMethod(\"GET\");\n conn.setDoInput(true);\n // Starts the query\n conn.connect();\n InputStream stream = conn.getInputStream();\n return stream;\n }", "private String downloadUrl(String myurl) throws IOException {\n InputStream is = null;\n // Only display the first 500 characters of the retrieved\n // web page content.\n int len = 500;\n\n try {\n URL url = new URL(myurl);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setReadTimeout(10000); /* milliseconds */\n conn.setConnectTimeout(15000);/* milliseconds */\n conn.setRequestMethod(\"GET\");\n conn.setDoInput(true);\n // Starts the query\n conn.connect();\n int response = conn.getResponseCode();\n Log.d(\"network\", \"The response is: \" + response);\n is = conn.getInputStream();\n\n // Convert the InputStream into a string\n String contentAsString = convertStreamToString(is);\n return contentAsString;\n\n // Makes sure that the InputStream is closed after the app is\n // finished using it.\n } finally {\n if (is != null) {\n is.close();\n }\n }\n }", "public String sendGet(String url)\n\t{\n\t\t//Getting most relevant user-agent from robots.txt\n\t\tbest_match = findBestMatch();\n\t\t//Deicing whether or not to skip\n\t\tif (shouldSkip(url))\n\t\t{\n\t\t\treturn \"skipped\";\n\t\t}\n\t\tif (url.startsWith((\"https\")))\n\t\t{\n\t\t\treturn sendGetSecure(url);\n\t\t}\n\t\ttry \n\t\t{\n\t\t\t//Creating URL objects\n\t\t\tURL http_url = new URL(url);\n\t\t\t//Delaying visit if directed to by robots.txt\n\t\t\tcrawlDelay();\n\t\t\tHttpURLConnection secure_connection = (HttpURLConnection)http_url.openConnection();\n\t\t\t//Setting request method\n\t\t\tsecure_connection.setRequestMethod(\"GET\");\n\t\t\t//Sending all headers except for host (since URLConnection will take care of this)\n\t\t\tfor (String h: headers.keySet())\n\t\t\t{\n\t\t\t\tif (!h.equals(\"Host\"))\n\t\t\t\t{\n\t\t\t\t\tsecure_connection.setRequestProperty(h, headers.get(h));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//Getting ResponseParser object to read in page content\n\t\t\tp = new ResponseParser(new BufferedReader(new InputStreamReader(secure_connection.getInputStream())));\n\t\t\t\n\t\t\t//Parsing all response headers from returned object\n\t\t\tMap<String,String> p_headers = p.getHeaders();\n\t\t\tMap<String, List<String>> response_headers = secure_connection.getHeaderFields();\n\t\t\tfor (Map.Entry<String, List<String>> entry : response_headers.entrySet()) \n\t\t\t{\n\t\t\t\tif (entry.getKey() == null)\n\t\t\t\t{\n\t\t\t\t\tp.setResponse(entry.getValue().get(0));\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tp_headers.put(entry.getKey(),entry.getValue().get(0));\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//If we didn't get any headers in the response, the URL was invalid\n\t\t\tif (p.getHeaders().size() == 0)\n\t\t\t{\n\t\t\t\treturn (\"invalid url\");\n\t\t\t}\n\t\t\t\n\t\t\t//Otherwise return the contents of the returned document\n\t\t\treturn p.getData();\n\t\t\t\n\t\t} \n\t\tcatch (IOException | IllegalArgumentException e) \n\t\t{\n\t\t\treturn \"invalid url\";\n\t\t}\t\t\n//\t\ttry\n//\t\t{\n//\t\t\t//Deals with secure request\n//\t\t\tif (url.startsWith((\"https\")))\n//\t\t\t{\n//\t\t\t\treturn sendGetSecure(url);\n//\t\t\t}\n//\t\t\t//Parsing host and port from URL\n//\t\t\tURLInfo url_info = new URLInfo(url);\n//\t\t\thost = url_info.getHostName();\n//\t\t\tport = url_info.getPortNo();\n//\t\t\t\n//\t\t\t//Changing Host header if necessary\n//\t\t\theaders.put(\"Host\", host + \":\" + port);\n//\t\t\t\n//\t\t\t//Getting file path of URL\n//\t\t\tString file_path = url_info.getFilePath();\n//\t\t\t\n//\t\t\t//If we weren't able to find a host, URL is invalid\n//\t\t\tif (host == null)\n//\t\t\t{\n//\t\t\t\treturn \"invalid url\";\n//\t\t\t}\n//\t\t\t\n//\t\t\t//Delaying visits based on robots.txt crawl delay\n//\t\t\tcrawlDelay();\n//\t\t\t\n//\t\t\t//Otherwise, opening up socket and sending request with all headers\n//\t\t\tsocket = new Socket(host, port);\n//\t\t\tout = new PrintWriter(socket.getOutputStream(), true);\n//\t\t\tString message = \"GET \" + file_path + \" HTTP/1.1\\r\\n\";\n//\t\t\tfor (String header: headers.keySet())\n//\t\t\t{\n//\t\t\t\tString head = header + \": \" + headers.get(header) + \"\\r\\n\";\n//\t\t\t\tmessage = message + head;\n//\t\t\t}\n//\t\t\tout.println(message);\n//\n//\t\t\t//Creating ResponseParser object to parse the Response\n//\t\t\tp = new ResponseParser(socket);\n//\t\t\t\n//\t\t\t//If we didn't get any headers in the response, the URL was invalid\n//\t\t\tif (p.getHeaders().size() == 0)\n//\t\t\t{\n//\t\t\t\treturn (\"invalid url\");\n//\t\t\t}\n//\t\t\t//Otherwise return the contents of the returned document\n//\t\t\treturn p.getData();\n//\t\t} \n//\t\tcatch (UnknownHostException e) \n//\t\t{\n//\t\t\tSystem.err.println(\"Unknown Host Exception\");\n//\t\t\tSystem.err.println(\"Problem url is: http://www.youtube.com/motherboardtv?feature=watch&trk_source=motherboard\");\n//\t\t} \n//\t\tcatch (IOException | IllegalArgumentException e) \n//\t\t{\n//\t\t\tSystem.err.println(\"IO Exception\");;\n//\t\t}\n//\t\t//Return null for all caught exceptions (Servlet will deal with this)\n//\t\treturn null;\n\t}", "private void downloadContent(){\n try {\n URL yahoo = new URL( \"http://api.letsleapahead.com/LeapAheadMultiFreindzy/index.php?action=getLang&langCode=EN&langId=1&appId=6\");\n BufferedReader in = new BufferedReader(\n new InputStreamReader(yahoo.openStream()));\n String inputLine;\n while ((inputLine = in.readLine()) != null)\n Log.e(\"TAG\" , inputLine);\n in.close();\n }catch (Exception e){\n e.printStackTrace();\n }\n\n }", "public String doHttpGet(String url, final String ...head);", "private String downloadURL(String url) {\n\t\ttry {\n\t\t\tHttpClient client = new DefaultHttpClient();\n\t\t\tHttpGet request = new HttpGet(url);\n\t\t\t// Get the response\n\t\t\tResponseHandler<String> responseHandler = new BasicResponseHandler();\n\t\t\tString response_str = client.execute(request, responseHandler);\n\t\t\treturn response_str;\n\n\t\t\t// Makes sure that the InputStream is closed after the app is\n\t\t\t// finished using it.\n\t\t} catch (IOException e) {\n\t\t\tLog.d(\"WL\", \"Error\");\n\t\t\te.printStackTrace();\n\t\t\treturn \"Error\";\n\t\t}\n\t}", "private InputStream downloadUrl(String urlString) throws IOException {\n\t URL url = new URL(urlString);\n\t HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n\t conn.setReadTimeout(10000 /* milliseconds */);\n\t conn.setConnectTimeout(15000 /* milliseconds */);\n\t conn.setRequestMethod(\"GET\");\n\t conn.setDoInput(true);\n\t // Starts the query\n\t conn.connect();\n\t return conn.getInputStream();\n\t}", "private String downloadUrl(String myUrl) throws IOException {\n InputStream is = null;\n\n try {\n URL url = new URL(myUrl);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setReadTimeout(10000 /* milliseconds */);\n conn.setConnectTimeout(15000 /* milliseconds */);\n conn.setRequestMethod(\"GET\");\n conn.setDoInput(true);\n // Starts the QUERY\n conn.connect();\n //int response = conn.getResponseCode();\n //Log.d(\"JSON\", \"The response is: \" + response);\n is = conn.getInputStream();\n\n // Convert the InputStream into a string\n return readIt(is);\n\n // Makes sure that the InputStream is closed after the app is\n // finished using it.\n } finally {\n if (is != null) {\n is.close();\n }\n }\n }", "private String downloadURL(String myurl) {\n\t\ttry {\n\t\t\tHttpClient client = new DefaultHttpClient();\n\t\t\tHttpGet request = new HttpGet(myurl);\n\t\t\t// Get the response\n\t\t\tResponseHandler<String> responseHandler = new BasicResponseHandler();\n\t\t\tString response_str = client.execute(request, responseHandler);\n\t\t\treturn response_str;\n\n\t\t\t// Makes sure that the InputStream is closed after the app is\n\t\t\t// finished using it.\n\t\t} catch (IOException e) {\n\t\t\tLog.d(\"WL\", \"Error\");\n\t\t\treturn \"Error\";\n\t\t}\n\t}", "String download(String path) throws IOException;", "WebCrawlerData retrieve(String url);", "private InputStream downloadUrl(String urlString) throws IOException {\n URL url = new URL(urlString);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setReadTimeout(10000 /* milliseconds */);\n conn.setConnectTimeout(15000 /* milliseconds */);\n conn.setRequestMethod(\"GET\");\n conn.setDoInput(true);\n // Starts the query\n conn.connect();\n return conn.getInputStream();\n }", "private InputStream downloadUrl(String urlString) throws IOException {\n\t\tURL url = new URL(urlString);\n\t\tHttpURLConnection conn = (HttpURLConnection) url.openConnection();\n\t\tconn.setReadTimeout(10000 /* milliseconds */);\n\t\tconn.setConnectTimeout(15000 /* milliseconds */);\n\t\tconn.setRequestMethod(\"GET\");\n\t\tconn.setDoInput(true);\n\t\t// Starts the query\n\t\tconn.connect();\n\t\tInputStream stream = conn.getInputStream();\n\n\t\treturn stream;\n\t}", "private InputStream downloadUrl(String urlString) throws IOException {\n URL url = new URL(urlString);\n HttpURLConnection conn = (HttpURLConnection) url.openConnection();\n conn.setReadTimeout(100000 /* milliseconds */);\n conn.setConnectTimeout(150000 /* milliseconds */);\n conn.setRequestMethod(\"GET\");\n conn.setDoInput(true);\n // Starts the query\n conn.connect();\n return conn.getInputStream();\n\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n return downloadUrl(urls[0]);\n } catch (IOException e) {\n\n\n return \"Unable to retrieve data. We are working on it..\";\n }\n }", "private String getUrlContents(String theUrl) {\n StringBuilder content = new StringBuilder();\n try {\n URL url = new URL(theUrl);\n URLConnection urlConnection = url.openConnection();\n //reads the response\n BufferedReader br = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()), 8);\n String line;\n while ((line = br.readLine()) != null) {\n content.append(line + \"\\n\");\n }\n br.close();\n }catch (Exception e) {\n //error occured, usually network related\n e.printStackTrace();\n }\n return content.toString();\n }", "public static void httpDownload(String url, String destFile) throws Exception {\r\n \t\tFileOutputStream out = null;\r\n \t\ttry {\r\n \t\t\tout = new FileOutputStream(destFile);\r\n \t\t\thttpDownload(url, out);\r\n \r\n \t\t} finally {\r\n \t\t\tif (out != null) {\r\n \t\t\t\tout.close();\r\n \t\t\t}\r\n \t\t}\r\n \t}", "public static String downloadContent(String url) throws IOException {\n URL website = new URL(url);\n URLConnection connection = website.openConnection();\n BufferedReader in = new BufferedReader(\n new InputStreamReader(\n connection.getInputStream()));\n\n StringBuilder response = new StringBuilder();\n String inputLine;\n\n while ((inputLine = in.readLine()) != null)\n response.append(inputLine);\n\n in.close();\n\n return response.toString();\n }", "void download(SearchResult result, String downloadPath);", "private static String downloadUrl(String downloadUrl) throws IOException {\n URL url = new URL(downloadUrl);\n\n HttpURLConnection httpURLConnection= (HttpURLConnection) url.openConnection();\n httpURLConnection.connect();\n\n InputStream urlInputStream = httpURLConnection.getInputStream();\n BufferedReader museumDataReader = new BufferedReader(new InputStreamReader(urlInputStream));\n\n StringBuilder museumDataBuilder = new StringBuilder();\n String line = \"\";\n \n while( (line = museumDataReader.readLine()) != null ) {\n museumDataBuilder.append(line);\n }\n\n String museumData = museumDataBuilder.toString();\n museumDataReader.close();\n\n return museumData;\n }", "public static void main(String[] args) {\n HttpClient client = new HttpClient();\n\n // Create a method instance.\n GetMethod method = new GetMethod(url);\n\n // Provide custom retry handler is necessary\n method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER,\n new DefaultHttpMethodRetryHandler(3, false));\n\n try {\n // Execute the method.\n int statusCode = client.executeMethod(method);\n\n if (statusCode != HttpStatus.SC_OK) {\n System.err.println(\"Method failed: \" + method.getStatusLine());\n }\n\n // Read the response body.\n byte[] responseBody = method.getResponseBody();\n\n Document doc= Jsoup.parse(new String(responseBody));\n\n Element body = doc.select(\"div.c1-body\").first();\n // 找出定义了 class=masthead 的元素\n Elements contents = body.select(\"div.c1-bline\");\n for (Element content : contents) {\n Element link = content.select(\"div\").select(\"a\").get(1);\n String linkHref = link.attr(\"href\");\n String linkText = link.text();\n System.out.println(\"-------------------------\");\n System.out.println(linkHref+\",\"+linkText);\n// copyTofile(\"------------------------------\");\n// copyTofile(linkHref+\",\"+linkText +\"\\n\");\n// readStatics(linkHref);\n }\n // Deal with the response.\n // Use caution: ensure correct character encoding and is not binary data\n// System.out.println(new String(responseBody));\n\n } catch (HttpException e) {\n System.err.println(\"Fatal protocol violation: \" + e.getMessage());\n e.printStackTrace();\n } catch (IOException e) {\n System.err.println(\"Fatal transport error: \" + e.getMessage());\n e.printStackTrace();\n } finally {\n // Release the connection.\n method.releaseConnection();\n }\n }", "private String downloadFile(String url) throws Exception {\n StringBuilder builder = new StringBuilder();\n \n URL u = new URL(url);\n URLConnection conn = u.openConnection();\n BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));\n String line;\n while ((line = rd.readLine()) != null) {\n builder.append(line);\n }\n \n return builder.toString();\n }", "public void crawl(String url);", "public byte[] downloadAndReadOneUrl(\n URL url,\n Credentials credentials,\n ExtendedEventHandler eventHandler,\n Map<String, String> clientEnv)\n throws IOException, InterruptedException {\n HttpConnectorMultiplexer multiplexer = setUpConnectorMultiplexer(eventHandler, clientEnv);\n\n ByteArrayOutputStream out = new ByteArrayOutputStream();\n SEMAPHORE.acquire();\n try (HttpStream payload =\n multiplexer.connect(url, Optional.absent(), credentials, Optional.absent())) {\n ByteStreams.copy(payload, out);\n } catch (SocketTimeoutException e) {\n // SocketTimeoutExceptions are InterruptedIOExceptions; however they do not signify\n // an external interruption, but simply a failed download due to some server timing\n // out. So rethrow them as ordinary IOExceptions.\n throw new IOException(e);\n } catch (InterruptedIOException e) {\n throw new InterruptedException(e.getMessage());\n } finally {\n SEMAPHORE.release();\n // TODO(wyv): Do we need to report any event here?\n }\n return out.toByteArray();\n }", "protected Object doInBackground(Object... objects) {\n\t\t\tString myurl = (String) objects[0];\n\t\t\tStringBuilder builder = new StringBuilder();\n\t\t\tHttpClient client = new DefaultHttpClient();\n\t\t\tHttpGet httpGet = new HttpGet(myurl);\n\t\t\tSystem.out.println(\"Yay5\");\n\t\t\ttry {\n\t\t\t\tHttpResponse response = client.execute(httpGet);\n\t\t\t\tStatusLine statusLine = response.getStatusLine();\n\t\t\t\tint statusCode = statusLine.getStatusCode();\n\t\t\t\tSystem.out.println(\"Yay6\");\n\t\t\t\tif (statusCode == 200) {\n\t\t\t\t\tHttpEntity entity = response.getEntity();\n\t\t\t\t\tInputStream content = entity.getContent();\n\t\t\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(content));\n\t\t\t\t\tSystem.out.println(\"Yay7\");\n\t\t\t\t\tString line;\n\t\t\t\t\tList<String> diary = new ArrayList<String>();\n\t\t\t\t\twhile ((line = reader.readLine()) != null) {\n\t\t\t\t\t\tbuilder.append(line);\n\t\t\t\t\t\tdiary.add(line);\n\t\t\t\t\t\tSystem.out.println(line);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.println(\"Failed to download\");\n\t\t\t\t}\n\t\t\t} catch (ClientProtocolException 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\treturn builder.toString();\n\t\t}", "public byte[] loadFromURL(String url) throws IOException {\r\n ByteArrayOutputStream baos = new ByteArrayOutputStream();\r\n \r\n URL u = new URL(url);\r\n HttpURLConnection con = (HttpURLConnection) u.openConnection();\r\n //con.setDoInput(false);\r\n con.setDoOutput(true);\r\n con.setRequestMethod(\"GET\");\r\n con.connect();\r\n \r\n InputStream is = con.getInputStream();\r\n int r;\r\n byte[] buffer = new byte[8000];\r\n while ((r = is.read(buffer)) >= 0) {\r\n if (r == 0) continue;\r\n baos.write(buffer, 0, r);\r\n }\r\n is.close();\r\n return baos.toByteArray();\r\n }", "public void testURL()\r\n {\r\n\r\n BufferedReader in = null;\r\n PrintStream holdErr = System.err;\r\n String errMsg = \"\";\r\n try\r\n {\r\n\r\n this.setSuccess(false);\r\n\r\n PrintStream fileout = new PrintStream(new FileOutputStream(\"testURLFile.html\"));\r\n System.setErr(fileout);\r\n System.err.println(\"testURL() - entry\");\r\n\r\n System.getProperties().put(\"https.proxyHost\", \"\" + this.getProxyHost());\r\n System.getProperties().put(\"https.proxyPort\", \"\" + this.getProxyPort());\r\n System.getProperties().put(\"http.proxyHost\", \"\" + this.getProxyHost());\r\n System.getProperties().put(\"http.proxyPort\", \"\" + this.getProxyPort());\r\n // System.getProperties().put(\"java.protocol.handler.pkgs\", \"com.sun.net.ssl.internal.www.protocol\");\r\n\r\n URL url = new URL(\"http://www.msn.com\");\r\n\r\n CookieModule.setCookiePolicyHandler(null); // Accept all cookies\r\n // Set the Authorization Handler\r\n // This will let us know waht we are missing\r\n DefaultAuthHandler.setAuthorizationPrompter(this);\r\n HTTPConnection con = new HTTPConnection(url);\r\n con.setDefaultHeaders(new NVPair[] { new NVPair(\"User-Agent\", \"Mozilla/4.5\")});\r\n con.setDefaultAllowUserInteraction(false);\r\n HTTPResponse headRsp = con.Head(url.getFile());\r\n HTTPResponse rsp = con.Get(url.getFile());\r\n\r\n int sts = headRsp.getStatusCode();\r\n if (sts < 300)\r\n {\r\n System.err.println(\"No authorization required to access \" + url);\r\n this.setSuccess(true);\r\n }\r\n else if (sts >= 400 && sts != 401 && sts != 407)\r\n {\r\n System.err.println(\"Error trying to access \" + url + \":\\n\" + headRsp);\r\n }\r\n else if (sts == 407)\r\n {\r\n System.err.println(\r\n \"Error trying to access \"\r\n + url\r\n + \":\\n\"\r\n + headRsp\r\n + \"\\n\"\r\n + \"<HTML><HEAD><TITLE>Proxy authorization required</TITLE></HEAD>\");\r\n this.setMessage(\"Error trying to access \" + url + \":\\n\" + headRsp + \"\\n\" + \"Proxy authorization required\");\r\n }\r\n // Start reading input\r\n in = new BufferedReader(new InputStreamReader(rsp.getInputStream()));\r\n String inputLine;\r\n\r\n while ((inputLine = in.readLine()) != null)\r\n {\r\n System.err.println(inputLine);\r\n }\r\n // All Done - We were success\r\n\r\n in.close();\r\n\r\n }\r\n catch (ModuleException exc)\r\n {\r\n errMsg = \"ModuleException caught: \" + exc;\r\n errMsg += \"\\nVerify Host Domain address and Port\";\r\n System.err.println(errMsg);\r\n }\r\n catch (ProtocolNotSuppException exc)\r\n {\r\n errMsg = \"ProtocolNotSuppException caught: \" + exc;\r\n errMsg += \"\\nVerify Host Domain address and Port\";\r\n System.err.println(errMsg);\r\n }\r\n catch (MalformedURLException exc)\r\n {\r\n errMsg = \"MalformedURLException caught: \" + exc;\r\n errMsg += \"\\nVerify Host Domain address and Port\";\r\n System.err.println(errMsg);\r\n }\r\n catch (FileNotFoundException exc)\r\n {\r\n errMsg = \"FileNotFoundException caught: \" + exc;\r\n errMsg += \"\\nVerify Host Domain address and Port\";\r\n System.err.println(errMsg);\r\n }\r\n catch (IOException exc)\r\n {\r\n errMsg = \"IOException caught: \" + exc;\r\n errMsg += \"\\nVerify Host Domain address and Port\";\r\n System.err.println(errMsg);\r\n }\r\n finally\r\n {\r\n System.err.println(\"testURL() - exit\");\r\n System.setErr(holdErr);\r\n if (in != null)\r\n {\r\n try\r\n {\r\n in.close(); // ENSURE we are CLOSED\r\n }\r\n catch (Exception exc)\r\n {\r\n // Do Nothing, It will be throwing an exception \r\n // if it cannot close the buffer\r\n }\r\n }\r\n this.setMessage(errMsg);\r\n System.gc();\r\n }\r\n\r\n }", "@Override\n protected String doInBackground(String... urls) {\n try {\n try {\n return httpPost(url);\n } catch (JSONException e) {\n e.printStackTrace();\n return \"Error!\";\n }\n } catch (IOException e) {\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\n\tpublic void run() {\n\t\ttry{\n\t\t\tboolean redirected=false;\n\t\t\tint responseCode=0;\n\t\t\tint tries=0;\n\t\t\tString location=site.getUrl();\n\t\t\tHttpURLConnection urlConnection=null;\n\t\t\tdo{\n\t\t\t\tURL url = new URL(location);\n\t\t\t\turlConnection = (HttpURLConnection) url.openConnection();\n\t\t\t\turlConnection.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11\");\n\t\t\t\turlConnection.setConnectTimeout(Constants.CONNECTION_TIMEOUT);\n\t\t\t\turlConnection.setReadTimeout(Constants.READ_TIMEOUT);\n\t\t\t\turlConnection.setRequestMethod(\"GET\");\n\t\t\t\turlConnection.setInstanceFollowRedirects(true);\n\t\t\t\turlConnection.setUseCaches(false);\n\t\t\t\turlConnection.setAllowUserInteraction(false);\n\t\t\t\turlConnection.setRequestProperty(\"Content-Type\", \"application/x-www-form-urlencoded\");\n\t\t\t\tresponseCode = urlConnection.getResponseCode();\n\t\t\t\t\n\t\t\t\tif(responseCode==HttpURLConnection.HTTP_MOVED_TEMP || responseCode==HttpURLConnection.HTTP_MOVED_PERM){ //handle 302 and 301 redirect. \n\t\t\t\t\tredirected=true;\n\t\t\t\t\tlocation = urlConnection.getHeaderField(\"Location\");\n\t\t\t\t\ttries++;\n\t\t\t\t}else\n\t\t\t\t\tredirected=false;\n\t\t\t}while(redirected && tries<3);\n\t\t\t\n\t\t\tif (responseCode == HttpURLConnection.HTTP_OK){\n\t\t\t\ttry (InputStream is = urlConnection.getInputStream();\n\t\t BufferedReader br = new BufferedReader(new InputStreamReader(is, StandardCharsets.UTF_8))) {\n\t\t String content = br.lines().collect(Collectors.joining(System.lineSeparator()));\n\t \tthis.callback.webContentCallBack(site, content);\n\t\t } \n\t\t\t}else this.callback.webContentCallBack(site, null); //any other case, null is returned as the content. \n\t\t}catch (Exception e) {\n\t\t\tLogger.getLogger(Fetcher.class.getName()).log(Level.WARNING, \"Site:\"+site.getUrl()+\" failed fetching.\", e);\n\t\t\ttry {\n\t\t\t\tthis.callback.webContentCallBack(site, null); //any exception, null is returned as the content. \n\t\t\t} catch (Exception e1) {\n\t\t\t} \n\t\t}\n\t}", "public static void main(String[] args) {\n String redirectUrl1 = DownloadUtil.getRedirectUrl(\"http://www.pc6.com/down.asp?id=68253\");\n String redirectUrl2 = DownloadUtil.getRedirectUrl(redirectUrl1);\n String redirectUrl3 = DownloadUtil.getRedirectUrl(redirectUrl2);\n System.out.println(redirectUrl1);\n System.out.println(redirectUrl2);\n System.out.println(redirectUrl3);\n }", "public Document fetchDocument(String url) { \n Document doc = new Document(\"\");\n //http://www.oracle.com/technetwork/java/javase/8u111-relnotes-3124969.html\n //Disable basic authentication for HTTPS tunneling \n System.setProperty(\"jdk.http.auth.tunneling.disabledSchemes\", \"''\");\n System.out.println(\"Acessing url \" + url + \" ...\");\n\n try {\n URL robotsTxT = new URL(url);\n\n Proxy proxy = proxies.get(this.rand.nextInt(proxies.size()));\n \n Authenticator authenticator = new Authenticator() {\n @Override\n protected PasswordAuthentication getPasswordAuthentication() {\n return (new PasswordAuthentication(USER, PASS.toCharArray()));\n }\n };\n Authenticator.setDefault(authenticator);\n \n HttpURLConnection httpConn = (HttpURLConnection) robotsTxT.openConnection(proxy);\n httpConn.setRequestProperty(\"User-Agent\", agentValue.get(rand.nextInt(agentValue.size())));\n\n Scanner httpResponse = new Scanner(httpConn.getInputStream());\n\n ByteArrayOutputStream response = new ByteArrayOutputStream();\n while(httpResponse.hasNextLine()) {\n response.write(httpResponse.nextLine().getBytes());\n } \n\n response.close();\n httpResponse.close(); \n\n String robotsData = response.toString();\n\n if(robotsData != null) {\n doc = Jsoup.parse(robotsData);\n }\n\n } catch (Exception ex) {\n System.err.println(\"ERROR: \" + ex.getMessage());\n }\n\n return doc;\n }", "private HttpResponse download(String url, List<String> headers) {\n\t\tSvnHttpClient http = new SvnHttpClient();\n\t\tHttpGet getMethod = new HttpGet(url);\n\t\tif (headers != null && headers.size() > 1) {\n\t\t\tfor (int i = 1; i < headers.size(); i++) {\n\t\t\t\tString[] parts = headers.get(i).split(\":\");\n\t\t\t\tif (parts != null && parts.length == 2) {\n\t\t\t\t\tgetMethod.addHeader(parts[0], parts[1]);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\tHttpResponse response = null;\n\t\ttry {\n\t\t\tLog.d(TAG, \"starting download\");\n\t\t\tresponse = http.execute(getMethod);\n\t\t\tLog.d(TAG, \"downloaded\");\n\t\t} catch (ClientProtocolException e) {\n\t\t\tLog.e(TAG, \"Error downloading\", e);\n\t\t} catch (IOException e) {\n\t\t\tLog.e(TAG, \"Error downloading\", e);\n\t\t}\n\t\treturn response;\n\t}", "private String downloadUrl(String strUrl) throws IOException{\n String data = \"\";\n InputStream iStream = null;\n HttpURLConnection urlConnection = null;\n try{\n URL url = new URL(strUrl);\n\n // Creating an http connection to communicate with url\n urlConnection = (HttpURLConnection) url.openConnection();\n\n // Connecting to url\n urlConnection.connect();\n\n // Reading data from url\n iStream = urlConnection.getInputStream();\n\n BufferedReader br = new BufferedReader(new InputStreamReader(iStream));\n\n StringBuffer sb = new StringBuffer();\n\n String line = \"\";\n while( ( line = br.readLine()) != null){\n sb.append(line);\n }\n\n data = sb.toString();\n\n br.close();\n\n }catch(Exception e){\n e.printStackTrace();\n }finally{\n iStream.close();\n urlConnection.disconnect();\n }\n return data;\n }", "public URLSpout() {\n \tURLSpout.activeThreads = new AtomicInteger();\n \tlog.debug(\"Starting URL spout\");\n \t\n \ttry { \t\t\n\t\t\treader = new BufferedReader(new FileReader(\"URLDisk.txt\"));\n\t\t\tint num_lines = XPathCrawler.getInstance().getFileCount().get();\n\t\t\tfor (int i = 0; i < num_lines; i++) {\n\t\t\t\treader.readLine(); //set reader to latest line\n\t\t\t}\t\t\t\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n }", "private String loadFromNetwork(String urlString) throws IOException {\n InputStream stream = null;\n String str =\"\";\n\n try {\n stream = downloadUrl(urlString);\n str = readIt(stream, 450000);\n } finally {\n if (stream != null) {\n stream.close();\n }\n }\n return str;\n }", "private String getContent(String url) throws BoilerpipeProcessingException, IOException {\n int code;\n HttpURLConnection connection = null;\n URL uri;\n do{\n uri = new URL(url);\n if(connection != null)\n connection.disconnect();\n connection = (HttpURLConnection)uri.openConnection();\n connection.setRequestMethod(\"GET\");\n connection.setConnectTimeout(5000);\n connection.setReadTimeout(5000);\n connection.connect();\n code = connection.getResponseCode();\n if(code == 301)\n url = connection.getHeaderField( \"Location\" );\n }while (code == 301);\n\n System.out.println(url + \" :: \" + code);\n String content = null;\n if(code < 400) {\n content = ArticleExtractor.INSTANCE.getText(uri);\n }\n connection.disconnect();\n return content;\n }", "protected String doInBackground(String... urls) {\n String value;\n value = this.downloadEmails(urls[0], urls[1], urls[2], urls[3], urls[4]);\n return value;\n }", "public void run()\n\t\t{\n\t\t\tint num = 0;\n\t\t\ttry{\n\t\t\t\tlog.debug(\"Dealing with: \" + url.toString() + \" From : \" + urlp);\n\t\t\t\t\n\t\t\t\tSocket socket = new Socket(url.getHost(), PORT);\n\t\t\t\tPrintWriter writer = new PrintWriter(socket.getOutputStream());\n\t\t\t\tBufferedReader reader = \n\t\t\t\t\tnew BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\t\t\tString request = \"GET \" + url.getPath() + \" HTTP/1.1\\n\" +\n\t\t\t\t\t\t\t\t\"Host: \" + url.getHost() + \"\\n\" +\n\t\t\t\t\t\t\t\t\"Connection: close\\n\" + \n\t\t\t\t\t\t\t\t\"\\r\\n\";\n\t\t\t\twriter.println(request);\n\t\t\t\twriter.flush();\n\t\t\n\t\t\t\tString line = reader.readLine();\n\t\t\t\t// filter the head message of the response\n\t\t\t\twhile(line != null && line.length() != 0)\n\t\t\t\t{\n\t\t\t\t\tline = reader.readLine();\n\t\t\t\t}\n\t\t\t\t// keep the html context\n\t\t\t\twhile (line != null) \n\t\t\t\t{\n\t\t\t\t\tcontext += line + \"\\n\";\n\t\t\t\t\tline = reader.readLine();\n\t\t\t\t}\n\t\t\t\treader.close();\n\t\t\t\twriter.close();\n\t\t\t\tsocket.close();\n\t\t\t\t//log.debug(context);\n\t\t\t\tstripper = new TagStripper(context);\n\t\t\t\tlog.debug(\"Removing script and style from: \" + url.toString());\n\t\t\t\tstripper.removeComments();\n\t\t\t\tstripper.removeScript();\n\t\t\t\tstripper.removeStyle();\n\t\t\t\tlog.debug(\"Getting links from: \" + url.toString());\n\t\t\t\tArrayList<String> link = new ArrayList<String>();\n\t\t\t\tstripper.buildLinks(url.toString());\n\t\t\t\t\n\t\t\t\tlink = stripper.getLinks();\n\t\t\t\tfor(String tmp : link) {\n\t\t\t\t\tif(getCount() < pageNum ) {\n\t\t\t\t\t\t// find if the link has been already visited\n\t\t\t\t\t\tif(!urlList.contains(tmp)) {\n\t\t\t\t\t\t\tworkers.execute(new SingleHTMLFetcher(new URL(tmp), this.url.toString()));\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\tString title = stripper.getTitle();\n\t\t\t\tif(title == null)\n\t\t\t\t\ttitle = \"NO title\";\n\t\t\t\ttitle = title.replaceAll(\"&[^;]*;\", \"\");\n\t\t\t\tlog.debug(\"Removing tags from: \" + url.toString());\n\t\t\t\tstripper.removeTags();\n\t\t\t\tstripper.removeSymbol();\n\t\t\t\tString snippet = stripper.getSnippet(title);\n\t\t\t\tdb.savePageInfo(connection, title, snippet, url.toString());\n\t\t\t\tcontext = stripper.getContext();\n\t\t\t\tString[] words = context.toLowerCase().split(\"\\\\s\");\n\t\t\t\tArrayList<String> wordsList = new ArrayList<String>();\n\t\t\t\tfor (int i = 0; i < words.length; i++) {\n\t\t\t\t\t// delete non-word character\n\t\t\t\t\twords[i] = words[i].replaceAll(\"\\\\W\", \"\").replace(\"_\",\n\t\t\t\t\t\t\t\"\");\n\t\t\t\t\tif(words[i].length() != 0)\n\t\t\t\t\t\twordsList.add(words[i]);\n\t\t\t\t}\n\t\t\t\tfor (String w : wordsList) {\n\t\t\t\t\tif (w.length() != 0) {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tindex.addNum(w, url.toString(), num);\n\t\t\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\tnum++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tlog.debug(\"URL: \" + url.toString() + \" is finished!\");\n\t\t\t\tdecrementPending();\n\t\t\t}catch(Exception ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}", "private void getHTMLOffer(String href, int index){\r\n ArrayList<String> htmlOffer = new ArrayList<>();\r\n \r\n try{\r\n URLConnection connection = new URL(href).openConnection();\r\n connection.setRequestProperty(\"Accept-Charset\", \"UTF-8\");\r\n BufferedReader in = new BufferedReader(\r\n new InputStreamReader(connection.getInputStream()));\r\n\r\n String inputLine;\r\n while ((inputLine = in.readLine()) != null){\r\n htmlOffer.add(inputLine);\r\n }\r\n \r\n in.close();\r\n } catch (MalformedURLException ex) {\r\n Logger.getLogger(OfferGeneralInformation.class.getName()).log(Level.SEVERE, null, ex);\r\n } catch (IOException ex) {\r\n Logger.getLogger(OfferGeneralInformation.class.getName()).log(Level.SEVERE, null, ex);\r\n } finally {\r\n SaveSingleOfferHTML saveOffer = new SaveSingleOfferHTML(htmlOffer, index);\r\n }\r\n }", "public String getSourceDownloadUrl();", "public void doGet() throws IOException {\n\n // search ressource\n byte[] contentByte = null;\n try {\n contentByte = ToolBox.readFileByte(RESOURCE_DIRECTORY, this.url);\n this.statusCode = OK;\n ContentType contentType = new ContentType(this.extension);\n sendHeader(statusCode, contentType.getContentType(), contentByte.length);\n } catch (IOException e) {\n System.out.println(\"Ressource non trouvé\");\n statusCode = NOT_FOUND;\n contentByte = ToolBox.readFileByte(RESPONSE_PAGE_DIRECTORY, \"pageNotFound.html\");\n sendHeader(statusCode, \"text/html\", contentByte.length);\n }\n\n this.sendBodyByte(contentByte);\n }", "public void Crawl(String startUrl) {\n HashSet crawledList = new HashSet();\n LinkedHashSet toCrawlList = new LinkedHashSet();\n // Add start URL to the To Crawl list.\n toCrawlList.add(startUrl);\n\n // Get URL at bottom of the list.\n String url = (String) toCrawlList.iterator().next();\n // Remove URL from the To Crawl list.\n toCrawlList.remove(url);\n // Convert string url to URL object.\n URL verifiedUrl = verifyUrl(url);\n\n // Add page to the crawled list.\n crawledList.add(url);\n // Download the page at the given URL.\n String pageContents = downloadPage(verifiedUrl);\n\n if (pageContents != null && pageContents.length() > 0) {\n // Retrieve list of valid links from page.\n ArrayList links = retrieveLinks(verifiedUrl, pageContents, crawledList);\n // Add links to the To Crawl list.\n toCrawlList.addAll(links);\n\n }\n\n System.out.println(pageContents);\n\n }", "private int DownloadFile(URL url) {\n try {\n //---simulate taking some time to download a file---\n thread.sleep(5000);\n } catch (InterruptedException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n return 100;\n }", "String getRequest(String url);", "public void testDownloadFile(){\n final String url = \"http://www.zebrai.cn/login/picture/getCaptcha\";\n new Thread(new Runnable() {\n @Override\n public void run() {\n downloadFile(url);\n }\n }).start();\n\n }", "private String downloadUrl(String strUrl) throws IOException {\n // Khoi tao du lieu tra ve\n String data = \"\";\n InputStream iStream = null;\n HttpURLConnection urlConnection = null;\n try {\n // Khoi tao url\n URL url = new URL(strUrl);\n // Mo ket noi url\n urlConnection = (HttpURLConnection) url.openConnection();\n // Ket noi url\n urlConnection.connect();\n // Lay ket qua tra ve\n iStream = urlConnection.getInputStream();\n // Doc ket qua tra ve\n BufferedReader br = new BufferedReader(new InputStreamReader(iStream));\n // Khoi tao buffer luu ket qua tra ve\n StringBuffer sb = new StringBuffer();\n // Doc tung dong tra ve\n String line = \"\";\n while ((line = br.readLine()) != null) {\n sb.append(line);\n }\n // Luu du lieu sau khi doc\n data = sb.toString();\n // Dong buffer\n br.close();\n } catch (Exception e) {\n // Neu bi loi thi log ra loi\n e.printStackTrace();\n } finally {\n // Dong stream va ket noi url\n iStream.close();\n urlConnection.disconnect();\n }\n return data;\n }", "public ArrayList<String> webCrawling(){\n\t\t\tfor(i=780100; i<790000; i++){\r\n\t\t\t\ttry{\r\n\t\t\t\tdoc = insertPage(i);\r\n\t\t\t\t//Thread.sleep(1000);\r\n\t\t\t\t}catch (Exception e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\tif(doc != null){\r\n\t\t\t\t\tElement ele = doc.select(\"div.more_comment a\").first();\r\n\t\t\t\t\t//System.out.println(ele.attr(\"href\"));\r\n\t\t\t\t\tcommentCrawling(ele.attr(\"href\"));//��۸�� ���� ��ũ\r\n\t\t\t\t\tcommentCrawlingList(commentURList);\r\n\t\t\t\t\tcommentURList = new ArrayList<String>();//��ũ ����� �ߺ��ǰ� ���̴� �� �����ϱ� ���� �ʱ�ȭ �۾�\r\n\t\t\t\t\tSystem.out.println(i+\"��° ������\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn replyComment;\r\n\t\t//return urlList.get(0);\r\n\t}", "public void doRequests(JobQueue urlList) {\n\t\tsynchronized(connections) {\n\t\t\t++connections;\n\t\t}\n \tHttpHost httpHost = new HttpHost(urlList.getHost());\n \t\n\t\twhile (! urlList.isEmpty()) {\n\t\t\tJob2 job = urlList.poll();\n\t\t\t\n\t \t// Do a HEAD request\n\t \tHttpRequest httpRequest = new HttpHead(job.getPath());\n\n\t\t\tString url = urlList.getUrl(job);\n\t\t\tLOG.info(\"Submitting \" + url);\n\n\t\t\ttry {\n\t\t\t\tHttpResponse httpResponse = httpClient.execute(httpHost, httpRequest);\n\t\t\t\tStatusLine statusLine = httpResponse.getStatusLine();\n\t\t\t\tLOG.info(statusLine.getStatusCode() + \" on \" + url);\n\t\t\t\t\n\t\t\t} catch (ClientProtocolException cpe) {\n\t\t\t\tLOG.info(\"CPE on \" + url, cpe);\n\t\t\t} catch (IOException ioe) {\n\t\t\t\tLOG.info(\"IOE on \" + url, ioe);\n\t\t\t}\n\n\t\t}\n\t\t\n\t\tsynchronized(connections) {\n\t\t\t--connections;\n\t\t\tif (connections == 0) {\n\t\t\t\tsynchronized(monitor) {\n\t\t\t\t\tmonitor.notify();\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "@Override\n protected String doInBackground(String... urls) {\n try {\n try {\n Log.d(\"ttbody:\",urls[0]);\n return httpPost(urls[0]);\n } catch (JSONException e) {\n e.printStackTrace();\n return \"Error!\";\n }\n } catch (IOException e) {\n Log.d(\"tterror:\",e.toString());\n return \"Unable to retrieve web page. URL may be invalid.\";\n }\n }", "@Override\npublic void get(String url) {\n\t\n}", "private String downloadUrl(String strUrl) throws IOException{\n String data = \"\";\n InputStream iStream = null;\n HttpURLConnection urlConnection = null;\n try{\n URL url = new URL(strUrl);\n\n // Creating an http connection to communicate with url\n urlConnection = (HttpURLConnection) url.openConnection();\n\n // Connecting to url\n urlConnection.connect();\n\n // Reading data from url\n iStream = urlConnection.getInputStream();\n\n BufferedReader br = new BufferedReader(new InputStreamReader(iStream));\n\n StringBuffer sb = new StringBuffer();\n\n String line = \"\";\n while( ( line = br.readLine()) != null){\n sb.append(line);\n }\n\n data = sb.toString();\n\n br.close();\n\n }catch(Exception e){\n System.out.println(\"Exception while downloading url \"+e.toString());\n }finally{\n iStream.close();\n urlConnection.disconnect();\n }\n return data;\n }", "private InputStream downloadStream(String urlString) throws IOException {\n\t\tURL url = new URL(urlString);\n\t\tHttpURLConnection conn = (HttpURLConnection) url.openConnection();\n\t\tconn.setReadTimeout(10000 /* milliseconds */);\n\t\tconn.setConnectTimeout(15000 /* milliseconds */);\n\t\tconn.setRequestMethod(\"GET\");\n\t\tconn.setDoInput(true);\n\t\t// Starts the query\n\t\tconn.connect();\n\t\tInputStream stream = conn.getInputStream();\n\t\treturn stream;\n\t}", "private String downloadUrl(String strUrl) throws IOException {\n\n String data = \"\";\n InputStream iStream = null;\n HttpURLConnection urlConnection = null;\n\n try{\n // Get URL\n URL url = new URL(strUrl);\n\n // Creating an http connection to communicate with url\n urlConnection = (HttpURLConnection) url.openConnection();\n\n // Connecting to url\n urlConnection.connect();\n\n // Reading data from url\n iStream = urlConnection.getInputStream();\n\n // Data to string\n BufferedReader br = new BufferedReader(new InputStreamReader(iStream));\n StringBuffer sb = new StringBuffer();\n String line = \"\";\n while( ( line = br.readLine()) != null){\n sb.append(line);\n }\n data = sb.toString();\n br.close();\n\n }catch(Exception e){\n Log.d(\"My Log Entry\", e.toString());\n }finally{\n iStream.close();\n urlConnection.disconnect();\n }\n\n // Return xml string of directions - start tag <DirectionsResponse>\n return data;\n }", "private String getResultByUrl(String url) {\r\n\r\n\t\tRequestConfig.Builder requestBuilder = RequestConfig.custom();\r\n\t\trequestBuilder = requestBuilder.setConnectTimeout(75000);\r\n\t\trequestBuilder = requestBuilder.setConnectionRequestTimeout(75000);\r\n\t\trequestBuilder.setSocketTimeout(75000);\r\n\r\n\t\tHttpClientBuilder builder = HttpClientBuilder.create();\r\n\t\tbuilder.setDefaultRequestConfig(requestBuilder.build());\r\n\t\tclient = builder.build();\r\n\r\n\t\trequest = new HttpGet(url);\r\n\t\trequest.addHeader(\"Accept\", \"application/json\");\r\n\r\n\t\tHttpResponse response = null;\r\n\t\tString r = \"\";\r\n\r\n\t\ttry {\r\n\t\t\tfor (int i = 0; i < 7; i++) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tSystem.out.println(\"Sending request: \" + url);\r\n\t\t\t\t\tresponse = client.execute(request);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t} catch (ConnectionPoolTimeoutException e) {\r\n\t\t\t\t\tSystem.out.println(\"Connection timeout. Trying again...\");\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tTimeUnit.SECONDS.sleep(10);\r\n\t\t\t\t\t} catch (InterruptedException ex) {\r\n\t\t\t\t\t\tex.printStackTrace();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"Response Code : \"\r\n\t\t\t\t\t+ response.getStatusLine().getStatusCode());\r\n\r\n\t\t\tbr = new BufferedReader(new InputStreamReader(response.getEntity()\r\n\t\t\t\t\t.getContent()));\r\n\r\n\t\t\tStringBuffer result = new StringBuffer();\r\n\t\t\tString line = \"\";\r\n\t\t\twhile ((line = br.readLine()) != null) {\r\n\t\t\t\tresult.append(line);\r\n\t\t\t}\r\n\t\t\tSystem.out.println(result + \"\\n\");\r\n\t\t\ttry {\r\n\t\t\t\tTimeUnit.SECONDS.sleep(1);\r\n\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\te.printStackTrace();\r\n\t\t\t}\r\n\t\t\tr = result.toString();\r\n\t\t\tGson gson = new GsonBuilder().setPrettyPrinting().create();\r\n\r\n\t\t\tJsonObject jsonResult = gson.fromJson(result.toString(),\r\n\t\t\t\t\tJsonObject.class);\r\n\t\t\tif (jsonResult.get(\"backoff\") != null) {\r\n\t\t\t\tint backoff = (jsonResult.get(\"backoff\")).getAsInt();\r\n\t\t\t\ttry {\r\n\t\t\t\t\tSystem.out.println(\"Received backoff. Waiting for \"\r\n\t\t\t\t\t\t\t+ backoff + \"seconds...\");\r\n\t\t\t\t\tTimeUnit.SECONDS.sleep(backoff + 5);\r\n\t\t\t\t} catch (InterruptedException e) {\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\te.printStackTrace();\r\n\t\t}\r\n\t\treturn r;\r\n\t}", "@Override\n protected String doInBackground(String... urls) {\n StringBuilder webResult = new StringBuilder();\n InputStream inputStream;\n try {\n URL url = new URL(urls[0]);\n HttpsURLConnection urlConnection = (HttpsURLConnection) url.openConnection();\n inputStream = urlConnection.getInputStream();\n } catch (MalformedURLException e) {\n Log.e(TAG, \"MalformedURLException thrown while trying to create URL\");\n return null;\n } catch (IOException e) {\n Log.e(TAG, \"IOException thrown while trying to open URL\", e);\n return null;\n } catch (Exception e) {\n Log.e(TAG, \"General Exception thrown while trying to create/open URL\", e);\n return null;\n }\n\n\n InputStreamReader inputStreamReader = new InputStreamReader(inputStream);\n BufferedReader bufferedReader = new BufferedReader(inputStreamReader);\n\n try {\n String line = bufferedReader.readLine();\n while(line != null){\n webResult.append(line);\n line = bufferedReader.readLine();\n }\n return String.valueOf(webResult);\n } catch(IOException e) {\n Log.e(TAG, \"IOException thrown while reading from BufferedReader\", e);\n } catch (Exception e) {\n Log.e(TAG, \"General Exception thrown while reading from BufferedReader\", e);\n } finally {\n try {\n bufferedReader.close();\n } catch (IOException e) {\n Log.e(TAG, \"Failed to close BufferedReader\", e);\n }\n }\n return String.valueOf(webResult);\n }", "private void downloadRange() throws IOException{\n HttpURLConnection httpURLConnection = (HttpURLConnection) new URL(urlString).openConnection();\n httpURLConnection.setConnectTimeout(CONNECT_TIMEOUT);\n httpURLConnection.setReadTimeout(READ_TIMEOUT);\n httpURLConnection.setRequestProperty(\"Range\", \"bytes=\" + range.getStart() + \"-\" + range.getEnd());\n int responseCode = httpURLConnection.getResponseCode();\n InputStream inputStream = null;\n for (int i = 1 ; i <= MAX_RETRIES ; i++) {\n try {\n inputStream = httpURLConnection.getInputStream();\n break;\n }catch (SocketTimeoutException e){\n if (i == MAX_RETRIES){\n //TODO find how to stop all threads\n System.err.println(\"got timeout exception. shutting down...\");\n System.exit(1);\n }\n }\n }\n System.out.println(\"DEBUG: Range: start:\" + range.getStart() + \" end: \" + range.getEnd() + \" Response code: \" + responseCode);\n// httpURLConnection.setRequestMethod(\"GET\");\n int lastChunkSize = range.getLength().intValue() % CHUNK_SIZE;\n int i = 0;\n long rangeLength = range.getLength();\n int chunkSize = CHUNK_SIZE;\n long rangesum = range.getStart();\n int part = (int) Math.ceil(rangeLength / (double) CHUNK_SIZE); //calculate how many times we need to iterate to read X chunks in the given range\n //inputStream.skip(range.getStart());\n int getSize = chunkSize;\n while(true) {\n try {\n byte[] byteChunk = new byte[CHUNK_SIZE];\n //jump to the right place in the range to read the next chunk\n //check whether are there enough tokens to read the chunk\n if (limitDownload) {\n tokenBucket.take(CHUNK_SIZE);\n }\n //case: last chunk is smaller than chunk_size\n// if (lastChunkSize != 0 && i == (part - 1)) {\n// chunkSize = lastChunkSize;\n// }\n if (fileSize == range.getStart() + (CHUNK_SIZE * i) + (rangeLength % CHUNK_SIZE)) {\n chunkSize = (int) rangeLength % CHUNK_SIZE;\n byteChunk = new byte[chunkSize];\n }\n //reDo the read operation if the operation reads less than the bytes it should read\n int output = inputStream.read(byteChunk, 0, chunkSize);\n if (range.getEnd() < rangesum) {\n break;\n } else if (output == -1) {\n break;\n } else if (output != chunkSize) {\n int output1 = inputStream.read(byteChunk, output, chunkSize - output);\n if (output1 != chunkSize - output) {\n inputStream.read(byteChunk, output, chunkSize - output - output1);\n }\n }\n outQueue.add(new Chunk(byteChunk, range.getStart() + (CHUNK_SIZE * i), chunkSize));\n i++;\n rangesum += 4096;\n } catch (SocketTimeoutException e){\n System.err.println(\"got timeout exception. shutting down...\");\n System.exit(1);\n }\n }\n\n System.out.println(\"finished download\");\n }", "@Override\n\tpublic InputStream doGet(String url) {\n\t\tInputStream in = null;\n\t\tHttpGet getRequest = new HttpGet(url);\n\t\tgetRequest.addHeader(\"charset\", HTTP.UTF_8);\n\t\tHttpClient client = new DefaultHttpClient();\n\t\tclient.getParams().setParameter(CoreConnectionPNames.CONNECTION_TIMEOUT, 6000);\n\t\tclient.getParams().setParameter(CoreConnectionPNames.SO_TIMEOUT, 8000);\n\t\tHttpResponse response = null;\n\t\ttry {\n\t\t\tresponse = client.execute(getRequest);\n\t\t\tif(null != response && response.getStatusLine().getStatusCode() == HttpStatus.SC_OK){\n\t\t\t\tin = response.getEntity().getContent();\n\t\t\t}\n\t\t} catch (ClientProtocolException 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\treturn in;\n\t}", "private String getURL(String feedUrl) {\n\tStringBuilder sb = null;\n\ttry {\n for(int i = 3; i>0; i--) {\n\t sb = new StringBuilder();\n URL url = new URL(feedUrl);\n\tHttpURLConnection uc = (HttpURLConnection) url.openConnection();\n\tuc.setRequestProperty(\"User-Agent\", \"Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.22) Gecko/20110902 Firefox/3.6.22 GTB7.1 ( .NET CLR 3.5.30729)\");\n\tuc.setRequestProperty(\"Accept\", \"text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8\");\n\tuc.setRequestProperty(\"Accept-Language\", \"en-us,en;q=0.5\");\n\tuc.setRequestProperty(\"Accept-Encoding\", \"gzip,deflate\");\n\tuc.setRequestProperty(\"Accept-Charset\", \"ISO-8859-1,utf-8;q=0.7,*;q=0.7\");\n\tuc.setRequestProperty(\"Keep-Alive\", \"115\");\n\tuc.setRequestProperty(\"Connection\", \"keep-alive\");\n\tuc.setDoOutput(true);\n\tuc.setDoInput(true);\n\tuc.setUseCaches(false);\n\tuc.setRequestMethod(\"POST\");\n\tuc.setRequestProperty(\"Content-Type\", \"text/xml\");\n\t\n\tBufferedReader in = new BufferedReader(new InputStreamReader(url.openStream()));//uc.getInputStream()\n\tString inputLine;\n\tboolean refreshAgain = false;\n\twhile ((inputLine = in.readLine()) != null) {\n\t\tsb.append(inputLine);\n\t\tif( inputLine.contains(\"Refresh\") ) {\n\t\t\trefreshAgain = true;\n\t\t\tSystem.out.println(\"Refresh\");\n\t\t}\n\t}\n\tin.close();\n\tuc.disconnect();\t\t\n//\tRefresh\n\tif( refreshAgain ) {\n\t Thread.sleep(1000);\n\t}\n\telse break;\n }\n }catch(Exception ee){}\nreturn sb.toString();\n}", "public static String getFile(String url) {\n final String USER_AGENT = \"Mozilla/5.0\";\n\n StringBuilder response = null;\n try {\n URL obj = new URL(url);\n HttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\n // request method\n con.setRequestMethod(\"GET\");\n\n //add request header\n con.setRequestProperty(\"User-Agent\", USER_AGENT);\n\n int responseCode = con.getResponseCode();\n System.out.println(\"Sending 'GET' request to URL : \" + url);\n System.out.println(\"Response Code : \" + responseCode);\n\n BufferedReader in = new BufferedReader(\n new InputStreamReader(con.getInputStream()));\n response = new StringBuilder();\n\n String inputLine;\n while ((inputLine = in.readLine()) != null) {\n response.append(inputLine).append(\"\\n\");\n }\n in.close();\n return response.toString();\n } catch (IOException e) {\n e.printStackTrace();\n }\n return \"\";\n }", "private synchronized void executeDownload(DownloadRequest request, String downloadUrl) {\n HttpURLConnection conn = null;\n URL url;\n InputStream inputStream = null;\n RandomAccessFile randomAccessFile;\n\n try {\n url = new URL(downloadUrl);\n long localFileLength = FileUtils.getLocalFileSize(getFullFileName());\n long remoteFileLength = fileTotalSize;\n\n // 远程文件不存在\n if (remoteFileLength == -1l) {\n // Log.log(\"下载文件不存在...\");\n updateDownloadFailed(request, DownloadManager.ERROR_UNHANDLED_HTTP_CODE, \"Remote file not found\");\n return;\n }\n\n request.setFileFullName(getFullFileName());\n randomAccessFile = new RandomAccessFile(getFullFileName(), \"rwd\");\n\n\n conn = (HttpURLConnection) url.openConnection();\n conn.setInstanceFollowRedirects(false);\n conn.setConnectTimeout(request.getRetryPolicy().getCurrentTimeout());\n conn.setReadTimeout(request.getRetryPolicy().getCurrentTimeout());\n conn.setRequestMethod(\"GET\");\n\n // 本地文件存在\n randomAccessFile.seek(localFileLength);\n conn.setRequestProperty(\"Range\", \"bytes=\"\n + localFileLength + \"-\" + remoteFileLength);\n\n inputStream = conn.getInputStream();\n\n\n HashMap<String, String> customHeaders = request.getCustomHeaders();\n if (customHeaders != null) {\n for (String headerName : customHeaders.keySet()) {\n conn.addRequestProperty(headerName, customHeaders.get(headerName));\n }\n }\n\n // Status Connecting is set here before\n // urlConnection is trying to connect to destination.\n updateDownloadState(request, DownloadManager.STATUS_CONNECTING);\n\n final int responseCode = conn.getResponseCode();\n\n DownLoadLog.v(\"Response code obtained for downloaded Id \"\n + request.getDownloadId()\n + \" : httpResponse Code \"\n + responseCode);\n\n switch (responseCode) {\n case HTTP_PARTIAL:\n case HTTP_OK:\n shouldAllowRedirects = false;\n if (fileTotalSize > 1) {\n transferData(request, inputStream, randomAccessFile);\n } else {\n updateDownloadFailed(request, DownloadManager.ERROR_DOWNLOAD_SIZE_UNKNOWN, \"Transfer-Encoding not found as well as can't know size of download, giving up\");\n }\n break;\n case HTTP_MOVED_PERM:\n case HTTP_MOVED_TEMP:\n case HTTP_SEE_OTHER:\n case HTTP_TEMP_REDIRECT:\n // Take redirect url and call executeDownload recursively until\n // MAX_REDIRECT is reached.\n while (mRedirectionCount < MAX_REDIRECTS && shouldAllowRedirects) {\n mRedirectionCount++;\n DownLoadLog.v(TAG, \"Redirect for downloaded Id \" + request.getDownloadId());\n final String location = conn.getHeaderField(\"Location\");\n executeDownload(request, location);\n }\n\n if (mRedirectionCount > MAX_REDIRECTS && shouldAllowRedirects) {\n updateDownloadFailed(request, DownloadManager.ERROR_TOO_MANY_REDIRECTS, \"Too many redirects, giving up\");\n return;\n }\n break;\n case HTTP_REQUESTED_RANGE_NOT_SATISFIABLE:\n updateDownloadFailed(request, HTTP_REQUESTED_RANGE_NOT_SATISFIABLE, conn.getResponseMessage());\n break;\n case HTTP_UNAVAILABLE:\n updateDownloadFailed(request, HTTP_UNAVAILABLE, conn.getResponseMessage());\n break;\n case HTTP_INTERNAL_ERROR:\n updateDownloadFailed(request, HTTP_INTERNAL_ERROR, conn.getResponseMessage());\n break;\n default:\n updateDownloadFailed(request, DownloadManager.ERROR_UNHANDLED_HTTP_CODE, \"Unhandled HTTP response:\" + responseCode + \" message:\" + conn.getResponseMessage());\n break;\n }\n } catch (SocketTimeoutException e) {\n e.printStackTrace();\n // Retry.\n attemptRetryOnTimeOutException(request);\n } catch (ConnectTimeoutException e) {\n e.printStackTrace();\n attemptRetryOnTimeOutException(request);\n } catch (IOException e) {\n e.printStackTrace();\n updateDownloadFailed(request, DownloadManager.ERROR_HTTP_DATA_ERROR, \"IOException \" + e.getMessage());\n } finally {\n if (conn != null) {\n conn.disconnect();\n }\n }\n }", "private String downloadUrl(String strUrl) throws IOException {\n String data = \"\";\n InputStream iStream = null;\n HttpURLConnection urlConnection = null;\n try{\n URL url = new URL(strUrl);\n\n // Creating an http connection to communicate with url\n urlConnection = (HttpURLConnection) url.openConnection();\n\n // Connecting to url\n urlConnection.connect();\n\n // Reading data from url\n iStream = urlConnection.getInputStream();\n\n BufferedReader br = new BufferedReader(new InputStreamReader(iStream));\n\n StringBuffer sb = new StringBuffer();\n\n String line = \"\";\n while( ( line = br.readLine()) != null){\n sb.append(line);\n }\n\n data = sb.toString();\n\n br.close();\n\n }catch(Exception e){\n //Log.d(\"Exception while downloading url\", e.toString());\n }finally{\n iStream.close();\n urlConnection.disconnect();\n }\n return data;\n }", "@Override\n\t\tprotected List<List<HashMap<String, String>>> doInBackground(String... params) {\n\t\t\treturn downloadUrl(params[0]);\n\t\t}", "private String downloadUrl(String strUrl) throws IOException {\n String data = \"\";\n InputStream iStream = null;\n HttpURLConnection urlConnection = null;\n try {\n URL url = new URL(strUrl);\n\n\n // Creating an http connection to communicate with url\n urlConnection = (HttpURLConnection) url.openConnection();\n\n // Connecting to url\n urlConnection.connect();\n\n // Reading data from url\n iStream = urlConnection.getInputStream();\n\n BufferedReader br = new BufferedReader(new InputStreamReader(iStream));\n\n StringBuffer sb = new StringBuffer();\n\n String line = \"\";\n while ((line = br.readLine()) != null) {\n sb.append(line);\n }\n\n data = sb.toString();\n\n br.close();\n\n } catch (Exception e) {\n //Log.d(\"Exception while downloading url\", e.toString());\n } finally {\n iStream.close();\n urlConnection.disconnect();\n }\n\n return data;\n }", "private Document getPageWithRetries(URL url) throws IOException {\n Document doc;\n int retries = 3;\n while (true) {\n sendUpdate(STATUS.LOADING_RESOURCE, url.toExternalForm());\n LOGGER.info(\"Retrieving \" + url);\n doc = Http.url(url)\n .referrer(this.url)\n .cookies(cookies)\n .get();\n if (doc.toString().contains(\"IP address will be automatically banned\")) {\n if (retries == 0) {\n throw new IOException(\"Hit rate limit and maximum number of retries, giving up\");\n }\n LOGGER.warn(\"Hit rate limit while loading \" + url + \", sleeping for \" + IP_BLOCK_SLEEP_TIME + \"ms, \" + retries + \" retries remaining\");\n retries--;\n try {\n Thread.sleep(IP_BLOCK_SLEEP_TIME);\n } catch (InterruptedException e) {\n throw new IOException(\"Interrupted while waiting for rate limit to subside\");\n }\n }\n else {\n return doc;\n }\n }\n }", "void downloadingFile(String path);", "private static String getURL(String url) {\r\n\t\t//fixup the url\r\n\t\tURL address;\r\n\t\ttry {\r\n\t\t\taddress = new URL(url);\r\n\t\t}\r\n\t\tcatch (MalformedURLException e) {\r\n\t\t\tSystem.out.println(\"====>\" + e.getMessage());\r\n\t\t\treturn new String();\r\n\t\t}\r\n\t\t\r\n\t\t//make the hookup\r\n\t\tHttpURLConnection con;\r\n\t\ttry {\r\n\t\t\tcon = (HttpURLConnection) address.openConnection();\r\n\t\t}\r\n\t\tcatch(IOException e) {\r\n\t\t\tSystem.out.println(\"====>\" + e.getMessage());\r\n\t\t\treturn new String();\r\n\t\t}\r\n\r\n\t\t// optional default is GET\r\n\t\ttry {\r\n\t\t\tcon.setRequestMethod(\"GET\");\r\n\t\t}\r\n\t\tcatch (ProtocolException e) {\r\n\t\t\tSystem.out.println(\"====>\" + e.getMessage());\r\n\t\t\treturn new String();\r\n\t\t}\r\n\r\n\t\t//this executes the get? - maybe check with wireshark if ever important\r\n//\t\tint responseCode = 0; \r\n//\t\ttry {\r\n//\t\t\tresponseCode = con.getResponseCode();\r\n//\t\t}\r\n//\t\tcatch(IOException e) {\r\n//\t\t\tSystem.out.println(\"====>\" + e.getMessage());\r\n//\t\t\treturn new String();\r\n//\t\t}\r\n\t\t\r\n\t\t//TODO handle bad response codes\r\n\r\n\t\t//read the response\r\n\t\tStringBuffer response = new StringBuffer();\r\n\t\ttry {\r\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\r\n\t\t\tString inputLine = new String();\r\n\t\r\n\t\t\t//grab each line from the response\r\n\t\t\twhile ((inputLine = in.readLine()) != null) {\r\n\t\t\t\tresponse.append(inputLine);\r\n\t\t\t}\r\n\t\t\t//fix dangling\r\n\t\t\tin.close();\r\n\t\t}\r\n\t\tcatch(IOException e) {\r\n\t\t\tSystem.out.println(\"====>\" + e.getMessage());\r\n\t\t\treturn new String();\r\n\t\t}\r\n\t\t\r\n\t\t//convert to a string\r\n\t\treturn response.toString();\r\n\t}", "public static void main(String args[] ) {\r\n\t\t\r\n\t\tSystem.out.println(\"Enter the url to consult.\");\r\n\t\tScanner ent = new Scanner(System.in);\r\n\r\n\t\tLinkedList<String> listcookies = getFromFile();\r\n\t\tSystem.out.println(\"Table of previous urls: \" + listcookies);\r\n\t\tString cookies = \"\";\r\n\t\tString cookiev = null;\r\n\t\tString reply = \"GET /\"+ent.nextLine()+\" HTTP1.1\\r\\n\";\r\n\t\tent.close();\r\n\t\t\r\n\t\tSocket myClient;\r\n\t\tDataInputStream entry;\r\n\t\tDataOutputStream exit;\r\n\t\tint i = 0;\r\n\t\tif (listcookies != null) for (String s : listcookies) {cookies+=i+\"=\"+s+\"; \"; i++;}\r\n\t\t\r\n\t\ttry {\r\n\t\t\t\r\n\t\t\tmyClient = new Socket(\"localhost\", 9999);\r\n\t\t\tentry = new DataInputStream(myClient.getInputStream());\r\n\t\t\texit = new DataOutputStream(myClient.getOutputStream());\r\n\t\t\t\r\n\t\t\tif (!cookies.equals(\"\")) reply += \"Cookie: \"+cookies+\"\\r\\n\";\r\n\t\t\treply += \"\\r\\n\";\r\n\t\t\tSystem.out.println(\"Current query: \"+reply);\r\n\t\t\texit.writeBytes(reply);\r\n\t\t\t\r\n\t\t\tString inf = entry.readLine();\r\n\t\t\twhile (inf != null) {\r\n\t\t\t\tSystem.out.println(inf);\r\n\t\t\t\tString[] parts = inf.split(\" \");\r\n\t\t\t\tif (parts[0].equals(\"Set-Cookie:\")) cookiev = parts[1];\r\n\t\t\t\tinf = entry.readLine();\r\n\t\t\t}\r\n\t\t\tif (cookiev != null) putInFile(cookiev);\r\n\t\t\tentry.close();\r\n\t\t\texit.close();\r\n\t\t} catch (IOException e) {System.out.println(e);}\r\n\t}", "private String downloadUrl(String strUrl) throws IOException {\n String data = \"\";\n InputStream iStream = null;\n HttpURLConnection urlConnection = null;\n try{\n URL url = new URL(strUrl);\n\n\n // Creating an http connection to communicate with url\n urlConnection = (HttpURLConnection) url.openConnection();\n\n // Connecting to url\n urlConnection.connect();\n\n // Reading data from url\n iStream = urlConnection.getInputStream();\n\n BufferedReader br = new BufferedReader(new InputStreamReader(iStream));\n\n StringBuffer sb = new StringBuffer();\n\n String line = \"\";\n while( ( line = br.readLine()) != null){\n sb.append(line);\n }\n\n data = sb.toString();\n\n br.close();\n\n }catch(Exception e){\n Log.d(\"Exception while downloading url\", e.toString());\n }finally{\n iStream.close();\n urlConnection.disconnect();\n }\n return data;\n }", "public static byte[] getURL(String string_url) {\n ByteArrayOutputStream bais = new ByteArrayOutputStream();\n InputStream is = null;\n try {\n URL url = new URL(string_url);\n is = url.openStream();\n byte[] byteChunk = new byte[4096];\n int n;\n \n while ( (n = is.read(byteChunk)) > 0 ) {\n bais.write(byteChunk, 0, n);\n }\n \n is.close();\n }\n catch (IOException e) {\n }\n \n return bais.toByteArray();\n }", "@Override\n protected String doInBackground(String... urls) {\n StringBuilder sb = new StringBuilder();\n StringBuilder sbCount = new StringBuilder();\n HttpURLConnection urlConnection = null;\n InputStream inputStream;\n try {\n URL url = new URL(urls[0]);\n URL urlCount = new URL(String.format(URL, url));\n\n // Open connection\n urlConnection = (HttpURLConnection) urlCount.openConnection();\n urlConnection.setChunkedStreamingMode(0);\n\n inputStream = new BufferedInputStream(urlConnection.getInputStream());\n if (inputStream != null){\n BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));\n String line = null;\n\n // Read Server Response\n while((line = br.readLine()) != null){\n // Append server response in string\n sbCount.append(line + \"\");\n }\n }\n String str = sbCount.toString();\n int count = Integer.parseInt(str);\n if(count<50){\n // Open connection\n urlConnection = (HttpURLConnection) url.openConnection();\n urlConnection.setChunkedStreamingMode(0);\n \n inputStream = new BufferedInputStream(urlConnection.getInputStream());\n if (inputStream != null){\n BufferedReader br = new BufferedReader(new InputStreamReader(inputStream));\n String line = null;\n \n // Read Server Response\n while((line = br.readLine()) != null){\n // Append server response in string\n sb.append(line + \"\");\n }\n }\n }else{\n return null;\n }\n\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }finally{\n if (urlConnection!=null){\n urlConnection.disconnect();\n }\n }\n return sb.toString();\n }", "private static InputStream retrieveStream(String url) {\r\n\t\tDefaultHttpClient client = new DefaultHttpClient();\r\n\t\tHttpGet getRequest = new HttpGet(url);\r\n\t\t\r\n\t\ttry{\r\n\t\t\tHttpResponse getResponse = client.execute(getRequest);\r\n\t\t\tfinal int statusCode = getResponse.getStatusLine().getStatusCode();\r\n\t\t\tSystem.out.println(statusCode);\r\n\t\t\t\r\n\t\t\tif(statusCode != HttpStatus.SC_OK){\r\n\t\t\t\t//Log.w(getClass().getSimpleName(),\r\n\t\t\t\t\t\t//\"Error \" + statusCode + \" for URL \" + url);\r\n\t\t\t\tSystem.out.println(statusCode);\r\n\t\t\t\treturn null;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tHttpEntity getResponseEntity = getResponse.getEntity();\r\n\t\t\treturn getResponseEntity.getContent();\r\n\t\t}\r\n\t\t\r\n\t\tcatch(IOException e){\r\n\t\t\tgetRequest.abort();\r\n\t\t\t//Log.w(getClass().getSimpleName(),\"Error for URL \" + url, e);\r\n\t\t}\r\n\t\treturn null;\r\n\t}", "private String downloadUrl(String strUrl) throws IOException{\r\n String data = \"\";\r\n InputStream iStream = null;\r\n HttpURLConnection urlConnection = null;\r\n try{\r\n URL url = new URL(strUrl);\r\n\r\n // Creating an http connection to communicate with url\r\n urlConnection = (HttpURLConnection) url.openConnection();\r\n\r\n // Connecting to url\r\n urlConnection.connect();\r\n\r\n // Reading data from url\r\n iStream = urlConnection.getInputStream();\r\n\r\n BufferedReader br = new BufferedReader(new InputStreamReader(iStream));\r\n\r\n StringBuffer sb = new StringBuffer();\r\n\r\n String line = \"\";\r\n while( ( line = br.readLine()) != null){\r\n sb.append(line);\r\n }\r\n\r\n data = sb.toString();\r\n\r\n br.close();\r\n\r\n }catch(Exception e){\r\n Log.d(\"Exception:downloading\", e.toString());\r\n }finally{\r\n iStream.close();\r\n urlConnection.disconnect();\r\n }\r\n return data;\r\n }", "private String downloadUrl(String strUrl) throws IOException {\n String data = \"\";\n InputStream iStream = null;\n HttpURLConnection urlConnection = null;\n try {\n URL url = new URL(strUrl);\n\n // Creating an http connection to communicate with url\n urlConnection = (HttpURLConnection) url.openConnection();\n\n // Connecting to url\n urlConnection.connect();\n\n // Reading data from url\n iStream = urlConnection.getInputStream();\n\n BufferedReader br = new BufferedReader(new InputStreamReader(iStream));\n\n StringBuffer sb = new StringBuffer();\n\n String line = \"\";\n while ((line = br.readLine()) != null) {\n sb.append(line);\n }\n\n data = sb.toString();\n\n br.close();\n\n } catch (Exception e) {\n //Log.d(\"Exception while downloading url\", e.toString());\n } finally {\n iStream.close();\n urlConnection.disconnect();\n }\n return data;\n }", "List<Transfer> requestDownloads(Leecher leecher);", "public String makeNetworkCall(String s) {\n\n try {\n URL url = new URL(s);\n\n HttpURLConnection httpURLConnection = (HttpURLConnection) url.openConnection();\n\n httpURLConnection.setRequestMethod(\"GET\");\n\n httpURLConnection.setConnectTimeout(3000);\n\n InputStream is = httpURLConnection.getInputStream();\n\n Scanner scanner = new Scanner(is);\n\n //This allows the scanner to read the entire file content in one go\n scanner.useDelimiter(\"\\\\A\");\n\n String result = \"\";\n\n if (scanner.hasNext()) {\n result = scanner.next();\n }\n\n return result;\n\n } catch (MalformedURLException e) {\n e.printStackTrace();\n Log.e(\"TAG\", \"makeNetworkCall: Incorrect URL : \" + s);\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return \"Some unexpected error occurred!\";\n\n }", "protected HTTPSampleResult downloadPageResources(HTTPSampleResult res, HTTPSampleResult container, int frameDepth) {\n Iterator<URL> urls = null;\n try {\n final byte[] responseData = res.getResponseData();\n if (responseData.length > 0) { // Bug 39205\n final LinkExtractorParser parser = getParser(res);\n if (parser != null) {\n String userAgent = getUserAgent(res);\n urls = parser.getEmbeddedResourceURLs(userAgent, responseData, res.getURL(), res.getDataEncodingWithDefault());\n }\n }\n } catch (LinkExtractorParseException e) {\n // Don't break the world just because this failed:\n res.addSubResult(errorResult(e, new HTTPSampleResult(res)));\n setParentSampleSuccess(res, false);\n }\n \n // Iterate through the URLs and download each image:\n if (urls != null && urls.hasNext()) {\n if (container == null) {\n container = new HTTPSampleResult(res);\n container.addRawSubResult(res);\n }\n res = container;\n \n // Get the URL matcher\n String re = getEmbeddedUrlRE();\n Perl5Matcher localMatcher = null;\n Pattern pattern = null;\n if (re.length() > 0) {\n try {\n pattern = JMeterUtils.getPattern(re);\n localMatcher = JMeterUtils.getMatcher();// don't fetch unless pattern compiles\n } catch (MalformedCachePatternException e) {\n log.warn(\"Ignoring embedded URL match string: \" + e.getMessage());\n }\n }\n \n // For concurrent get resources\n final List<Callable<AsynSamplerResultHolder>> list = new ArrayList<>();\n \n int maxConcurrentDownloads = CONCURRENT_POOL_SIZE; // init with default value\n boolean isConcurrentDwn = isConcurrentDwn();\n if (isConcurrentDwn) {\n try {\n maxConcurrentDownloads = Integer.parseInt(getConcurrentPool());\n } catch (NumberFormatException nfe) {\n log.warn(\"Concurrent download resources selected, \"// $NON-NLS-1$\n + \"but pool size value is bad. Use default value\");// $NON-NLS-1$\n }\n \n // if the user choose a number of parallel downloads of 1\n // no need to use another thread, do the sample on the current thread\n if (maxConcurrentDownloads == 1) {\n log.warn(\"Number of parallel downloads set to 1, (sampler name=\" + getName()+\")\");\n isConcurrentDwn = false;\n }\n }\n \n while (urls.hasNext()) {\n Object binURL = urls.next(); // See catch clause below\n try {\n URL url = (URL) binURL;\n if (url == null) {\n log.warn(\"Null URL detected (should not happen)\");\n } else {\n- String urlstr = url.toString();\n- String urlStrEnc = escapeIllegalURLCharacters(encodeSpaces(urlstr));\n- if (!urlstr.equals(urlStrEnc)) {// There were some spaces in the URL\n- try {\n- url = new URL(urlStrEnc);\n- } catch (MalformedURLException e) {\n- res.addSubResult(errorResult(new Exception(urlStrEnc + \" is not a correct URI\"), new HTTPSampleResult(res)));\n- setParentSampleSuccess(res, false);\n- continue;\n- }\n+ try {\n+ url = escapeIllegalURLCharacters(url);\n+ } catch (Exception e) {\n+ res.addSubResult(errorResult(new Exception(url.toString() + \" is not a correct URI\"), new HTTPSampleResult(res)));\n+ setParentSampleSuccess(res, false);\n+ continue;\n }\n // I don't think localMatcher can be null here, but check just in case\n- if (pattern != null && localMatcher != null && !localMatcher.matches(urlStrEnc, pattern)) {\n+ if (pattern != null && localMatcher != null && !localMatcher.matches(url.toString(), pattern)) {\n continue; // we have a pattern and the URL does not match, so skip it\n }\n try {\n url = url.toURI().normalize().toURL();\n } catch (MalformedURLException | URISyntaxException e) {\n- res.addSubResult(errorResult(new Exception(urlStrEnc + \" URI can not be normalized\", e), new HTTPSampleResult(res)));\n+ res.addSubResult(errorResult(new Exception(url.toString() + \" URI can not be normalized\", e), new HTTPSampleResult(res)));\n setParentSampleSuccess(res, false);\n continue;\n }\n \n if (isConcurrentDwn) {\n // if concurrent download emb. resources, add to a list for async gets later\n list.add(new ASyncSample(url, HTTPConstants.GET, false, frameDepth + 1, getCookieManager(), this));\n } else {\n // default: serial download embedded resources\n HTTPSampleResult binRes = sample(url, HTTPConstants.GET, false, frameDepth + 1);\n res.addSubResult(binRes);\n setParentSampleSuccess(res, res.isSuccessful() && (binRes == null || binRes.isSuccessful()));\n }\n-\n }\n } catch (ClassCastException e) { // TODO can this happen?\n res.addSubResult(errorResult(new Exception(binURL + \" is not a correct URI\"), new HTTPSampleResult(res)));\n setParentSampleSuccess(res, false);\n }\n }", "@Test\n public void test1 () throws Exception{\n URI uri = new URI(\"http://www.baidu.com\");\n\n URL url = uri.toURL();\n\n InputStream input = url.openStream();\n OutputStream output = new ByteArrayOutputStream();\n\n int i = 0;\n byte[] bytes = new byte[1024];\n int length = -1;\n while( (length = input.read(bytes)) != -1){\n output.write(bytes, 0, length);\n }\n\n System.out.println(new String(bytes));\n }", "public String doInBackground(String... strings) {\n try {\n return HospitalMapsActivity.this.downloadUrl(strings[0]);\n } catch (IOException e) {\n e.printStackTrace();\n return null;\n }\n }", "@Override\r\n\t\t\tprotected String doInBackground(String... url) {\r\n\t\t\t\ttry {\r\n\t\t\t\t\tdata = downloadUrl(url[0]);\r\n\t\t\t\t} catch (Exception e) {\r\n\t\t\t\t\tLog.d(\"Background Task\", e.toString());\r\n\t\t\t\t}\r\n\t\t\t\treturn data;\r\n\t\t\t}", "public static void downloadUrlToPath(String url2, String path) {\n BufferedInputStream bInput = null;\n BufferedOutputStream bOutput = null;\n try {\n HttpURLConnection conn = null;\n URL url = new URL(url2);\n conn = (HttpURLConnection) url.openConnection();\n bInput = getBufferedInput(conn);\n bOutput = getBufferedOutput(path);\n byte[] buffer = new byte[1024];\n int cnt;\n while ((cnt = bInput.read(buffer)) != -1) {\n bOutput.write(buffer, 0, cnt);\n }\n bOutput.flush();\n if (conn != null) {\n conn.disconnect();\n }\n } catch (Exception e) {\n e.printStackTrace();\n } finally {\n try {\n if (bInput != null)\n bInput.close();\n if (bOutput != null)\n bOutput.close();\n } catch (IOException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n }", "public CrawlerResult crawl(URL url){\n //Creating the crawler result\n CrawlerResult rslt = new CrawlerResult(url);\n logger.info(url +\" started crawling....\");\n try{\n //Get the Document from the URL\n Document doc = Jsoup.connect(url.toString()).get();\n\n rslt.setTitle(doc.title());\n\n //links on the page\n Elements links = doc.select(\"a\");\n\n //Links on the page\n for(Element link : links){\n rslt.addLinksOnPage(new URL(link.attr(\"abs:href\")));\n }\n }catch(Exception e){\n //TODO\n }\n logger.info(url +\" finished crawled.\");\n return rslt;\n }" ]
[ "0.6898061", "0.6883236", "0.6883236", "0.6883236", "0.6883236", "0.6883236", "0.6883236", "0.6883236", "0.6883236", "0.6883236", "0.6883236", "0.6782899", "0.6772595", "0.6465282", "0.64292425", "0.63809216", "0.6368789", "0.634128", "0.62920374", "0.6250325", "0.6221149", "0.62058824", "0.61834276", "0.61314225", "0.6101275", "0.60755986", "0.6064965", "0.6057344", "0.6046779", "0.6029439", "0.60201293", "0.6011211", "0.5992551", "0.598431", "0.5983486", "0.5958887", "0.5924482", "0.59098303", "0.5897161", "0.5879877", "0.58775866", "0.5865829", "0.5845953", "0.5828235", "0.5826111", "0.58189034", "0.5807198", "0.5782197", "0.57677156", "0.576439", "0.576405", "0.573304", "0.5719275", "0.5709856", "0.570442", "0.56906366", "0.56836134", "0.5682844", "0.56640756", "0.566337", "0.56625414", "0.5652075", "0.5647527", "0.5645995", "0.5643747", "0.56352645", "0.56268245", "0.56231236", "0.56170297", "0.560951", "0.5592152", "0.55906326", "0.5588073", "0.5576735", "0.5561879", "0.5558271", "0.555784", "0.5557416", "0.55526894", "0.5552079", "0.55481666", "0.5544451", "0.55368066", "0.55224586", "0.55178744", "0.5513877", "0.5513041", "0.5506432", "0.5506166", "0.55043507", "0.55016506", "0.5497117", "0.5481627", "0.54747415", "0.5453505", "0.5445824", "0.5439264", "0.54374725", "0.54323864", "0.54293036" ]
0.65290976
13
Extract URLs in page content
static List<WebURL> ExtractUrl(Page page){ // TODO: reference to parser to extractor urls from the web content return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static List<String> extract(Document document) {\n Elements links = document.select(\"a[href]\");\n Elements media = document.select(\"[src]\");\n Elements imports = document.select(\"link[href]\");\n\n List<String> allLinks = new ArrayList<>();\n populateLinks(allLinks, media, \"abs:src\");\n populateLinks(allLinks, imports, \"abs:href\");\n populateLinks(allLinks, links, \"abs:href\");\n return allLinks;\n }", "public void pullResources(String domainURL){\n URLResource page = new URLResource(\"https://www.dukelearntoprogram.com//course2/data/manylinks.html\");\n \n int startIndex;\n int endIndex;\n // loop through pages\n for (String s : page.lines()){\n \n //System.out.println(s);\n int pose = s.indexOf(domainURL);\n \n // if the url is in the line\n if (-1 != pose) {\n \n startIndex = s.lastIndexOf(\"\\\"\",pose); // find actual start\n endIndex = s.indexOf(\"\\\"\",pose+1); // find end\n \n System.out.println( s.substring(startIndex, endIndex));\n \n \n \n }\n \n \n }\n}", "Set<Link> extractLinks(CrawlDoc doc, ParseState parseState)\n throws IOException;", "public static Set<String> parsePage(Document doc){\n\t\ttry{\n\t\t\tElements links = doc.select(\"a[href]\");\n\t\t\tSet<String> pageLinks = new HashSet<String>();\n\t\t\tfor(Element link : links){\n\t\t\t\tpageLinks.add(link.attr(\"abs:href\"));\n\t\t\t}\n\t\t\treturn pageLinks;\n\t\t}catch(Exception err){\n\t\t\terr.printStackTrace();\n\t\t\treturn null;\n\t\t}\n\t}", "public void extract(String pathToPageFile, String baseUri) throws Exception {\n\n File file = new File(pathToPageFile);\n Document doc = Jsoup.parse(file, \"UTF-8\", baseUri);\n Elements links = doc.select(\"a[href]\");\n Elements media = doc.select(\"[src]\");\n Elements imports = doc.select(\"link[href]\");\n\n printf(\"\\nMedia: %d\", media.size());\n for (Element src: media) {\n printf(\" * %s: <%s>\", src.tagName(), src.attr(\"abs:src\"));\n }\n\n printf(\"\\nImports: %d\", imports.size());\n for (Element link: imports) {\n printf(\" * %s <%s> (%s)\", link.tagName(), link.attr(\"abs:href\"), link.attr(\"rel\"));\n }\n\n printf(\"\\nLinks: %d\", links.size());\n for (Element link: links) {\n printf(\" * %s <%s> (%s)\", link.tagName(), link.attr(\"abs:href\"), trim(link.text(), 35));\n }\n }", "@Override\n public void visit(Page page) {\n\t visitObject.visitUrls(page);\n\t String url = page.getWebURL().getURL();\n\t System.out.println(\"URL: \" + url);\n\t if (page.getParseData() instanceof HtmlParseData) {\n\t\t HtmlParseData htmlParseData = (HtmlParseData) page.getParseData();\n\t\t String text = htmlParseData.getText();\n\t\t String html = htmlParseData.getHtml();\n\t\t Set<WebURL> links = htmlParseData.getOutgoingUrls();\n\t\t System.out.println(\"Text length: \" + text.length());\n\t\t System.out.println(\"Html length: \" + html.length());\n\t\t System.out.println(\"Number of outgoing links: \" + links.size());\n\t\t }\n }", "public ArrayList<String> soupThatSite(String url) throws IOException {\n\n ArrayList<String> parsedDoc = new ArrayList<>();\n Document doc = Jsoup.connect(url).get();\n\n if (url.contains(\"cnn.com\")) {\n\n doc.select(\"h1\").stream().filter(Element::hasText).forEach(element1 -> {\n String str = element1.text();\n String clean = Jsoup.clean(str, Whitelist.basic());\n parsedDoc.add(clean);\n });\n\n doc.select(\".zn-body__paragraph\").stream().filter(Element::hasText).forEach(element1 -> {\n String str = element1.text();\n String clean = Jsoup.clean(str, Whitelist.basic());\n parsedDoc.add(clean);\n });\n\n } else {\n\n doc.select(\"h1\").stream().filter(Element::hasText).forEach(element1 -> {\n String str = element1.text();\n String clean = Jsoup.clean(str, Whitelist.basic());\n parsedDoc.add(clean);\n });\n\n doc.select(\"p\").stream().filter(Element::hasText).forEach(element -> {\n String str = element.text();\n String clean = Jsoup.clean(str, Whitelist.basic());\n parsedDoc.add(clean);\n });\n }\n\n return parsedDoc;\n }", "private void ExtractURLs(String line)\n {\n String matchedURL = \"\";\n Matcher urlMatcher = urlPattern.matcher(line);\n\n while (urlMatcher.find())\n {\n matchedURL = urlMatcher.group();\n\n if (!distinctURLs.containsKey(matchedURL))\n {\n distinctURLs.put(matchedURL,matchedURL);\n }\n }\n }", "private void pullLinks(String htmlPage) {\n\n Document doc = Jsoup.parse(htmlPage);\n Elements links = doc.select(\"a[href]\");\n\n for (Element link : links) {\n\n String possibleUrl = link.attr(\"abs:href\");\n\n if (!possibleUrl.equals(\"\")) {\n// Log.v(\"pullLinks\", \" will try to make URL from\" + possibleUrl);\n //if the link attr isn't empty, make a URL\n URL theUrl = NetworkUtils.makeURL(possibleUrl);\n\n if (RegexUtils.urlDomainNameMatch(firstLinkAsString, theUrl.toString())) {\n //if the string version of url is within the same domain as original query\n if (!visitedLinks.contains(theUrl.toString())) {\n// Log.v(\"DLAsyncTask.pullLinks\", \" thinks that \" + theUrl.toString() + \" wasn't visited, add into collected...\");\n collectedLinks.add(theUrl.toString());\n }\n }\n }\n\n }\n }", "private static Set<String> extractHosts(String rawContent) { \r\n\t\tString hostRegex = \"https:\\\\/\\\\/[a-zA-Z]([\\\\w\\\\.\\\\-])*\\\\.gov.br\";\r\n\t\tMatcher matcher = Pattern.compile(hostRegex).matcher(rawContent);\r\n\t\t\r\n\t\tSet<String> results = new HashSet<String>();\r\n\t\twhile(matcher.find()) {\r\n\t\t\tresults.add(matcher.group().replace(\"http://\", \"\").replace(\"https://\", \"\"));\r\n\t\t}\r\n\t\treturn results;\r\n\t\t\r\n\t}", "private void pageContent( String url) {\n\t\t\n\t\tif ( !url.matches(URL)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tList<String> outlinks = null; // out link urls\n\t\tUrlBean bean = null; // basic info of the url\n\t\t\n\t\tbean = new UrlBean();\n\t\ttry {\n\t\t\t\n\t\t\tconn = Jsoup.connect(url).timeout(5000);\n\t\t\tif ( conn == null) {\n\t\t\t\treturn ;\n\t\t\t}\n\t\t\t\n\t\t\tdocument = conn.get(); // 得到网页源代码,超时时间是5秒\n\t\t\t\n\t\t\t/*\n\t\t\t * 文章基本信息\n\t\t\t */\n\t\t\telements = document.getElementsByTag(\"title\");\n\t\t\tif ( elements!= null && elements.size() != 0) {\n\t\t\t\telement = elements.get(0);\n\t\t\t}\n\t\t\tString title = element.text();\n\t\t\tbean.setTitle(title);\n\t\t\tbean.setKeywords(title);\n\t\t\t\n\t\t\telements = document.getElementsByTag(\"a\");\n\t\t\tif ( elements != null) {\n\t\t\t\tString linkUrl = null;\n\t\t\t\toutlinks = new ArrayList<String>();\n\t\t\t\tfor ( int i = 0; i < elements.size(); i++) {\n\t\t\t\t\tlinkUrl = elements.get(i).attr(\"href\");\n\t\t\t\t\tif ( linkUrl.matches(URL)) {\n\t\t\t\t\t\toutlinks.add(linkUrl);\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\treturn;\n\t\t} \n\t\t\n\t\tbean.setUrl(url);\n\t\tbean.setId(urlId++);\n\t\tbean.setRank(1);\n\t\tif ( outlinks != null) {\n\t\t\tint count = outlinks.size();\n\t\t\tbean.setOutlinks(count);\n\t\t\tfor ( int i = 0; i < count; i++) {\n\t\t\t\turlsSet.add(outlinks.get(i));\n\t\t\t}\n\t\t\tif ( new AllInterface().addOneUrlInfo(bean, outlinks)) {\n\t\t\t\tSystem.out.println(\"Add to database successfully, url is '\" + url + \"'.\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Fail to add to database, maybe url exists. Url is '\" + url + \"'.\");\n\t\t\t}\n\t\t\tSystem.out.println(\"[\" + count + \" urls remain...]\");\n\t\t\tSystem.out.println();\n\t\t} else {\n\t\t\tSystem.out.println(\"Error occurs in crawl, url is '\" + url + \"'.\");\n\t\t\tSystem.out.println(\"[[FINISHED]]\");\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t}", "public Set<URL> getTargetPageURLs(){\n\t\tSet<URL> urls = new HashSet<URL>();\n\t\tString url = \"http://www.infoq.com/news/2012/12/twemproxy;jsessionid=1652D82C3359CBAB67DA00B26BE7784B\";\n\t\turls.add(URL.valueOf(url));\n\t\treturn urls;\n\t}", "private void processUrls(){\n // Strip quoted tweet URL\n if(quotedTweetId > 0){\n if(entities.urls.size() > 0 &&\n entities.urls.get(entities.urls.size() - 1)\n .expandedUrl.endsWith(\"/status/\" + String.valueOf(quotedTweetId))){\n // Match! Remove that bastard.\n entities.urls.remove(entities.urls.size() - 1);\n }\n }\n\n // Replace minified URLs\n for(Entities.UrlEntity entity : entities.urls){\n // Find the starting index for this URL\n entity.indexStart = text.indexOf(entity.minifiedUrl);\n // Replace text\n text = text.replace(entity.minifiedUrl, entity.displayUrl);\n // Find the last index for this URL\n entity.indexEnd = entity.indexStart + entity.displayUrl.length();\n }\n }", "@Override\r\n public void visit(Page page) {\r\n String url = page.getWebURL().getURL();\r\n System.out.println(\"URL: \" + url);\r\n\r\n if (page.getParseData() instanceof HtmlParseData) {\r\n HtmlParseData htmlParseData = (HtmlParseData) page.getParseData();\r\n String text = htmlParseData.getText();\r\n String html = htmlParseData.getHtml();\r\n List<WebURL> links = htmlParseData.getOutgoingUrls();\r\n\r\n System.out.println(\"Text length: \" + text.length());\r\n System.out.println(\"Html length: \" + html.length());\r\n System.out.println(\"Number of outgoing links: \" + links.size());\r\n\r\n try {\r\n Configuration config = new Configuration();\r\n System.setProperty(\"HADOOP_USER_NAME\", \"admin\");\r\n FileSystem fileSystem = FileSystem.get(new URI(\"hdfs://192.168.51.116:8022/\"), config);\r\n FSDataOutputStream outStream = fileSystem.append(new Path(\"/user/admin/crawler-results.txt\"));\r\n\r\n IOUtils.write(text.replace('\\n', ' '), outStream);\r\n outStream.flush();\r\n IOUtils.closeQuietly(outStream);\r\n } catch (Exception ex) {\r\n ex.printStackTrace();\r\n throw new RuntimeException(ex);\r\n }\r\n }\r\n }", "private String getContent(String url) throws BoilerpipeProcessingException, IOException {\n int code;\n HttpURLConnection connection = null;\n URL uri;\n do{\n uri = new URL(url);\n if(connection != null)\n connection.disconnect();\n connection = (HttpURLConnection)uri.openConnection();\n connection.setRequestMethod(\"GET\");\n connection.setConnectTimeout(5000);\n connection.setReadTimeout(5000);\n connection.connect();\n code = connection.getResponseCode();\n if(code == 301)\n url = connection.getHeaderField( \"Location\" );\n }while (code == 301);\n\n System.out.println(url + \" :: \" + code);\n String content = null;\n if(code < 400) {\n content = ArticleExtractor.INSTANCE.getText(uri);\n }\n connection.disconnect();\n return content;\n }", "private @NotNull List<String> getAllLinks(final String text, final String urlStart) {\n List<String> links = new ArrayList<>();\n\n int i = 0;\n while (text.indexOf(urlStart, i) != -1) {\n int linkStart = text.indexOf(urlStart, i);\n int linkEnd = text.indexOf(\" \", linkStart);\n if (linkEnd != -1) {\n String link = text.substring(linkStart, linkEnd);\n links.add(link);\n } else {\n String link = text.substring(linkStart);\n links.add(link);\n }\n i = text.indexOf(urlStart, i) + urlStart.length();\n }\n\n return links;\n }", "public String getUrl(){\n return urlsText;\n }", "private List<String> getOfferPagesLinks(Document document) {\n return document.select(\"div[class=product-image loaded] > a[href]\").eachAttr(\"abs:href\");\n }", "private List<Elements> extractHTMLInfo(String url) throws IOException {\r\n\r\n //All required info to be collected is within the <section> tag\r\n Element sectionTag = Jsoup.connect(url).get().select(\"section\").get(0);\r\n\r\n List<Elements> list = new ArrayList();\r\n\r\n //Banner img Tag\r\n list.add(sectionTag.select(\"img\"));\r\n\r\n //TimeTag\r\n list.add(sectionTag.select(\"header\").select(\"time\"));\r\n\r\n //Article Title\r\n list.add(sectionTag.select(\"header\").select(\"h2 a\"));\r\n\r\n //Author\r\n list.add(sectionTag.select(\"header\").select(\"p a\"));\r\n\r\n //Content Body HTML\r\n list.add(sectionTag.select(\"article\").select(\"div\"));\r\n\r\n return list;\r\n }", "@Override\n\tpublic void visit(Page page) {\n\t\tint docid = page.getWebURL().getDocid();\n\t\tString url = page.getWebURL().getURL();\n\t\tString domain = page.getWebURL().getDomain();\n\t\tString path = page.getWebURL().getPath();\n\t\tString subDomain = page.getWebURL().getSubDomain();\n\t\tString parentUrl = page.getWebURL().getParentUrl();\n\n\t\tSystem.out.println(\"Docid: \" + docid);\n\t\tSystem.out.println(\"URL: \" + url);\n\t\tSystem.out.println(\"Domain: '\" + domain + \"'\");\n\t\tSystem.out.println(\"Sub-domain: '\" + subDomain + \"'\");\n\t\tSystem.out.println(\"Path: '\" + path + \"'\");\n\t\tSystem.out.println(\"Parent page: \" + parentUrl);\n\n\t\tif(page.getParseData() instanceof JavaScriptParseData) {\n\t\t\tSystem.out.println(\"Got an instance of JS Parse DATA!!!!\");\n\t\t\tSystem.out.println(\"Parent Page of JS data is : \" + page.getWebURL().getParentUrl());\n\n\t\t\tJavaScriptParseData jsParseData = (JavaScriptParseData) page.getParseData();\n\t\t\tString jsText = jsParseData.getJs();\n\n\t\t\ttry {\n\t\t\t\tif(DomainTrackerParser.containsTracker(jsText)){\n\t\t\t\t\tdomainTrackerSet.add(url);\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\n\t\tif (page.getParseData() instanceof HtmlParseData) {\n\t\t\tHtmlParseData htmlParseData = (HtmlParseData) page.getParseData();\n\t\t\tString text = htmlParseData.getText();\n\t\t\tString html = htmlParseData.getHtml();\n\t\t\tList<WebURL> links = htmlParseData.getOutgoingUrls();\n\n\t\t\tSystem.out.println(\"Text length: \" + text.length());\n\t\t\tSystem.out.println(\"Html length: \" + html.length());\n\t\t\tSystem.out.println(\"Number of outgoing links: \" + links.size());\n\n\t\t\tfor(WebURL webUrl : links) {\n\t\t\t\tString urlString = webUrl.getURL().toString();\n\n\t\t\t\ttry {\n\t\t\t\t\tif(urlString != null && DomainTrackerParser.containsTracker(urlString)) {\n\t\t\t\t\t\tSystem.out.println(\"added a tracker to the set : \" + urlString);\n\t\t\t\t\t\tdomainTrackerSet.add(urlString);\n\t\t\t\t\t}\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\tSystem.out.println(\"Outgoing URL : \" + webUrl);\n//\t\t\t\tSystem.out.println(domainTrackerSet);\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.println(\"=============\");\n\t}", "public static Set<String> parser(String html){\r\n\r\n\t\tSet<String> urls = new HashSet<String>();\r\n\t\tString regex = \"<a.*?/a>\";\r\n\t\tPattern pt = Pattern.compile(regex);\r\n\t\tMatcher matcher = pt.matcher(html);\r\n\t\twhile(matcher.find()){\r\n\t\t\t//获取网址\r\n//\t\t\tSystem.out.println(\"Group:\"+matcher.group());\r\n\t\t\tMatcher myurl = Pattern.compile(\"href=\\\".*?\\\">\").matcher(matcher.group());\r\n\t\t\tif(myurl.find()){\r\n\t\t\t\tdo{\r\n\t\t\t\t\tString temp = myurl.group();\r\n\t\t\t\t\tif(!temp.startsWith(\"javascript\") && !temp.startsWith(\"/\") && ! temp.startsWith(\"#\")){\r\n\t\t\t\t\t\tString url = myurl.group().replaceAll(\"href=\\\"|\\\">\",\"\");\r\n\t\t\t\t\t\tif(url.contains(\"http\")){\r\n\t\t\t\t\t\t\tif(url.contains(\"\\\"\")){\r\n\t\t\t\t\t\t\t\turl = url.substring(0, url.indexOf(\"\\\"\"));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\tif(!url.contains(\"$\") && !url.contains(\" \")){\r\n\t\t\t\t\t\t\t\turls.add(url);\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}while(myurl.find());\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn urls;\r\n\t}", "private static Set<String> scrapeHTML(String html) {\n\t\tSet<String> set = new HashSet<String>();\n\t\tint skipLength = 0;\n\t\tint counter = 0;\n\t\t// the subtraction of 15 is because of the number of characters in \n\t\t// \"<a href=\\\"/wiki/\", to avoid a index out of bounds error\n\t\tfor(int i = 0; i < html.length()-15; i++) {\n\t\t\tif(html.substring(i, i+15).equals(\"<a href=\\\"/wiki/\")) {\n\t\t\t\t// if format matches starts to check the following characters\n\t\t\t\t// to check if it does not contain a : or a #\n\t\t\t\tchar ch = html.charAt(i+15);\n\t\t\t\tString str = \"\";\n\t\t\t\tint count = 0;\n\t\t\t\twhile(html.charAt(i+count+15) != '\"'){\n\t\t\t\t\tif(html.charAt(i+count+15) == ':' || html.charAt(i+count+15) == '#') {\n\t\t\t\t\t\tstr = \"\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tch = html.charAt(count+i+15);\n\t\t\t\t\tstr += ch;\n\t\t\t\t\tcount++;\n\t\t\t}\n\t\t\t\t// adds if the page name is not empty\n\t\t\t\tif(str != \"\")\n\t\t\t\tset.add(str);\n\t\t\t\tskipLength = str.length();\n\t\t\t\tcount = 0;\n\t\t}\n\t\t\ti += skipLength;\n\t\t\tskipLength = 0;\n\t\t\tcounter++;\n\t\n\t}\n\treturn set;\n}", "public Set<Anchor> parse(Reader reader, String url) {\n\n Set<Anchor> elements = new HashSet<>();\n String urtContent = null;\n try {\n urtContent = readFully(reader);\n } catch (IOException e) {\n e.printStackTrace();\n }\n if (urtContent == null){\n return elements;\n }\n\n mTag = pTag.matcher(urtContent);\n\n while (mTag.find()) {\n\n String href = mTag.group(1); // get the values of href\n String linkElem = mTag.group(2); // get the text of link Html Element\n\n mLink = pLink.matcher(href);\n\n while (mLink.find()) {\n\n String link = mLink.group(1);\n Anchor anchor = new Anchor();\n anchor.setUrl(link);\n anchor.setText(linkElem);\n\n elements.add(anchor);\n\n }\n }\n return elements;\n }", "private Set<String> extracLinks(String url, LinkFilter filter) {\n\n\t\tSet<String> links = new HashSet<String>();\n\t\ttry {\n\t\t\tParser parser = new Parser(url);\n\t\t\tparser.setEncoding(\"UTF-8\");\n\t\t\t// linkFilter filter <a> tag\n\t\t\tNodeClassFilter linkFilter = new NodeClassFilter(LinkTag.class);\n\t\t\t// get all filtered links\n\t\t\tNodeList list = parser.extractAllNodesThatMatch(linkFilter);\n\t\t\tfor (int i = 0; i < list.size(); i++) {\n\t\t\t\tNode tag = list.elementAt(i);\n\t\t\t\tif (tag instanceof LinkTag)// <a> tag\n\t\t\t\t{\n\t\t\t\t\tLinkTag link = (LinkTag) tag;\n\t\t\t\t\tString linkUrl = link.getLink();// url\n\t\t\t\t\tif (filter.accept(linkUrl)) {\n\t\t\t\t\t\t// change bbsdoc to bbstdoc\n\t\t\t\t\t\tString stlink = linkUrl.replace(\"bbsdoc\", \"bbstdoc\");\n\t\t\t\t\t\tlinks.add(stlink);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (ParserException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\treturn links;\n\t}", "private String fetchUrl() {\n\t\tString url;\n\t\tint depth;\n\t\tdo\n\t\t{\n\t\t\tLandingPage lp = this.pagesToVisit.remove(0);\n\t\t\turl = lp.getUrl();\n\t\t\tdepth = lp.getDepth();\n\t\t\t\n\t\t}while(this.pagesVisited.containsKey(url) || !(isvalidURL(url)));\n\t\tthis.pagesVisited.put(url,depth);\n\t\treturn url;\n\t}", "private String getText(URL url){\n\tString parsedHtml=null;\n\ttry{\n\t\tHttpURLConnection urlConn = (HttpURLConnection) url.openConnection();\n\t\tString line = null;\n\t\tStringBuilder tmp = new StringBuilder();\n\t\tBufferedReader in = new BufferedReader(new InputStreamReader(urlConn.getInputStream()));\n\t\twhile ((line = in.readLine()) != null) {\n\t\t tmp.append(line);\n\t\t}\n\t\t \n\t\tDocument doc = Jsoup.parse(tmp.toString());\n\t\tparsedHtml = doc.title() + doc.body().text();\n\t\t\n\t}\n\tcatch(IOException e){\n\t\tSystem.out.println(\"Page not reached for: \"+url );\n\t}\n\tfinally{\n\t\treturn parsedHtml;\n\t}\n\t\n}", "public String getContentURL();", "public void getLinks() {\n\n var client = HttpClient.newBuilder()\n .followRedirects(HttpClient.Redirect.ALWAYS)\n .build();\n\n HttpRequest request = HttpRequest.newBuilder()\n .uri(URI.create(URL_PREFIX))\n .build();\n client.sendAsync(request, HttpResponse.BodyHandlers.ofLines())\n .thenApply(HttpResponse::body)\n .thenApply(this::processLines)\n .thenApply(versions -> tasks(versions))\n .join();\n }", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "java.lang.String getUrl();", "private Stream<String> processLines(Stream<String> lines) {\n System.out.println(\"processlines\" + Thread.currentThread().getName());\n Pattern pattern = Pattern.compile(\"<a href=\\\"([^\\\\/]*\\\\/)\\\".*\");\n\n return lines\n .map(s -> pattern.matcher(s))\n .filter(m -> m.matches())\n .map(m -> m.group(1))\n .filter(s -> !\"../\".equals(s));\n }", "void retrievePageContents()\n\t{\n\t\tStringBuilder longString = new StringBuilder();\n\t\tfor (int i = 0; i < pageContents.size(); i++)\n\t\t{\n\t\t\tlongString.append(pageContents.get(i));\n\t\t}\n\t\tString pageMarkup = longString.toString().toLowerCase();\n\t\textractComments(pageMarkup);\n\n\t}", "private String readHTML(URL url) {\n String urlContents = \"\";\n\n try {\n BufferedReader bufferedReader =\n new BufferedReader(new InputStreamReader(url.openStream()));\n StringBuilder stringBuilder = new StringBuilder();\n\n String line;\n while ((line = bufferedReader.readLine()) != null) {\n stringBuilder.append(line).append(\"\\n\");\n }\n\n urlContents = stringBuilder.toString();\n bufferedReader.close();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n return urlContents;\n }", "public List getLinks() {\r\n List links = getElements(\"a\");\r\n ArrayList result = new ArrayList();\r\n for (int i = 0; i < links.size(); i++) {\r\n try {\r\n StandAloneElement keep = ((StandAloneElement)links.get(i));\r\n result.add(parseUrl(keep.getAttribute(\"href\")));\r\n } catch (Exception e) {\r\n }\r\n }\r\n links = getElements(\"FRAME\");\r\n for (int i = 0; i < links.size(); i++) {\r\n try {\r\n StandAloneElement keep = ((StandAloneElement)links.get(i));\r\n result.add(parseUrl(keep.getAttribute(\"src\")));\r\n } catch (Exception e) {\r\n }\r\n }\r\n\r\n return result;\r\n }", "public static URL[] HTMLLinks(String url) throws Exception\n\t{\n\t\t// Get the links\n\n\t\tURLConnection conn = (new java.net.URL(url)).openConnection();\n\t\tconn.setRequestProperty(\"User-Agent\",\"Mozilla/5.0 ( compatible ) \");\n\t\tconn.setRequestProperty(\"Accept\",\"*/*\");\n\n\t\tLinkBean sb = new LinkBean();\n\t\tsb.setURL(url);\n\t\tsb.setConnection(conn);\n\t\tURL[] outlinks = sb.getLinks();\n\n\t\t// make links fully qualified\n\t\tURI baseURI = null;\n\t\ttry\n\t\t{\n\t\t\tbaseURI = new URI(url);\n\t\t}\n\t\tcatch (Exception e)\n\t\t{\n\t\t\tlogger.error(e.getMessage(), e);\n\t\t\treturn new URL[0];\n\t\t}\n\n\t\t// ----\n\t\tList<URL> fqurls = new ArrayList<URL>();\n\t\tfor (int i = 0; i < outlinks.length; i++)\n\t\t{\n\t\t\tURL fqurl = null;\n\t\t\ttry\n\t\t\t{\n\t\t\t\tfqurl = baseURI.resolve(outlinks[i].toURI()).toURL();\n\t\t\t}\n\t\t\tcatch (Exception e)\n\t\t\t{\n\t\t\t\tlogger.error(e.getMessage(), e);\n\t\t\t}\n\t\t\tif (fqurl != null)\n\t\t\t{\n\t\t\t\tfqurls.add(fqurl);\n\t\t\t}\n\t\t}\n\t\treturn fqurls.toArray(new URL[fqurls.size()]);\n\t}", "private String getUrlContents(String theUrl) {\n StringBuilder content = new StringBuilder();\n try {\n URL url = new URL(theUrl);\n URLConnection urlConnection = url.openConnection();\n //reads the response\n BufferedReader br = new BufferedReader(new InputStreamReader(urlConnection.getInputStream()), 8);\n String line;\n while ((line = br.readLine()) != null) {\n content.append(line + \"\\n\");\n }\n br.close();\n }catch (Exception e) {\n //error occured, usually network related\n e.printStackTrace();\n }\n return content.toString();\n }", "public Stream<ParsedURL> urls() {\n return stream().map(req -> new ParsedURL(req.getUrl()));\n }", "private void getLinks(Page page, Element content, boolean withConnection) throws JSONException, SQLException {\n\t\tString pageTitle = page.getTitle();\n\t\tString pageId = String.valueOf(page.getPageId());\n\t\tElements links = content.select(\"a[href]\");\n\t\tPageApi pa = new PageApi();\n\t\tfor (Iterator<Element> iterator = links.iterator(); iterator.hasNext();) {\n\t\t\tElement element = iterator.next();\n\t\t\tString link = element.attr(\"href\");\n\t\t\t/**\n\t\t\t * It has to be an internal wikipedia link\n\t\t\t */\n\t\t\tif (link.startsWith(\"/wiki/\")) {\n\t\t\t\t/**\n\t\t\t\t * Ignore unrelevant links\n\t\t\t\t */\n\t\t\t\tif (link.startsWith(\"/wiki/Category:\") || link.startsWith(\"/wiki/Special:\")\n\t\t\t\t\t\t|| link.startsWith(\"/wiki/Wikipedia:\") || link.startsWith(\"/wiki/Help:\")\n\t\t\t\t\t\t|| link.startsWith(\"/wiki/Template:\") || link.startsWith(\"/wiki/Portal:\")\n\t\t\t\t\t\t|| link.startsWith(\"/wiki/Talk:\") || link.startsWith(\"/wiki/\" + pageTitle + \":\")\n\t\t\t\t\t\t|| link.startsWith(\"/wiki/File:\") || link.startsWith(\"/wiki/Template_talk:\")) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tlink = link.replace(\"/wiki/\", \"\");\n\t\t\t\tPage character = pa.getPageInfoForTitle(link);\n\t\t\t\tif (withConnection) {\n\t\t\t\t\tif (tempList.contains(character.getPageId())) {\n\t\t\t\t\t\tpersistConnection(pageId, character);\n\t\t\t\t\t}\n\n\t\t\t\t}\n\n\t\t\t\telse {\n\t\t\t\t\tpersistCharacter(pageId, character);\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "public static List<String> getURLs(List<WebElement> links) {\n\t\t List<String> ListHref = new ArrayList<String>();\n\t\t \n\t\t //loops through all links\n\t\t for(WebElement Webhref:links) {\n\t\t\t \n\t\t\t //if element isn't null\n\t\t\t if (Webhref.getAttribute(\"href\") != null) {\n\t\t\t\t String StringHref = (Webhref.getAttribute(\"href\")).toString();\n\n\t\t\t\t //if page isn't part of domain, ignore\n\t\t\t\t if (StringHref.startsWith(variables.domain)) {\n\t\t\t\t\t //System.out.println(StringHref);\n\t\t\t\t\t \n\t\t\t\t\t //if page doesn't have an octothorpe\n\t\t\t\t\t if (!StringHref.contains(\"#\")) {\n\t\t\t\t\t\t \n\t\t\t\t\t\t//if page doesn't ends with one of the file extensions to not use\n\t\t\t\t\t\t String extension = getExtension(StringHref);//gets TLD from URL\n\t\t\t\t\t\t if(!variables.list.stream().anyMatch(extension::contains)) {\n\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t//if value isn't already part of this array or the already crawled array\n\t\t\t\t\t\t\t if(!ListHref.contains(StringHref) && !variables.crawled.contains(StringHref)) {\n\t\t\t\t\t\t\t\t ListHref.add(StringHref);\n\t\t\t\t\t\t\t\t //System.out.println(StringHref);\n\t\t\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t }\n\t\t\t\t\t }\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\n\t\treturn ListHref;\n\t}", "@Override\n\tpublic void process(Page page) {\n\t\tDocument doc = Jsoup.parse(page.getHtml().getFirstSourceText());\n\n\t\tif (isFirst) {\n\t\t\tSystem.out.println(\"添加所有列表链接\");\n\t\t\tArrayList<String> urls = new ArrayList<String>();\n\t\t\t// 33\n\t\t\tfor (int i = 2; i < 30; i++) {\n\t\t\t\turls.add(\"http://zyjy.jiangmen.gov.cn//szqjszbgg/index_\" + i + \".htm\");\n\t\t\t}\n\t\t\tpage.addTargetRequests(urls);\n\t\t\tSystem.out.println(\"这一页一共有 \" + urls.size() + \" 条数据\");\n\n\t\t\tisFirst = false;\n\t\t}\n\n\t\tif (page.getUrl().regex(URL_LIST).match() || page.getUrl().toString().trim().equals(url)) {\n\t\t\tSystem.out.println(\"获取列表数据\");\n\n\t\t\tElements uls = doc.getElementsByAttributeValue(\"class\", \"c1-bline\");\n\t\t\tfor (Element ul : uls) {\n\t\t\t\tString url = ul.getElementsByAttributeValue(\"class\", \"f-left\").get(0).select(\"a\").attr(\"href\").trim();\n\t\t\t\tString title = ul.getElementsByAttributeValue(\"class\", \"f-left\").get(0).text();\n\t\t\t\tString data = ul.getElementsByAttributeValue(\"class\", \"f-right\").get(0).text();\n\t\t\t\tCacheHashMap.cache.put(url, title + \"###\" + data);\n\t\t\t\tMyUtils.addRequestToPage(page, url);\n\t\t\t\tSystem.out.println(url + \" \" + CacheHashMap.cache.get(url));\n\t\t\t}\n\n\t\t}\n\t\tif (page.getUrl().regex(URL_DETAILS).match()) {\n\n\t\t\tProject project = new Project();\n\t\t\tStringBuffer project_article = new StringBuffer();\n\n\t\t\tString urldetails = CacheHashMap.cache.get(page.getUrl().toString().trim());\n\t\t\tSystem.out.println(\"url\" + page.getUrl().toString().trim());\n\t\t\tSystem.out.println(\"urldetails \" + urldetails);\n\n\t\t\tString[] value = urldetails.split(\"###\");\n\t\t\tif (value != null && value.length > 1) {\n\t\t\t\tproject.setProjectName(value[0]);\n\t\t\t\tproject.setPublicStart(value[1]);\n\t\t\t}\n\n\t\t\tElements divs = doc.getElementsByAttributeValue(\"class\", \"contlist minheight\");\n\t\t\tfor (Element div : divs.get(0).children()) {\n\t\t\t\tif (div.nodeName().equals(\"table\")) {\n\t\t\t\t\tElements trs = divs.select(\"tbody\").select(\"tr\");\n\t\t\t\t\tfor (Element tr : trs) {\n\t\t\t\t\t\tproject_article.append(tr.text()).append(\"\\n\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tproject_article.append(div.text()).append(\"\\n\");\n\n\t\t\t\t}\n\t\t\t}\n\t\t\tproject.setUrl(page.getUrl().toString().trim());\n\t\t\tproject.setState(0);\n\t\t\tproject.setWebsiteType(\"江门市\");\n\t\t\tproject.setTime(MyUtils.getcurentTime());\n\t\t\tproject.setRawHtml(divs.toString());\n\n\t\t\tproject.setArticle(project_article.toString());\n\t\t\tSystem.out.println(project);\n\n\t\t\tHibernateUtil.save2Hibernate(project);\n\n\t\t}\n\n\t}", "public static void main(String args[]){\n String pattern = \"/^(http(s)?(:\\\\/\\\\/))?(www\\\\.)?\\\\.(\\\\/.*)?$/\";\r\n String input = \"(http://www.archive.com/web/http://www.mrvc.indianrai.gov.in/overview)\";\r\n\r\n Matcher matcher = Pattern.compile(pattern).matcher(input);\r\n while (matcher.find()) {\r\n System.out.println(matcher.group());\r\n int start = matcher.start(1);\r\n int end = matcher.end(1);\r\n String result = input.substring(start,end).replaceFirst(\"www.\",\"\");\r\n if(result.startsWith(\"www.\") ){\r\n input.substring(start,end).replaceFirst(\"www.\",\"\");\r\n }else if(result.startsWith(\"ww2.\")){\r\n input.substring(start,end).replaceFirst(\"ww2.\",\"\");\r\n }else if(result.startsWith(\"web.\")){\r\n input.substring(start,end).replaceFirst(\"web.\",\"\");\r\n }\r\n System.out.println(result);\r\n\r\n }\r\n }", "String getUrl();", "String getUrl();", "String getUrl();", "String getUrl();", "String getUrl();", "java.net.URL getUrl();", "String getHref();", "public static void parsepage(String sourcecode) {\r\n\t\tint indexfrom = 0;\r\n\t\tint indexto = 0;\r\n\t\t\r\n\t\tindexfrom = sourcecode.indexOf(\"<title>\", indexfrom + 1);\r\n\t\tindexto = sourcecode.indexOf(\"</title>\", indexto + 1);\r\n\t\tif(indexfrom != -1 && indexto != -1) {\r\n\t\t\tSystem.out.println(sourcecode.substring(indexfrom + 7, indexto) + \"\\n\\r\");\r\n\t\t}\r\n\r\n\t\tindexfrom = 0;\r\n\t\tindexto = 0;\r\n\t\twhile(true) {\r\n\t\t\tindexfrom = sourcecode.indexOf(\"<\", indexfrom + 1);\r\n\t\t\tif(indexfrom != -1) {\r\n\t\t\t\tif(sourcecode.substring(indexfrom, indexfrom+6).contains(\"<p>\")) {\r\n\t\t\t\t\tindexto = sourcecode.indexOf(\"</p>\", indexfrom + 2);\r\n\t\t\t\t\tif(indexto != -1) {\r\n\t\t\t\t\t\tSystem.out.println(sourcecode.substring(indexfrom + 3, indexto) + \"\\n\\r\");\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\tif(sourcecode.substring(indexfrom, indexfrom+6).contains(\"<img\")) {\r\n\r\n\t\t\t\t\tindexto = sourcecode.indexOf(\"src=\\\"\", indexfrom + 2);\r\n\t\t\t\t\tif(indexto != -1) {\r\n\t\t\t\t\t\tString imagepath = sourcecode.substring(indexto+5, sourcecode.indexOf(\"\\\"\", indexto+5));\r\n\t\t\t\t\t\tif(!imagepath.contains(host)) {\r\n\t\t\t\t\t\t\tif(imagepath.contains(\":\")) {\r\n\t\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\tString[] tokens = url.split(\"\\\\/(?=[^\\\\/]+$)\");\r\n\t\t\t\t\t\t\t\thost = tokens[0];\r\n\t\t\t\t\t\t\t\tif(host.startsWith(\"http://\")) {\r\n\t\t\t\t\t\t\t\t\thost = host.substring(host.indexOf(\"//\") + 2);\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(!host.startsWith(\"www.\")) {\r\n\t\t\t\t\t\t\t\t\thost = \"www.\" + host;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\tif(imagepath.startsWith(\"/\")) {\r\n\t\t\t\t\t\t\t\t\timagepath = \"http://\" + host + imagepath;\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\tif(host.endsWith(\"/\")) {\r\n\t\t\t\t\t\t\t\t\t\timagepath = \"http://\" + host + imagepath;\r\n\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\timagepath = \"http://\" + host + \"/\" + imagepath;\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}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\ttry {\r\n\t\t\t\t\t\t\tdownloadimage(imagepath);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tcatch(IOException e) {\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t} else {\r\n\t\t\t\tbreak;\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t}", "public Set<String> getURLs() {\n return pageURLs;\n }", "private boolean extractArticleFromUrl(URL url) {\n\n\t\tif (!mDBh.urlExistsInWebsite(url)) {\n\t\t\tString content = null;\n\n\t\t\t//REMEMBER TO: when switching content format text <-> HTML, change the textType in SIMMO Document\n\n\t\t\t//Extract the content as plain text\n//\t\t\ttry {\n//\t\t\t\tfinal InputSource is = HTMLFetcher.fetch(url).toInputSource();\n//\t\t\t\tfinal BoilerpipeSAXInput in;\n//\t\t\t\tin = new BoilerpipeSAXInput(is);\n//\t\t\t\tfinal TextDocument doc = in.getTextDocument();\n//\t\t\t\tcontent = ArticleExtractor.INSTANCE.getText(doc);\n//\t\t\t} catch (SAXException e) {\n//\t\t\t\tSystem.out.println(\"KIndex :: Scrapper.extractArticleFromUrl() SAXException for url: \" + url.toString());\n//\t\t\t\te.printStackTrace();\n//\t\t\t\treturn false;\n//\t\t\t} catch (BoilerpipeProcessingException e) {\n//\t\t\t\tSystem.out.println(\"KIndex :: Scrapper.extractArticleFromUrl() BoilerpipeProcessingException for url: \" + url.toString());\n//\t\t\t\te.printStackTrace();\n//\t\t\t\treturn false;\n//\t\t\t} catch (IOException e) {\n//\t\t\t\tSystem.out.println(\"KIndex :: Scrapper.extractArticleFromUrl() IOException for url: \" + url.toString());\n//\t\t\t\te.printStackTrace();\n//\t\t\t\treturn false;\n//\t\t\t}\n\n\t\t\t//extract the content as HTML\n\t\t\tfinal BoilerpipeExtractor extractor = CommonExtractors.DEFAULT_EXTRACTOR;\n\t\t\tfinal HTMLHighlighter hh = HTMLHighlighter.newExtractingInstance();\n\t\t\ttry {\n\t\t\t\tcontent = hh.process(url, extractor);\n\t\t\t} catch (IOException e) {\n\t\t\t\tSystem.out.println(\"KIndex :: Scrapper.extractArticleFromUrl() IOException for url: \" + url.toString());\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn false;\n\t\t\t} catch (BoilerpipeProcessingException e) {\n\t\t\t\tSystem.out.println(\"KIndex :: Scrapper.extractArticleFromUrl() BoilerpipeProcessingException for url: \" + url.toString());\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn false;\n\t\t\t} catch (SAXException e) {\n\t\t\t\tSystem.out.println(\"KIndex :: Scrapper.extractArticleFromUrl() SAXException for url: \" + url.toString());\n\t\t\t\te.printStackTrace();\n\t\t\t\treturn false;\n\t\t\t}\n\n\n\t\t\t//checking if website already exist\n\n\t\t\t//Storing content in Simmo\n\t\t\t//Create a Simmo Webpage\n\t\t\tWebpage wp = new Webpage();\n\t\t\twp.setUrl(url.toString());\n\n\t\t\tCalendar cal = Calendar.getInstance();\n\t\t\twp.setCreationDate(cal.getTime());\n\n\t\t\t//Create a Simmo Text\n\t\t\tText txt = new Text();\n\t\t\ttxt.setContent(content);\n\t\t\ttxt.setTextType(Text.TEXT_TYPE.HTML);\n//\t\t\ttxt.setTextType(Text.TEXT_TYPE.TXT);\n\n\t\t\t//Add Text to Webpage\n\t\t\twp.addItem(txt);\n\n\t\t\t//Store Webpage to db\n\t\t\tDAOManager manager = new DAOManager(MongoDBHandler.getTrgDBName());\n\t\t\tmanager.saveWebpage(wp);\n\n\n\t\t\t//Politeness policy of one second.\n\t\t\ttry {\n\t\t\t\tThread.sleep(1000); //1000 milliseconds is one second.\n\t\t\t} catch (InterruptedException ex) {\n\t\t\t\t//Thread.currentThread().interrupt();\n\t\t\t\tSystem.out.println(\"Could not make the thread sleep\");\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\t\tSystem.out.println(\"Already exist in database: \" + url.toString());\n\t\treturn false;\n\t}", "private Set<String> findNewUrls(Document doc) {\n Set<String> newUrlSet = new HashSet<>();\n\n for (Element ah : doc.select(\"a[href]\")) {\n String href = ah.attr(\"abs:href\");\n\n if (!urlSet.contains(href) // Check if this is a new URL\n && href.contains(domain) // Check if the URL is from the same domain\n && isValidExtension(href) // Check that the file extension is not in the list of excluded extensions\n && !href.contains(\"mailto:\") // Check that the href is not an email address\n ) {\n newUrlSet.add(href);\n }\n\n }\n\n processNewUrls(newUrlSet);\n return newUrlSet;\n }", "public String ProcessHTMLPage(String url) {\n\t\tString htmlSource = null;\n\t\tSystem.out.println(\"processing ..\" + url);\n\t\tStringBuilder stringBuilder = new StringBuilder();\n\t\ttry {\n\t\t\thtmlSource = getURLSource(url);\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t\tDocument document = Jsoup.parse(htmlSource);\n\n\t\torg.jsoup.select.Elements allElements = document.getAllElements();\n\t\tfor (Element element : allElements) {\n\t\t\tif (element.nodeName().matches(\n\t\t\t\t\t\"^.*(p|h1|h2|h3|h4|h5|h6|title|body|li|a|em|i|ins|big|bdo|b|blockquote|center|mark|small|string|sub|sup|tt|u).*$\")) {\n\t\t\t\tif (!element.ownText().isEmpty()) {\n\t\t\t\t\t// System.out.println(element.nodeName()\n\t\t\t\t\t// + \" \" + element.ownText());\n\t\t\t\t\tstringBuilder.append(element.ownText());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn stringBuilder.toString();\n\n\t}", "WebCrawlerData retrieve(String url);", "@Override\n public Page extractPage(String link) {\n\n return new Page(link, extract(link));\n }", "URL getUrl();", "public String getContent() {\n String s = page;\n\n // Bliki doesn't seem to properly handle inter-language links, so remove manually.\n s = LANG_LINKS.matcher(s).replaceAll(\" \");\n\n wikiModel.setUp();\n s = getTitle() + \"\\n\" + wikiModel.render(textConverter, s);\n wikiModel.tearDown();\n\n // The way the some entities are encoded, we have to unescape twice.\n s = StringEscapeUtils.unescapeHtml(StringEscapeUtils.unescapeHtml(s));\n\n s = REF.matcher(s).replaceAll(\" \");\n s = HTML_COMMENT.matcher(s).replaceAll(\" \");\n\n // Sometimes, URL bumps up against comments e.g., <!-- http://foo.com/-->\n // Therefore, we want to remove the comment first; otherwise the URL pattern might eat up\n // the comment terminator.\n s = URL.matcher(s).replaceAll(\" \");\n s = DOUBLE_CURLY.matcher(s).replaceAll(\" \");\n s = HTML_TAG.matcher(s).replaceAll(\" \");\n\n return s;\n }", "public List<LinkDetails> scrapeRSSPageForLinks(String rssUrl) {\n\t\tString description = \"\";\n\t\tString title = \"\";\n\t\tString link = \"\";\n\t\tString pubdate = \"\";\n\t\tURL url;\n\t\tInputStream in;\n\n\t\tList<LinkDetails> rssProcessedData = new ArrayList<LinkDetails>();\n\n\t\ttry {\n\t\t\turl = new URL(rssUrl);\n\t\t} catch (MalformedURLException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\n\t\ttry {\n\t\t\tin = url.openStream();\n\t\t} catch (IOException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\n\t\t// create XML input factory\n\t\tXMLInputFactory inputFactory = XMLInputFactory.newInstance();\n\n\t\t// read the XML document\n\t\ttry {\n\n\t\t\tXMLEventReader eventReader = inputFactory.createXMLEventReader(in);\n\n\t\t\tboolean isFeedHeader = true;\n\t\t\twhile (eventReader.hasNext()) {\n\t\t\t\tXMLEvent event = eventReader.nextEvent();\n\t\t\t\tif (event.isStartElement()) {\n\t\t\t\t\tString localPart = event.asStartElement().getName().getLocalPart();\n\n\t\t\t\t\t// System.out.println(localPart);\n\n\t\t\t\t\tswitch (localPart) {\n\n\t\t\t\t\tcase \"item\":\n\t\t\t\t\t\t// if (isFeedHeader) {\n\t\t\t\t\t\t// isFeedHeader = false;\n\t\t\t\t\t\t// System.out.println(\" title: \"+title+ \" description: \"+ description + \" link:\n\t\t\t\t\t\t// \"+link+\" pubDate: \"+pubdate);\n\t\t\t\t\t\t// }\n\t\t\t\t\t\tevent = eventReader.nextEvent();\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\tcase \"title\":\n\t\t\t\t\t\ttitle = getCharacterData(event, eventReader);\n\t\t\t\t\t\t// System.out.println(\"title: \"+title);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"description\":\n\t\t\t\t\t\tdescription = getCharacterData(event, eventReader);\n\t\t\t\t\t\t// System.out.println(\"description: \"+description);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"link\":\n\t\t\t\t\t\tlink = getCharacterData(event, eventReader);\n\t\t\t\t\t\tSystem.out.println(\"link: \" + link);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"pubDate\":\n\t\t\t\t\t\tpubdate = getCharacterData(event, eventReader);\n\t\t\t\t\t\t// System.out.println(\"pubDate: \"+pubdate);\n\t\t\t\t\t\tbreak;\n\n\t\t\t\t\t}\n\t\t\t\t} else if (event.isEndElement()) {\n\t\t\t\t\tif (event.asEndElement().getName().getLocalPart() == (\"item\")) {\n\n\t\t\t\t\t\tLinkDetails linkDetails = new LinkDetails(link, title, description, pubdate);\n\t\t\t\t\t\trssProcessedData.add(linkDetails);\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (XMLStreamException e) {\n\t\t\tthrow new RuntimeException(e);\n\t\t}\n\n\t\treturn rssProcessedData;\n\t}", "@Override\n\tpublic String getUrls() throws TException {\n try {\n return DBUtils.getExternWebSite();\n } catch (SQLException e) {\n e.printStackTrace();\n }\n return null;\n\t}", "public static ArrayList<URL> listLinks(URL baseURL, String htmlText) {\n // list to store links\n ArrayList<URL> links = new ArrayList<URL>();\n\n // compile string into regular expression\n Pattern p = Pattern.compile(REGEX);\n\n // match provided text against regular expression\n Matcher m = p.matcher(htmlText);\n\n // loop through every match found in text\n while ( m.find() ) \n {\n // add the appropriate group from regular expression to list\n try {\n\t\t\t\tlinks.add(new URL(baseURL, m.group(GROUP)));\n\t\t\t} catch (MalformedURLException e) {\n\t\t\t\tSystem.err.println(\"Invalid URL\");\n\t\t\t\te.printStackTrace();\n\t\t\t}\n }\n return links;\n }", "public static void main(String[] args) throws IOException {\n Deque<String> urlsToVisit = new ArrayDeque<String>();\n // Keep track of which URLs we have visited, so we don't get ourselves stuck in a loop.\n List<String> visitedUrls = new ArrayList<String>();\n // Keep track of how we got to each page, so that we can find our trace back to the BEGIN_URL.\n Hashtable<String, String> referrers = new Hashtable<String, String>();\n boolean pathFound = false;\n\n // Begin with the BEGIN_URL\n urlsToVisit.push(BEGIN_URL);\n\n while(!urlsToVisit.isEmpty() && !pathFound) {\n String currentUrl = urlsToVisit.pop();\n visitedUrls.add(currentUrl);\n\n Elements paragraphs = wf.fetchWikipedia(BASE_URL + currentUrl);\n List<String> pageUrls = new ArrayList<String>();\n\n for (Element p : paragraphs) {\n pageUrls.addAll(getLinksFromParagraph(p));\n }\n\n // Reverse the order of all page urls so that when we're done pushing all the URLS\n // to the stack, the first URL in the page will be the first URL in the current page.\n Collections.reverse(pageUrls);\n\n // Add all the URLs to the list of URLs to visit.\n for (String newUrl : pageUrls) {\n if(!visitedUrls.contains(newUrl)) {\n urlsToVisit.push(newUrl);\n // Record how we ended up at newUrl.\n referrers.put(newUrl, currentUrl);\n\n // Check if one of the links in this page is the END_URL; which means we'll be done!\n if (newUrl.equals(END_URL)) {\n pathFound = true;\n }\n }\n }\n }\n\n if (pathFound) {\n System.out.println(\"=================\");\n System.out.println(\"Path found!\");\n System.out.println(\"=================\");\n\n // Back trace how we ended up at END_URL.\n String backtraceUrl = END_URL;\n System.out.println(backtraceUrl);\n while(backtraceUrl != BEGIN_URL) {\n String referrerUrl = referrers.get(backtraceUrl);\n System.out.println(referrerUrl);\n backtraceUrl = referrerUrl;\n }\n } else {\n System.out.println(\"=================\");\n System.out.println(\"No path found :(\");\n System.out.println(\"=================\");\n }\n }", "Uri getUrl();", "public Address interpretUrl(String url);", "@Override\n public void visit(Page page) {\n String url = page.getWebURL().getURL();\n System.out.println(\"URL: \" + url);\n\n try {\n if (page.getParseData() instanceof HtmlParseData) {\n HtmlParseData htmlParseData = (HtmlParseData) page.getParseData();\n\n final Document document = Jsoup.parse(htmlParseData.getHtml());\n\n Transformer transformer = TransformerFactory.newInstance()\n .newTransformer(new StreamSource(getClass().getResourceAsStream(xslPath)));\n\n Writer write = new StringWriter();\n transformer.transform(new DOMSource(new W3CDom().fromJsoup(document)), new StreamResult(write));\n\n String xml = write.toString();\n\n // XML 1.1\n // [#x1-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF]\n String xml11pattern = \"[^\"\n + \"\\u0001-\\uD7FF\"\n + \"\\uE000-\\uFFFD\"\n + \"\\ud800\\udc00-\\udbff\\udfff\"\n + \"]+\";\n\n // remove invalid character in xml\n xml = xml.replaceAll(xml11pattern, \"\");\n\n JAXBContext jc = JAXBContext.newInstance(ProxyListDTO.class);\n\n Unmarshaller unmarshaller = jc.createUnmarshaller();\n ProxyListDTO data = (ProxyListDTO) unmarshaller.unmarshal(new StringReader(xml));\n data.getProxies().forEach(p -> p.setSource(source));\n\n\n result.addAll(data.getProxies());\n }\n } catch (Exception e) {\n logger.error(\"fail to visit \" + url, e);\n }\n }", "@Test\n public void hrefPatternTest() {\n Pattern aTeg = Pattern.compile(\"(?i)<a([^>]+)>(.+?)</a>\");\n Pattern href = Pattern.compile(\"\\\\s*(?i)href\\\\s*=\\\\s*(\\\\\\\"([^\\\"]+\\\\\\\")|'[^']+'|([^'\\\">\\\\s]+))\");\n String[] validLinkTegs = {\"<li><a href=\\\"/toolbar-creator\\\">Create a Custom Toolbar</a></li>\",\n \"<a href=\\\"http://stlpublicradio.org/programs/slota/archivedetail.php?date='2012-02-29'\\\" title=\\\"\\\" class=\\\"menu_icon menu-17197 \\\" >Грузовые перевозки</a></li>\",\n \"<li><a href='http://www.tipsntracks.com/date/2012/03' title='March 2012'>March 2012</a></li>\"};\n String[] invalidLinkTags = {\"<a href=\\\"\\\"style=\\\"\\\"><img width=\\\"148\\\" height=\\\"32\\\" src=\\\"/images/buttons/btn-www-survey.gif\\\" /></a>\"};\n String[] validLinks = new String[validLinkTegs.length];\n String[] invalidLinks = new String[invalidLinkTags.length];\n for (int i = 0; i < validLinkTegs.length; i++) {\n Matcher matcher = aTeg.matcher(validLinkTegs[i]);\n Assert.assertTrue(matcher.find());\n validLinks[i] = matcher.group(1);\n }\n for (int i = 0; i < invalidLinkTags.length; i++) {\n Matcher matcher = aTeg.matcher(invalidLinkTags[i]);\n Assert.assertTrue(matcher.find());\n invalidLinks[i] = matcher.group(1);\n }\n for (int i = 0; i < validLinkTegs.length; i++) {\n Matcher matcher = href.matcher(validLinks[i]);\n Assert.assertTrue(matcher.find());\n String s = matcher.group(1);\n System.out.println(s.substring(1, s.length() - 1));\n }\n for (int i = 0; i < invalidLinkTags.length; i++) {\n Matcher matcher = href.matcher(invalidLinks[i]);\n Assert.assertFalse(matcher.find());\n }\n }", "protected abstract String getUrl();", "public Collection<String> parse(Reader page)\r\n\t{\n\r\n\t\ttry\r\n\t\t{\r\n\t\t\t\r\n\t\t\t//create an input source to parse from the stream\r\n\t\t\tInputSource pageInputSource = new InputSource(page);\r\n\t\t\t\r\n\t\t\t// parse page\r\n\t\t\tp.parse(pageInputSource);\r\n\t\t\t\r\n\t\t\treturn linkContextHandler.removeLinkStrings();\r\n\t\t} catch (IOException e)\r\n\t\t{\r\n\r\n\t\t\tLogger.log(0, this.getClass().getSimpleName(), \"parse\",\r\n\t\t\t\t\t\"input error, couldn't parse page: \" + e.toString());\r\n\t\t} catch (SAXException e)\r\n\t\t{\r\n\t\t\tLogger.log(0, this.getClass().getSimpleName(), \"parse\",\r\n\t\t\t\t\t\"SAX exception, tag soup couldn't parse page: \"\r\n\t\t\t\t\t\t\t+ e.toString());\r\n\t\t}\r\n\r\n\t\treturn null;\r\n\t}", "@Override\n\tpublic void visit(Page page) {\n\t\t\n\t\ttry{\n\t\t\tfin=\"\";\n\t\t\tif(flag == 0){\n\t\t\t\tfw = new FileWriter(wrtFile);\n\t\t\t\tfw1 = new FileWriter(wrtFile1);\n\t\t\t\tvisit_url = new HashSet<String>();\n\t\t\t\tall_txt = new HashSet<String>();\n\t\t\t\teng_sen = new ArrayList<String>();\n\t\t\t}\n\t\t\tflag++;\n\t\t\tsynchronized (this) {\n\t\t\t\tif(page.getParseData() instanceof HtmlParseData){\n\t\t\t\t\tHtmlParseData htmlParseData = (HtmlParseData) page.getParseData();\n\t\t\t\t\tString html = htmlParseData.getHtml();\n\t\t\t\t\tString url = page.getWebURL().getURL().toLowerCase();\n\t\t\t\t\t//System.out.println(\"VISIT: \"+ url);\n\t\t\t\t\t//System.out.println(\"HTML: \"+ html);\n\t\t\t\t\tDocument doc = Jsoup.parse(html);\n\t\t\t\t\tdoc.removeClass(\"twitter-tweet\");\n\t\t\t\t\tElements links = doc.select(\"div\");\n\t\t\t\t\tIterator<Element> it = links.iterator();\n\t\t\t\t\t\n\t\t\t\t\tString text=\"\";\n\t\t\t\t\tElement link;\n\t\t\t\t\tElements children;\n\t\t\t\t\twhile(it.hasNext()){\n\t\t\t\t\t\tlink = it.next();\n\t\t\t\t\t\tif(link.attr(\"class\").equals(\"desc\")){\n\t\t\t\t\t\t\t//System.out.println(\"Division Class: \"+ link.attr(\"class\"));\n\t\t\t\t\t\t\t//text.replaceAll(\",\", \"(COMMA)\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tchildren = link.children();\n\t\t\t\t\t\t\tif(!children.isEmpty()){\n\t\t\t\t\t\t\t\tIterator<Element> child_it = children.iterator();\n\t\t\t\t\t\t\t\tElement child;\n\t\t\t\t\t\t\t\twhile(child_it.hasNext()){\n\t\t\t\t\t\t\t\t\tchild = child_it.next(); \n\t\t\t\t\t\t\t\t\tif(child.attr(\"data-lang\").equals(\"en\") || child.attr(\"class\").equals(\"instagram-media\") || child.text().contains(\"Read Also\")){\n\t\t\t\t\t\t\t\t\t\tchild.text(\"\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!text.contains(link.text())){\t\t\n\t\t\t\t\t\t\t\tif(!link.text().matches(\".*Updated (Mon|Tue|Wed|Thu|Fri|Sat|Sun).*\")){\n\t\t\t\t\t\t\t\t\ttext += link.text();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//System.out.println(\"Text: \"+ text);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif(link.attr(\"class\").equals(\"caption\")){\n\t\t\t\t\t\t\t//System.out.println(\"Division Class: \"+ link.attr(\"class\"));\n\t\t\t\t\t\t\t//text.replaceAll(\",\", \"(COMMA)\");\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tchildren = link.children();\n\t\t\t\t\t\t\tif(!children.isEmpty()){\n\t\t\t\t\t\t\t\tIterator<Element> child_it = children.iterator();\n\t\t\t\t\t\t\t\tElement child;\n\t\t\t\t\t\t\t\twhile(child_it.hasNext()){\n\t\t\t\t\t\t\t\t\tchild = child_it.next(); \n\t\t\t\t\t\t\t\t\tif(child.attr(\"data-lang\").equals(\"en\") || child.attr(\"class\").equals(\"instagram-media\") || child.text().contains(\"Read Also\")){\n\t\t\t\t\t\t\t\t\t\tchild.text(\"\");\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(!text.contains(link.text())){\t\t\n\t\t\t\t\t\t\t\tif(!link.text().matches(\".*Updated (Mon|Tue|Wed|Thu|Fri|Sat|Sun).*\")){\n\t\t\t\t\t\t\t\t\ttext += link.text();\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t//System.out.println(\"Text: \"+ text);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(text != \"\"){\n\t\t\t\t\t\tif(!visit_url.contains(url) && !all_txt.contains(text)){\n\t\t\t\t\t\t\tfin = text+\"\\n\";\n\t\t\t\t\t\t\tfin1 = url+\"\\n\";\n\t\t\t\t\t\t\t//System.out.println(\"Text: \"+ text);\n\t\t\t\t\t\t\t//System.out.println(\"URL: \"+ url);\n\t\t\t\t\t\t\tFiles.write(Paths.get(wrtFile), fin.getBytes(), StandardOpenOption.APPEND);\n\t\t\t\t\t\t\tFiles.write(Paths.get(wrtFile1), fin1.getBytes(), StandardOpenOption.APPEND);\n\t\t\t\t\t\t\tall_txt.add(text);\n\t\t\t\t\t\t\tvisit_url.add(url);\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}catch (Exception e) {\n\t\t\t// TODO: handle exception\n\t\t\te.printStackTrace();\n\t\t}\n\n\t}", "public List<String> getLinks();", "public void parsePage() {\n seen = true;\n int first = id.indexOf('_', 0);\n int second = id.indexOf('_', first + 1);\n String firstDir = \"result_\" + id.substring(0, first);\n String secondDir = id.substring(0, second);\n String fileName = id + \".page\";\n String wholePath = pagePath + firstDir + File.separator + secondDir\n + File.separator + fileName;\n try {\n BufferedReader reader = new BufferedReader(new FileReader(wholePath));\n String line = null;\n while((line = reader.readLine()) != null) {\n if (line.equals(\"#ThisURL#\")) {\n url = reader.readLine();\n }\n// else if (line.equals(\"#Length#\")) {\n// length = Integer.parseInt(reader.readLine());\n// }\n else if (line.equals(\"#Title#\")) {\n title = reader.readLine();\n }\n else if (line.equals(\"#Content#\")) {\n content = reader.readLine();\n lowerContent = content.toLowerCase();\n break;\n }\n }\n reader.close();\n if (content == null) {\n return;\n }\n valid = true;\n } catch (IOException e) {\n// System.out.println(\"Parse page \" + id + \" not successful\");\n }\n }", "public static String getUrlContents(URL url) throws IOException {\n\t\tURLConnection cnx = url.openConnection();\n\t\tScanner s = new Scanner(cnx.getInputStream());\n\t\tString ret = s.useDelimiter(\"\\\\A\").next();\n\t\ts.close();\n\t\treturn ret;\n\t}", "Map<String, String> getCachedLinks(Page page);", "public String[] getUrls() {\n\t\tif (results == null)\n\t\t\treturn null;\n\t\tWebSearchResult[] resultsArray = results.listResults();\n\t\tString[] urls = new String[resultsArray.length];\n\t\tfor (int i = 0; i < urls.length; i++) {\n\t\t\turls[i] = resultsArray[i].getUrl();\n\t\t}\n\t\treturn urls;\n\t}", "public String getTextUrl(String text) {\n return StrUtils.createUrlFromString(text);\n }", "protected abstract String getPublicUrl(URL url);", "public void getPhotoLinks() {\n try {\n image = Jsoup.connect(link + \"/+images/\").get();\n } catch (IOException e) {\n e.printStackTrace();\n }\n Elements elements = image.getElementsByClass(\"image-list-item\");\n photosLinks = new String[elements.size()];\n for (int i = 0; i < elements.size(); i++) {\n String element = elements.get(i).attr(\"href\");\n photosLinks[i] = element;\n }\n }", "private String cleanupText(String text){\n return text.replaceAll(\"http[s]*[:](//)[^ ]+\", \"URL\");\n }", "public Collection<Map<String, String>> getLinks();", "public void wapTinyurl() {\n String url = \"http://m.nuomi.com/mianyang/deal/l5kkhcqr\";\r\n Pattern p = Pattern.compile(\"^http://\\\\w+\\\\.nuomi\\\\.com/\\\\w+/deal/(\\\\w+$)\");\r\n Matcher m = p.matcher(url);\r\n if (m.find()) {\r\n p(m.group(1));\r\n }\r\n }", "public Object[] chechEarlyLink(String url) {\n\t\tString mostRecentHTML = \"\";\n\t\tboolean success;\n\t\tprocessor.printSys(\"Original URL of Early Link: \" + url);\n\t\ttry {\n\t\t\tHttpURLConnection con = settings.isUsingProxy() ? (HttpURLConnection)(new URL(url).openConnection(proxyBuilder.getProxy())) : (HttpURLConnection)(new URL(url).openConnection());\n\t\t\tcon.setUseCaches(false);\n\t\t\tcon.setConnectTimeout(8000);\n\t\t\tcon.setInstanceFollowRedirects(false);\n\t\t\tcon.connect();\n\t\t\tString location = con.getHeaderField(\"Location\");\n\t\t\tprocessor.printSys(\"Response Code: \" + con.getResponseCode() + \", Early Link Redirected to: \" + location);\n\t\t\tmostRecentHTML = connectionToString(con);\n\t\t\tsuccess = location == null; //if the redirect location was null, this worked\n\t\t} catch (MalformedURLException e) {\n\t\t\tsuccess = false;\n\t\t} catch (IOException e) {\n\t\t\tsuccess = false;\n\t\t}\n\n\t\treturn new Object[]{success, mostRecentHTML};\n\t}", "@Override\n public HashSet<String> findPostIds() throws IOException {\n HashSet<String> postId = new HashSet();\n Document document = Jsoup.connect(\"https://www.bd-pratidin.com/\").userAgent(\"Opera\").get();\n Element body = document.body();\n\n Elements posts = body.getElementsByClass(\"home-latest-news\").first().getElementsByTag(\"a\");\n for (int i=0;i<20;i++) {\n String link = posts.get(i).attr(\"href\");\n postId.add(link);\n }\n return postId;\n }", "@Override\n public void crawl() {\n Document doc;\n try {\n\n\n doc = Jsoup.connect(rootURL).userAgent(\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A\").get();\n\n Elements articles = doc.select(\"section.list article\");\n\n System.out.println(\"Number of articles found:\"+articles.size());\n //list of links found\n for(Element article: articles){\n\n Element titleLink = article.select(\"a\").first();\n System.out.println(titleLink.attr(\"abs:href\"));\n\n //if the url found is in the cache, do not retrieve the url.\n if(urlCache.contains(titleLink.attr(\"abs:href\"))) {\n System.out.println(\"Doucment found in cache, ignoring document\");\n continue;\n }\n\n storeDocument(Jsoup.connect(titleLink.attr(\"abs:href\")).get());\n\n //add the URL to the cache so that we don't retrieve it again.\n urlCache.add(titleLink.attr(\"abs:href\"));\n }\n\n\n } catch (Exception e){\n logger.log(Level.SEVERE, \"Error Retrieving from URL\", e);\n e.printStackTrace();\n }\n }", "private static void go2(){\n\t\tString concreateURL = \"http://www.yixinhealth.com/%E5%8C%96%E9%AA%8C%E5%92%8C%E6%A3%80%E6%9F%A5/%E5%BF%83%E7%94%B5%E5%9B%BE/\"; \n\t\tConnection c = Jsoup.connect(concreateURL); \n\t\tc.timeout(10000);\n\t\ttry {\n\t\t\tDocument doc = c.get();\n\t\t\t//System.out.println(doc.html()); \n\t\t\t//System.out.println(doc.getElementById(\"content_area\").html());\n\t\t\t//Element eles = doc.getElementById(\"content_area\");\n\t\t\t//System.out.println(eles.html());\n\t\t\t\n\t\t\t//Below code is for the multiple link page\n\t\t\t//Elements eles2 = eles.getElementsByAttributeValue(\"style\", \"text-align: center;\");\n\t\t\t//System.out.println(eles2.html());\n\t\t\t/*for(Element ele: eles2){\n\t\t\t\tElements link = ele.getElementsByTag(\"a\");\n\t\t\t\t//System.out.println(link.html());\n\t\t\t\tfor (int i=0;i<link.size();i++) {\n\t\t\t\t\tSystem.out.println(link.get(i).attr(\"href\"));\n\t\t\t\t}\n\t\t\t}*/\n\t\t\t\n\t\t\t\n\t\t\t//System.out.println(eles2.html());\n\t\t\tElement eles = doc.getElementById(\"content_area\");\n\t\t\tElements eles2 = eles.getElementsByTag(\"img\");\n\t\t\tfor(int i=0;i<eles2.size();i++){\n\t\t\t\teles2.get(i).parent().attr(\"style\", \"text-align:center\");\n\t\t\t\teles2.get(i).parent().parent().nextElementSibling().attr(\"style\", \"text-align:center\");\n\t\t\t\teles2.get(i).attr(\"style\", \"width:50%\");\n\t\t\t}\n\t\t\t\n\t\t\tElements eles3 = eles.getElementsByClass(\"j-header\");\n\t\t\tfor (Element ele : eles3) {\n\t\t\t\tElements eleHeader = ele.getElementsByTag(\"h2\");\n\t\t\t\teleHeader.attr(\"style\", \"text-align:center\");\n\t\t\t}\n\t\t\tSystem.out.println(eles.html());\n\t\t\t\n\t\t\t//Below code is help to clear out the share icon to like Sina weibo\n\t\t\tElements eles4 = eles.getElementsByClass(\"bshare-custom\");\n\t\t\t//eles4.remove();\n\t\t\t\n\t\t\t//Elements eles3 = eles.getElementsByClass(\"n*j-imageSubtitle\");\n\t\t\t//System.out.println(eles3.size());\n\t\t\t/*for(int i=0;i<eles3.size();i++){\n\t\t\t\teles3.get(i).attr(\"style\", \"text-align:center;width:50%\");\n\t\t\t}\n\t\t\tSystem.out.println(eles.html());*/\n\t\t\t//System.out.println(eles2.get(0).attr(\"src\"));\n\t\t\t/*Element eles = doc.getElementById(\"content_area\");\n\t\t\tElements eles2 = eles.getElementsByClass(\"j-header\");\n\t\t\tfor (Element ele : eles2) {\n\t\t\t\tElements eleHeader = ele.getElementsByTag(\"h2\");\n\t\t\t\tSystem.out.println(\"Title---->\"+eleHeader.html()); \n\t\t\t}\n\t\t\tElements elesBody = eles.getElementsByClass(\"j-text\");\n\t\t\tSystem.out.println(\"Body---->\"+elesBody.html()); */\n\t\t\t//System.out.println(eles2.html()); \n /*List<String> nameList = new ArrayList<String>(); \n for (Element ele : eles) {\n \tString text = ele.select(\"h*\").text();\n \tSystem.out.println(text); \n String text = ele.select(\"span\").first().text(); \n if (text.length() > 1 && text.startsWith(\"▲\")) { \n \n if (Integer.parseInt(text.substring(1)) > 30) { \n // 在这里.html()和.text()方法获得的内容是一样的 \n System.out.println(ele.select(\"a\").first().html()); \n nameList.add(ele.select(\"a\").first().text()); \n } \n } \n } */\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "public ArrayList<String> findLinks(Text value) throws CharacterCodingException{\n\t\tint start = value.find(\"<text\");\n\t\tstart = value.find(\">\", start);\n\t\tint end = value.find(\"</text>\", start);\n\t\t//start+=1;\n\t\tString textBlock=new String();\n\t\ttry{\n\t\tif(end < value.getLength())\n\t\t\ttextBlock = Text.decode(value.getBytes(), start, end-start);\n\t\telse\n\t\t\ttextBlock = Text.decode(value.getBytes(), start, value.getLength()-start);\n\t\t} catch(Exception e){\n\t\t\treturn null;\n\t\t}\n\t\tArrayList<String> List = new ArrayList<String>();\n\t\t\n\t\tPattern wikiLinkRegEx = Pattern.compile(\"\\\\[\\\\[(?:[^|\\\\]]*\\\\|)?([^\\\\]]+)\\\\]\\\\]\");\n\t\tMatcher patternMatcher = wikiLinkRegEx.matcher(textBlock);\n\t\twhile(patternMatcher.find()) {\n\t\t\tint flag=0;\n\t\t\tint startIndex = patternMatcher.start();\n\t\t\tint endIndex = patternMatcher.end();\n\t\t\tString wikiLink = textBlock.substring(startIndex+2, endIndex-2);\n\t\t\twikiLink = wikiLink.replace(\" \", \"_\");\n\n\t\t\t//Checking for the occurrence of '|'\n\t\t\tif(wikiLink.contains(\"|\")){\n\t\t\t\tint pipeIndex = wikiLink.indexOf(\"|\");\n\t\t\t\twikiLink = wikiLink.substring(0, pipeIndex);\n\t\t\t}\n\t\t\t\n\t\t\t//Flagging all the invalid WikiLinks \n\t\t\t//if(wikiLink.contains(\":\") || wikiLink.contains(\"#\") || wikiLink.contains(\"/\") ){\n\t\t\t//\tflag=1;\n\t\t\t//}\n\t\t\t\n\t\t\t// Add the valid WikiLinks in the List\n\t\t\tif(flag==0){\n\t\t\t\twikiLink = wikiLink.replace(\"&amp;\", \"&\");\n\t\t\t\tList.add(wikiLink);\n\t\t\t}\n\t }\n\t\treturn List;\n\t}", "public List<String> linkTexts()\n\t{\n\t\t\n\t\tList<String> links=new ArrayList<String>();\n\t\tlinks.add(linkString);\n\t\tlinks.add(\"Facebook.com\");\n\t\tlinks.add(\"google.com;\");\n\t\tlinks.add(\"gmail.com\");\n\t\tlinks.add(\"shine.com\");\n\t\tlinks.add(\"nukari.com\");\n\t\t\n\t\t// Like the above we have to add number of link text are passed to achieve the DataDriven approach through BBD \n\t\t\t\n\t\treturn links;\n\t\t\n\t}", "private String[] getImgUrls(String html){\n String result=\"\";\n Document doc = Jsoup.parse(html);\n Elements images = doc.select(\"img\");\n for(Element node : images) {\n result = result + \",\" + node.attr(\"src\");\n }\n return result.length()<1?new String[0]:result.substring(1).split(\",\");\n }", "public String extractText(String urlString) {\n String text = \"\";\n try {\n URL url = new URL(urlString);\n text = ArticleExtractor.INSTANCE.getText(url); \n } catch (Exception ex) {\n Logger.getLogger(TextExtractor.class.getName()).log(Level.SEVERE, null, ex);\n }\n \n return text;\n }", "public String getUrl();", "public String getUrl();", "public String getUrl();", "public String getUrl();", "private String extractRealUrl(String url) {\n return acceptsURL(url) ? url.replace(\"p6spy:\", \"\") : url;\n }", "public abstract String getURL();", "private final Map<String, String> getUrls(String themeDir, UrlBuilder urlBuilder) {\n // The urls that are accessible to the templates. \n // NB We are not using our menu object mechanism to build menus here, because we want the \n // view to control which links go where, and the link text and title.\n Map<String, String> urls = new HashMap<String, String>();\n \n urls.put(\"home\", urlBuilder.getHomeUrl());\n \n urls.put(\"about\", urlBuilder.getPortalUrl(Route.ABOUT));\n if (ContactMailServlet.getSmtpHostFromProperties() != null) {\n urls.put(\"contact\", urlBuilder.getPortalUrl(Route.CONTACT));\n }\n urls.put(\"search\", urlBuilder.getPortalUrl(Route.SEARCH)); \n urls.put(\"termsOfUse\", urlBuilder.getPortalUrl(Route.TERMS_OF_USE)); \n urls.put(\"login\", urlBuilder.getPortalUrl(Route.LOGIN)); \n urls.put(\"logout\", urlBuilder.getLogoutUrl()); \n urls.put(\"siteAdmin\", urlBuilder.getPortalUrl(Route.LOGIN)); \n \n urls.put(\"siteIcons\", urlBuilder.getPortalUrl(themeDir + \"/site_icons\"));\n return urls;\n }", "void test_jsoup2(final Context context, final String url){\n Thread thread = new Thread(new Runnable(){\n @Override\n public void run() {\n try {\n Log.i(\"tag_\", url);\n\n String result = \"\";\n Document doc = Jsoup.connect(url).get();\n Elements nodeBlogStats = doc.select(\"a[href]\");\n for ( Element column : nodeBlogStats ) {\n //Log.i(\"tag_\", \"link:\" + column.text() );\n result += column.text();\n result +=\"\\n\";\n }\n Toast.makeText( context, result, Toast.LENGTH_LONG).show();//this will just show the result in Toast message\n }catch(Exception e){\n\n }\n }\n });\n thread.start();\n }", "public void getURL(String url, String target)\n throws IOException {\n if (url.startsWith(JSSTRING)) {\n linkCount += ExtractorJS.considerStrings(uriErrors, curi, url, \n false);\n } else {\n int max = uriErrors.getMaxOutlinks(curi);\n Link.addRelativeToVia(curi, max, url, LinkContext.EMBED_MISC,\n Hop.EMBED);\n linkCount++;\n }\n }" ]
[ "0.67949164", "0.66035825", "0.6561706", "0.65073764", "0.64317197", "0.64194554", "0.6298129", "0.6252565", "0.6242706", "0.61659354", "0.6161054", "0.61458665", "0.6099071", "0.6056902", "0.60331243", "0.600903", "0.5997185", "0.59707373", "0.5940851", "0.5935357", "0.5915137", "0.5821383", "0.5821296", "0.5808126", "0.57995105", "0.5725653", "0.5718227", "0.5716558", "0.57152605", "0.57152605", "0.57152605", "0.57152605", "0.57152605", "0.57152605", "0.57081616", "0.5630577", "0.5621315", "0.56156754", "0.56135243", "0.559111", "0.55884135", "0.5577223", "0.55763257", "0.5566296", "0.55581075", "0.5549775", "0.5549775", "0.5549775", "0.5549775", "0.5549775", "0.55491495", "0.5547564", "0.5539636", "0.5539147", "0.5537594", "0.5534993", "0.5525405", "0.55092025", "0.5501325", "0.5498755", "0.5493626", "0.54870814", "0.54842025", "0.54722375", "0.5472087", "0.5470413", "0.5460947", "0.5455873", "0.5445751", "0.5440042", "0.543983", "0.5430581", "0.5384287", "0.5370521", "0.53039324", "0.52972895", "0.5296056", "0.52932906", "0.52923125", "0.52905434", "0.5282744", "0.52739185", "0.52582604", "0.5257749", "0.52540123", "0.5245664", "0.52435416", "0.52403104", "0.52401406", "0.52400815", "0.52383554", "0.52379227", "0.52379227", "0.52379227", "0.52379227", "0.5234407", "0.5233754", "0.5225042", "0.52194", "0.521657" ]
0.7733296
0
TODO: filter out duplicated urls single machine: HashMap of hashed web content multithread: threadsafe hashmap database + bloomfilter
List<WebURL> Filter(List<WebURL> urls){ return null; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public static void invertedIndex(String URL){\n //if the url set already contains this url, it means this url has already been processed, so return\n if(urlSet.contains(URL)){\n return;\n }\n else{\n //first add this unprocessed url to url list\n urlSet.add(URL);\n try{\n //connect this url and get its content\n URL url = new URL(URL);\n URLConnection urlCon = url.openConnection();\n BufferedReader in = new BufferedReader(new InputStreamReader(urlCon.getInputStream()));\n String urlString = \"\";\n String current;\n while((current = in.readLine()) != null)\n {\n urlString += current;\n }\n\n //by filtering the link label to get all the links in this page\n String[] urlList = urlString.split(\"<a href=\\\"\");\n\n //define regex expression to filter script label\n String scriptFilter=\"<script[^>]*?>[\\\\s\\\\S]*?<\\\\/script>\";\n\n //define regex expression to filter style label\n String styleFilter=\"<style[^>]*?>[\\\\s\\\\S]*?<\\\\/style>\";\n\n //define regex expression to filter html label\n String htmlFilter=\"<[^>]+>\";\n\n //filter all the useless labels\n Pattern scriptP=Pattern.compile(scriptFilter,Pattern.CASE_INSENSITIVE);\n Matcher scriptM=scriptP.matcher(urlString);\n urlString=scriptM.replaceAll(\"\");\n\n Pattern styleP=Pattern.compile(styleFilter,Pattern.CASE_INSENSITIVE);\n Matcher styleM=styleP.matcher(urlString);\n urlString=styleM.replaceAll(\"\");\n\n Pattern htmlP=Pattern.compile(htmlFilter,Pattern.CASE_INSENSITIVE);\n Matcher htmlM=htmlP.matcher(urlString);\n urlString=htmlM.replaceAll(\"\");\n\n //transfer content to a word array\n String[] words = urlString.split(\" \");\n for(int i = 0; i < words.length; i++){\n //System.out.println(words[i]);\n //if the hashmap doesn't contain this word, so put this word and its url pair into the hashmap\n if(!index.containsKey(words[i])){\n HashSet<String> str = new HashSet<String>();\n str.add(URL);\n index.put(words[i],str);\n }\n //if the hashmap already contains this word, update its record\n else{\n HashSet<String> str = index.get(words[i]);\n str.add(URL);\n index.put(words[i],str);\n }\n }\n //System.out.println(urlString);\n\n for(int i = 1; i < urlList.length;i++){\n //get each url in this page and transfer it to valid url, after that process each url\n int endpos = urlList[i].indexOf(\"\\\"\");\n String Url = getValidUrl(urlList[i].substring(0, endpos));\n //System.out.println(Url);\n if(Url != null){\n invertedIndex(Url);\n }\n }\n }catch(Exception e){\n System.out.println(\"can't process url : \" + URL);\n }\n }\n }", "public void cacheResult(java.util.List<wsihash> wsihashs);", "protected int hashCode(URL paramURL) {\n/* 351 */ int i = 0;\n/* */ \n/* */ \n/* 354 */ String str1 = paramURL.getProtocol();\n/* 355 */ if (str1 != null) {\n/* 356 */ i += str1.hashCode();\n/* */ }\n/* */ \n/* 359 */ InetAddress inetAddress = getHostAddress(paramURL);\n/* 360 */ if (inetAddress != null) {\n/* 361 */ i += inetAddress.hashCode();\n/* */ } else {\n/* 363 */ String str = paramURL.getHost();\n/* 364 */ if (str != null) {\n/* 365 */ i += str.toLowerCase().hashCode();\n/* */ }\n/* */ } \n/* */ \n/* 369 */ String str2 = paramURL.getFile();\n/* 370 */ if (str2 != null) {\n/* 371 */ i += str2.hashCode();\n/* */ }\n/* */ \n/* 374 */ if (paramURL.getPort() == -1) {\n/* 375 */ i += getDefaultPort();\n/* */ } else {\n/* 377 */ i += paramURL.getPort();\n/* */ } \n/* */ \n/* 380 */ String str3 = paramURL.getRef();\n/* 381 */ if (str3 != null) {\n/* 382 */ i += str3.hashCode();\n/* */ }\n/* 384 */ return i;\n/* */ }", "private int computeHash(URI location) {\n \t\treturn location.hashCode();\n \t}", "@Override\n public int hashCode()\n {\n return getURI().hashCode();\n }", "private int calculateHash(int id, String uri) {\n\t\treturn uri.hashCode() * Constants.HASH_PRIMES[0]\n\t\t\t\t+ Integer.toString(id).hashCode() * Constants.HASH_PRIMES[1];\n\t}", "public void cacheResult(wsihash wsihash);", "public static void main(String[] arg) throws IOException, URISyntaxException, InterruptedException {\n DB = new manageDB();\n Crawler crawler = new Crawler();\n DBLock=new AtomicInteger(0);\n new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n crawler.CrawlerProcess(5);\n } catch (IOException e) {\n e.printStackTrace();\n } catch (InterruptedException e) {\n e.printStackTrace();\n } catch (URISyntaxException e) {\n e.printStackTrace();\n }\n }\n }).start();\n\n new Thread(new Runnable() {\n @Override\n public void run() {\n processedCrawledPages=0;\n outputSection = new HashSet<>();\n while (true) {\n crawlerOutput = crawler.crawlerOutput;\n if (crawlerOutput != null)\n {\n if (crawlerOutput.size() > 0)\n {\n Iterator<Crawler.OutputDoc> itr = crawlerOutput.iterator();\n if(itr.hasNext())\n {\n Crawler.OutputDoc output;\n synchronized (crawlerOutput) {\n output = itr.next();\n outputSection.add(output);\n }\n if(processedCrawledPages%10==0)\n {\n //lock db to be exclusive for POP function\n DBLock.set(1);\n processedCrawledPages=0;\n try {\n Thread popThread=new Thread(new POPClass(outputSection));\n popThread.start();\n popThread.join();\n\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n outputSection.clear();\n \n }\n while(DBLock.intValue()==1);\n processedCrawledPages +=1;\n DB.docProcess(output);\n synchronized (crawlerOutput) {\n crawlerOutput.remove(output);\n }\n }\n\n }\n }\n }\n }\n\n }).start();\n\n\n new Thread(new Runnable() {\n @Override\n public void run() {\n try {\n ServerSocket serverSocket = new ServerSocket(7800);\n System.out.println(\"server is up and running...\");\n while (true) {\n Socket s = serverSocket.accept();\n System.out.println(\"server accepted the query...\");\n DataInputStream DIS = new DataInputStream(s.getInputStream());\n String query_and_flags = DIS.readUTF();\n Boolean imageSearch = false;\n Boolean phraseSearch = false;\n System.out.println(\"query_and_flags=\" + query_and_flags);\n String[] list_query_and_flags = query_and_flags.split(\"@\");\n String query = list_query_and_flags[0];\n if (list_query_and_flags[1].equals(\"phrase\"))\n phraseSearch = true;\n if (list_query_and_flags[2].equals(\"yes\"))\n imageSearch = true;\n\n if (imageSearch)\n manageDB.imageSearch(query);\n else manageDB.rank(query,phraseSearch);\n if (phraseSearch)\n System.out.println(\"it's phrase search\");\n else System.out.println(\"no phrase search\");\n DIS.close();\n s.close();\n\n }\n } catch (IOException | SQLException e) {\n // TODO Auto-generated catch block\n e.printStackTrace();\n }\n }\n }).start();\n\n\n }", "Map<String, Integer> getSearchResults(String searchTerm) {\n\n Map<String, Integer> libCount = new ConcurrentHashMap<>();\n\n try {\n Document document = Jsoup.connect(google + URLEncoder.encode(searchTerm, charset))\n .userAgent(userAgent)\n .referrer(\"http://www.google.com\")\n .get();\n\n Elements links = document.select(\"a[href]\");\n Set<String> urls = new HashSet<>();\n for (Element link: links) {\n if (link.attr(\"href\") != null && link.attr(\"href\").contains(\"=\")) {\n String url = link.attr(\"href\").split(\"=\")[1];\n if (url.contains(\"http\")) {\n urls.add(getDomainName(url));\n }\n }\n }\n\n CountDownLatch latch = new CountDownLatch(urls.size());\n\n for (String url: urls) {\n AnalysePage analysePage = new AnalysePage(url);\n completionService.submit(analysePage);\n }\n\n int completed = 0;\n\n while(completed < urls.size()) {\n try {\n Future<Set<String>> resultFuture = completionService.take();\n Set<String> strings = resultFuture.get();\n for (String lib : strings) {\n Integer count = libCount.get(lib);\n if (count == null) {\n libCount.put(lib, 1);\n } else {\n libCount.put(lib, ++count);\n }\n }\n completed++;\n latch.countDown();\n } catch (InterruptedException | ExecutionException e) {\n e.printStackTrace();\n }\n }\n try {\n latch.await();\n } catch (InterruptedException e) {\n e.printStackTrace();\n }\n\n } catch (MalformedURLException e) {\n System.out.println(\"The URL is Malformed\");\n } catch (UnsupportedEncodingException e) {\n System.out.println(\"Incorrect URL encoding\");\n } catch (IOException e) {\n System.out.println(\"Unable to read from google\");\n e.printStackTrace();\n }\n executor.shutdown();\n return libCount;\n }", "static String hashURL(String url){\n\t\treturn url.replace('/', 's').replace(':','c');\n\t}", "public Map getContainers(Set wordHashes, Set urlselection, boolean deleteIfEmpty, boolean interruptIfEmpty, long maxTime) {\n HashMap containers = new HashMap();\r\n String singleHash;\r\n indexContainer singleContainer;\r\n Iterator i = wordHashes.iterator();\r\n long start = System.currentTimeMillis();\r\n long remaining;\r\n while (i.hasNext()) {\r\n // check time\r\n remaining = maxTime - (System.currentTimeMillis() - start);\r\n //if ((maxTime > 0) && (remaining <= 0)) break;\r\n if ((maxTime >= 0) && (remaining <= 0)) remaining = 100;\r\n \r\n // get next word hash:\r\n singleHash = (String) i.next();\r\n \r\n // retrieve index\r\n singleContainer = getContainer(singleHash, urlselection, deleteIfEmpty, (maxTime < 0) ? -1 : remaining / (wordHashes.size() - containers.size()));\r\n \r\n // check result\r\n if (((singleContainer == null) || (singleContainer.size() == 0)) && (interruptIfEmpty)) return new HashMap();\r\n \r\n containers.put(singleHash, singleContainer);\r\n }\r\n return containers;\r\n }", "protected void createLookupCache()\n/* */ {\n/* 1260 */ this.lookup = new SimpleCache(1, Math.max(getSize() * 2, 64));\n/* */ }", "protected void rehash() {\n int oldCapacity = table.length;\n ServerDescEntry oldMap[] = table;\n\n int newCapacity = oldCapacity * 2 + 1;\n ServerDescEntry newMap[] = new ServerDescEntry[newCapacity];\n\n threshold = (int)(newCapacity * loadFactor);\n table = newMap;\n\n for (int i = oldCapacity ; i-- > 0 ;) {\n for (ServerDescEntry old = oldMap[i] ; old != null ; ) {\n ServerDescEntry e = old;\n old = old.next;\n\n int index = (e.desc.sid & 0x7FFFFFFF) % newCapacity;\n e.next = newMap[index];\n newMap[index] = e;\n }\n }\n }", "private void pageContent( String url) {\n\t\t\n\t\tif ( !url.matches(URL)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tList<String> outlinks = null; // out link urls\n\t\tUrlBean bean = null; // basic info of the url\n\t\t\n\t\tbean = new UrlBean();\n\t\ttry {\n\t\t\t\n\t\t\tconn = Jsoup.connect(url).timeout(5000);\n\t\t\tif ( conn == null) {\n\t\t\t\treturn ;\n\t\t\t}\n\t\t\t\n\t\t\tdocument = conn.get(); // 得到网页源代码,超时时间是5秒\n\t\t\t\n\t\t\t/*\n\t\t\t * 文章基本信息\n\t\t\t */\n\t\t\telements = document.getElementsByTag(\"title\");\n\t\t\tif ( elements!= null && elements.size() != 0) {\n\t\t\t\telement = elements.get(0);\n\t\t\t}\n\t\t\tString title = element.text();\n\t\t\tbean.setTitle(title);\n\t\t\tbean.setKeywords(title);\n\t\t\t\n\t\t\telements = document.getElementsByTag(\"a\");\n\t\t\tif ( elements != null) {\n\t\t\t\tString linkUrl = null;\n\t\t\t\toutlinks = new ArrayList<String>();\n\t\t\t\tfor ( int i = 0; i < elements.size(); i++) {\n\t\t\t\t\tlinkUrl = elements.get(i).attr(\"href\");\n\t\t\t\t\tif ( linkUrl.matches(URL)) {\n\t\t\t\t\t\toutlinks.add(linkUrl);\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\treturn;\n\t\t} \n\t\t\n\t\tbean.setUrl(url);\n\t\tbean.setId(urlId++);\n\t\tbean.setRank(1);\n\t\tif ( outlinks != null) {\n\t\t\tint count = outlinks.size();\n\t\t\tbean.setOutlinks(count);\n\t\t\tfor ( int i = 0; i < count; i++) {\n\t\t\t\turlsSet.add(outlinks.get(i));\n\t\t\t}\n\t\t\tif ( new AllInterface().addOneUrlInfo(bean, outlinks)) {\n\t\t\t\tSystem.out.println(\"Add to database successfully, url is '\" + url + \"'.\");\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Fail to add to database, maybe url exists. Url is '\" + url + \"'.\");\n\t\t\t}\n\t\t\tSystem.out.println(\"[\" + count + \" urls remain...]\");\n\t\t\tSystem.out.println();\n\t\t} else {\n\t\t\tSystem.out.println(\"Error occurs in crawl, url is '\" + url + \"'.\");\n\t\t\tSystem.out.println(\"[[FINISHED]]\");\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t}", "public WebCrawler(String urlSeed) {\n\t\t\n\n\t\t\n\t\tconnection = db.openConnection();\n\n\t\t\ttry {\n\t\t\t\tthis.urlSeed = new URL(urlSeed);\n\t\t\t} catch(MalformedURLException ex) {\n\t\t\t\tlog.error(\"please input the right url with protocol part!\");\n\t\t\t\tSystem.exit(0);\n\t\t\t}\n\t\t\tworkers = new WorkQueue(10);\n\t\t\tthis.count = 0;\n\t\t\tthis.pending = 0;\n\t\t\turlList = new ArrayList<String>();\n\t\t\t//index = new InvertedIndex();\n\t\t\tlong start = System.currentTimeMillis();\n\t\t\tthis.HTMLFetcher();\n\t\t\tlong end = System.currentTimeMillis();\n\t\t\tlog.info(\"Running time for htmlFetcher: \" + (end - start));\n\t\t\tList<String> suggestedQuery = index.getSuggestedQuery();\n\t\t\tdb.updateSuggestedQuery(connection, suggestedQuery);\n\t\t\tdb.closeConnection(connection);\n\t}", "private void getCache(Context context) throws IOException {\n\t\t // Read file from distributed caches - each line is a item/itemset with its frequent\n\n \t// get caches files.\n\t\tfor (int i = 0; i < 10; i++)\n\t\t\tSystem.out.println(\"SETUP ------ MAPPER ----------- GET FREQUENT ITEMS--------------\");\n\t\t\n\t\t\n\t\t// URI to locate cachefile, ex URI a = new URI(\"http://www.foo.com\");\n\t\tList<URI> uris = Arrays.asList(context.getCacheFiles());\n\t\t\n\t\tSystem.out.println(\"Reading cached files\");\n\t\t// read cache files which contains candidates?\n\t\t\n\t\tnItems = 0;\n\t\t\n\t\tfor (URI uri : uris) {\n\t\t\tPath p = new Path(uri);\n\t\t\tSystem.out.println(\"Loading \" + uri.toString());\n\t\t\tFileSystem fs = FileSystem.get(context.getConfiguration());\n\t\t\tInputStreamReader ir = new InputStreamReader(fs.open(p));\n\t\t\tBufferedReader data = new BufferedReader(ir);\n\t \twhile (data.ready()) { \t\t\n\t \t\tString line=data.readLine();\n\t \t\tif (line.matches(\"\\\\s*\")) continue; // be friendly with empty lines\n\t \t\tString[] numberStrings = line.split(\"\\t\");\n\t \t\t\n \n\t \t\tint frequentItem = Integer.parseInt(numberStrings[0]);\n \t\t\tif (!hashItems.containsKey(frequentItem)) {\n\t \t\t\t\thashItems.put(frequentItem, nItems);\n\t \t\t\t\tnItems++;\n\t \t\t\t}\n\t \t\t}\n\t \t\t\n\t \t} \n\n }", "@Test\n public void TestScrapeMgr() throws Exception {\n ExecutorService e = Executors.newFixedThreadPool(4);\n ScrapeManager sm = new ScrapeManager(e);\n\n DALManager dm = new DALManager();\n Account a = dm.AllAccounts().get(0);\n Campaign c = a.getSelectCampaign();\n for (AConfiguration cf : c.getConfigurations()) {\n if (cf.getQueries() == null) {\n cf.setQueries(new ArrayList<AQuery>());\n }\n AQuery nw = new AQuery(\"fashion\", null, PinterestObject.PinterestObjectResources.External);\n cf.getQueries().add(nw);\n\n System.err.println(\"\" + cf.getClass().getSimpleName() + \" \" + cf.toString());\n Map<PinterestObject, Board> lst = new HashMap<>();\n Map<PinterestObject, Board> scraped = sm.Scrape(cf, a, null); //page 1 ; may return null !!!\n if (scraped == null) {\n System.err.println(\"nothing to scrape***\");\n } else {\n lst.putAll(scraped);\n scraped.clear(); /// !!!!!!!!!\n\n scraped = sm.Scrape(cf, a, null);//page 2\n lst.putAll(scraped);\n scraped.clear(); /// !!!!!!!!!\n\n int i = 1;\n for (Map.Entry<PinterestObject, Board> kv : lst.entrySet()) {\n System.err.println(\n (i++) + \" \" + ((Pin) kv.getKey()).getHashUrl()\n );\n }\n }\n System.err.println(\"__\");\n System.err.println(\"__\");\n }\n\n }", "public void rehash() {\n\t\tArrayList<Node<MapPair<K, V>>> temp=buckets;\n\t\tbuckets=new ArrayList<>();\n\t\tfor(int i=0;i<2*temp.size();i++)\n\t\t{\n\t\t\tbuckets.add(null);\n\t\t}\n\t\tfor(Node<MapPair<K, V>> node:temp)\n\t\t{\n\t\t\tif(node!=null)\n\t\t\t{\n\t\t\t\twhile(node!=null)\n\t\t\t\t{\n\t\t\t\t\tput(node.data.key,node.data.value);\n\t\t\t\t\tnode=node.next;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "Map<String, String> getCachedLinks(Page page);", "static int hash(int h) {\n\t\t // This function ensures that hashCodes that differ only by constant \n\t\t // multiples at each bit position have a bounded number of collisions \n\t\t // (approximately 8 at default load factor).\n\t\th ^= (h >>> 20) ^ (h >>> 12);\n\t\treturn h ^ (h >>> 7) ^ (h >>> 4);\n\t}", "private static void testConsistentHashing() {\n Map<String, AtomicInteger> CHNodesMap = Maps.newHashMap();\r\n List<String> CHNodes = Lists.newArrayList();\r\n for(int i = 0 ; i < nodesCount; i ++) {\r\n CHNodes.add(\"CHNode\"+i);\r\n CHNodesMap.put(\"CHNode\"+i, new AtomicInteger());\r\n }\r\n ConsistentHashing<String, String> ch = new ConsistentHashing(charsFunnel, charsFunnel, CHNodes);\r\n \r\n // insert keys\r\n long startTime = System.currentTimeMillis();\r\n for(int i = 0 ; i < keyCount; i++) {\r\n CHNodesMap.get(ch.getHash(\"\"+i)).incrementAndGet();\r\n }\r\n long endTime = System.currentTimeMillis();\r\n long timeElapsed = endTime - startTime;\r\n // System.out.println(\"Execution Time in milliseconds : \" + timeElapsed);\r\n\r\n // print out distriubution + clear\r\n for(Entry<String, AtomicInteger> entry : CHNodesMap.entrySet()) {\r\n System.out.println(entry.getKey() + \": \" + entry.getValue().get());\r\n entry.getValue().set(0);\r\n }\r\n \r\n // remove node 3\r\n System.out.println(\"\\n=== After Removing Node 3 ===\");\r\n ch.removeNode(\"CHNode3\");\r\n CHNodesMap.remove(\"CHNode3\");\r\n \r\n // re-add\r\n for(int i = 0 ; i < keyCount; i++) {\r\n CHNodesMap.get(ch.getHash(\"\"+i)).incrementAndGet();\r\n }\r\n \r\n // print out distriubution again\r\n for(Entry<String, AtomicInteger> entry : CHNodesMap.entrySet()) {\r\n System.out.println(entry.getKey() + \": \" + entry.getValue().get());\r\n }\r\n }", "synchronized void crawledList_add(HashSet _crawledList, String url)\n {\n _crawledList.add(url);\n System.out.println(\"Added\"+\"\\t\"+url);\n }", "void hashLexicons() {\n for (int i = 0; i < trainingData.hamEmails.length; i++) {\n hashLexicons(trainingData.hamEmails[i]);\n }\n for (int i = 0; i < trainingData.spamEmails.length; i++) {\n hashLexicons(trainingData.spamEmails[i]);\n }\n }", "public int tryRemoveURLs(String urlHash) {\r\n // this tries to delete an index from the cache that has this\r\n // urlHash assigned. This can only work if the entry is really fresh\r\n // and can be found in the RAM cache\r\n // this returns the number of deletion that had been possible\r\n return dhtInCache.tryRemoveURLs(urlHash) | dhtOutCache.tryRemoveURLs(urlHash);\r\n }", "private List<Woacrawledurl> readCrawledUrls()\n\t{\n\t\tString hql = \"from Woacrawledurl where instanceId=\"\n\t\t\t\t+ this.param.instance.getTaskinstanceId() + \"order by id\";\n\t\tSessionFactory sessionFactory = TaskFactory.getSessionFactory(this.param.dbid);\n\t\tSession session = sessionFactory.getCurrentSession();\n\t\tTransaction t = session.beginTransaction();\n\t\tQuery q = session.createQuery(hql);\n\t\tList<Woacrawledurl> list = q.list();\n\t\tt.commit();\n\t\treturn list;\n\t}", "@Override\n public void crawl() {\n Document doc;\n try {\n\n\n doc = Jsoup.connect(rootURL).userAgent(\"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) AppleWebKit/537.75.14 (KHTML, like Gecko) Version/7.0.3 Safari/7046A194A\").get();\n\n Elements articles = doc.select(\"section.list article\");\n\n System.out.println(\"Number of articles found:\"+articles.size());\n //list of links found\n for(Element article: articles){\n\n Element titleLink = article.select(\"a\").first();\n System.out.println(titleLink.attr(\"abs:href\"));\n\n //if the url found is in the cache, do not retrieve the url.\n if(urlCache.contains(titleLink.attr(\"abs:href\"))) {\n System.out.println(\"Doucment found in cache, ignoring document\");\n continue;\n }\n\n storeDocument(Jsoup.connect(titleLink.attr(\"abs:href\")).get());\n\n //add the URL to the cache so that we don't retrieve it again.\n urlCache.add(titleLink.attr(\"abs:href\"));\n }\n\n\n } catch (Exception e){\n logger.log(Level.SEVERE, \"Error Retrieving from URL\", e);\n e.printStackTrace();\n }\n }", "int getHash();", "String getHash();", "String getHash();", "public static void main(String[] args) {\n Map<Integer, String> ht = new Hashtable<>();\n \n // hash = 7, so, (7 & 0x7FFFFFFF) % 11 => 7 % 11 => 7. So, it stores the element in 7th index bucket location\n ht.put(7, \"aa\"); \n ht.put(11, \"ba\");\n ht.put(1, \"ad\");\n ht.put(15, \"sa\");\n ht.put(20, \"rea\");\n \n // hash = 18, so, (18 & 0x7FFFFFFF) % 11 => 18 % 11 => 7. So, it stores the element in 7th index bucket location.\n // But we already have one element then this new element will have next pointer variable. It will point to the element whcih already exists.\n // Then this new element will be placed in the 7th index.\n ht.put(18, \"ewa\");\n\n // When we iterate the elements it will iterate from top to bottom and right to left only.\n // Same index we have a possibility of multiple elements. So, it will read it from right to left.\n System.out.println(ht);\n }", "private IDictionary<URI, ISet<URI>> makeGraph(ISet<Webpage> webpages) {\n IDictionary<URI, ISet<URI>> graph = new ArrayDictionary<URI, ISet<URI>>();\n ISet<URI> webpageUris = new ChainedHashSet<URI>();\n for (Webpage webpage : webpages) {\n \twebpageUris.add(webpage.getUri());\n }\n for (Webpage webpage : webpages) {\n \tURI pageUri = webpage.getUri();\n \tISet<URI> links = new ChainedHashSet<URI>();\n \tfor (URI uri : webpage.getLinks()) {\n \t\tif (!uri.equals(pageUri) && !links.contains(uri) && webpageUris.contains(uri)) {\n \t\t\tlinks.add(uri);\n \t\t}\n \t}\n \tgraph.put(pageUri, links);\n }\n return graph;\n }", "@Override\n public HashSet<String> findPostIds(String catWiseUrl) throws IOException {\n HashSet<String> postId = new HashSet<String>();\n Document document = Jsoup.connect(catWiseUrl).userAgent(\"Opera\").get();\n Element body = document.body();\n\n Elements posts = body.getElementsByClass(\"lead-news\").first().getElementsByTag(\"a\");\n\n for (Element post:posts) {\n String link = post.attr(\"href\");\n postId.add(link);\n }\n\n posts = body.getElementsByClass(\"lead-news-2nd\").first().getElementsByTag(\"a\");\n\n for (Element post:posts) {\n String link = post.attr(\"href\");\n postId.add(link);\n }\n\n posts = body.getElementsByClass(\"lead-news-3nd\").first().getElementsByTag(\"a\");\n\n for (Element post:posts) {\n String link = post.attr(\"href\");\n postId.add(link);\n\n if(postId.size()==5)\n break;\n }\n\n return postId;\n }", "public static void leechBBC(Hdict dict)\r\n {\r\n WebDriver driver = new ChromeDriver();\r\n \r\n String baseUrl = \"https://www.bbc.com/\";\r\n driver.get(baseUrl);\r\n \r\n List<WebElement> links = driver.findElements(By.tagName(\"a\"));\r\n \r\n System.out.println(\"There is a total of \" + links.size() + \" frong page news detected on BBC\");\r\n \r\n Hdict titleDicts = new Hdict();\r\n \r\n for(int i = 0; i < links.size(); i++)\r\n {\r\n //get href links\r\n String url = links.get(i).getAttribute(\"href\");\r\n \r\n Words hUrl = new Words(url, 0);\r\n if(titleDicts.hdict_lookup(hUrl) != null) // if this page is already parsed\r\n {\r\n continue;\r\n }\r\n \r\n //if the page is not parsed\r\n titleDicts.hdict_insert(hUrl);\r\n \r\n String urlname = \"https://www.bbc.com/news/\";\r\n \r\n String[] news = url.split(urlname);\r\n if(news.length > 1 && news[1].length() > 10) // if it is .html and has some other shish, shit solution but works\r\n {\r\n //WebDriver driver1 = new ChromeDriver();\r\n //driver1.get(url);\r\n \r\n String[] temp1 = news[1].split(\"-\");\r\n \r\n try{ // if the serial is not attached\r\n Integer.parseInt(temp1[temp1.length-1]);\r\n }\r\n catch(Exception e){ continue; };\r\n \r\n if(temp1.length < 2) // if it is not even a topic\r\n continue;\r\n \r\n //nytimes doesn't have viewers count, so default 2500 effectiveness on all posts\r\n \r\n int reactions = NYTIME_AVG;\r\n \r\n String directory = news[1];\r\n \r\n directory = directory.split(\".html\")[0]; // removes file name and directory\r\n String[] temp = directory.split(\"/\");\r\n String title = temp[temp.length-2]; // get file name, more concise, skip last for CNN, last is index\r\n String[] keys = title.split(\"-\");\r\n \r\n for(String key : keys)\r\n {\r\n if(key.contains(\".html\")) continue; // useless stuff\r\n \r\n boolean integercheck = true;\r\n try{\r\n Integer.parseInt(key);\r\n } catch(Exception e) \r\n {\r\n integercheck = false;\r\n };\r\n if(integercheck) continue; // useless numbers\r\n \r\n if(Arrays.binarySearch(JUNK_WORDS, key) >= 0) continue; // useless words\r\n \r\n Words wkey = new Words(key, reactions * BBC_WORTH);\r\n Words wkey_old = dict.hdict_lookup(wkey);\r\n if(wkey_old == null) dict.hdict_insert(wkey);\r\n else\r\n {\r\n wkey.setPopularity(wkey.getPopularity() + wkey_old.getPopularity());\r\n dict.hdict_insert(wkey);\r\n }\r\n }\r\n }\r\n }\r\n //close Chrome\r\n driver.close();\r\n }", "protected static void rehash() \r\n\t{\r\n\t\tEntry\told, e;\r\n\t\tint\t\ti, index;\r\n\r\n\t\tEntry\toldMap[] = m_table;\r\n\t\tint\t\toldCapacity = oldMap.length;\r\n\r\n\t\tint newCapacity = oldCapacity * 2 + 1;\r\n\t\tEntry newMap[] = new Entry[newCapacity];\r\n\r\n\t\tm_threshold = (int)(newCapacity * m_loadFactor);\r\n\t\tm_table = newMap;\r\n\r\n\t\tfor (i = oldCapacity ; i-- > 0 ;) {\r\n\t\t\tfor (old = oldMap[i] ; old != null ; ) {\r\n\t\t\t\te = old;\r\n\t\t\t\told = old.m_next;\r\n\r\n\t\t\t\tindex = (e.m_name.hashCode() & 0x7FFFFFFF) % newCapacity;\r\n\t\t\t\te.m_next = newMap[index];\r\n\t\t\t\tnewMap[index] = e;\r\n\t\t\t}\r\n\t\t}\r\n }", "private void ExtractURLs(String line)\n {\n String matchedURL = \"\";\n Matcher urlMatcher = urlPattern.matcher(line);\n\n while (urlMatcher.find())\n {\n matchedURL = urlMatcher.group();\n\n if (!distinctURLs.containsKey(matchedURL))\n {\n distinctURLs.put(matchedURL,matchedURL);\n }\n }\n }", "void runC() {\n\t\tArrayList<Link> links_s2 = new ArrayList<Link>(links_s);\n\t\tArrayList<Link> links_p2 = new ArrayList<Link>(links_p);\n\t\talgorithmC = new HashSet<Link>(algorithmC(links_p2, links_s2));\n\t}", "private void outputBigHashInformation(HashMap<String, HashMap<String, Integer>> list, String doctype, String warcName, CSVPrinter html, CSVPrinter html5) {\n ArrayList<String> pageInfo;\n\n try {\n for (String key : list.keySet()) {\n //Reset line info\n pageInfo = new ArrayList<String>();\n\n //Get all information for this element in a single line, output it\n String temp = hashToString(warcName, list.get(key), false);\n if (temp == null || temp.equals(\"\"))\n continue;\n pageInfo.add(warcName + \"£\" + key + \"£\" + temp);\n synchronized (html) {\n html.printRecord(pageInfo);\n html.flush();\n }\n\n //If an HTML5 document, output to its specific file as well\n doctype = doctype.toLowerCase();\n if (doctype.equals(\"<!doctype html>\")) {\n synchronized (html5) {\n html5.printRecord(pageInfo);\n html5.flush();\n }\n }\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "private void rehash() {\r\n\t\tSystem.out.println( \"rehashing : buckets \" + numBuckets + \" size \" + size );\r\n\t\tArrayList<MapNode<K, V>> temp = buckets;\r\n\t\tbuckets = new ArrayList();\r\n\t\tfor( int i = 0; i < 2*numBuckets; i++ ) {\r\n\t\t\tbuckets.add( null );\r\n\t\t}\r\n\t\tsize = 0; //size 0 means abi ek b element nhi h\r\n\t\tnumBuckets *= 2; //ab number of buckets double ho gya h\r\n\t\t//now we will trvrs old arraylist and linkedlist and\r\n\t\t//copy is elemenet one by one\r\n\t\tfor( int i = 0; i < temp.size(); i++ ) {\r\n\t\t\tMapNode< K, V > head = temp.get(i);\r\n\t\t\twhile( head != null ) {\r\n\t\t\t\t\r\n\t\t\t\tK key = head.key;\r\n\t\t\t\tV value = head.value;\r\n\t\t\t\tinsert( key, value );\r\n\t\t\t\thead = head.next;\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void outputHashInformation(HashMap<String, Integer> list, String doctype, String warcName, CSVPrinter html, CSVPrinter html5) {\n ArrayList<String> pageInfo = new ArrayList<String>();\n String temp;\n\n try {\n temp = hashToString(warcName, list, true);\n //Hash map has data, return\n if (temp == null || temp.equals(\"\"))\n return;\n pageInfo.add(temp);\n synchronized (html)\n {\n html.printRecord(pageInfo);\n html.flush();\n }\n\n //If an HTML5 document, output to its specific file as well\n doctype = doctype.toLowerCase();\n if (doctype.equals(\"<!doctype html>\")) {\n synchronized (html5) {\n html5.printRecord(pageInfo);\n html5.flush();\n }\n }\n\n } catch (IOException e) {\n e.printStackTrace();\n }\n }", "void store(WebCrawlerData data);", "private void loadLoreEntries() {\n entryIDMap = new ConcurrentHashMap<>();\n entryIDThreads = new ThreadGroup(\"entryIDThreads\");\n\n for (int i = 0; i < bookSelectionData.size(); i++) {\n\n final String entryName = bookSelectionData.get(i).getBookName();\n final long entryID = bookSelectionData.get(i).getBookID();\n\n new Thread(entryIDThreads, new Runnable() {\n @Override\n public void run() {\n try {\n ArrayList<Long> arraylist = new ArrayList<>();\n arraylist.add(entryID);\n DataAccessObject_LoreBookSelectionDefinition node = database.getDao().getPresentationNodeById(arraylist).get(0);\n JsonObject json = node.getJson();\n JsonArray entryNodes = json.getAsJsonObject(\"children\").getAsJsonArray(\"records\");\n\n long[] ID = new long[entryNodes.size()];\n for (int j = 0; j < entryNodes.size(); j++) {\n JsonObject entry = (JsonObject) entryNodes.get(j);\n long hash = Long.parseLong(entry.get(\"recordHash\").getAsString());\n ID[j] = convertHash(hash);\n }\n entryIDMap.put(entryName, ID);\n } catch (Exception ignored) {\n }\n }\n }).start();\n }\n }", "public static void hashMapEx() {\n\t\tString str = \"habiletechE\";\n\t\tstr = str.toLowerCase();\n\t\tchar[] ch = str.toCharArray();\n\t\tint size = ch.length;\n\n\t\tHashMap<Character, Integer> hmap = new HashMap<Character, Integer>();\n\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tif (!hmap.containsKey(ch[i]))\n\t\t\t\thmap.put(ch[i], 1);\n\t\t\telse {\n\t\t\t\tint val = hmap.get(ch[i]) + 1;\n\t\t\t\thmap.put(ch[i], val);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"Duplicate Charaacters :\");\n\t\tfor (Map.Entry<Character, Integer> hm : hmap.entrySet()) {\n\t\t\tif (hm.getValue() > 1)\n\t\t\t\tSystem.out.println(hm.getKey() + \" \" + hm.getValue());\n\t\t}\n\t}", "List<Link> findLinkByCache();", "public Map<String, URLValue> loadAllURLs()\n\t{\n\t\tEntityCursor<URLEntity> results = this.env.getEntityStore().getPrimaryIndex(String.class, URLEntity.class).entities();\n\t\tMap<String, URLValue> urls = new HashMap<String, URLValue>();\n\t\tURLValue url;\n\t\tfor (URLEntity entity : results)\n\t\t{\n\t\t\turl = new URLValue(entity.getKey(), entity.getURL(), entity.getUpdatingPeriod());\n\t\t\turls.put(url.getKey(), url);\n\t\t}\n\t\tresults.close();\n\t\treturn urls;\n\t}", "public ArrayList<String> webCrawling(){\n\t\t\tfor(i=780100; i<790000; i++){\r\n\t\t\t\ttry{\r\n\t\t\t\tdoc = insertPage(i);\r\n\t\t\t\t//Thread.sleep(1000);\r\n\t\t\t\t}catch (Exception e) {\r\n\t\t\t\t\te.printStackTrace();\r\n\t\t\t\t}\r\n\t\t\t\tif(doc != null){\r\n\t\t\t\t\tElement ele = doc.select(\"div.more_comment a\").first();\r\n\t\t\t\t\t//System.out.println(ele.attr(\"href\"));\r\n\t\t\t\t\tcommentCrawling(ele.attr(\"href\"));//��۸�� ���� ��ũ\r\n\t\t\t\t\tcommentCrawlingList(commentURList);\r\n\t\t\t\t\tcommentURList = new ArrayList<String>();//��ũ ����� �ߺ��ǰ� ���̴� �� �����ϱ� ���� �ʱ�ȭ �۾�\r\n\t\t\t\t\tSystem.out.println(i+\"��° ������\");\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn replyComment;\r\n\t\t//return urlList.get(0);\r\n\t}", "@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 void cacheHashCode() {\n _hashCode = 1;\n for (int counter = size() - 1; counter >= 0; counter--) {\n _hashCode = 31 * _hashCode + get(counter).hashCode();\n }\n }", "public abstract int getHash();", "@Override\n public int hashCode() {\n return (content.hashCode() *17 + StringResource.class.hashCode());\n }", "protected void createLookupCache() {\n }", "private static void getHashtagSimilarities(String input, String output) throws IOException,\r\n\t\t\tClassNotFoundException, InterruptedException {\r\n\t\t// Share the feature vector of #job to all mappers.\r\n\t\tConfiguration conf = new Configuration();\r\n\t\tconf.set(\"input\", input);\r\n\t\t\r\n\t\tOptimizedjob job = new Optimizedjob(conf, input, output,\r\n\t\t\t\t\"Get similarities between #job and all other hashtags\");\r\n\t\tjob.setClasses(SimilarityMapper.class, null, null);\r\n\t\tjob.setMapOutputClasses(IntWritable.class, Text.class);\r\n\t\tjob.run();\r\n\t}", "java.lang.String getHashData();", "private static void testRendezvousHashing() {\n Map<String, AtomicInteger> HRWNodesMap = Maps.newHashMap();\r\n List<String> HRWNodes = Lists.newArrayList();\r\n for(int i = 0 ; i < nodesCount; i ++) {\r\n HRWNodes.add(\"HRWNode\"+i);\r\n HRWNodesMap.put(\"HRWNode\"+i, new AtomicInteger());\r\n }\r\n RendezvousHashing<String, String> hrw = new RendezvousHashing(charsFunnel, charsFunnel, HRWNodes);\r\n \r\n // insert keys\r\n long startTime = System.currentTimeMillis();\r\n for(int i = 0 ; i < keyCount; i++) {\r\n HRWNodesMap.get(hrw.getHash(\"\"+i)).incrementAndGet();\r\n }\r\n long endTime = System.currentTimeMillis();\r\n long timeElapsed = endTime - startTime;\r\n // System.out.println(\"Execution Time in milliseconds : \" + timeElapsed);\r\n \r\n\r\n // print out distriubution + clear\r\n for(Entry<String, AtomicInteger> entry : HRWNodesMap.entrySet()) {\r\n System.out.println(entry.getKey() + \": \" + entry.getValue().get());\r\n entry.getValue().set(0);\r\n }\r\n\r\n // remove node 3\r\n System.out.println(\"\\n=== After Removing Node 3 ===\");\r\n hrw.removeNode(\"HRWNode3\");\r\n HRWNodesMap.remove(\"HRWNode3\");\r\n\r\n // re-add\r\n for(int i = 0 ; i < keyCount; i++) {\r\n HRWNodesMap.get(hrw.getHash(\"\"+i)).incrementAndGet();\r\n }\r\n\r\n // print out distriubution again\r\n for(Entry<String, AtomicInteger> entry : HRWNodesMap.entrySet()) {\r\n System.out.println(entry.getKey() + \": \" + entry.getValue().get());\r\n }\r\n }", "private void calculateDuplicate(ArrayList<String> pathList) {\n\n HashMap<String, byte[]> pathMdHashMap = new HashMap<>();\n\n for (int i = 0; i < pathList.size(); i++) {\n\n LinkedHashMap<File, String> uniquePathAndFileHash = new LinkedHashMap<>();\n\n if (pathList.get(i) == null || !(new File(pathList.get(i)).isFile()) || !(new File(pathList.get(i)).exists()))\n continue;\n\n byte[] fileHash1 = Constant.fileHash(new File(pathList.get(i)));\n\n if (fileHash1 == null)\n continue;\n\n for (int j = i + 1; j < pathList.size(); j++) {\n\n String path = pathList.get(j);\n\n if (path == null || !(new File(path).isFile()) || !(new File(path).exists()))\n continue;\n\n byte[] fileHash2;\n\n if (pathMdHashMap.containsKey(path)) {\n fileHash2 = pathMdHashMap.get(path);\n } else {\n fileHash2 = Constant.fileHash(new File(pathList.get(j)));\n pathMdHashMap.put(path, fileHash2);\n }\n\n boolean flag = MessageDigest.isEqual(fileHash1, fileHash2);\n\n if (flag) {\n\n if (!uniquePathAndFileHashCopy.containsValue(pathList.get(i))) {\n uniquePathAndFileHash.put(new File(pathList.get(i)), pathList.get(i));\n }\n\n if (!uniquePathAndFileHashCopy.containsValue(path)) {\n uniquePathAndFileHash.put(new File(path), path);\n }\n }\n }\n\n if (uniquePathAndFileHash.size() > 1) {\n\n index++;\n\n\n LinkedHashMap<Integer, LinkedHashMap<File, String>> similarVideo = new LinkedHashMap<>();\n\n similarVideo.put(index, uniquePathAndFileHash);\n\n similarVideoCopy.put(index, uniquePathAndFileHash);\n\n uniquePathAndFileHashCopy.putAll(uniquePathAndFileHash);\n\n\n new Handler(Looper.getMainLooper()).post(() ->\n responseLiveData.setValue(FileRemoverResponse.success(similarVideo)));\n\n }\n }\n\n }", "@Override\n public int hashCode() {\n int result = doi.hashCode();\n result = 31 * result + mappedUrl.hashCode();\n result = 31 * result + status.hashCode();\n result = 31 * result + message.hashCode();\n result = 31 * result + date.hashCode();\n return result;\n }", "public void run()\n\t\t{\n\t\t\tint num = 0;\n\t\t\ttry{\n\t\t\t\tlog.debug(\"Dealing with: \" + url.toString() + \" From : \" + urlp);\n\t\t\t\t\n\t\t\t\tSocket socket = new Socket(url.getHost(), PORT);\n\t\t\t\tPrintWriter writer = new PrintWriter(socket.getOutputStream());\n\t\t\t\tBufferedReader reader = \n\t\t\t\t\tnew BufferedReader(new InputStreamReader(socket.getInputStream()));\n\t\t\t\tString request = \"GET \" + url.getPath() + \" HTTP/1.1\\n\" +\n\t\t\t\t\t\t\t\t\"Host: \" + url.getHost() + \"\\n\" +\n\t\t\t\t\t\t\t\t\"Connection: close\\n\" + \n\t\t\t\t\t\t\t\t\"\\r\\n\";\n\t\t\t\twriter.println(request);\n\t\t\t\twriter.flush();\n\t\t\n\t\t\t\tString line = reader.readLine();\n\t\t\t\t// filter the head message of the response\n\t\t\t\twhile(line != null && line.length() != 0)\n\t\t\t\t{\n\t\t\t\t\tline = reader.readLine();\n\t\t\t\t}\n\t\t\t\t// keep the html context\n\t\t\t\twhile (line != null) \n\t\t\t\t{\n\t\t\t\t\tcontext += line + \"\\n\";\n\t\t\t\t\tline = reader.readLine();\n\t\t\t\t}\n\t\t\t\treader.close();\n\t\t\t\twriter.close();\n\t\t\t\tsocket.close();\n\t\t\t\t//log.debug(context);\n\t\t\t\tstripper = new TagStripper(context);\n\t\t\t\tlog.debug(\"Removing script and style from: \" + url.toString());\n\t\t\t\tstripper.removeComments();\n\t\t\t\tstripper.removeScript();\n\t\t\t\tstripper.removeStyle();\n\t\t\t\tlog.debug(\"Getting links from: \" + url.toString());\n\t\t\t\tArrayList<String> link = new ArrayList<String>();\n\t\t\t\tstripper.buildLinks(url.toString());\n\t\t\t\t\n\t\t\t\tlink = stripper.getLinks();\n\t\t\t\tfor(String tmp : link) {\n\t\t\t\t\tif(getCount() < pageNum ) {\n\t\t\t\t\t\t// find if the link has been already visited\n\t\t\t\t\t\tif(!urlList.contains(tmp)) {\n\t\t\t\t\t\t\tworkers.execute(new SingleHTMLFetcher(new URL(tmp), this.url.toString()));\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\tString title = stripper.getTitle();\n\t\t\t\tif(title == null)\n\t\t\t\t\ttitle = \"NO title\";\n\t\t\t\ttitle = title.replaceAll(\"&[^;]*;\", \"\");\n\t\t\t\tlog.debug(\"Removing tags from: \" + url.toString());\n\t\t\t\tstripper.removeTags();\n\t\t\t\tstripper.removeSymbol();\n\t\t\t\tString snippet = stripper.getSnippet(title);\n\t\t\t\tdb.savePageInfo(connection, title, snippet, url.toString());\n\t\t\t\tcontext = stripper.getContext();\n\t\t\t\tString[] words = context.toLowerCase().split(\"\\\\s\");\n\t\t\t\tArrayList<String> wordsList = new ArrayList<String>();\n\t\t\t\tfor (int i = 0; i < words.length; i++) {\n\t\t\t\t\t// delete non-word character\n\t\t\t\t\twords[i] = words[i].replaceAll(\"\\\\W\", \"\").replace(\"_\",\n\t\t\t\t\t\t\t\"\");\n\t\t\t\t\tif(words[i].length() != 0)\n\t\t\t\t\t\twordsList.add(words[i]);\n\t\t\t\t}\n\t\t\t\tfor (String w : wordsList) {\n\t\t\t\t\tif (w.length() != 0) {\n\t\t\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\t\t\tindex.addNum(w, url.toString(), num);\n\t\t\t\t\t\t\t\t} catch (InterruptedException e) {\n\t\t\t\t\t\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\t\t\t\t\t\te.printStackTrace();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\tnum++;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tlog.debug(\"URL: \" + url.toString() + \" is finished!\");\n\t\t\t\tdecrementPending();\n\t\t\t}catch(Exception ex) {\n\t\t\t\tex.printStackTrace();\n\t\t\t}\n\t\t}", "public static void main(String[] args) throws IOException {\n Deque<String> urlsToVisit = new ArrayDeque<String>();\n // Keep track of which URLs we have visited, so we don't get ourselves stuck in a loop.\n List<String> visitedUrls = new ArrayList<String>();\n // Keep track of how we got to each page, so that we can find our trace back to the BEGIN_URL.\n Hashtable<String, String> referrers = new Hashtable<String, String>();\n boolean pathFound = false;\n\n // Begin with the BEGIN_URL\n urlsToVisit.push(BEGIN_URL);\n\n while(!urlsToVisit.isEmpty() && !pathFound) {\n String currentUrl = urlsToVisit.pop();\n visitedUrls.add(currentUrl);\n\n Elements paragraphs = wf.fetchWikipedia(BASE_URL + currentUrl);\n List<String> pageUrls = new ArrayList<String>();\n\n for (Element p : paragraphs) {\n pageUrls.addAll(getLinksFromParagraph(p));\n }\n\n // Reverse the order of all page urls so that when we're done pushing all the URLS\n // to the stack, the first URL in the page will be the first URL in the current page.\n Collections.reverse(pageUrls);\n\n // Add all the URLs to the list of URLs to visit.\n for (String newUrl : pageUrls) {\n if(!visitedUrls.contains(newUrl)) {\n urlsToVisit.push(newUrl);\n // Record how we ended up at newUrl.\n referrers.put(newUrl, currentUrl);\n\n // Check if one of the links in this page is the END_URL; which means we'll be done!\n if (newUrl.equals(END_URL)) {\n pathFound = true;\n }\n }\n }\n }\n\n if (pathFound) {\n System.out.println(\"=================\");\n System.out.println(\"Path found!\");\n System.out.println(\"=================\");\n\n // Back trace how we ended up at END_URL.\n String backtraceUrl = END_URL;\n System.out.println(backtraceUrl);\n while(backtraceUrl != BEGIN_URL) {\n String referrerUrl = referrers.get(backtraceUrl);\n System.out.println(referrerUrl);\n backtraceUrl = referrerUrl;\n }\n } else {\n System.out.println(\"=================\");\n System.out.println(\"No path found :(\");\n System.out.println(\"=================\");\n }\n }", "@Override\n public void run() {\n int flagcount = 0;\n Map<String, Integer> setBackLinksCounter = new HashMap<>(0);\n Map<String, Integer[]> setPaDaCounter = new HashMap<>(0);\n try {\n for (String domainName : setDomains) {\n setBackLinksCounter.put(domainName.trim(), getBackLinksCount(domainName.trim()));\n setPaDaCounter.put(domainName.trim(), getPaDaCounts(domainName.trim()));\n }\n } catch (Exception ex) {\n l.debug(ex + \" \" + ex.getMessage());\n }\n\n Integer countBackLinks;\n Integer[] countPaDa;\n String domainName;\n Integer keywordId;\n List<Serpkeywords> lstKeywordsURL = new ArrayList<>();\n List<Seokeyworddetails> listUpdatedKeywords = new ArrayList<>();\n try {\n for (Serpkeywords objKeywords : lstKeywords) {\n boolean check = false;\n if (lstKeywordsURL.size() != 0) {\n // System.out.println(\"came to dis section\");\n for (Serpkeywords stringURL : lstKeywordsURL) {\n \n if (stringURL.getUrl().equalsIgnoreCase(objKeywords.getUrl())) {\n System.out.println(\"true\");\n check = true;\n }\n }\n }\n if (check == false) {\n lstKeywordsURL.add(objKeywords);\n }\n }\n } catch (Exception ex) {\n l.debug(ex + \" \" + ex.getMessage());\n }\n \n\n try {\n // for (Serpkeywords objKeywords : lstKeywords) {\n Seokeyworddetails objSeokeyworddetails=null;\n for (Serpkeywords objKeywords : lstKeywordsURL) {\n objSeokeyworddetails = new Seokeyworddetails();\n\n domainName = objKeywords.getUrl().trim();\n keywordId = objKeywords.getKeywordID();\n countBackLinks = setBackLinksCounter.get(domainName);\n countPaDa = setPaDaCounter.get(domainName);\n int pacount = countPaDa[0];\n int dacount = countPaDa[1];\n if (countPaDa[1] == -1) {\n dacount = getDAvalue(domainName);\n }\n System.out.println(\"keywordis:::: \" + keywordId);\n System.out.println(\"Domain:::::: \" + domainName);\n System.out.println(\"da:::: \" + dacount);\n System.out.println(\"pa:::: \" + pacount);\n System.out.println(\"Backlinks :: \" + countBackLinks);\n\n objSeokeyworddetails.setKeywordID(objKeywords);\n objSeokeyworddetails.setUrl(domainName);\n objSeokeyworddetails.setKeyword(objKeywords.getKeyword());\n objSeokeyworddetails.setCampaignID(objKeywords.getCampaignID());\n objSeokeyworddetails.setCountBackLinks(countBackLinks);\n objSeokeyworddetails.setGooglePA(pacount);\n objSeokeyworddetails.setGoogleDA(dacount);\n\n listUpdatedKeywords.add(objSeokeyworddetails);\n\n// objKeywordDao.saveBackLinksResult1(keywordId, domainName, objKeywords.getKeyword(), objKeywords.getCampaignID(), countBackLinks, startTrackId, endtrackId, objKeywords.getUrl());\n// objKeywordDao.savePaDaResult1(keywordId, domainName, objKeywords.getKeyword(), objKeywords.getCampaignID(), pacount, dacount, objKeywords.getUrl());\n }\n\n } catch (Exception ex) {\n l.debug(ex + \" \" + ex.getMessage());\n }\n\n try {\n\n for (Seokeyworddetails objUniqueURL : listUpdatedKeywords) {\n\n for (Serpkeywords objKeywords : lstKeywords) {\n if (objUniqueURL.getUrl().equals(objKeywords.getUrl())) {\n keywordId = objUniqueURL.getKeywordID().getKeywordID();\n objKeywordDao.saveBackLinksResult(objKeywords.getKeywordID(), objKeywords.getUrl(), objKeywords.getKeyword(), objKeywords.getCampaignID(), objUniqueURL.getCountBackLinks(), startTrackId, endtrackId);\n objKeywordDao.savePaDaResult(objKeywords.getKeywordID(), objKeywords.getUrl(), objKeywords.getKeyword(), objKeywords.getCampaignID(),objUniqueURL.getGooglePA() , objUniqueURL.getGoogleDA());\n\n }\n\n }\n }\n\n } catch (Exception ex) {\n l.debug(ex + \" \" + ex.getMessage());\n }\n\n }", "public int hash(String w){\n return (Math.abs(w.hashCode()) % hashTable.length);\n }", "private static List<PwPair> removeDuplicateSiteUrls(List<PwPair> allPwPairs) {\n List<PwPair> filteredPwPairs = new ArrayList<>();\n Set<String> siteUrls = new HashSet<>();\n for (PwPair pwPair : allPwPairs) {\n String siteUrl = pwPair.getPwsResult().getSiteUrl();\n if (!siteUrls.contains(siteUrl)) {\n siteUrls.add(siteUrl);\n filteredPwPairs.add(pwPair);\n }\n }\n return filteredPwPairs;\n }", "private static int initHash() {\n return 0x811c9DC5; // unsigned 2166136261\n }", "private void updateQueue(String url)\r\n\t{\r\n\t\tQueue temp = new Queue(SIZE);\r\n\t\tObject temp2 = ' ';\r\n\t\tObject target = ' ';\r\n\t\t\r\n\t\tfor (int i = 0; i < siteVisited; i++)\r\n\t\t{\r\n\t\t\ttemp2 = rChronological.dequeue();\r\n\t\t\tif (!url.equals(temp2))\r\n\t\t\t\ttemp.enqueue(temp2);\r\n\t\t\telse\r\n\t\t\t\ttarget = temp2;\r\n\t\t}\r\n\t\t\r\n\t\tfor (int i = 0; i < siteVisited - 1; i++)\r\n\t\t\trChronological.enqueue(temp.dequeue());\r\n\t\trChronological.enqueue(target);\r\n\t}", "@Bean\n public ConcurrentMap<Site, SiteRedirects> redirectsCache(@Autowired SitesService sitesService) {\n // Resizing ConcurrentHashMaps is rather expensive, so we start at least with the correct size.\n return new ConcurrentHashMap<>(sitesService.getSites().size());\n }", "public static LinkedHashSet<String> searchLinks(String searchUrl) {\n LinkedHashSet<String> uniqueLinks = new LinkedHashSet();\n Document doc;\n try {\n doc = Jsoup.connect(searchUrl).get();\n Elements links = doc.select(\"a\");\n for(Element url : links){\n if (validUrl(url.attr(\"href\"))) {\n uniqueLinks.add(url.attr(\"href\"));\n }\n }\n } catch (IOException e) {\n }\n return uniqueLinks;\n }", "public Map<String, Map<String, Boolean>> containExternalLinks(Map<String, List<String>> data) throws IOException\n {\n List<List<String>> pagelinks = wiki.getExternalLinksOnPage(new ArrayList<>(data.keySet()));\n int counter = 0;\n Map<String, Map<String, Boolean>> ret = new HashMap<>();\n for (Map.Entry<String, List<String>> entry : data.entrySet())\n { \n List<String> addedlinks = entry.getValue();\n List<String> currentlinks = pagelinks.get(counter);\n Map<String, Boolean> stillthere = new HashMap<>();\n for (int i = 0; i < addedlinks.size(); i++)\n {\n String url = addedlinks.get(i);\n stillthere.put(url, currentlinks.contains(url));\n }\n ret.put(entry.getKey(), stillthere);\n counter++;\n }\n return ret;\n }", "public static void main(String[] args) {\n\t\t\n\t\t/*MultiThreadedCrawler crawler = new MultiThreadedCrawler(\"https://cs.uic.edu\", \"uic.edu\", \"main\");\n\t\tcrawler.start();\n\t\tList<Map> p = new ArrayList<>();\n\t\tp.add(crawler.getResults());\n\t\t\n\t\ttry {\n\t\t\tGlobals.urlSet.add(new URL(\"https://disabilityresources.uic.edu\"));\n\t\t\tGlobals.urlSet.add(new URL(\"http://disabilityresources.uic.edu\"));\n\t\t\tGlobals.urlSet.add(new URL(\"http://cmhsrp.uic.edu/nrtc\")); \n\n\t\t} catch (MalformedURLException e1) {\n\t\t\t// TODO Auto-generated catch block\n\t\t\te1.printStackTrace();\n\t\t}\n\t\t\n\t\t\n\t\tMultiThreadedCrawler c1 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c1\");\n\t\tMultiThreadedCrawler c2 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c2\");\n\t\tMultiThreadedCrawler c3 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c3\");\n\t\tMultiThreadedCrawler c4 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c4\");\n\t\tMultiThreadedCrawler c5 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c5\");\n\t\tMultiThreadedCrawler c6 = new MultiThreadedCrawler(\"\", \"uic.edu\", \"c6\");\n\t\t//MultiThreadedCrawler c7 = new MultiThreadedCrawler(\"https://housing.uic.edu\", \"uic.edu\", \"housing\");\n\t\t//MultiThreadedCrawler c8 = new MultiThreadedCrawler(\"https://grad.uic.edu\", \"uic.edu\", \"grad\");\n\t\t//MultiThreadedCrawler c9 = new MultiThreadedCrawler(\"https://today.uic.edu\", \"uic.edu\", \"today\");\n\t\t\n\t\t\n\t\t\n\t\tList<Thread> crawlers = new ArrayList<>();\n\t\tcrawlers.add(new Thread(c1, \"c1\"));\n\t\tcrawlers.add(new Thread(c2, \"c2\"));\n\t\tcrawlers.add(new Thread(c3, \"c3\"));\n\t\tcrawlers.add(new Thread(c4, \"c4\"));\n\t\tcrawlers.add(new Thread(c5, \"c5\"));\n\t\tcrawlers.add(new Thread(c6, \"c6\"));\n\t\tcrawlers.add(new Thread(c7, \"housing\"));\n\t\tcrawlers.add(new Thread(c8, \"grad\"));\n\t\tcrawlers.add(new Thread(c9, \"today\"));\n\t\t\n\t\t\n\t\tfor(Thread t: crawlers) {\n\t\t\tt.start();\n\t\t}\n\t\t\n\t\tfor(Thread t: crawlers) {\n\t\t\ttry {\n\t\t\t\tt.join();\n\t\t\t}catch(InterruptedException e) {\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tp.add(c1.getResults());\n\t\tp.add(c2.getResults());\n\t\tp.add(c3.getResults());\n\t\tp.add(c4.getResults());\n\t\tp.add(c5.getResults());\n\t\tp.add(c6.getResults());\n\t\t//p.add(c7.getResults());\n\t\t//p.add(c8.getResults());\n\t\t//p.add(c9.getResults());\n\t\t\n\t\t\n\t\twhile(true) {\n\t\t\tfor(Map m: p) {\n\t\t\t\tif(m == null)\n\t\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\tSystem.out.println(\"All done\");\n\t\tmergeResults(p);\n\t\tUtil.updateDocVectLenMap();\n\t\tSystem.out.println(\"Total in collection: \" + Globals.pageDataMap.size());\n\t\tUtil.writeInvertedIndexTfMapAndMaxFreqMapToFile();*/\n\t\t\n\t\t\n\t\tUtil.loadDataFromFile();\n\t\tUtil.updateDocVectLenMap();\n\t\tSpringApplication.run(SearchApplication.class, args);\n\t}", "public static ArrayList<Map<String,String>> getContFromRssNoHtml(String urlAdress) {\n\n URL url = null;\n Iterator itEntries = null;\n try {\n //thetume ton browser Agent se browser-like gia na apofigume 403 errors\n System.setProperty(\"http.agent\", \"Mozilla/5.0 (Windows NT 10.0; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0\");\n url = new URL(urlAdress);\n HttpURLConnection httpcon = (HttpURLConnection) url.openConnection();\n httpcon.setRequestProperty(\"User-Agent\",\n \"Mozilla/5.0 (Windows NT 5.1; rv:19.0) Gecko/20100101 Firefox/19.0\");\n // Reading the feed\n SyndFeedInput input = new SyndFeedInput();\n SyndFeed feed = input.build(new XmlReader(httpcon));\n List entries = feed.getEntries();\n itEntries = entries.iterator();\n } catch (MalformedURLException e) {\n e.printStackTrace();\n } catch (FeedException e) {\n e.printStackTrace();\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n //contAr has all the entries\n ArrayList<Map<String,String>> contAr = new ArrayList<Map<String, String>>();\n\n //contMap has all the entries contents\n Map<String,String> contMap = new HashMap<String, String>();\n contMap.put(\"URI\",urlAdress);\n\n\n while (itEntries.hasNext()) {\n contMap = new HashMap<String, String>();\n SyndEntry entry = (SyndEntry) itEntries.next();\n System.out.println(entry.getUri());\n contMap.put(\"Title\",entry.getTitle());\n contMap.put(\"Link\",entry.getLink());\n contMap.put(\"Description\",entry.getDescription().getValue());\n\n contAr.add(contMap);\n System.out.println();\n }\n return contAr;\n }", "private static int computeHash(int par0)\n {\n par0 ^= par0 >>> 20 ^ par0 >>> 12;\n return par0 ^ par0 >>> 7 ^ par0 >>> 4;\n }", "private static Bundle m6379a(ShareContent shareContent, boolean z) {\n Bundle bundle = new Bundle();\n Utility.m5771a(bundle, \"LINK\", shareContent.getContentUrl());\n Utility.m5772a(bundle, \"PLACE\", shareContent.getPlaceId());\n Utility.m5772a(bundle, \"PAGE\", shareContent.getPageId());\n Utility.m5772a(bundle, \"REF\", shareContent.getRef());\n bundle.putBoolean(\"DATA_FAILURES_FATAL\", z);\n Collection peopleIds = shareContent.getPeopleIds();\n if (!Utility.m5786a(peopleIds)) {\n bundle.putStringArrayList(Sticker.FRIENDS_CAPABILITY, new ArrayList(peopleIds));\n }\n shareContent = shareContent.getShareHashtag();\n if (shareContent != null) {\n Utility.m5772a(bundle, \"HASHTAG\", shareContent.getHashtag());\n }\n return bundle;\n }", "WebCrawlerData retrieve(String url);", "public int addPageIndex(URL url, String urlHash, Date urlModified, int size, plasmaParserDocument document, plasmaCondenser condenser, String language, char doctype, int outlinksSame, int outlinksOther) {\n Iterator i = condenser.words();\r\n Map.Entry wentry;\r\n String word;\r\n indexRWIEntry ientry;\r\n plasmaCondenser.wordStatProp wprop;\r\n String wordHash;\r\n int urlLength = url.toString().length();\r\n int urlComps = htmlFilterContentScraper.urlComps(url.toString()).length;\r\n \r\n while (i.hasNext()) {\r\n wentry = (Map.Entry) i.next();\r\n word = (String) wentry.getKey();\r\n wprop = (plasmaCondenser.wordStatProp) wentry.getValue();\r\n // if ((s.length() > 4) && (c > 1)) System.out.println(\"# \" + s + \":\" + c);\r\n wordHash = plasmaURL.word2hash(word);\r\n ientry = newRWIEntry(urlHash,\r\n urlLength, urlComps, (document == null) ? urlLength : document.getMainLongTitle().length(),\r\n wprop.count,\r\n condenser.RESULT_SIMI_WORDS,\r\n condenser.RESULT_SIMI_SENTENCES,\r\n wprop.posInText,\r\n wprop.posInPhrase,\r\n wprop.numOfPhrase,\r\n 0,\r\n size,\r\n urlModified.getTime(),\r\n System.currentTimeMillis(),\r\n condenser.RESULT_WORD_ENTROPHY,\r\n language,\r\n doctype,\r\n outlinksSame, outlinksOther,\r\n true);\r\n addEntry(wordHash, ientry, System.currentTimeMillis(), false);\r\n }\r\n // System.out.println(\"DEBUG: plasmaSearch.addPageIndex: added \" +\r\n // condenser.getWords().size() + \" words, flushed \" + c + \" entries\");\r\n return condenser.RESULT_SIMI_WORDS;\r\n }", "public void reloadCache(DB db) {\n // LevelDB is great at scanning consecutive keys.\n // This take seconds even with 20m keys to add.\n log.info(\"Loading Bloom Filter\");\n DBIterator iterator = db.iterator();\n byte[] key = getKey(KeyType.OPENOUT_ALL);\n for (iterator.seek(key); iterator.hasNext(); iterator.next()) {\n ByteBuffer bbKey = ByteBuffer.wrap(iterator.peekNext().getKey());\n byte firstByte = bbKey.get(); // remove the KeyType.OPENOUT_ALL\n // byte.\n if (key[0] != firstByte) {\n printStat();\n return;\n }\n\n byte[] hash = new byte[32];\n bbKey.get(hash);\n add(hash);\n }\n try {\n iterator.close();\n } catch (IOException e) {\n log.error(\"Error closing iterator\", e);\n }\n printStat();\n }", "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 }", "public void map()\n\t{\n\t // key is the documentId\n\t\t// value is the url\n\t\t//fetch the document using the documentId\n\t\t\n\t}", "private int hash(String str, int h){\n int v=0;\n\n /* FILL IN HERE */\n v = Math.floorMod(MurmurHash.hash32(str, seeds[h]) >>> h, 1 << logNbOfBuckets);\n\n return v;\n }", "public static void main(String[] args) throws Exception{\n\t\tSystem.out.println(Check_Hash_URL(\"http://www.facebook.com\"));\n\t\tSystem.out.println(Check_Hash_URL(\"http://www.facebook.com/images\"));\n\t\tSystem.out.println(Check_Hash_URL(\"http://www.pornhub.com\"));\n\t\tSystem.out.println(Check_Hash_URL(\"abortbypill.com\"));\n\t\tSystem.out.println(Check_Hash_URL(\"http://www.facebook.com\"));\n\t\tSystem.out.println(Check_Hash_URL(\"http://www.facebook.com/images\"));\n\t\t//System.out.println(Check_Hash_URL(\"http://www.facebook.com\"));\n\t\t//CreateBlacklist();\n\t\t//Readfile(\"/home/qu/Desktop/arabic_pages\", con); //for text files\n\t\t//Readexcelfile(\"/home/qu/Desktop/arabic_pages\", con );\n\t\t// passing a file of blacklisted urls\n\t}", "public static void main(String[] args) throws FileNotFoundException, IOException {\n \n \n File textBank = new File(\"textbank/\");\n Hashtable<Integer,Integer> frequency;\n Hashtable<Integer, String> table;\n table = new Hashtable<>();\n frequency = new Hashtable<>();\n Scanner input = new Scanner(new File(\"stoplist.txt\"));\n int max=0;\n while (input.hasNext()) {\n String next;\n next = input.next();\n if(next.length()>max)\n max=next.length();\n table.put(next.hashCode(), next); //to set up the hashmap with the wordsd\n \n }\n \n System.out.println(max);\n \n Pattern p0=Pattern.compile(\"[\\\\,\\\\=\\\\{\\\\}\\\\\\\\\\\\\\\"\\\\_\\\\+\\\\*\\\\#\\\\<\\\\>\\\\!\\\\`\\\\-\\\\?\\\\'\\\\:\\\\;\\\\~\\\\^\\\\&\\\\%\\\\$\\\\(\\\\)\\\\]\\\\[]\") \n ,p1=Pattern.compile(\"[\\\\.\\\\,\\\\@\\\\d]+(?=(?:\\\\s+|$))\");\n \n \n \n wor = new ConcurrentSkipListMap<>();\n \n ConcurrentMap<String , Map<String,Integer>> wordToDoc = new ConcurrentMap<String, Map<String, Integer>>() {\n @Override\n public Map<String, Integer> putIfAbsent(String key, Map<String, Integer> value) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public boolean remove(Object key, Object value) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public boolean replace(String key, Map<String, Integer> oldValue, Map<String, Integer> newValue) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public Map<String, Integer> replace(String key, Map<String, Integer> value) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public int size() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public boolean isEmpty() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public boolean containsKey(Object key) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public boolean containsValue(Object value) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public Map<String, Integer> get(Object key) {\n return wor.get((String)key);//To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public Map<String, Integer> put(String key, Map<String, Integer> value) {\n wor.put(key, value); // this saving me n \n //if(frequency.get(key.hashCode())== null)\n \n //frequency.put(key.hashCode(), )\n return null;\n }\n\n @Override\n public Map<String, Integer> remove(Object key) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public void putAll(Map<? extends String, ? extends Map<String, Integer>> m) {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public void clear() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public Set<String> keySet() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public Collection<Map<String, Integer>> values() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n\n @Override\n public Set<Map.Entry<String, Map<String, Integer>>> entrySet() {\n throw new UnsupportedOperationException(\"Not supported yet.\"); //To change body of generated methods, choose Tools | Templates.\n }\n };\n totalFiles = textBank.listFiles().length;\n for (File textFile : textBank.listFiles()) {\n totalReadFiles++;\n //checking whether file has txt extension and file size is higher than 0\n if(textFile.getName().contains(\".txt\") && textFile.length() > 0){\n docName.add(textFile.getName().replace(\".txt\", \".stp\"));\n StopListHandler sp = new StopListHandler(textFile, table,System.currentTimeMillis(),p0,p1,wordToDoc);\n sp.setFinished(() -> {\n \n tmp++;\n \n if(tmp==counter)\n //printTable(counter);\n \n if(totalReadFiles == totalFiles)\n {\n printTable(counter);\n }\n \n });\n \n sp.start();\n counter ++;}\n \n \n }\n System.out.println(counter);\n //while(true){if(tmp==counter-1) break;}\n System.out.println(\"s\");\n \n }", "void hashLexicons(Email email) {\n for (String s : email.processedMessage.keySet()) {\n int tempCount = email.processedMessage.get(s);\n \n if(email.ec==EmailClass.ham)\n {\n totalNumberOfWordsInHamDocuments= totalNumberOfWordsInHamDocuments+tempCount;\n }\n else\n {\n totalNumberOfWordsInSpamDocuments = totalNumberOfWordsInSpamDocuments +tempCount;\n }\n //totalNumberOfWords = totalNumberOfWords + tempCount;\n if (words.containsKey(s)) {\n LexiconCount lc = words.get(s);\n long hc = lc.numberOfOccurencesInHamDocuments;\n long sc = lc.numberOfOccurencesInSpamDocuments;\n\n if (email.ec == EmailClass.ham) {\n hc = hc + tempCount;\n } else {\n sc = sc + tempCount;\n }\n words.put(s, new LexiconCount(hc, sc));\n } else {\n long hc=0,sc=0;\n if(email.ec==EmailClass.ham)\n {\n hc=tempCount;\n }\n else\n {\n sc=tempCount;\n }\n words.put(s, new LexiconCount(hc,sc));\n }\n }\n }", "protected void rehash() {\n int oldCapacity = table.length;\n Entry oldMap[] = table;\n\n int newCapacity = oldCapacity * 2 + 1;\n Entry newMap[] = new Entry[newCapacity];\n\n threshold = (int) (newCapacity * loadFactor);\n table = newMap;\n\n for (int i = oldCapacity; i-- > 0; ) {\n for (Entry old = oldMap[i]; old != null; ) {\n Entry e = old;\n old = old.next;\n\n int index = (e.key & 0x7FFFFFFF) % newCapacity;\n e.next = newMap[index];\n newMap[index] = e;\n }\n }\n }", "public void updateHashers() {\n\n\t\thasherClock++;\n\t\t// TODO -> GET DATA FROM POOL!\n\n\t\tString data = \"\";\n\t\tString pool_key = \"\";\n\t\tlong difficulty = 0;\n\t\tlong neededDL = 0;\n\t\tlong height = 0;\n\n\t\t// TODO->HARDFORK 80K\n\t\tboolean doMine = true;\n\t\tint hf_argon_t_cost = 1;\n\t\tint hf_argon_m_cost = 524288;\n\t\tint hf_argon_para = 1;\n\n\t\tString url = null;\n\t\ttry {\n\t\t\turl = getPool() + \"?q=info&worker=\" + URLEncoder.encode(getMinerName(), \"UTF-8\");\n\t\t\tif (hasherClock > 30 * 3) {\n\t\t\t\thasherClock = 0;\n\t\t\t\turl += \"&address=\" + ArionumMain.getAddress() + \"&hashrate=\" + getLastHashrate();\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\n\t\ttry {\n\t\t\tURL u = new URL(url);\n\t\t\tURLConnection uc = u.openConnection();\n\t\t\t@SuppressWarnings(\"resource\")\n\t\t\tString content = new Scanner(uc.getInputStream()).nextLine();\n\t\t\tJSONObject o = new JSONObject(content);\n\t\t\tJSONObject jsonData = (JSONObject) o.get(\"data\");\n\t\t\tString localData = (String) jsonData.get(\"block\");\n\t\t\tdata = localData;\n\t\t\tBigInteger localDifficulty = new BigInteger((String) jsonData.get(\"difficulty\"));\n\t\t\tdifficulty = localDifficulty.longValue();\n\t\t\tlong limitDL = Long.parseLong(jsonData.get(\"limit\").toString());\n\t\t\tneededDL = limitDL;\n\t\t\tlong localHeight = jsonData.getLong(\"height\");\n\t\t\theight = localHeight;\n\t\t\tString publicpoolkey = jsonData.getString(\"public_key\");\n\t\t\tpool_key = publicpoolkey;\n\n\t\t\tif (jsonData.getString(\"recommendation\") != null) {\n\t\t\t\tString recomm = jsonData.getString(\"recommendation\");\n\t\t\t\tif (!recomm.equals(\"mine\")) {\n\t\t\t\t\tdoMine = false;\n\t\t\t\t\tnotify(\"Waiting for MN-Block...\");\n\t\t\t\t}\n\t\t\t\tint argon_mem = jsonData.getInt(\"argon_mem\");\n\t\t\t\tint argon_threads = jsonData.getInt(\"argon_threads\");\n\t\t\t\tint argon_time = jsonData.getInt(\"argon_time\");\n\n\t\t\t\tif (doMine) {\n\t\t\t\t\tString type = \"CPU\";\n\t\t\t\t\tif (argon_mem < 500000)\n\t\t\t\t\t\ttype = \"GPU\";\n\n\t\t\t\t\tif (!lastType.equals(type)) {\n\t\t\t\t\t\tlastType = type;\n\t\t\t\t\t\tSystem.out.println(\"RESETING SCORE\");\n\t\t\t\t\t\thashTime.clear();\n\t\t\t\t\t}\n\n\t\t\t\t\tint hasherss = 0;\n\t\t\t\t\tfor (ArionumHasher hasher : hashers)\n\t\t\t\t\t\tif (!hasher.isSuspended() && hasher.isActive())\n\t\t\t\t\t\t\thasherss++;\n\t\t\t\t\tgetCurrentHashrate();\n\t\t\t\t\tnotify(\"Hashers:\" + hasherss + \" | Type:\" + type + \" | Hashrate: \" + getLastHashrate());\n\t\t\t\t}\n\n\t\t\t\thf_argon_m_cost = argon_mem;\n\t\t\t\thf_argon_para = argon_threads;\n\t\t\t\thf_argon_t_cost = argon_time;\n\t\t\t} else {\n\t\t\t\tnotify(\"Mining on outdated pool!\");\n\t\t\t}\n\n\t\t} catch (Exception e) {\n\t\t\t// TODO -> HANDLE FAILED URL RESPONSE\n\t\t\te.printStackTrace();\n\t\t\tif (System.currentTimeMillis() - lastnotice > 5000) {\n\t\t\t\tlastnotice = System.currentTimeMillis();\n\t\t\t\tnew Modal(\"Pool URL could not get resolved!\", \"The url you specified couldnt get resolved!\")\n\t\t\t\t\t\t.show(new Stage());\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\n\t\tArionumMiner.minDL = neededDL;\n\t\tArionumMiner.currentBlock = height;\n\n\t\tString type = \"CPU\";\n\t\tif (hf_argon_m_cost < 500000 && doMine)\n\t\t\ttype = \"GPU\";\n\n\t\tfor (final ArionumHasher hasher : hashers) {\n\t\t\thasher.updateHasher(data, pool_key, difficulty, neededDL, height, doMine, hf_argon_t_cost, hf_argon_m_cost,\n\t\t\t\t\thf_argon_para);\n\t\t\tif (!hasher.isInitiated()) {\n\t\t\t\tThread thread = new Thread(new Runnable() {\n\t\t\t\t\t@Override\n\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\thasher.initiate();\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\tthreadCollection.add(thread);\n\t\t\t\tthread.setDaemon(true);\n\t\t\t\tthread.setName(\"Arionum Hasher Thread\");\n\t\t\t\tthread.setPriority(10);\n\t\t\t\tthread.start();\n\t\t\t}\n\t\t}\n\n\t\t// TODO -> DISABLE HASHERS FOR GPU BLOCK TO MAKE 4THREADS FASTER\n\n\t\tint maxhashers = threads / hf_argon_para;\n\t\tif (maxhashers < 1)\n\t\t\tmaxhashers = 1;\n\n\t\tint active = 0;\n\t\tfor (final ArionumHasher hasher : hashers) {\n\t\t\tif (type.equalsIgnoreCase(\"GPU\")) {\n\t\t\t\tif (!hasher.isSuspended())\n\t\t\t\t\tactive++;\n\t\t\t\tif (active > maxhashers && !hasher.isSuspended()) {\n\t\t\t\t\tSystem.out.println(\"SUSPENING HASHER: \" + hasher);\n\t\t\t\t\thasher.setSuspended(true);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (hasher.isSuspended()) {\n\t\t\t\t\thasher.setSuspended(false);\n\t\t\t\t\tThread thread = new Thread(new Runnable() {\n\t\t\t\t\t\t@Override\n\t\t\t\t\t\tpublic void run() {\n\t\t\t\t\t\t\thasher.initiate();\n\t\t\t\t\t\t}\n\t\t\t\t\t});\n\t\t\t\t\tthreadCollection.add(thread);\n\t\t\t\t\tthread.setDaemon(true);\n\t\t\t\t\tthread.setName(\"Arionum Hasher Thread\");\n\t\t\t\t\tthread.setPriority(10);\n\t\t\t\t\tthread.start();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private HashMap<String, ArrayList<String>> loadNeighbourCache(String fileName, int n) {\n System.out.println(\"Loading Similar word Cache...\");\n long start = System.currentTimeMillis();\n Tokenizer tkn = new SimpleTokenizer();\n HashMap<String, ArrayList<String>> cache = new HashMap<>();\n String line;\n try (BufferedReader in = new BufferedReader(new FileReader(fileName))) {\n while ((line = in.readLine()) != null) {\n tkn.tokenize(line, \"[a-zA-Z]{3,}\", false, true);\n for (SimpleTokenizer.Token token : tkn.getTokens()) {\n String word = token.getSequence();\n if (!cache.containsKey(word)) {\n cache.put(word, new ArrayList<>());\n for (String similarWord : vec.wordsNearest(word, n)) {\n cache.get(word).add(similarWord);\n }\n }\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n\n System.out.println(\"Similar Word Cache Loaded.\");\n System.out.println(\"Elapsed time: \" + (System.currentTimeMillis() - start) / 1000.0 + \" s \\n\");\n\n return cache;\n }", "public interface Crawler {\n int size();\n boolean visited(String link);\n void addNewLinkToSitemap(String link);\n void addToChildSitemap(String parent, String child);\n void addVisited(String s, Integer depth);\n void startCrawling(String requestid, String link, int maxDepth);\n ForkJoinPool getMainPool();\n Map<String, Collection<String>> getSiteMap();\n}", "protected void rehash() {\n // TODO: fill this in.\n //double number of maps, k, each time it is called\n\t\t//use MyBetterMap.makeMaps and MyLinearMap.getEntries\n\t\t//collect entries in the table, resize the table, then put the entries back in\n\t\tList<MyLinearMap<K, V>> newmaps = MyBetterMap.makeMaps(maps.size()*2);\n\t\tfor(MyLinearMap<K, V> curr: this.maps) {\n\t\t\tfor(Entry ent: MyLinearMap.getEntries()) {\n\t\t\t\tnewmaps.put(ent.key, ent.value);\n\t\t\t}\n\t\t}\n\t\tthis.maps = newmaps;\n\t\treturn;\n\t}", "public void testShouldCacheProperPages(DefinableArchivalUnit au, \n String peerjSite, String baseConstant) throws Exception {\n daemon.getLockssRepository(au);\n daemon.getNodeManager(au);\n BaseCachedUrlSet cus = new BaseCachedUrlSet(au,\n new RangeCachedUrlSetSpec(BASE_URL));\n // permission page\n shouldCacheTest(BASE_URL + \"lockss.txt\", true, au, cus); \n // volume page - https://peerj.com/archives/?year=2013\n // volume page - https://peerj.com/archives-preprints/?year=2013\n shouldCacheTest(BASE_URL + peerjSite + \"/?year=2013\", true, au, cus); \n // issue toc - https://peerj.com/articles/index.html?month=2013-09\n shouldCacheTest(BASE_URL + baseConstant + \"/index.html?month=2013-09\", \n true, au, cus);\n // article from Archives (main) site - https://peerj.com/articles/55/\n // other files: .bib, .pdf, .ris, .xml, .rdf, .json, .unixref, /reviews\n // article from Preprints site - https://peerj.com/preprints/55/\n // other files: .bib, .pdf, .ris, .xml, .rdf, .json\n shouldCacheTest(BASE_URL + baseConstant + \"/55/\", true, au, cus);\n shouldCacheTest(BASE_URL + baseConstant + \"/55.bib\", true, au, cus);\n shouldCacheTest(BASE_URL + baseConstant + \"/55.pdf\", true, au, cus);\n shouldCacheTest(BASE_URL + baseConstant + \"/55.ris\", true, au, cus);\n shouldCacheTest(BASE_URL + baseConstant + \"/55.xml\", true, au, cus);\n shouldCacheTest(BASE_URL + baseConstant + \"/55.html\", true, au, cus);\n shouldCacheTest(BASE_URL + baseConstant + \"/55.rdf\", true, au, cus);\n shouldCacheTest(BASE_URL + baseConstant + \"/55.json\", true, au, cus);\n // not exists on Preprints site\n if (baseConstant == \"archives\") {\n shouldCacheTest(BASE_URL + baseConstant + \"/55.unixref\", true, au, cus);\n shouldCacheTest(BASE_URL + baseConstant + \"/55/reviews/\", true, au, cus);\n }\n // images figures and tables can live here\n // https://dfzljdn9uc3pi.cloudfront.net/2013/55/1/fig-1-2x.jpg\n // https://dfzljdn9uc3pi.cloudfront.net/2013/55/1/fig-1-full.png\n // https://d3amtssd1tejdt.cloudfront.net/2013/21/1/figure1.png\n // https://d2pdyyx74uypu5.cloudfront.net/2013/22/2/figure2.jpg\n shouldCacheTest(\"https://dfzljdn9uc3pi.cloudfront.net\"\n \t\t + \"/2013/55/1/fig-1-2x.jpg\", true, au, cus); \n shouldCacheTest(\"https://dfzljdn9uc3pi.cloudfront.net\"\n + \"/2013/55/1/fig-1-full.png\", true, au, cus); \n shouldCacheTest(\"https://d3amtssd1tejdt.cloudfront.net\"\n + \"/2013/21/1/figure1.png\", true, au, cus);\n shouldCacheTest(\"https://d2pdyyx74uypu5.cloudfront.net\"\n + \"/2013/22/2/figure2.jpg\", true, au, cus); \n // missing peerj site string - should not get crawled\n shouldCacheTest(BASE_URL + \"?year=2012\", false, au, cus); \n // LOCKSS\n shouldCacheTest(\"http://lockss.stanford.edu\", false, au, cus);\n }", "@Override\n\tpublic int hashCode()\n\t{\n\t\t// This is really simple, but it works... and prevents a deep hash\n\t\treturn nodeList.size() + edgeList.size() * 23;\n\t}", "@Override\r\n\tpublic int hashCode() {\n\t\tint result=1,prime=31;\r\n\t\tresult = result * prime + tableName.hashCode();\r\n\t\tresult = result * prime + databaseName.hashCode();\r\n\t\tresult = result * prime + limit;\r\n\t\tresult = result * prime + offset;\r\n\t\tresult = result * prime + queryCondition.hashCode();\r\n\t\treturn result;\r\n\t}", "public Set<Website> getAllWebsite() throws StorageException{\n\t\tSet<Map<String, String>> results = storage.get(\"websites\", \" 1=1\");\n\t\tSet<Website> data = new LinkedHashSet<>();\n\t\t\n\t\tfor(Map<String, String> element: results){\n\t\t\tdata.add(new Website(element));\n\t\t}\n\t\t\n\t\treturn data;\n\t\t\n\t}", "public static void main(String[] args) {\n CustomHashCode customHashCode=new CustomHashCode();\r\n Byte byte1=new Byte((byte) 12);\r\n String str=customHashCode.getHashCode(\"adfasdk\");\r\n System.out.println(str);\r\n List<Integer> list=new LinkedList<>();\r\n java.util.Collections.synchronizedList(list);\r\n \r\n \r\n\t}", "private void rehash()\n {\n int hTmp = 37;\n\n if ( isHR != null )\n {\n hTmp = hTmp * 17 + isHR.hashCode();\n }\n\n if ( id != null )\n {\n hTmp = hTmp * 17 + id.hashCode();\n }\n\n if ( attributeType != null )\n {\n hTmp = hTmp * 17 + attributeType.hashCode();\n }\n \n h = hTmp;\n }", "private void searchNext(CrawlingSession executor, Link link) {\n HTMLLinkExtractor htmlLinkExtractor = HTMLLinkExtractor.getInstance();\n// htmlLinkExtractor.setWorking(link);\n \n Source source = CrawlingSources.getInstance().getSource(link.getSourceFullName());\n if(source == null) return;\n \n SessionStore store = SessionStores.getStore(source.getCodeName());\n if(store == null) return;\n\n List<Link> collection = htmlLinkExtractor.getLinks(link, /*link.getSource(),*/ pagePaths);\n// List<Link> collection = htmlLinkExtractor.getLinks(srResource);\n List<Link> nextLinks = createNextLink(link, collection);\n if(nextLinks.size() < 1) return;\n if(userPaths == null && contentPaths == null) {\n executor.addElement(nextLinks, link.getSourceFullName());\n return;\n }\n \n \n if(nextLinks.size() < 2) {\n executor.addElement(nextLinks, link.getSourceFullName());\n }\n \n// long start = System.currentTimeMillis();\n \n int [] posts = new int[nextLinks.size()];\n for(int i = 0; i < nextLinks.size(); i++) {\n try {\n posts[i] = PageDownloadedTracker.searchCode(nextLinks.get(i), true);\n } catch (Throwable e) {\n posts[i] = -1;\n LogService.getInstance().setThrowable(link.getSourceFullName(), e);\n// executor.abortSession();\n// return;\n }\n }\n \n int max = 1;\n for(int i = 0; i < posts.length; i++) {\n if(posts[i] > max) max = posts[i];\n }\n \n// System.out.println(\" thay max post la \"+ max);\n \n List<Link> updateLinks = new ArrayList<Link>();\n for(int i = 0; i < posts.length; i++) {\n if(posts[i] >= max) continue;\n updateLinks.add(nextLinks.get(i));\n }\n \n// long end = System.currentTimeMillis();\n// System.out.println(\"step. 4 \"+ link.getUrl()+ \" xu ly cai ni mat \" + (end - start));\n \n executor.addElement(updateLinks, link.getSourceFullName());\n \n /*int minPost = -1;\n Link minLink = null;\n List<Link> updateLinks = new ArrayList<Link>();\n for(int i = 0; i < nextLinks.size(); i++) {\n Link ele = nextLinks.get(i);\n int post = 0;\n try {\n post = PostForumTrackerService2.getInstance().read(ele.getAddressCode());\n } catch (Exception e) {\n LogService.getInstance().setThrowable(link.getSource(), e);\n }\n if(post < 1) {\n updateLinks.add(ele);\n continue;\n } \n\n if(minPost < 0 || post < minPost){\n minLink = ele;\n minPost = post; \n } \n }\n\n if(minLink != null) updateLinks.add(minLink);\n executor.addElement(updateLinks, link.getSource());*/\n }", "@org.junit.Test\n public void put() throws Exception {\n for (int i = 0; i < 2_000_000; i++) {\n hashTable.put(Integer.toString(i), Integer.toString(i));\n }\n\n for (int i = 0; i < 2_000_000; i++) {\n assertEquals(true, hashTable.contains(Integer.toString(i)));\n }\n}", "public ConcurrentHashMap<Long, NativeDownloadModel> mo45197b() {\n ConcurrentHashMap<Long, NativeDownloadModel> concurrentHashMap = new ConcurrentHashMap<>();\n try {\n for (Map.Entry<String, ?> entry : m41930c().getAll().entrySet()) {\n try {\n long longValue = Long.valueOf(entry.getKey()).longValue();\n NativeDownloadModel b = NativeDownloadModel.m41805b(new JSONObject((String) entry.getValue()));\n if (longValue > 0 && b != null) {\n concurrentHashMap.put(Long.valueOf(longValue), b);\n }\n } catch (Exception e) {\n e.printStackTrace();\n }\n }\n } catch (Exception e2) {\n e2.printStackTrace();\n }\n return concurrentHashMap;\n }", "private void getTweetsMostCommonHashTag() {\r\n final List<Entry<String, Integer>> list = \r\n getCommonList(countHashtags, countHashtags.size());\r\n list.stream()\r\n .filter(entry -> !searched.contains(entry.getKey().toLowerCase()))\r\n .limit(1)\r\n .forEach(entry -> getTweets(entry.getKey(), geocode, getAuth()));\r\n }", "public int hashCode()\r\n/* 448: */ {\r\n/* 449:610 */ return this.headers.hashCode();\r\n/* 450: */ }", "public void crawlAndIndex(String url) throws Exception {\r\n\t\t// TODO : Add code here\r\n\t\tQueue<String> queue=new LinkedList<>();\r\n\t\tqueue.add(url);\r\n\t\twhile (!queue.isEmpty()){\r\n\t\t\tString currentUrl=queue.poll();\r\n\t\t\tif(internet.getVisited(currentUrl)){\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\tArrayList<String> urls = parser.getLinks(currentUrl);\r\n\t\t\tArrayList<String> contents = parser.getContent(currentUrl);\r\n\t\t\tupdateWordIndex(contents,currentUrl);\r\n\t\t\tinternet.addVertex(currentUrl);\r\n\t\t\tinternet.setVisited(currentUrl,true);\r\n\t\t\tfor(String u:urls){\r\n\t\t\t\tinternet.addVertex(u);\r\n\t\t\t\tinternet.addEdge(currentUrl,u);\r\n\t\t\t\tqueue.add(u);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t}", "public static void Hash_Blacklist(File directory, File directory1){\n\t\tfor (final File file : directory.listFiles()) {\n\t\t\tDomain_Doc_Array.add(file.getPath());\n\t\t}\n\t\t//File directory1 = new File(\"Blacklist/URL\");\n\t\tfor (final File file1 : directory1.listFiles()) {\n\t\t\tURL_Doc_Array.add(file1.getPath());\n\t\t}\n\t\ttry{\n\n\t\t\tfor (int docno = 0; docno <URL_Doc_Array.size(); docno++ ){\n\t\t\t\tBufferedReader br = new BufferedReader(new FileReader(URL_Doc_Array.get(docno)));\n\t\t\t\tString line;\n\t\t\t\twhile ((line = br.readLine()) != null){\n\n\t\t\t\t\tBlacklist_Domain.put(line, 0);\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\ttry{\n\n\t\t\tfor (int docno = 0; docno <Domain_Doc_Array.size(); docno++ ){\n\t\t\t\tBufferedReader br = new BufferedReader(new FileReader(Domain_Doc_Array.get(docno)));\n\t\t\t\tString line;\n\t\t\t\twhile ((line = br.readLine()) != null){\n\n\t\t\t\t\tBlacklist_URL.put(line, 0);\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\n\t\n\t}", "public static List<UrlInfo> searchAllUrl() {\n\n //getSynonyms(queryKeywords);\n\n ArrayList<Long> keywordIdList = new ArrayList<Long>();\n ArrayList<Long> finalIdList = new ArrayList<Long>();\n\n String email = Secured.getUser(ctx());\n List<UrlEntry> entryIdList = UrlEntry.find()\n .select(\"entryId\")\n .where()\n .eq(\"email\", email)\n .findList();\n for (UrlEntry entry : entryIdList) {\n finalIdList.add(entry.getEntryId());\n }\n System.out.println(\"finalIdList---\" + finalIdList);\n List<UrlInfo> urlList = UrlInfo.find().select(\"url\").where().in(\"urlEntryId\", finalIdList).findList();\n /*ArrayList<String> urls = new ArrayList<String>();\n for (UrlInfo urlInfo : urlList) {\n urls.add(urlInfo.getUrl());\n }\n System.out.println(\"urls in search----\" + urls);*/\n return urlList;\n }", "private Bitmap getCechaFromUrl(String url) {\n\t\treturn mLruCache.get(url);\r\n\t}", "long getCacheHits();", "private void addBitmapToCache(String url, Bitmap bitmap) {\n if (bitmap != null) {\n synchronized (sHardBitmapCache) {\n sHardBitmapCache.put(url, bitmap);\n }\n }\n }", "private static void LessonHash() {\n\n System.out.println(\"---Hash Table---\");\n\n Hashtable<Integer, String> oopPrinciples = new Hashtable<>();\n oopPrinciples.put(1, \"Inheritance\");\n oopPrinciples.put(2, \"Polymorphism\");\n oopPrinciples.put(3, \"Abstraction\");\n oopPrinciples.put(4, \"Encapsulation\");\n //oopPrinciples.put(5, null); // throws null pointer execption\n\n //Single output from hashtable\n System.out.println(oopPrinciples.get(3));\n\n //All values\n for(Integer key : oopPrinciples.keySet()) {\n System.out.println(oopPrinciples.get(key));\n };\n System.out.println(\"----------------\");\n\n // Key-Value Pairs / Value List\n /*\n Hash Map\n 1.) Does allow null for either key or value\n 2.) unsynchronized, not thread safe, but performance is better\n */\n\n System.out.println(\"---Hash Map---\");\n\n HashMap<Integer, String> oopPrinciples2 = new HashMap<>();\n oopPrinciples2.put(1, \"Inheritance\");\n oopPrinciples2.put(2, \"Polymorphism\");\n oopPrinciples2.put(3, \"Abstraction\");\n oopPrinciples2.put(4, \"Encapsulation\");\n oopPrinciples2.put(5, null);\n\n //Single output from hashtable\n System.out.println(oopPrinciples2.get(3));\n\n //All values\n for(Integer key : oopPrinciples.keySet()) {\n System.out.println(oopPrinciples.get(key));\n };\n System.out.println(\"----------------\");\n\n // Key-Value Pairs / Value List\n /*\n Hash Set\n 1.) Built in mechanism for duplicates\n 2.) used for when you wanna maintain unique list\n */\n\n System.out.println(\"---Hash Set---\");\n\n HashSet<String> oopPrinciples3 = new HashSet<>();\n oopPrinciples3.add(\"Inheritance\");\n oopPrinciples3.add(\"Polymorphism\");\n oopPrinciples3.add(\"Abstraction\");\n oopPrinciples3.add(\"Encapsulation\");\n\n //Single output from hashtable\n System.out.println(oopPrinciples3);\n\n //All values\n for(String s : oopPrinciples3) {\n System.out.println(s);\n }\n\n if(oopPrinciples.contains(\"Inheritance\")) {\n System.out.println(\"Value does exist!\");\n } else {\n System.out.println(\"Value does not exist!\");\n }\n\n System.out.println(\"----------------\");\n }" ]
[ "0.58376163", "0.58290935", "0.57803565", "0.5574668", "0.5554355", "0.55396163", "0.5481212", "0.5473345", "0.5426008", "0.5416189", "0.5410145", "0.53729856", "0.53626084", "0.53122365", "0.52803934", "0.5271617", "0.52569085", "0.5241415", "0.5240086", "0.5230616", "0.5226584", "0.5218594", "0.5212141", "0.5206157", "0.52035165", "0.51906854", "0.51639295", "0.513996", "0.513996", "0.5135403", "0.5134309", "0.5129001", "0.51259714", "0.5122214", "0.5118311", "0.5102356", "0.51017845", "0.509582", "0.50895333", "0.506796", "0.5056071", "0.5045012", "0.50439197", "0.50353855", "0.503314", "0.5025037", "0.5010123", "0.5007376", "0.5005579", "0.50038826", "0.50032544", "0.50007665", "0.49900106", "0.49769685", "0.49748594", "0.49704516", "0.496841", "0.49683544", "0.49652904", "0.4964235", "0.49621832", "0.49591556", "0.49569538", "0.49480563", "0.4947446", "0.4940778", "0.49288696", "0.49269927", "0.4925584", "0.4921052", "0.49207157", "0.49134108", "0.49134007", "0.49085358", "0.49041688", "0.48991126", "0.48942733", "0.48916635", "0.4888011", "0.48844647", "0.48836374", "0.4875502", "0.48617265", "0.48558354", "0.4844071", "0.48243856", "0.48232752", "0.48204693", "0.48197034", "0.48176485", "0.48158455", "0.48109293", "0.48049325", "0.47998914", "0.4799793", "0.4787961", "0.4783439", "0.4773342", "0.47647387", "0.47603947", "0.47543368" ]
0.0
-1
Este medoto se utiliza para obtener el la ruta del directorio raiz de la aplicion
public ViewHolder(@NonNull View itemView) { super(itemView); txvNombreMascotaDesparasitante = itemView.findViewById(R.id.txvNombreMascotaDesparasitante); txvNombreDesparasitante = itemView.findViewById(R.id.txvNombreDesparasitante); txvPesoDesparasitante = itemView.findViewById(R.id.txvPesoDesparasitante); txvFechaAplicacionDesparasitante = itemView.findViewById(R.id.txvFechaAplicacionDesparasitante); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "String getDir();", "private static String getRioHomeDirectory() {\n String rioHome = RioHome.get();\n if(!rioHome.endsWith(File.separator))\n rioHome = rioHome+File.separator;\n return rioHome;\n }", "public String pathToSave() {\n String path;\n File folder;\n do {\n System.out.print(\"Introduce la ruta en la que quieres guardar el fichero(separando directorios por guiones: directorio1-directorio2-directorio3): \");\n path = Utils.getString();\n path = String.valueOf(System.getProperty(\"user.dir\")).substring(0, 2) + \"\\\\\" + path.replace('-', '\\\\');\n folder = new File(path);\n if (!folder.exists()) {\n System.out.println(\"El directorio introducido no existe intentalo de nuevo...\");\n } else {\n if (!folder.isDirectory()) {\n System.out.println(\"Eso no es un directorio intentalo de nuevo...\");\n }\n }\n } while (!folder.exists() && !folder.isDirectory());\n return path;\n }", "private static String returnDiretorioPai(Path a){\n return a.getParent().toString();\n }", "public String getDir();", "public static String getPath() {\n\t\t// Lấy đường dẫn link\n\t\tAuthentication auth1 = SecurityContextHolder.getContext().getAuthentication();\n\t\tAgentconnection cus = (Agentconnection) auth1.getPrincipal();\n\t\t \n\t\t//String PATH_STRING_REAL = fileStorageProperties.getUploadDir()+cus.getMerchant()+\"/hotel/images/\" + year + \"/\" + month + \"/\" ;\n\t String PATH_STRING_REAL = \"E:/ezcloud/upload/\"+cus.getMerchant()+\"/hotel/images/\" + year + \"/\" + month + \"/\" ;\n\t return PATH_STRING_REAL;\n\t}", "FsPath baseDir();", "java.io.File getBaseDir();", "private String getAbsoluteFilesPath() {\n\n //sdcard/Android/data/cucumber.cukeulator\n //File directory = getTargetContext().getExternalFilesDir(null);\n //return new File(directory,\"reports\").getAbsolutePath();\n return null;\n }", "public static String getImageResoucesPath() {\n\t\t//return \"d:\\\\PBC\\\\GitHub\\\\Theia\\\\portal\\\\WebContent\\\\images\";\n\t\treturn \"/Users/anaswhb/Documents/Eclipse/Workspace/portal/WebContent/images\";\n\t\t\n\t}", "Object getDir();", "public String getWorkDirectory(){\n String wd = \"\";\n try {\n wd = new File(\"test.txt\").getCanonicalPath().replace(\"/test.txt\",\"\");\n } catch (IOException e) {\n e.printStackTrace();\n }\n return wd;\n }", "static File getAppDir(String app) {\n return Minecraft.a(app);\n }", "String folderPath();", "String rootPath();", "public abstract String getFullPath();", "abstract public String getRingResourcesDir();", "abstract public String getDataResourcesDir();", "public void creaRutaImgPerfil(){\n servletContext=(ServletContext) contexto.getExternalContext().getContext();\n String ruta=\"\";\n //Ruta real hasta la carpeta de uploads\n ruta=servletContext.getRealPath(\"/upload/\");\n \n //Concatenamiento de directorios internos\n ruta+=File.separatorChar+\"img\"+File.separatorChar+\"users\"+File.separatorChar;\n \n //Asignacion de la ruta creada\n this.rutaImgPerfil=ruta;\n }", "abstract public String getImageResourcesDir();", "public static String getRootPath(Activity activity) {\n String path;\n if (android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {\n path = activity.getExternalFilesDir(null).getAbsolutePath()\n + File.separator + \"Autonomes Fahrzeug\" + File.separator;\n } else {\n path = Environment.getExternalStorageDirectory() + File.separator\n + \"Autonomes Fahrzeug\" + File.separator;\n }\n return path;\n }", "String getDirectoryPath();", "abstract public String getTopResourcesDir();", "abstract File getResourceDirectory();", "Path getBaseInputDir();", "private synchronized Directory getDirectoryEmDisco() throws IOException{\r\n\t\tif(diretorioEmDisco == null){\r\n\t\t\tdiretorioEmDisco = FSDirectory.open(pastaDoIndice);\r\n\t\t}\r\n\t\t\r\n\t\treturn diretorioEmDisco;\r\n\t}", "String getPath();", "String getPath();", "String getPath();", "String getPath();", "String getPath();", "String getFilepath();", "private String downloadFolder(){\n\t\tFile home = new File(System.getProperty(\"user.home\"));\n\t\tFile folder = new File (home,\"Downloads/PaluDownloads\");\n\t\tif (!folder.exists()){\n\t\t\tfolder.mkdir();\n\t\t}\n\t\treturn folder.getAbsolutePath();\n\t}", "public String getRelativePath();", "public Path getDataDirectory();", "public String getLocationPath();", "public void crearRutaImgPublicacion(){\n \n servletContext=(ServletContext) contexto.getExternalContext().getContext();\n String ruta=\"\";\n //Ruta real hasta la carpeta uploads\n ruta=servletContext.getRealPath(\"/upload/\");\n //Obtener el codigo del usuario de la sesion actual\n //este es utilizado para ubicar la carpeta que le eprtenece\n String codUsuario=String.valueOf(new SessionLogica().obtenerUsuarioSession().getCodUsuario());\n //Concatenamiento de directorios internos\n ruta+=File.separatorChar+\"img\"+File.separatorChar+\"post\"+File.separatorChar+codUsuario+File.separatorChar+\"all\"+File.separatorChar;\n //Asignacion de la ruta creada\n this.rutaImgPublicacion=ruta;\n }", "private static void findPath()\r\n {\r\n String temp_path = System.getProperty(\"user.dir\");\r\n char last = temp_path.charAt(temp_path.length() - 1);\r\n if(last == 'g')\r\n {\r\n path = \".\";\r\n }\r\n else\r\n {\r\n path = \"./bag\";\r\n }\r\n \r\n }", "public abstract String direcao();", "java.lang.String getDirName();", "public Path getRepositoryBaseDir();", "Path getMainCatalogueFilePath();", "private String getDicDir() {\n\t\tString wDir = null;\n\n\t\tif (System.getProperties().containsKey(\"root\")) {\n\t\t\twDir = System.getProperty(\"root\");\n\t\t}\n\n\t\tif ((wDir == null || wDir.isEmpty()) && CPlatform.isMacOs())\n\t\t\twDir = new File(CPlatform.getUserHome(), \"Library/Spelling\")\n\t\t\t\t\t.getAbsolutePath();\n\n\t\tif (wDir == null || wDir.isEmpty())\n\t\t\twDir = \"/home/ff/projects/hunspell\";\n\t\treturn wDir;\n\t}", "private String getConfigurationDirectory() throws UnsupportedEncodingException {\r\n\r\n String folder;\r\n if (ISphereJobLogExplorerPlugin.getDefault() != null) {\r\n // Executed, when started from a plug-in.\r\n folder = ISphereJobLogExplorerPlugin.getDefault().getStateLocation().toFile().getAbsolutePath() + File.separator + REPOSITORY_LOCATION\r\n + File.separator;\r\n FileHelper.ensureDirectory(folder);\r\n } else {\r\n // Executed, when started on a command line.\r\n URL url = getClass().getResource(DEFAULT_CONFIGURATION_FILE);\r\n if (url == null) {\r\n return null;\r\n }\r\n String resource = URLDecoder.decode(url.getFile(), \"utf-8\"); //$NON-NLS-1$\r\n folder = new File(resource).getParent() + File.separator;\r\n }\r\n return folder;\r\n }", "public String resolvePath();", "private static boolean esDirectorio(String ruta) {\n\t\tboolean b = false;\n\t\tFile f = new File(ruta);\n\t\tif (f.isDirectory()) {\n\t\t\tb = true;\n\t\t}\n\t\treturn b;\n\t}", "private String getFullPath()\n\t{\n\t\tif (libraryName.equals(\"\"))\n\t\t{\n\t\t\treturn fileName;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn libraryName + \"/\" + fileName;\n\t\t}\n\t}", "public String getRelPath () throws java.io.IOException, com.linar.jintegra.AutomationException;", "private String relativize(String p) {\n return Paths.get(\"\").toAbsolutePath().relativize(Paths.get(p).toAbsolutePath()).toString();\n }", "Path getRootPath();", "public static Path locateResourcesDir(ServiceContext context) {\n if (context.getServlet() != null) {\n return locateResourcesDir(context.getServlet().getServletContext(), context.getApplicationContext());\n }\n\n return context.getBean(GeonetworkDataDirectory.class).getResourcesDir();\n }", "private String getDirTempDruida()\n\t\t\tthrows Exception\n {\t\t\t\t\n\t\t\tString dir = null;\n\t\t\tdir = Contexto.getPropiedad(\"TMP.UPLOAD\");\t\t\n\t\t\treturn dir;\n }", "private String setFileDestinationPath(){\n String filePathEnvironment = Environment.getExternalStorageDirectory().getAbsolutePath();\n Log.d(TAG, \"Full path edited \" + filePathEnvironment + \"/earwormfix/\" + generatedFilename + EXTENSION_JPG);\n return filePathEnvironment+ \"/earwormfix/\" + generatedFilename + EXTENSION_JPG;\n }", "public ResourcePath() {\n //_externalFolder = \"file:///C:/Program%20Files/ESRI/GPT9/gpt/\";\n //_localFolder = \"gpt/\";\n}", "public String getNabtoResourceDirectory() {\n return nabtoResourceDirectory.getAbsolutePath();\n }", "protected static String getObjectDirPath(URI resource) {\n String ret = getObjectPath(resource);\n return ret.substring(0, ret.lastIndexOf('/') + 1);\n }", "public String getPath();", "public String getPath();", "public String getPath();", "public static String getBaseDir() {\r\n Path currentRelativePath = Paths.get(System.getProperty(\"user.dir\"));\r\n return currentRelativePath.toAbsolutePath().toString();\r\n }", "@Override\r\n\t\tpublic String getDir()\r\n\t\t\t{\n\t\t\t\treturn null;\r\n\t\t\t}", "String basePath();", "public abstract String getPath();", "public abstract String getPath();", "@Override\r\n\tpublic String getRootDir() {\t\t\r\n\t\treturn Global.USERROOTDIR;\r\n\t}", "public String getResourcePath();", "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 String crearRuta(String ruta) {\n\t\tFile directorio = new File(ruta);\n\t\tif (!directorio.exists())\n\t\t\tdirectorio.mkdirs();\n\t\treturn ruta;\n\t}", "public static String getAppFolder(String file_name) {\n return Environment.getExternalStorageDirectory().getAbsolutePath() + \"/Chitchato/\";\n }", "protected abstract String childFolderPath();", "public Path getRemoteRepositoryBaseDir();", "public static String getPath() {\n\t\t\n\t\tJFileChooser chooser = new JFileChooser();\n\t \tFileNameExtensionFilter filtroImagen =new FileNameExtensionFilter(\"*.TXT\", \"txt\");\n\t \tchooser.setFileFilter(filtroImagen);\n\t \tFile f = null;\n\t \t\n\t\ttry {\n\t\t\tf = new File(new File(\".\").getCanonicalPath());\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\tString path = \"\";\n\t\t\n\t\ttry {\n\t\t\tchooser.setCurrentDirectory(f);\n\t\t\tchooser.setCurrentDirectory(null);\n\t\t\tchooser.showOpenDialog(null);\n\t \n\t\t\tpath = chooser.getSelectedFile().toString();\n\t\t}catch(Exception e) {\n\t\t\t\n\t\t}\n\t return path;\n\t}", "public File getBasedir()\n {\n return basedir;\n }", "public static String getUserFolder() {\n\n String sPath;\n String sConfDir;\n\n \n // default is to use system's home folder setting\n sPath = System.getProperty(\"user.home\") + File.separator + \"sextante\"; \n \n // check if SEXTANTE.confDir has been set\n sConfDir = System.getProperty(\"SEXTANTE.confDir\"); \t\n if ( sConfDir != null ) {\n \t sConfDir = sConfDir.trim();\n \t \tif ( sConfDir.length() > 0 ) {\n \t \t\t// check if we have to append a separator char\n \t \t\tif ( sConfDir.endsWith(File.separator) ) {\n \t \t\t\tsPath = sConfDir;\n \t \t\t} else {\n \t \t\t\tsPath = sConfDir + File.separator;\n\t\t\t\t}\n\t\t\t}\n }\n\n final File sextanteFolder = new File(sPath);\n if (!sextanteFolder.exists()) {\n \t sextanteFolder.mkdir();\n }\n return sPath;\n\n }", "public String getLocalRepositoryRootFolder() {\n\t\tString userFolder = IdatrixPropertyUtil.getProperty(\"idatrix.local.reposity.root\",getRepositoryRootFolder() );\n\t\tint index = userFolder.indexOf(\"://\");\n\t\tif(index > -1 ) {\n\t\t\tuserFolder = userFolder.substring(index+3);\n\t\t}\n\t\treturn userFolder;\n\t}", "public File getWorldFolder(String worldName);", "private String toCompletePath(String fullRequest) {\n \n///Parse request for file path\nString requestLine[] = new String[] {\" \", \" \", \" \"};\n requestLine = fullRequest.split(\" \");\nString partialPath = requestLine[1];\n \n//If requested path is just \"/\" or \"\", don't return any path\n if(partialPath.length() <= 1) {\n noFileRequested = true;\n return null;\n }\n \nString completePath;\n//If using my Windows machine, the path is different than the school Linux machines\nif (Windows)\n completePath = \"C:/Users/Michelle/eclipse-workspace/P1\" + partialPath;\nelse\n completePath = \".\" + partialPath;\n \n return completePath;\n}", "public static Path locateResourcesDir(ServletContext context,\n ApplicationContext applicationContext) {\n Path property = null;\n try {\n property = applicationContext.getBean(GeonetworkDataDirectory.class).getResourcesDir();\n } catch (NoSuchBeanDefinitionException e) {\n final String realPath = context.getRealPath(\"/WEB-INF/data/resources\");\n if (realPath != null) {\n property = IO.toPath(realPath);\n }\n }\n\n if (property == null) {\n return IO.toPath(\"resources\");\n } else {\n return property;\n }\n }", "String getRealPath(String path);", "public static String uploadDir() {\n\n String uploads = stringValue(\"treefs.uploads\");\n if(isNullOrEmpty(uploads)) {\n // default home location\n uploads = home() + File.separator + \"uploads\";\n } else {\n uploads = home() + File.separator + uploads;\n }\n\n System.out.println(\"uploadDir=\" + uploads);\n return uploads;\n }", "public IPath getRuntimeBaseDirectory(TomcatServer server);", "public String getSavingLocation()\n {\n return Environment.getExternalStorageDirectory() + File.separator + getResources().getString(R.string.app_name);\n }", "static File requestNewResourcesFolder(Context context){\n SharedPreferences sharedPreferences = context.getSharedPreferences(Values.PREFERENCES_NAME, Context.MODE_PRIVATE);\n File downloadPath = null;\n File[] folders = context.getExternalFilesDirs(null);\n if(hasWritableSd(context) && checkAvailableSpace(folders[1], 10)){\n downloadPath = folders[1];\n sharedPreferences.edit().putString(Values.DOWNLOAD_LOCATION, Values.LOCATION_EXTERNAL).apply();\n }\n else{\n if(checkAvailableSpace(folders[0], 10)){\n downloadPath = folders[0];\n sharedPreferences.edit().putString(Values.DOWNLOAD_LOCATION, Values.LOCATION_INTERNAL).apply();\n }\n }\n return downloadPath;\n }", "public static String getWorkingDirectory(Context context) {\n String res;\n if (isSDCardMounted()) {\n String directory = \"For Happy\";\n res = Environment.getExternalStorageDirectory().getAbsolutePath() + \"/\" + directory;\n } else {\n res = context.getFilesDir().getAbsolutePath() + \"/\";\n }\n if (!res.endsWith(\"/\")) {\n res += \"/\";\n }\n File f = new File(res);\n if (!f.exists()) {\n boolean success = f.mkdirs();\n if (!success) {\n LogUtil.e(\"FileUtils create file failed\");\n }\n }\n return res;\n }", "public static String sBasePath() \r\n\t{\r\n\t\tif(fromJar) \r\n\t\t{\r\n\t\t\tFile file = new File(System.getProperty(\"java.class.path\"));\r\n\t\t\tif (file.getParent() != null)\r\n\t\t\t{\r\n\t\t\t\treturn file.getParent().toString();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\ttry \r\n\t\t{\r\n\t\t\treturn new java.io.File(\"\").getCanonicalPath();\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\t\r\n\t\treturn null;\r\n\t}", "public static File getResourcesFolder(Context context){\n SharedPreferences sharedPreferences = context.getSharedPreferences(Values.PREFERENCES_NAME, Context.MODE_PRIVATE);\n File downloadPath = null;\n File[] folders = context.getExternalFilesDirs(null);\n switch (sharedPreferences.getString(Values.DOWNLOAD_LOCATION, Values.NOT_YET_DECIDED)) {\n case Values.LOCATION_INTERNAL:\n downloadPath = folders[0];\n break;\n case Values.LOCATION_EXTERNAL:\n if (hasWritableSd(context))\n downloadPath = folders[1];\n break;\n case Values.NOT_YET_DECIDED:\n //If it's the first time choosing one of the two possible storage locations, make the choice\n downloadPath = requestNewResourcesFolder(context);\n }\n return downloadPath;\n }", "private static String m119220d() {\n File externalFilesDir = C6399b.m19921a().getExternalFilesDir(null);\n if (externalFilesDir == null) {\n return null;\n }\n C7276d.m22805a(externalFilesDir);\n return externalFilesDir.getAbsolutePath();\n }", "private static String getDirectoryPath() {\n // Replace the path here with your own\n File file = new File(Environment.getExternalStorageDirectory(),\n \"/GenericAndroidSoundboard/Audio/\");\n // Create the directory if it doesn't exist\n if (!file.exists()) {\n file.mkdirs();\n }\n\n // Get the path to the newly created directory\n return Environment.getExternalStorageDirectory()\n .getAbsolutePath() + \"/GenericAndroidSoundboard/Audio/\";\n }", "public void criarArvoreDeDiretorioLocal(String caminhoDestino, String raiz, String fs) {\r\n String caminhoDeCriacao;\r\n \r\n caminhoDeCriacao = caminhoDestino;\r\n if (new File(caminhoDeCriacao).mkdir())\r\n System.out.println(\"Diretorio Criado\");\r\n else\r\n System.out.println(\"Diretorio: \" + caminhoDeCriacao + \" nao criado\");\r\n \r\n ArrayList<String> filhos = new ArrayList<>(arvoreDeDiretorios.getSuccessors(raiz));\r\n \r\n for (String filho : filhos) {\r\n //new File(caminhoDeCriacao +fs + filho).mkdir();\r\n criarArvoreDeDiretorioLocal(caminhoDeCriacao + fs + filho, filho,fs);\r\n } \r\n }", "File getTargetDirectory();", "protected abstract String getResourcePath();", "@Override\n\tpublic String getDirName() {\n\t\treturn StringUtils.substringBeforeLast(getLocation(), \"/\");\n\t}", "public static File getOzoneMetaDirPath(ConfigurationSource conf) {\n File dirPath = getDirectoryFromConfig(conf,\n HddsConfigKeys.OZONE_METADATA_DIRS, \"Ozone\");\n if (dirPath == null) {\n throw new IllegalArgumentException(\n HddsConfigKeys.OZONE_METADATA_DIRS + \" must be defined.\");\n }\n return dirPath;\n }", "FileObject getBaseFolder();", "public static String GetLoLFolder() {\n\t\tFile file = null;\n String path = null;\n\t\ttry {\n\n JFileChooser chooser = new JFileChooser();\n chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);\n chooser.setDialogTitle(\"Please set your Location of \\\"lol.launcher.exe\\\"\");\n chooser.setBackground(Gui.myColor);\n chooser.setForeground(Color.LIGHT_GRAY);\n chooser.setFileFilter(new FileFilter() {\n public boolean accept(File f) {\n return f.getName().toLowerCase().endsWith(\"lol.launcher.exe\")\n || f.isDirectory();\n }\n\n public String getDescription() {\n return \"lol.launcher.exe(*.exe)\";\n }\n });\n int rueckgabeWert = chooser.showOpenDialog(null);\n if (rueckgabeWert == JFileChooser.APPROVE_OPTION) {\n file = chooser.getSelectedFile();\n if (file.getName().contains(\"lol.launcher.exe\")) {\n System.out.println(\"- Found League of Legends Installation\");\n path = chooser.getSelectedFile().getParent();\n File FilePath = new File(\"Path\");\n FileWriter writer;\n writer = new FileWriter(FilePath);\n writer.write(path);\n writer.flush();\n writer.close();\n } else {\n System.out\n .println(\"- No League of Legends Installation found :(\");\n path = \"No installation found\";\n }\n }\n } catch (IOException e)\n {\n logger.error(\"Write Error\");\n }\n\t\treturn path;\n\t}", "private String getOutputFolder(String path){\n\n //Remove the portion of the path which is prior to our repositories file path\n path = StringUtils.removeStart(FilenameUtils.getFullPath(path), REPOSITORY_LOCATION);\n //Return the path without leading and ending / and ensures the file path uses forward slashes instead of backslashes\n return StringUtils.strip(StringUtils.strip(path,\"/\"),\"\\\\\").replace(\"\\\\\", \"/\");\n }", "String getDockerFilelocation();", "@Override\n protected Path calculateAppPath(Path image) throws Exception {\n return image.resolve(\"usr\").resolve(\"lib\").resolve(\"APPDIR\");\n }", "public static String getClassPathFileParentDir(String resFile)\n\t{\n\t\tURL url = ClassUtils.getClassLoader(ResourceUtil.class).getResource(resFile) ;\n\n\t\t//System.out.println( \"url============\" + url ) ;\n\n\t\tString fullPath = null ;\n\t\ttry\n\t\t{\n\t\t\tfullPath = new File(url.getFile(), \".\").getCanonicalPath() ;\n\t\t}\n\t\tcatch (IOException e)\n\t\t{\n\t\t\tthrow new RuntimeException(\"获取配置文件路径出错:\" + e.getMessage(), e) ;\n\t\t}\n\n\t\tfullPath = fullPath.replaceAll(\"\\\\\\\\\", SEPARATOR) ;\n\n\t\tString parentPath = fullPath.substring(0, fullPath.lastIndexOf(SEPARATOR)) ;\n\n\t\tif (!parentPath.endsWith(SEPARATOR))\n\t\t{\n\t\t\tparentPath = parentPath + SEPARATOR ;\n\t\t}\n\n\t\treturn parentPath ;\n\t}", "File getTilePathBase();", "String path(Configuration configuration);" ]
[ "0.6985088", "0.69307196", "0.69191706", "0.6844622", "0.68091875", "0.67827", "0.6762781", "0.6603355", "0.6483714", "0.6479017", "0.64499116", "0.6398175", "0.63597447", "0.6358058", "0.6328888", "0.63283116", "0.63027185", "0.6274354", "0.62406313", "0.6220463", "0.61945814", "0.6193146", "0.61714125", "0.61619186", "0.61566794", "0.61503696", "0.6142323", "0.6142323", "0.6142323", "0.6142323", "0.6142323", "0.6139348", "0.61130255", "0.6107203", "0.60749555", "0.6058283", "0.6053458", "0.6022309", "0.60138744", "0.59801215", "0.5978849", "0.5971439", "0.5970901", "0.5947873", "0.59429854", "0.59369266", "0.59201777", "0.5919986", "0.59194136", "0.59064883", "0.58971334", "0.588889", "0.58866096", "0.58865654", "0.5877926", "0.58707243", "0.585969", "0.585969", "0.585969", "0.58569294", "0.5854533", "0.5844008", "0.5828446", "0.5828446", "0.58273363", "0.5822219", "0.5817665", "0.58139026", "0.5808857", "0.5808665", "0.57960886", "0.5795547", "0.57907444", "0.57875246", "0.5777", "0.5775594", "0.57754564", "0.57742226", "0.57664746", "0.5763057", "0.57607085", "0.57552576", "0.57550186", "0.5753427", "0.5750268", "0.57484293", "0.57477885", "0.57454914", "0.5740418", "0.5736492", "0.5735315", "0.5725107", "0.57237065", "0.57195777", "0.57146835", "0.57126623", "0.5710058", "0.5707889", "0.5700203", "0.5688364", "0.5685865" ]
0.0
-1
CREAMOS LA VISTA QUE CONTENDRA, EL DISENIO DE CADA ITEM
@NonNull @Override public ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) { View vista = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_desparasitante, parent, false); //RETORNAR INSTANCIA DE LA CLASE PERSONALIZADA PASANDO COMO ARGUMENTO LA VISTA CREADA return new ViewHolder(vista); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void CrearVenda (BaseDades bd, int idproducte, int quantitat) {\n Producte prod = bd.consultarUnProducte(idproducte);\n java.sql.Date dataActual = getCurrentDate();//Data SQL\n if (prod != null) {\n if (bd.actualitzarStock(prod, quantitat, dataActual)>0) {//Hi ha estoc\n String taula = \"VENDES\";\n int idvenda = bd.obtenirUltimID(taula);\n Venda ven = new Venda(idvenda, prod.getIdproducte(), dataActual, quantitat);\n \n if (bd.inserirVenda(ven)>0)\n System.out.println(\"VENDA INSERIDA...\");\n } else\n System.out.println(\"NO ES POT FER LA VENDA, NO HI HA ESTOC...\");\n \n } else {\n System.out.println(\"NO HI HA EL PRODUCTE\");\n }\n }", "public void newElemento(Elemento item, Carrito carrito){\n SQLiteDatabase db = helper.getWritableDatabase();\r\n\r\n // TODO: 12.- Mapeamos columnas con valores\r\n // Crea un nuevo mapa de valores, de tipo clave-valor, donde clave es nombre de columna\r\n ContentValues values = new ContentValues();\r\n values.put(ElementosContract.Entrada.COLUMNA_CARRITO_ID, carrito.getId());\r\n values.put(ElementosContract.Entrada.COLUMNA_NOMBRE_PRODUCTO, item.getNombreProducto());\r\n values.put(ElementosContract.Entrada.COLUMNA_PRECIO_PRODUCTO, item.getPrecioProducto());\r\n values.put(ElementosContract.Entrada.COLUMNA_CANTIDAD, item.getCantidad());\r\n\r\n // TODO: 13.- Insertamos fila\r\n // Inserta la nueva fila, regresando el valor de la primary key\r\n long newRowId = db.insert(ElementosContract.Entrada.NOMBRE_TABLA, null, values);\r\n\r\n // cierra conexión\r\n db.close();\r\n }", "public void adicionarItem(Cerveja cerveja, Integer quantidade){\r\n\t\t\r\n\t\t// filtra o item adicionado\r\n\t\tOptional<ItemVenda> itemVendaOptional = buscarItemPorCerveja(cerveja);\r\n\t\t\r\n\t\tItemVenda itemVenda = null;\r\n\t\t\r\n\t\t// caso o item ja exista no carrinho de compras altere somente a quantidade\r\n\t\tif(itemVendaOptional.isPresent()){\r\n\t\t\titemVenda = itemVendaOptional.get();\r\n\t\t\t\r\n\t\t\t//altera a quantidade somando a quantidade atual + a nova quantidade informada \r\n\t\t\titemVenda.setQuantidade(itemVenda.getQuantidade() + quantidade);\r\n\t\t\t\r\n\t\t\t\r\n\t\t// \tadicione um novo item no carrinho\r\n\t\t}else{\r\n\t\t\titemVenda = new ItemVenda();\r\n\t\t\titemVenda.setCerveja(cerveja);\r\n\t\t\titemVenda.setQuantidade(quantidade);\r\n\t\t\titemVenda.setValorUnitario(cerveja.getValor());\r\n\t\t\t\r\n\t\t\t// possiciona o novo item criado na primeira posicao da lista\r\n\t\t\titens.add(0, itemVenda);\r\n\t\t\t\r\n\t\t}\r\n\t}", "@Override\n public ArrayList<String> Crear(){\n setVida(3500);\n Creado.add(0, Integer.toString(getVida()));\n Creado.add(1,\"150\");\n Creado.add(2,\"100\");\n Creado.add(3,\"70\");\n return Creado;\n }", "public void inicializarItemInvoice() {\r\n\t\ttry {\r\n\t\t\teditarItem = false;\r\n\t\t\trequired = true;\r\n\t\t\tpo = new PO();\r\n\t\t\tlistPos = new ArrayList<PO>();\r\n\t\t\titemInvoice = null;\r\n\t\t\titemPO = null;\r\n\t\t\tpartNumber = null;\r\n\t\t\tBasicFiltroPO filtroPO = new BasicFiltroPO();\r\n\r\n\t\t\tCarga c = facade.getCargaById(invoice.getCarga().getId());\r\n\t\t\tfiltroPO.setFilial(c.getFilial());\r\n\t\t\tlistPos = facade.listarPO(filtroPO);\r\n\t\t\tpoConverter = new ConverterUtil<PO>(listPos);\r\n\r\n\t\t} catch (BusinessException e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\t}", "public boolean alterarIDItemCardapio(){\n\t\tif(\tid_item_pedido \t\t> 0 && //Verifica se o item do pedido informado é maior que zero, se existe, se não está fechado, verifica se o item do cardapio informado existe e se está disponível\r\n\t\t\tconsultar().size() \t> 0 && \r\n\t\t\tconsultar().get(5)\t.equals(\"Aberto\")/* &&\r\n\t\t\titem_cardapio.consultar().size()>0 &&\r\n\t\t\titem_cardapio.consultar().get(4).equals(\"Disponível\")*/\r\n\t\t\t){\r\n\t\t\t\r\n\t\t\treturn new Item_Pedido_DAO().alterarIDItemCardapio(id_item_pedido, id_item_cardapio);\t\t\t\r\n\r\n\t\t}else{\r\n\t\t\t\r\n\t\t\treturn false;\r\n\t\t\t\r\n\t\t}\r\n\t\t\r\n\t}", "Reserva Obtener();", "private void hienThiCBBmaDV(){\n DichVuService dichVuService = new DichVuService();\n dichVuModels = dichVuService.layToanBoDichVu();\n \n cbbMaDV.removeAllItems();\n if (dichVuModels != null){\n for (DichVuModel dichVuModel : dichVuModels) {\n cbbMaDV.addItem(dichVuModel.getMaDV());\n }\n }else{\n return;\n }\n }", "public String nuevaSubasta() {\n\t\tofer_id = null;\n\t\tofer_valor_oferta = null;\n\t\tofer_fecha_oferta = null;\n\t\tpostulante = null;\n\t\titem_nombre = \"\";\n\t\titem_caracteristicas = \"\";\n\t\titem_imagen = \"\";\n\t\tpos_nombre = \"\";\n\t\tpos_apellido = \"\";\n\t\tpos_direccion = \"\";\n\t\tpos_correo = \"\";\n\t\tpos_telefono = \"\";\n\t\tpos_celular = \"\";\n\t\tpos_institucion = \"\";\n\t\tpos_gerencia = \"\";\n\t\tpos_area = \"\";\n\t\treturn \"nitem?faces-redirect=true\";\n\t}", "@Override\r\n\tpublic void crearVehiculo() {\n\t\t\r\n\t}", "private void getNewVacunas(){\n mNewVacunas = estudioAdapter.getListaNewVacunasSinEnviar();\n //ca.close();\n }", "public void consulterBoiteVocale() {\n for (int i = 0; i < this.boiteVocale.getListeMessagesVocaux().size(); i++) {\n //on passe l'attribut consulte à true pour savoir qu'il a été vu pour la facturation\n this.boiteVocale.getListeMessagesVocaux().get(i).setConsulte(true);\n }\n }", "public Sesiones() {\n\t\tentradasVendidas = 0;\n\t}", "public void vender() {\n\t\tSystem.out.println(\"Vender \"+cantidad+\" de \"+itemName);\n\t}", "private void loadMaTauVaoCBB() {\n cbbMaTau.removeAllItems();\n try {\n ResultSet rs = LopKetNoi.select(\"select maTau from Tau\");\n while (rs.next()) {\n cbbMaTau.addItem(rs.getString(1));\n }\n } catch (Exception e) {\n System.out.println(\"Load ma tau vao cbb that bai\");\n }\n\n }", "private void pulsarItemMayus(){\n if (mayus) {\n mayus = false;\n texto_frases = texto_frases.toLowerCase();\n }\n else {\n mayus = true;\n texto_frases = texto_frases.toUpperCase();\n }\n fillList(false);\n }", "private static void crearPedidoConStockDeVariedades() throws RemoteException {\n\t\tlong[] idVariedades = { 25, 33 };\n\t\tint[] cantidades = { 2, 3 };\n\t\tPedidoClienteDTO pedido = crearPedido(\"20362134596\", \"test 1\", idVariedades, cantidades);\n\n\t\tpedido = PedidoController.getInstance().crearPedido(pedido).toDTO();\n\n\t\tPedidoController.getInstance().cambiarEstadoPedidoCliente(pedido.getNroPedido(), EstadoPedidoCliente.ACEPTADO);\n\t}", "public void insereFim(TinfoTransicao item) {\t\t\n\t\tTnodoTransicao novo = new TnodoTransicao(item);\n\t\tnovo.proximo = this.ultimo.proximo;\n\t\tthis.ultimo.proximo = novo;\n\t\tthis.ultimo = novo;\t\n\t}", "public Cobra()\r\n {\r\n super();\r\n corpo = new ArrayList<CorpoCobra>();\r\n\r\n porCrescer = 0;\r\n ovosComidos = 0;\r\n vidas = 3;\r\n tonta = 0;\r\n }", "private void addNerves(){\n Vector items = new Vector();\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_MEDIAN_RIGHT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_MEDIAN_LEFT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_CUBITAL_RIGHT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_CUBITAL_LEFT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_SQIATIQUE_RIGHT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_SQIATIQUE_LEFT\");\n\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_MEDIAN_RIGHT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_MEDIAN_LEFT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_CUBITAL_RIGHT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_CUBITAL_LEFT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_SQIATIQUE_RIGHT\");\n items.add(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_SQIATIQUE_LEFT\");\n\n if(verifyList(items)){\n contentTable = new PdfPTable(1);\n table = new PdfPTable(5);\n\n // title\n table.addCell(createItemNameCell(getTran(\"leprosy\",\"nerves\"),2));\n\n // dedicated table\n PdfPTable nervesTable = new PdfPTable(8);\n\n // header\n nervesTable.addCell(emptyCell(2));\n nervesTable.addCell(createHeaderCell(getTran(\"leprosy\",\"median\"),2));\n nervesTable.addCell(createHeaderCell(getTran(\"leprosy\",\"cubital\"),2));\n nervesTable.addCell(createHeaderCell(getTran(\"leprosy\",\"sciatiquepopliteexterne\"),2));\n\n // sub header\n nervesTable.addCell(emptyCell(2));\n nervesTable.addCell(createHeaderCell(getTran(\"web\",\"right\"),1));\n nervesTable.addCell(createHeaderCell(getTran(\"web\",\"left\"),1));\n nervesTable.addCell(createHeaderCell(getTran(\"web\",\"right\"),1));\n nervesTable.addCell(createHeaderCell(getTran(\"web\",\"left\"),1));\n nervesTable.addCell(createHeaderCell(getTran(\"web\",\"right\"),1));\n nervesTable.addCell(createHeaderCell(getTran(\"web\",\"left\"),1));\n\n //***** row 1 : epaissis *****\n cell = createHeaderCell(getTran(\"leprosy\",\"epaissis\"),2);\n cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT);\n nervesTable.addCell(cell);\n\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_MEDIAN_RIGHT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_MEDIAN_LEFT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_CUBITAL_RIGHT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_CUBITAL_LEFT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_SQIATIQUE_RIGHT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_EPAISSIS_SQIATIQUE_LEFT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n\n //***** row 2 : douloureux *****\n cell = createHeaderCell(getTran(\"leprosy\",\"douloureux\"),2);\n cell.setHorizontalAlignment(PdfPCell.ALIGN_LEFT);\n nervesTable.addCell(cell);\n\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_MEDIAN_RIGHT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_MEDIAN_LEFT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_CUBITAL_RIGHT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_CUBITAL_LEFT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_SQIATIQUE_RIGHT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n itemValue = getItemValue(IConstants_PREFIX+\"ITEM_TYPE_LEPROSYBEGIN_NERVES_DOULOUREUX_SQIATIQUE_LEFT\");\n nervesTable.addCell(createValueCell((itemValue.length()>0?getTran(\"web\",itemValue).toLowerCase():\"\"),1));\n\n // add nervesTable\n cell = createCell(new PdfPCell(nervesTable),3,PdfPCell.ALIGN_CENTER,PdfPCell.BOX);\n cell.setColspan(5);\n cell.setPadding(3);\n table.addCell(cell);\n\n // add table to transaction\n if(table.size() > 0){\n if(contentTable.size() > 0) contentTable.addCell(emptyCell());\n contentTable.addCell(createCell(new PdfPCell(table),1,PdfPCell.ALIGN_CENTER,PdfPCell.NO_BORDER));\n tranTable.addCell(new PdfPCell(contentTable));\n addTransactionToDoc();\n }\n }\n }", "public void changeSelectAnio(int item){\n\t\tList<CrGeneralDTO> listAnioHRTemp = new ArrayList<CrGeneralDTO>();\n\t\t\n\t\tIterator<CrGeneralDTO> it3 = listAnioHR.iterator();\n\t\t\n\t\twhile (it3.hasNext()) {\n\t\t\tCrGeneralDTO obj = it3.next();\n\t\t\tif(obj.getId() == item) {\n\t\t\t\tobj.setSeleted(true);\n\t\t\t\tselectAnnioRecord = Integer.parseInt(obj.getDescripcion());\n\t\t\t\t\n\t\t\t}else {\n\t\t\t\tobj.setSeleted(false);\n\t\t\t}\n\t\t\t\n\t\t\tlistAnioHRTemp.add(obj);\n\t\t}\n\t\t\n\t\tlistAnioHR = new ArrayList<CrGeneralDTO>();\n\t\tlistAnioHR = listAnioHRTemp;\n\t\t\n\t\t//================ Cargar Lista Predios ==============\n\t\t\ttry {\n\t\t\t\tlistPrediosHR = cajaBo.obtenerPredios(this.referencia.getPersonaId(),selectAnnioRecord);\n\t\t\t\t\n\t\t\t\tIterator<CrGeneralDTO> it4 = listPrediosHR.iterator();\n\t\t\t\twhile (it3.hasNext()) {\n\t\t\t\t\tCrGeneralDTO obj = it4.next();\n\t\t\t\t\tobj.setSeleted(false);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t} catch (Exception e) {\n\t\t\t\t// TODO Auto-generated catch block\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t//====================================================\n\t\t\n \t}", "private void caricaLista() {\n /** variabili e costanti locali di lavoro */\n ArrayList unaLista = null;\n CampoDati unCampoDati = null;\n CDBLinkato unCampoDBLinkato = null;\n //@todo da cancellare\n try { // prova ad eseguire il codice\n /* recupera il campo DB specializzato */\n unCampoDBLinkato = (CDBLinkato)unCampoParente.getCampoDB();\n\n /* recupera la lista dal campo DB */\n unaLista = unCampoDBLinkato.caricaLista();\n\n /* recupera il campo dati */\n unCampoDati = unCampoParente.getCampoDati();\n\n /* registra i valori nel modello dei dati del campo */\n if (unaLista != null) {\n unCampoDati.setValoriInterni(unaLista);\n// unCampoDatiElenco.regolaElementiAggiuntivi();\n } /* fine del blocco if */\n\n } catch (Exception unErrore) { // intercetta l'errore\n /* mostra il messaggio di errore */\n Errore.crea(unErrore);\n } /* fine del blocco try-catch */\n\n }", "public void ConsultaVehiculosSQlite() {\n preguntas = mydb.getCartList();\n for( int i = 0 ; i < preguntas.size() ; i++ ){\n //Toast.makeText(getApplicationContext(), preguntas.get( i ).getPregunta(), Toast.LENGTH_SHORT).show();\n persons.add(new Solicitud(\"Pregunta \" + String.valueOf(i+1) +\": \"+preguntas.get( i ).getPregunta(),\"Fecha: \"+ preguntas.get( i ).getFecha(), R.drawable.solicitudes,\"Motivo: \"+preguntas.get( i ).getMotivo(),\"Observacion: \"+preguntas.get( i ).getObservacion(),\"\"));\n }\n }", "private static void VeureVendes (BaseDades bd) {\n ArrayList <Venda> llista = new ArrayList <Venda>();\n llista = bd.consultaVen(\"SELECT * FROM VENDES\");\n if (llista != null)\n for (int i = 0; i<llista.size(); i++) {\n Venda p = (Venda) llista.get(i);\n Producte prod = bd.consultarUnProducte(p.getIdproducte());\n System.out.println(\"ID Venda =>\"+p.getNumvenda()+\"* Producte: \"\n +prod.getDescripcio()+\"* Quantitat: \"+p.getQuantitat()\n +\"* Data: \"+p.getDatavenda());\n }\n }", "public Tavolo (String id_tavolo, int num_posti){\n this.id_tavolo = id_tavolo;\n this.num_posti = num_posti;\n interno = true;\n disponibile = true;\n AssegnamentiTavolo = new ArrayList<Invitato>(num_posti);\n postiTot=num_posti;\n }", "public void creaAddebitiGiornalieri(AddebitoFissoPannello pannello,\n int codConto,\n Date dataInizio,\n Date dataFine) {\n /* variabili e costanti locali di lavoro */\n boolean continua = true;\n Modulo modAddFisso;\n ArrayList<CampoValore> campiFissi;\n Campo campoQuery;\n CampoValore campoVal;\n ArrayList<WrapListino> lista;\n ArrayList<AddebitoFissoPannello.Riga> righeDialogo = null;\n int quantita;\n\n try { // prova ad eseguire il codice\n\n modAddFisso = this.getModulo();\n campiFissi = new ArrayList<CampoValore>();\n\n /* recupera dal dialogo il valore obbligatorio del conto */\n if (continua) {\n campoQuery = modAddFisso.getCampo(Addebito.Cam.conto.get());\n campoVal = new CampoValore(campoQuery, codConto);\n campiFissi.add(campoVal);\n }// fine del blocco if\n\n /* recupera dal dialogo il pacchetto di righe selezionate */\n if (continua) {\n righeDialogo = pannello.getRigheSelezionate();\n }// fine del blocco if\n\n /* crea il pacchetto delle righe di addebito fisso da creare */\n if (continua) {\n\n /* traverso tutta la collezione delle righe selezionate nel pannello */\n for (AddebitoFissoPannello.Riga riga : righeDialogo) {\n lista = ListinoModulo.getPrezzi(riga.getCodListino(),\n dataInizio,\n dataFine,\n true,\n false);\n quantita = riga.getQuantita();\n for (WrapListino wrapper : lista) {\n this.creaAddebitoFisso(codConto, dataInizio, wrapper, quantita);\n }\n } // fine del ciclo for-each\n }// fine del blocco if\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n }", "public VistaListacomprasnocliente() {\n // You can initialise any data required for the connected UI components here.\n }", "public CrearQuedadaVista() {\n }", "public void creoVehiculo() {\n\t\t\n\t\tAuto a= new Auto(false, 0);\n\t\ta.encender();\n\t\ta.setPatente(\"saraza\");\n\t\ta.setCantPuertas(123);\n\t\ta.setBaul(true);\n\t\t\n\t\tSystem.out.println(a);\n\t\t\n\t\tMoto m= new Moto();\n\t\tm.encender();\n\t\tm.frenar();\n\t\tm.setManubrio(true);\n\t\tm.setVelMax(543);\n\t\tm.setPatente(\"zas 241\");\n\t\tVehiculo a1= new Auto(true, 0);\n\t\ta1.setPatente(\"asd 423\");\n\t\t((Auto)a1).setBaul(true);\n\t\t((Auto)a1).setCantPuertas(15);\n\t\tif (a1 instanceof Auto) {\n\t\t\tAuto autito= (Auto) a1;\n\t\t\tautito.setBaul(true);\n\t\t\tautito.setCantPuertas(531);\n\t\t\t\n\t\t}\n\t\tif (a1 instanceof Moto) {\n\t\t\tMoto motito=(Moto) a1;\n\t\t\tmotito.setManubrio(false);\n\t\t\tmotito.setVelMax(15313);\n\t\t\t\n\t\t\t\n\t\t}\n\t\tif (a1 instanceof Camion) {\n\t\t\tCamion camioncito=(Camion) a1;\n\t\t\tcamioncito.setAcoplado(false);\n\t\t\tcamioncito.setPatente(\"ge\");\n\t\t\t\n\t\t\t\n\t\t}\n\t\tVehiculo a2= new Moto();\n\t\tSystem.out.println(a2);\n\t\ta1.frenar();\n\t\t\n\t\tArrayList<Vehiculo>listaVehiculo= new ArrayList<Vehiculo>();\n\t\tlistaVehiculo.add(new Auto(true, 53));\n\t\tlistaVehiculo.add(new Moto());\n\t\tlistaVehiculo.add(new Camion());\n\t\tfor (Vehiculo vehiculo : listaVehiculo) {\n\t\t\tSystem.out.println(\"clase:\" +vehiculo.getClass().getSimpleName());\n\t\t\tvehiculo.encender();\n\t\t\tvehiculo.frenar();\n\t\t\tSystem.out.println(\"=======================================\");\n\t\t\t\n\t\t}\n\t}", "private void comboCarrega() {\n\n try {\n con = BancoDeDados.getConexao();\n //cria a string para inserir no banco\n String query = \"SELECT * FROM servico\";\n\n PreparedStatement cmd;\n cmd = con.prepareStatement(query);\n ResultSet rs;\n\n rs = cmd.executeQuery();\n\n while (rs.next()) {\n JCservico.addItem(rs.getString(\"id\") + \"-\" + rs.getString(\"modalidade\"));\n }\n\n } catch (SQLException ex) {\n System.out.println(\"Erro de SQL \" + ex.getMessage());\n }\n }", "private void inizia() throws Exception {\n this.setAllineamento(Layout.ALLINEA_CENTRO);\n this.creaBordo(\"Coperti serviti\");\n\n campoPranzo=CampoFactory.intero(\"a pranzo\");\n campoPranzo.setLarghezza(60);\n campoPranzo.setModificabile(false);\n campoCena=CampoFactory.intero(\"a cena\");\n campoCena.setLarghezza(60);\n campoCena.setModificabile(false);\n campoTotale=CampoFactory.intero(\"Totale\");\n campoTotale.setLarghezza(60); \n campoTotale.setModificabile(false);\n\n this.add(campoPranzo);\n this.add(campoCena);\n this.add(campoTotale);\n }", "private void iniciarNovaVez() {\n this.terminouVez = false;\n }", "public void chargeListe(){\n jCbListeEtablissement.removeAllItems();\n String sReq = \"From Etablissement\";\n Query q = jfPrincipal.getSession().createQuery(sReq);\n Iterator eta = q.iterate();\n while(eta.hasNext())\n {\n Etablissement unEtablissement = (Etablissement) eta.next();\n jCbListeEtablissement.addItem(unEtablissement.getEtaNom());\n }\n bChargeListe = true;\n }", "private void registrarDetallesVenta() {\r\n\t\tdetalleEJB.registrarDetalleVenta(productosCompra, factura);\r\n\r\n\t\ttry {\r\n\r\n\t\t\taccion = \"Crear DetalleVenta\";\r\n\t\t\tString browserDetail = Faces.getRequest().getHeader(\"User-Agent\");\r\n\t\t\tauditoriaEJB.crearAuditoria(\"AuditoriaDetalleVenta\", accion, \"DT creada: \" + factura.getId(),\r\n\t\t\t\t\tsesion.getUser().getCedula(), browserDetail);\r\n\r\n\t\t} catch (Exception e) {\r\n\t\t\te.printStackTrace();\r\n\t\t}\r\n\r\n\t}", "public void comprar() {\n\t\tSystem.out.println(\"Comprar \"+cantidad+\" de \"+itemName);\n\t}", "public static ArrayList IngresarInfoLista(int posarray){\n\n // Definir objeto de la clase constanste para mensajes\n Constantes constantes = new Constantes();\n\n // Definir Array del objeto de la clase BeneficiosCovid\n ArrayList <BeneficiosCovid19> arrayBeneficios = new ArrayList <BeneficiosCovid19>();\n\n System.out.println(\"Por favor ingresar Subsidios para la lista Nro: \" + posarray);\n\n // Variables de trabajo\n String tipoDato = \"\";\n String info = \"\";\n String idrandom;\n String continuar = constantes.TXT_SI;\n //iniciar Ciclo para cargar informacion\n //while (continuar.equals(\"SI\")){\n\n //Definir Objeto de la clase BeneficiosCovid\n BeneficiosCovid19 beneficios_Covid = new BeneficiosCovid19();\n\n //Ingresar Nombre Tipo Alfa\n tipoDato = \"A\";\n info = validarinfo(constantes.TXT_Inp_Nombre,tipoDato);\n beneficios_Covid.setNombre(info);\n\n //Ingresar Valor Subsidio Tipo Numerico\n tipoDato = \"N\";\n info = validarinfo(constantes.TXT_Inp_Subsidio,tipoDato);\n beneficios_Covid.setValorSubsidio(Float.parseFloat(info));\n\n //Obtener el ID de manera aleatoria\n idrandom = getIdBeneficio();\n beneficios_Covid.setId(idrandom);\n\n arrayBeneficios.add(beneficios_Covid);\n\n /**\n * Validacion para continuar o finalizar el ciclo\n * principaly finalizar Main de manera controlada\n * por consola\n **/\n\n /* tipoDato = \"A\";\n continuar = validarinfo(constantes.TXT_Msg_Continuar,tipoDato);\n // Validar valor ingrsado para continuar o finalizar aplicación\n while ( !continuar.equals(\"SI\") && !continuar.equals(\"NO\")) {\n continuar = validarinfo(constantes.TXT_Msg_Continuar, tipoDato);\n }\n\n }\n */\n return arrayBeneficios;\n }", "private void listarItems() {\r\n // Cabecera\r\n System.out.println(\"Listado de Items\");\r\n System.out.println(\"================\");\r\n\r\n // Criterio de Ordenación/Filtrado\r\n System.out.printf(\"Criterio de Ordenación .: %S%n\", criOrd.getNombre());\r\n System.out.printf(\"Criterio de Filtrado ...: %S%n\", criFil.getNombre());\r\n\r\n // Separados\r\n System.out.println(\"---\");\r\n\r\n // Filtrado > Selección Colección\r\n List<Item> lista = criFil.equals(Criterio.NINGUNO) ? CARRITO : FILTRO;\r\n\r\n // Recorrido Colección\r\n for (Item item : lista) {\r\n System.out.println(item.toString());\r\n }\r\n\r\n // Pausai\r\n UtilesEntrada.hacerPausa();\r\n }", "public void Lista(){\n\t\tcabeza = null;\n\t\ttamanio = 0;\n\t}", "@Test\r\n public void testPesquisaDescricao() {\r\n TipoItem item = new TipoItem();\r\n \r\n item.setDescricao(\"tipoItemDescrição\");\r\n TipoItemRN rn = new TipoItemRN();\r\n rn.salvar(item);\r\n \r\n assertTrue(\"tipoItemDescrição\", true);\r\n }", "public static void proveraServisa() {\n\t\tSystem.out.println(\"Unesite redni broj vozila za koje racunate vreme sledeceg servisa:\");\n\t\tUtillMethod.izlistavanjeVozila();\n\t\tint redniBroj = UtillMethod.unesiteInt();\n\t\tif (redniBroj < Main.getVozilaAll().size()) {\n\t\t\tif (!Main.getVozilaAll().get(redniBroj).isVozObrisano()) {\n\t\t\t\tUtillMethod.proveraServisaVozila(Main.getVozilaAll().get(redniBroj));\n\t\t\t} else {\n\t\t\t\tSystem.out.println(\"Ovo vozilo je obrisano i ne moze da se koristi!\");\n\t\t\t}\n\t\t} else {\n\t\t\tSystem.out.println(\"Uneli ste pogresan redni broj!\");\n\t\t}\n\t}", "private void aumentaCapacidade(){\n\t\tif(this.tamanho == this.elementos.length){\n\t\t\tObject[] elementosNovos = new Object[this.elementos.length*2];\n\t\t\tfor(int i =0; i<this.elementos.length;i++){\n\t\t\t\telementosNovos[i]=this.elementos[i];\n\t\t\t}\n\t\t\tthis.elementos=elementosNovos;\n\t\t}\n\t}", "private void populaDiasTreinoCat()\n {\n DiasTreinoCat dias1 = new DiasTreinoCat(\"1 vez por semana\", 1);\n diasTreinoCatDAO.insert(dias1);\n DiasTreinoCat dias2 = new DiasTreinoCat(\"2 vez por semana\", 2);\n diasTreinoCatDAO.insert(dias2);\n DiasTreinoCat dias3 = new DiasTreinoCat(\"3 vez por semana\", 3);\n diasTreinoCatDAO.insert(dias3);\n DiasTreinoCat dias4 = new DiasTreinoCat(\"4 vez por semana\", 4);\n diasTreinoCatDAO.insert(dias4);\n DiasTreinoCat dias5 = new DiasTreinoCat(\"5 vez por semana\", 5);\n diasTreinoCatDAO.insert(dias5);\n DiasTreinoCat dias6 = new DiasTreinoCat(\"6 vez por semana\", 6);\n diasTreinoCatDAO.insert(dias6);\n DiasTreinoCat dias7 = new DiasTreinoCat(\"7 vez por semana\", 7);\n diasTreinoCatDAO.insert(dias7);\n\n }", "private void fillIVACb() {\n ObservableList ivaOp = FXCollections.observableArrayList(\"Abonado por cliente\", \"No abonado por cliente\");\n getIvaCb().setItems(ivaOp);\n }", "public SrvINFONEGOCIO(AgregarInfoNegocio view) {//C.P.M Tendremos un constructor con la vista de agregar informacion de negocio\r\n this.vista = view;//C.P.M Se la agregamos a la variable para tener acceso a la vista \r\n }", "public Funcionalidad() {\n Cajero cajero1 = new Cajero(\"Pepe\", 2);\n empleados.put(cajero1.getID(), cajero1);\n Reponedor reponedor1 = new Reponedor(\"Juan\", 3);\n empleados.put(reponedor1.getID(), reponedor1);\n Producto producto1 = new Producto(\"Platano\", 10, 8);\n productos.add(producto1);\n Perecedero perecedero1 = new Perecedero(LocalDateTime.now(), \"Yogurt\", 10, 8);\n }", "public String guardarsalidatransferencia( List<ListviewGenerico> existencias, List<ListviewGenerico> salidatransferencia, String clavemobil, String observacion){\n\t\tint size = existencias.size();\n\t\tfor (int i = 0; i < size; i++){\n\t\t Double existencia =existencias.get(i).getexistencia();\n\t\t int idmaterial =existencias.get(i).getidmaterial();\n\t\t int idalmacen =existencias.get(i).getidalmacen();\n\t\t updateexistencia(existencia,idmaterial,idalmacen);\t\t \n\t\t}\n\t\t\n\t\tString cadenaimprimir=\"\";\n\t\tsize =salidatransferencia.size();\n\t\tVector vector=new Vector();\n\t\tfor (int i = 0; i < size; i++){\t\t\n\t\t\tint cont=0;\n\t\t\tfor (int j=0; j<vector.size(); j++){\n\t\t\t\tif(vector.elementAt(j).equals(salidatransferencia.get(i).getnombrealmacne()))\n\t\t\t\t\tcont++;\t\n\t\t\t}\n\t\t\tif(cont==0)\n\t\t\t\tvector.add(salidatransferencia.get(i).getnombrealmacne());\t\t\t\n\t\t}\n\t\tcadenaimprimir+=\"SALIDA TRANSFERECIA\\n\";\n\t\tfor (int j=0; j<vector.size(); j++) {\n\t\t\tLog.e(\"obra-concepto\",vector.elementAt(j)+\"\");\t\t\t\n\t\t\tcadenaimprimir+=\"--------------------------------------------\\n\";\n\t\t\tcadenaimprimir+=vector.elementAt(j).toString()+\"\\n\";\n\t\t\tcadenaimprimir+=\"--------------------------------------------\\n\";\n\t\t\tfor (int i = 0; i < size; i++){\n\t\t\t\t\tif(vector.elementAt(j).equals(salidatransferencia.get(i).getnombrealmacne())){\n\t\t\t\t\t\tLog.e(\"concepto\",\" \"+salidatransferencia.get(i).getexistencia()+\" - \"+salidatransferencia.get(i).getunidad()+\"\\n \"+salidatransferencia.get(i).getdescripcion());\n\t\t\t\t\t\tcadenaimprimir+=\" \"+salidatransferencia.get(i).getexistencia()+\" - \"+salidatransferencia.get(i).getunidad()+\"\\n \"+salidatransferencia.get(i).getdescripcion()+\"\\n\";\n\t\t\t\t\t\tif(salidatransferencia.get(i).getidcontratista()>0){\n\t\t\t\t\t\t\tcadenaimprimir+=\" Entregado a: \"+salidatransferencia.get(i).getnombrecontratista()+\"\";\t\n\t\t\t\t\t\t\tLog.e(\"material\",\" \"+salidatransferencia.get(i).getnombrecontratista());\n\t\t\t\t\t\t\tif(salidatransferencia.get(i).getconcargo()>0){\n\t\t\t\t\t\t\t\tcadenaimprimir+=\"(Con cargo)\\n\";\n\t\t\t\t\t\t\t\tLog.e(\"material\",\" -> Con cargo\");\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\tcadenaimprimir+=\"\\n\\nObservaciones: \"+observacion;\n\t\t\n\t\tfor (int i = 0; i < size; i++){\n\t\t\t Double existencia =salidatransferencia.get(i).getexistencia();\n\t\t\t int idmaterial =salidatransferencia.get(i).getidmaterial();\n\t\t\t int idalmacen =salidatransferencia.get(i).getidalmacen();\n\t\t\t String unidad=salidatransferencia.get(i).getunidad();\t\n\t\t\t int idcontratista=salidatransferencia.get(i).getidcontratista();\t\n\t\t\t int concargo=salidatransferencia.get(i).getconcargo();\n\t\t\t \n\t\t\t salidatrasferenciapartidas(existencia, idmaterial, unidad, idalmacen, clavemobil, idcontratista, concargo);\n\t\t}\n\t\treturn cadenaimprimir;\n\t\t\n\t}", "public void onAdicionarItemTroca()\n\t{\n\t\t\n\t}", "public Celula() { // Sentinela\n\t\tthis.item = new Jogador();\n\t\tproximo = null;\n\t}", "private String creaElenco() {\n String testoTabella ;\n String riga = CostBio.VUOTO;\n ArrayList listaPagine = new ArrayList();\n ArrayList listaRiga;\n HashMap mappaTavola = new HashMap();\n String cognomeText;\n int num;\n int taglioPagine = Pref.getInt(CostBio.TAGLIO_COGNOMI_PAGINA);\n String tag = \"Persone di cognome \";\n ArrayList titoli = new ArrayList();\n titoli.add(LibWiki.setBold(\"Cognome\"));\n titoli.add(LibWiki.setBold(\"Voci\"));\n\n for (Map.Entry<String, Integer> mappa: mappaCognomi.entrySet()) {\n\n cognomeText = mappa.getKey();\n num = mappa.getValue();\n if (num >= taglioPagine) {\n cognomeText = tag + cognomeText + CostBio.PIPE + cognomeText;\n cognomeText = LibWiki.setQuadre(cognomeText);\n cognomeText = LibWiki.setBold(cognomeText);\n }// end of if cycle\n\n listaRiga = new ArrayList();\n listaRiga.add(cognomeText);\n listaRiga.add(num);\n listaPagine.add(listaRiga);\n\n }// end of for cycle\n mappaTavola.put(Cost.KEY_MAPPA_SORTABLE_BOOLEAN, true);\n mappaTavola.put(Cost.KEY_MAPPA_TITOLI, titoli);\n mappaTavola.put(Cost.KEY_MAPPA_RIGHE_LISTA, listaPagine);\n testoTabella = LibWiki.creaTable(mappaTavola);\n\n return testoTabella;\n }", "public void cargaDatosInicialesSoloParaAdicionDeCuenta() throws Exception {\n GestionContableWrapper gestionContableWrapper = parParametricasService.factoryGestionContable();\n gestionContableWrapper.getNormaContable3();\n parAjustesList = parParametricasService.listaTiposDeAjuste(obtieneEnumTipoAjuste(gestionContableWrapper.getNormaContable3()));\n //Obtien Ajuste Fin\n //Activa formulario para automatico modifica \n if (selectedEntidad.getNivel() >= 3) {\n numeroEspaciadorAdicionar = 260;\n }\n\n if (selectedEntidad.getNivel() == 3) {\n swParAutomatico = false;\n numeroEspaciadorAdicionar = 230;\n }\n if (selectedEntidad.getNivel() == 2) {\n swParAutomatico = true;\n swActivaBoton = true;\n numeroEspaciadorAdicionar = 200;\n }\n if (selectedEntidad.getNivel() == 1) {\n swParAutomatico = true;\n numeroEspaciadorAdicionar = 130;\n cntParametroAutomaticoDeNivel2 = cntParametroAutomaticoService.obtieneObjetoDeParametroAutomatico(selectedEntidad);\n }\n\n mascaraNuevoOpcion = \"N\";\n cntEntidad = (CntEntidad) getCntEntidadesService().find(CntEntidad.class, selectedEntidad.getIdEntidad());\n mascaraNivel = getCntEntidadesService().generaCodigoNivelesSubAndPadre(selectedEntidad, \"N\");\n mascaraSubNivel = getCntEntidadesService().generaCodigoNivelesSubAndPadre(selectedEntidad, \"S\");\n longitudNivel = getCntEntidadesService().controlaLongitudNumero(selectedEntidad, \"N\");\n longitudSubNivel = getCntEntidadesService().controlaLongitudNumero(selectedEntidad, \"S\");\n }", "private static void comprobarBBDD() {\n\t\tSQLiteHelper usdbh = new SQLiteHelper(contexto, \"baseDeDatos\", null, 1);\n\n\t\tSQLiteDatabase db = usdbh.getReadableDatabase();\n\t\t\n\t\tlistaTarjetas.clear();\n\n\t\t// Si hemos abierto correctamente la base de datos\n\t\tif (db != null) {\n\t\t\t// Consultamos el valor esLaPrimeraVez\n\t\t\tCursor c = db.rawQuery(\"SELECT * from Tarjetas;\", null);\n\t\t\t// Nos aseguramos de que existe al menos un registro\n\t\t\t// Nos aseguramos de que existe al menos un registro\n\t\t\tif (c.moveToFirst()) {\n\t\t\t\tdo {\n\t\t\t\t\tlistaTarjetas.add(new Tarjetas(c.getString(0), c\n\t\t\t\t\t\t\t.getString(1), c.getString(2), c.getString(3)));\n\t\t\t\t\t// Herramientas.getYo().setId(c.getString(0));\n\t\t\t\t} while (c.moveToNext());\n\t\t\t}\n\t\t\tif (listaTarjetas.size() == 0)\n\t\t\t{\n\t\t\t\tNfcAdapter nfcAdapter = nfcAdapter = NfcAdapter.getDefaultAdapter(contexto);\n\n\t\t\t\tif (nfcAdapter == null) { \n\t\t\t\t\tlistaTarjetas.add(new Tarjetas(\"\", \"\",contexto.getResources().getString(R.string.textoVacio1),\"\"));\n\t\t\t\t}\n\t\t\t\telse if (!nfcAdapter.isEnabled()) {\n\t\t\t\t\tlistaTarjetas.add(new Tarjetas(\"\", \"\",contexto.getResources().getString(R.string.textoVacio1),\"\"));\n\t\t\t\t} else {\n\t\t\t\t\tlistaTarjetas.add(new Tarjetas(\"\", \"\",contexto.getResources().getString(R.string.textoVacio2),\"\"));\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tdb.close();\n\t\t}\n\t}", "public void iniciarNovaPartida(Integer posicao);", "public void recuperarMovimentacao(){\n movimentacaoRef = databaseReference.child(\"movimentacoes\")\n .child(idUsuario)\n .child(mesAnoSelecionado);\n\n valueEventListenerMovimentacoes = movimentacaoRef.addValueEventListener(new ValueEventListener() {\n @Override\n public void onDataChange(@NonNull DataSnapshot dataSnapshot) {\n movimentacoes.clear();\n for (DataSnapshot dados: dataSnapshot.getChildren()){\n Movimentacao movimentacao = dados.getValue(Movimentacao.class);\n movimentacao.setKey(dados.getKey());\n movimentacoes.add(movimentacao);\n\n }\n adapterMovimentacao.notifyDataSetChanged();\n }\n\n\n @Override\n public void onCancelled(@NonNull DatabaseError databaseError) {\n\n }\n });\n }", "public agregarArticulo(String user, String password, String vend, String codigoVend) {\n initComponents();\n usu = user;\n contra = password;\n\n try {\n model = new ConnectionTableDB(usu, contra, \"adv_facturacion\", \"SELECT tipo_producto from tipo_producto\", false);\n\n for (int i = 0; i < model.getRowCount(); i++) {\n tipo.addItem(String.valueOf(model.getValueAt(i, 0)));\n }\n //this.getContentPane().setBackground(Color.white);\n } catch (SQLException ex) {\n Logger.getLogger(agregarArticulo.class.getName()).log(Level.SEVERE, null, ex);\n }\n model.desconectar();\n }", "private static float adicionarItem(int idCliente, int idCompra) throws Exception {\r\n int idItemComprado;\r\n float gasto = 0;\r\n boolean qtdInvalida;\r\n boolean idInvalido = false;\r\n do {\r\n qtdInvalida = false;\r\n System.out.print(\"Digite o id do produto desejado: \");\r\n int id = read.nextInt();\r\n Produto p = arqProdutos.pesquisar(id - 1);\r\n if (p != null && p.getID() != -1) {\r\n do {\r\n qtdInvalida = false;\r\n System.out.print(\"Qual a quantidade desejada? \");\r\n byte qtdProduto = read.nextByte();\r\n if (qtdProduto > 0 && qtdProduto <= 255) {\r\n ItemComprado ic = new ItemComprado(idCompra, qtdProduto, p);\r\n idItemComprado = arqItemComprado.inserir(ic);\r\n indice_Compra_ItemComprado.inserir(idCompra, idItemComprado);\r\n indice_ItemComprado_Compra.inserir(idItemComprado, idCompra);\r\n indice_Produto_Cliente.inserir(p.getID(), idCliente);\r\n indice_Cliente_Produto.inserir(idCliente, p.getID());\r\n System.out.println(\"Adicionado \" + qtdProduto + \"x '\" + p.nomeProduto + \"'\");\r\n gasto = qtdProduto * p.preco;\r\n p.addQuantVendidos(qtdProduto);\r\n arqProdutos.alterar(p.getID(), p);\r\n } else {\r\n System.out.println(\"Valor invalido!\");\r\n qtdInvalida = true;\r\n }\r\n } while (qtdInvalida);\r\n } else {\r\n System.out.println(\"\\nId invalido!\");\r\n idInvalido = true;\r\n }\r\n } while (idInvalido);\r\n return gasto;\r\n }", "public void addItem() {\r\n\t\tFacesContext fc = FacesContext.getCurrentInstance();\r\n\t\tif (itemInvoice.getQuantidade() <= itemPO.getQuantidadeSaldo()) {\r\n\t\t\tBigDecimal total = itemInvoice.getPrecoUnit().multiply(\r\n\t\t\t\t\tnew BigDecimal(itemInvoice.getQuantidade()));\r\n\t\t\titemInvoice.setTotal(total);\r\n\t\t\tif (!editarItem) {\r\n\r\n\t\t\t\tif (itemInvoice.getPrecoUnit() == null) {\r\n\t\t\t\t\titemInvoice.setPrecoUnit(new BigDecimal(0.0));\r\n\t\t\t\t}\r\n\t\t\t\tif (itemInvoice.getQuantidade() == null) {\r\n\t\t\t\t\titemInvoice.setQuantidade(0);\r\n\t\t\t\t}\r\n\t\t\t\titemInvoice.setInvoice(invoice);\r\n\r\n\t\t\t\tinvoice.getItensInvoice().add(itemInvoice);\r\n\r\n\t\t\t} else {\r\n\t\t\t\tinvoice.getItensInvoice().set(\r\n\t\t\t\t\t\tinvoice.getItensInvoice().indexOf(itemInvoice),\r\n\t\t\t\t\t\titemInvoice);\r\n\t\t\t}\r\n\t\t\tcarregarTotais();\r\n\t\t\tinicializarItemInvoice();\r\n\t\t\trequired = false;\r\n\t\t} else {\r\n\r\n\t\t\tMessages.adicionaMensagemDeInfo(TemplateMessageHelper.getMessage(\r\n\t\t\t\t\tMensagensSistema.INVOICE, \"lblQtdMaioSaldo\", fc\r\n\t\t\t\t\t\t\t.getViewRoot().getLocale()));\r\n\t\t}\r\n\t}", "public ListaDuplamenteEncadeada(){\r\n\t\t\r\n\t}", "@Override\n\tpublic void descriere() {\n\t\tSystem.out.println(\"Item: \"+this.numeSectiune);\n\t}", "private JTable itensNaoRecebidos() {\n\t\tinitConexao();\t\t\n try {\t \n\t String select = \"SELECT cod_item_r, nome_item_r, valor_item_r FROM Item_receita WHERE recebimento_item_r = '0'\";\n\t PreparedStatement ptStatement = c.prepareStatement(select);\n\t rs = ptStatement.executeQuery();\n\t \n\t Object[] colunas = {\"Item de receita\", \"Valor total\", \"\", \"code\"}; \t\t\n\t\t\t DefaultTableModel model = new DefaultTableModel();\t\t \n\t\t\t model.setColumnIdentifiers(colunas); \t\t \n\t\t\t Vector<Object[]> linhas = new Vector<Object[]>(); \n\t\t\t \n\t while (rs.next()){\n\t\t linhas.add(new Object[]{rs.getString(\"nome_item_r\"),rs.getString(\"valor_item_r\"),\"Receber\", rs.getString(\"cod_item_r\")}); \t \t\n\t \t } \n\t \n\t\t\t for (Object[] linha : linhas) { \n\t\t model.addRow(linha); \n\t\t } \t\t \n\t\t\t final JTable tarefasTable = new JTable(); \t\t \n\t\t\t tarefasTable.setModel(model); \t\t\n\t\t\t \n\t\t\t ButtonColumn buttonColumn = new ButtonColumn(tarefasTable, 2, \"itemNaoRecebido\");\n\t\t\t \n\t\t\t tarefasTable.removeColumn(tarefasTable.getColumn(\"code\")); \t \n\t return tarefasTable; \n } catch (SQLException ex) {\n System.out.println(\"ERRO: \" + ex);\n }\n\t\treturn null; \n\t}", "public void inicializarSugeridos() {\n\t\tarticulosSugeridos = new ArrayList<>();\n\t\tfor(Articulo articulo : this.getMain().getArticulosEnStock()) {\n\t\t\tarticulosSugeridos.add(articulo.getNombre().get() + \" - \" + articulo.getTalle().get());\n\t\t}\n\t\tasignarSugeridos();\n\t\tinicializarTxtArticuloVendido();\n\t}", "private boolean seleccionarItemEnListado(){\n\t\t\n\t\tint indice = this.getUltIdDoc();\n\t\tif (indice > -1){ //solo si se eligió un doc\n\t\t\tif ((indice+1) > tablaDocs.getItemCount()){ //se pasa de la cantidad de elemento en la lista, poner el de mas arriba en su lugar\n\t\t\t\tthis.setUltIdDoc(tablaDocs.getItemCount()-1);\n\t\t\t\tindice = this.getUltIdDoc(); \n\t\t\t}\n\t\t\ttablaDocs.setSelection(indice); \n\t\t\tlistaDocumentos.setSelection(indice);\n\t\t}\n\t\treturn true;\n\t}", "public void cargarEConcepto() {\n\tevidenciaConcepto = true;\n\tif (conceptoSeleccionado.getOrigen().equals(\n\t OrigenInformacionEnum.CONVENIOS.getValor())) {\n\t idEvidencia = convenioVigenteDTO.getId();\n\t nombreFichero = iesDTO.getCodigo() + \"_\"\n\t\t + convenioVigenteDTO.getId();\n\t}\n\n\ttry {\n\t listaEvidenciaConcepto = institutosServicio\n\t\t .obtenerEvidenciasDeIesPorIdConceptoEIdTabla(\n\t\t iesDTO.getId(), conceptoSeleccionado.getId(),\n\t\t idEvidencia, conceptoSeleccionado.getOrigen());\n\n\t} catch (ServicioException e) {\n\t LOG.log(Level.SEVERE, e.getMessage(), e);\n\t}\n }", "public void carregarCliente() {\n\t\tgetConnection();\n\t\ttry {\n\t\t\tString sql = \"SELECT CLIENTE FROM CLIENTE ORDER BY CLIENTE\";\n\t\t\tst = con.createStatement();\n\t\t\trs = st.executeQuery(sql);\n\t\t\twhile(rs.next()) {\n\t\t\t\tcbCliente.addItem(rs.getString(\"CLIENTE\"));\n\t\t\t}\n\t\t}catch(SQLException e) {\n\t\t\tSystem.out.println(\"ERRO\" + e.toString());\n\t\t}\n\t}", "public Vector listaAsignaturas(String nombre_titulacion)\n {\n try\n {\n Date fechaActual = new Date();\n SimpleDateFormat formato = new SimpleDateFormat(\"yyyy-MM-dd HH:mm\");\n\n //Se obtiene una conexion\n Connection conexion = this.bbdd.getConexion();\n\n //Se prepara la query\n String query = \"SELECT * FROM asignaturatotal \";\n query += \"WHERE fechainicio <='\" + formato.format(fechaActual) +\"' \";\n query += \"AND fechafin >= '\"+formato.format(fechaActual)+\"' AND tit_nombre='\"+nombre_titulacion+\"' AND activa = 's'\";\n\n //Se crea un vector de asignaturas\n Vector vectorAsignaturas = new Vector();\n\n //Se ejecuta la query \n Statement st = conexion.createStatement();\n ResultSet resultado = st.executeQuery(query);\n \n //Para cada fila se creará un objeto y se rellenará\n //con los valores de las columnas.\n while(resultado.next())\n {\n asignatura asignatura = new asignatura();\n \n asignatura.setCodigo(resultado.getString(\"codigo\"));\n asignatura.setTitulo(resultado.getString(\"titulo\"));\n asignatura.setFechaInicio(resultado.getDate(\"fechainicio\"));\n asignatura.setFechaFin(resultado.getDate(\"fechafin\"));\n asignatura.setResponsable(resultado.getString(\"responsable\"));\n asignatura.setEmail(resultado.getString(\"email\"));\n asignatura.setTelefono(resultado.getString(\"telefono\"));\n \n //Se añade la asignatura al vector de asignaturas\n vectorAsignaturas.add(asignatura);\n }\n\n //Se cierra la conexión\n this.bbdd.cerrarConexion(conexion);\n\n return vectorAsignaturas;\n }\n catch(SQLException e)\n {\n System.out.println(\"Error al acceder a las asignaturas de la Base de Datos: \"+e.getMessage());\n return null;\n }\n }", "public void clicTable(View v) {\n try {\n conteoTab ct = clc.get(tb.getIdTabla() - 1);\n\n if(ct.getEstado().equals(\"0\")) {\n String variedad = ct.getVariedad();\n String bloque = ct.getBloque();\n Long idSiembra = ct.getIdSiembra();\n String idSiempar = String.valueOf(idSiembra);\n\n long idReg = ct.getIdConteo();\n int cuadro = ct.getCuadro();\n int conteo1 = ct.getConteo1();\n int conteo4 = ct.getConteo4();\n int total = ct.getTotal();\n\n txtidReg.setText(\"idReg:\" + idReg);\n txtCuadro.setText(\"Cuadro: \" + cuadro);\n cap_1.setText(String.valueOf(conteo1));\n cap_2.setText(String.valueOf(conteo4));\n cap_ct.setText(String.valueOf(total));\n txtId.setText(\"Siembra: \" + idSiempar);\n txtVariedad.setText(\"Variedad: \" + variedad);\n txtBloque.setText(\"Bloque: \" + bloque);\n }else{\n Toast.makeText(this, \"No se puede cargar el registro por que ya ha sido enviado\", Toast.LENGTH_SHORT).show();\n }\n\n } catch (Exception E) {\n Toast.makeText(getApplicationContext(), \"No has seleccionado aún una fila \\n\" + E, Toast.LENGTH_LONG).show();\n }\n }", "public void calcularReserva(ProductoDTO item) {\n\t\t\n\t}", "private void actualizaSugerencias() { \t \t\n\n \t// Pide un vector con las últimas N_SUGERENCIAS búsquedas\n \t// get_historial siempre devuelve un vector tamaño N_SUGERENCIAS\n \t// relleno con null si no las hay\n \tString[] historial = buscador.get_historial(N_SUGERENCIAS);\n \t\n \t// Establece el texto para cada botón...\n \tfor(int k=0; k < historial.length; k++) { \t\t \t\t\n \t\t\n \t\tString texto = historial[k]; \n \t\t// Si la entrada k está vacía..\n \t\tif ( texto == null) {\n \t\t\t// Rellena el botón con el valor por defecto\n \t\t\ttexto = DEF_SUGERENCIAS[k];\n \t\t\t// Y lo añade al historial para que haya concordancia\n \t\t\tbuscador.add_to_historial(texto);\n \t\t} \t\t\n \t\tb_sugerencias[k].setText(texto);\n \t} \t\n }", "public void creaAziendaAgricola(){\n\t\tCantina nipozzano = creaCantina(\"Nipozzano\");\t\n\t\tBotte[] bottiNipozzano = new Botte[5+(int)(Math.random()*10)];\t\n\t\tfor(int i=0; i<bottiNipozzano.length; i++){\n\t\t\tbottiNipozzano[i] = creaBotte(nipozzano, i, (int)(Math.random()*10+1), tipologiaBotte[(int)(Math.random()*tipologiaBotte.length)]);\n\t\t}\t\t\n\t\tVigna mormoreto = creaVigna(\"Mormoreto\", 330, 25, EsposizioneVigna.sud, \"Terreni ricchi di sabbia, ben drenati. Discreta presenza di calcio. pH neutro o leggermente alcalino\");\n\t\tFilare[] filariMormoreto = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariMormoreto.length;i++){\n\t\t\tfilariMormoreto[i] = creaFilare(mormoreto, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\t\n\t\tVigna montesodi = creaVigna(\"Montesodi\", 400, 20, EsposizioneVigna.sud_ovest, \"Arido e sassoso, di alberese, argilloso e calcareo, ben drenato, poco ricco di sostanza organica\");\n\t\tFilare[] filariMontesodi = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariMontesodi.length;i++){\n\t\t\tfilariMontesodi[i] = creaFilare(montesodi, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\n\t\t/*\n\t\t * CANTINA: POMINO - VIGNETO BENEFIZIO\n\t\t */\n\t\t\n\t\tCantina pomino = creaCantina(\"Pomino\");\n\t\tBotte[] bottiPomino = new Botte[5+(int)(Math.random()*10)];\t\n\t\tfor(int i=0; i<bottiPomino.length; i++){\n\t\t\tbottiPomino[i] = creaBotte(pomino, i, (int)(Math.random()*10+1), tipologiaBotte[(int)(Math.random()*tipologiaBotte.length)]);\n\t\t}\n\t\tVigna benefizio = creaVigna(\"Benefizio\", 700, 9, EsposizioneVigna.sud_ovest, \"Terreni ricchi di sabbia, forte presenza di scheletro. Molto drenanti. Ricchi in elementi minerali. PH acido o leggermente acido.\");\n\t\tFilare[] filariBenefizio = new Filare[5+(int)(Math.random()*10)];\n\t\tfor(int i=0; i<filariBenefizio.length;i++){\n\t\t\tfilariBenefizio[i] = creaFilare(benefizio, i, tipologiaFilare[(int)(Math.random()*tipologiaFilare.length)]);\n\t\t}\n\t\t\n\t\taziendaAgricolaDAO.saveLuogo(nipozzano);\n\t\taziendaAgricolaDAO.saveLuogo(mormoreto);\n\t\taziendaAgricolaDAO.saveLuogo(montesodi);\n\t\t\n\t\taziendaAgricolaDAO.saveLuogo(pomino);\n\t\taziendaAgricolaDAO.saveLuogo(benefizio);\n\t\t\n\t\taziendaAgricolaDAO.saveResponsabile(responsabile(\"Giulio d'Afflitto\"));\n\t\taziendaAgricolaDAO.saveResponsabile(responsabile(\"Francesco Ermini\"));\n\n\t\t\n\t}", "public void doCreateItem() {\r\n\t\tlogger.info(\"Se procede a crear el book \" + newItem.getDescription());\r\n\t\tBook entity = newItem.getEntity();\r\n\t\tentity.setUser(Global.activeUser());\r\n\t\tentity.setBookBalance(BigDecimal.ZERO);\r\n\t\tentity.setTotalBudget(BigDecimal.ZERO);\r\n\t\tentity.setTotalIncome(BigDecimal.ZERO);\r\n\t\tentity.setTotalExpenses(BigDecimal.ZERO);\r\n\t\tentity = bookService.create(entity);\r\n\r\n\t\t// Actualizar el mapa de books\r\n\t\tGlobalBook.instance().put(new BookData(entity));\r\n\r\n\t\tlogger.info(\"Se ha creado el book \" + newItem.getDescription());\r\n\t\tnewItem = new BookData(new Book());\r\n\t\tFacesContext.getCurrentInstance().addMessage(null,\r\n\t\t\t\tnew FacesMessage(FacesMessage.SEVERITY_INFO, \"Libro creado\", \"Libro creado correctamente\"));\r\n\t}", "public DocumentVente(String code, Date date, Tier fornisseur, Date datecommande, String codefourni) {\n this.code = code;\n this.date = date;\n this.client = fornisseur;\n this.datecommande = datecommande;\n this.codeclient = codefourni;\n// this.lieu = emplacement;\n \n }", "@Override\r\n\t/**\r\n\t * Actionne l'effet de la carte.\r\n\t * \r\n\t * @param listejoueur\r\n\t * \t\t\tLa liste des joueurs de la partie.\r\n\t * @param cible\r\n\t * \t\t\tLa joueur contre qui l'effet sera joué.\r\n\t * @param table\r\n\t * \t\t\tCollection de cartes situées au centre de la table de jeu.\r\n\t * @param carte\r\n\t * \t\t\tLa carte qui joue l'effet.\r\n\t * @param j\r\n\t * \t\t\tLe joueur qui joue la carte.\r\n\t * @param collection\r\n\t * \t\t\tLe deck de cartes.\r\n\t * @param tourjoueur\r\n\t * \t\t\tLa liste des joueurs selon l'ordre de jeu.\r\n\t */\r\n\tpublic void utiliserEffet(ArrayList<Joueur> listejoueur, int cible, ArrayList<Carte> table, Carte carte,\r\n\t\t\tint j, ArrayList<Carte> collection,ArrayList<Joueur> tourjoueur) {\n\t\tcont = Controller.getInstance();\r\n\t\tint id = carte.getIdentifiantCarte();\r\n\t\tif (id ==9 || id ==10 || id==22 || id==23){\r\n\t\t\tif (tourjoueur.get(j) == listejoueur.get(0)){\r\n\t\t\t\tSystem.out.println(\"Choisissez le Divinité qui sera forcer de sacrifier un croyant\");\r\n\t\t\t\t\r\n\t\t\t\tcont.setChoisirCible(true);\r\n\t\t\t\t\r\n\t\t\t\twhile(cont.getChoixCible()==-1){\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tThread.sleep(200);\r\n\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\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\tSystem.out.println(\"Effet: Le \" +tourjoueur.get(j).getNom() + \" force le \" +listejoueur.get(cont.getChoixCible()).getNom() + \" à sacrifier un Croyant\");\r\n\t\t\t\t\r\n\t\t\t\tif (listejoueur.get(cont.getChoixCible()).getNombreCroyantTotal()>0){\r\n\t\t\t\t\tfor(int i=0;i<listejoueur.get(cont.getChoixCible()).getGuidePossede().size();i++){\r\n\t\t\t\t\t\tfor (int k=0;k<listejoueur.get(cont.getChoixCible()).getGuidePossede().get(i).getCroyantPossede().size();k++){\r\n\t\t\t\t\t\t\tlistejoueur.get(cont.getChoixCible()).getGuidePossede().get(i).getCroyantPossede().get(k).setSelectionnee(true); // On rend possible l'utilisation de la carte\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\tlistejoueur.get(cont.getChoixCible()).setDoitSacrifierCroyant(true);\r\n\t\t\t\ttourjoueur.get(j).forcerAction(cont.getChoixCible(),listejoueur.get(cont.getChoixCible()).isDoitSacrifierCroyant(), listejoueur,0,table,collection,tourjoueur);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tSystem.out.println(\"Info : Le \" +listejoueur.get(cont.getChoixCible()).getNom() + \" n'a aucun croyant a sacrifier \");\r\n\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\t\r\n\t\t\t\t max = 0;\r\n\t\t\t\t\tjoueurCible =-1;;\r\n\t\t\t\tfor (int i=0; i<listejoueur.size();i++){\r\n\t\t\t\t\r\n\t\t\t\t\tif (listejoueur.get(i).getGuidePossede().size() > max){\r\n\t\t\t\t\tmax = listejoueur.get(i).getGuidePossede().size();\r\n\t\t\t\t\tjoueurCible = i;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\tSystem.out.println(\"Effet: Le \" +tourjoueur.get(j).getNom() + \" force le \" +listejoueur.get(joueurCible).getNom() + \" à sacrifier un Croyant\");\r\n\t\t\tif (listejoueur.get(joueurCible).getNombreCroyantTotal()>0){\r\n\t\t\t\t\r\n\t\t\t\t\tfor(int i=0;i<listejoueur.get(joueurCible).getGuidePossede().size();i++){\r\n\t\t\t\t\t\tfor (int k=0;k<listejoueur.get(joueurCible).getGuidePossede().get(i).getCroyantPossede().size();k++){\r\n\t\t\t\t\t\t\tlistejoueur.get(joueurCible).getGuidePossede().get(i).getCroyantPossede().get(k).setSelectionnee(true); // On rend possible l'utilisation de la carte\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\tlistejoueur.get(joueurCible).setDoitSacrifierCroyant(true);\r\n\t\t\ttourjoueur.get(j).forcerAction(joueurCible,listejoueur.get(joueurCible).isDoitSacrifierCroyant(), listejoueur,0,table,collection,tourjoueur);\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tSystem.out.println(\"Info : Le \" +listejoueur.get(joueurCible).getNom() + \" n'a aucun croyant à sacrifier\");\r\n\t\t\t}\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\telse if ( id==11){\r\n\t\t\tif (tourjoueur.get(j) == listejoueur.get(0)){\r\n\t\t\t\tSystem.out.println(\"Choisissez le Divinité qui sera forcer de sacrifier un guide\");\r\n\t\t\t\twhile(cont.getChoixCible()==-1){\r\n\t\t\t\t\ttry {\r\n\t\t\t\t\t\tThread.sleep(200);\r\n\t\t\t\t\t} catch (InterruptedException e) {\r\n\t\t\t\t\t\t// TODO Auto-generated catch block\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\tSystem.out.println(\"Effet: Le \" +tourjoueur.get(j).getNom() + \" force le \" +listejoueur.get(cont.getChoixCible()).getNom() + \" à sacrifier un Guide\");\r\n\t\t\t\t\r\n\t\t\t\tif(listejoueur.get(cont.getChoixCible()).getGuidePossede().size()>0){\r\n\t\t\t\t\tfor (int i=0;i<listejoueur.get(cont.getChoixCible()).getGuidePossede().size();i++){\r\n\t\t\t\t\t\tfor(int k=0;k<listejoueur.get(cont.getChoixCible()).getGuidePossede().get(i).getCroyantPossede().size();k++){\r\n\t\t\t\t\t\t\tlistejoueur.get(cont.getChoixCible()).getGuidePossede().get(i).getCroyantPossede().get(k).setSelectionnee(true);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\tlistejoueur.get(cont.getChoixCible()).setDoitSacrifierGuide(true);\r\n\t\t\t\t\ttourjoueur.get(j).forcerAction(cont.getChoixCible(),listejoueur.get(cont.getChoixCible()).isDoitSacrifierGuide(), listejoueur,0,table,collection,tourjoueur);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tSystem.out.println(\"Info : Le \" +listejoueur.get(joueurCible).getNom() + \" n'a aucun guide à sacrifier\");\r\n\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\t\r\n\t\t\t\t max = 0;\r\n\t\t\t\t\tjoueurCible =-1;;\r\n\t\t\t\tfor (int i=0; i<listejoueur.size();i++){\r\n\t\t\t\t\r\n\t\t\t\t\tif (listejoueur.get(i).getGuidePossede().size() > max){\r\n\t\t\t\t\tmax = listejoueur.get(i).getGuidePossede().size();\r\n\t\t\t\t\tjoueurCible = i;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tSystem.out.println(\"Effet: Le \" +tourjoueur.get(j).getNom() + \" force le \" +listejoueur.get(joueurCible).getNom() + \" à sacrifier un Guide\");\r\n\t\t\t\tif (listejoueur.get(joueurCible).getGuidePossede().size()>0){\r\n\t\t\t\t\t\r\n\t\t\t\t\t\tfor(int i=0;i<listejoueur.get(joueurCible).getGuidePossede().size();i++){\r\n\t\t\t\t\t\t\tlistejoueur.get(joueurCible).getGuidePossede().get(i).setSelectionnee(true); // On rend possible l'utilisation de la carte\t\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\tlistejoueur.get(joueurCible).setDoitSacrifierGuide(true);\r\n\t\t\t\ttourjoueur.get(j).forcerAction(joueurCible,listejoueur.get(joueurCible).isDoitSacrifierGuide(), listejoueur,0,table,collection,tourjoueur);\r\n\t\t\t\t}\r\n\t\t\t\telse{\r\n\t\t\t\t\tSystem.out.println(\"Info : Le \" +listejoueur.get(joueurCible).getNom() + \" n'a aucun guide à sacrifier\");\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\n\t\t\tpublic void onItemClick(AdapterView<?> adapterView, View view, int i, long l)\n\t\t\t{\n\t\t\t\tcodigo = iAdapter.getItem(i).getItem();\n\t\t\t\tnombre = iAdapter.getItem(i).getNombre();\n\t\t\t\tfactor = iAdapter.getItem(i).getFactor();\n\t\t\t\tstock = iAdapter.getItem(i).getStock();\n\t\t\t\tprecio = iAdapter.getItem(i).getPrecioPed();\n\t\t\t\taplicaIva = iAdapter.getItem(i).getIva();\n\t\t\t\ttipoItem = iAdapter.getItem(i).getBien();\n\t\t\t\tporuti = iAdapter.getItem(i).getPoruti();\n\t\t\t\tcostop = iAdapter.getItem(i).getCostoP();\n\t\t\t\t\n\t\t\t\tToast.makeText(getApplicationContext(), \"El precio del item es \"+precio, Toast.LENGTH_SHORT).show();\n\t\t\t\t\n\t\t\t\tif(precio > 0)\n\t\t\t\t{\n\t\t\t\t\t//Los almaceno en un ArrayList para luego convertirlo en Json\n\t\t\t\t\tgson = new Gson();\n\t\t\t\t\tString detallesJson = gson.toJson(alDetPedidos);\n\t\t\t\t\t\n\t\t\t\t\t//Esto sirve para cerrar la actividad y en caso de que vuelva atras no se muestre de nuevo esta actividad\n\t\t\t\t\tfinish();\n\t\t\t\t\t\n\t\t\t\t\t//Llamo a la actividade de pedidos y les paso los valores\n\t\t\t\t\tintent = new Intent(getApplicationContext(),MainEdicionPedidos.class);\n\t\t\t\t\tintent.putExtra(\"codigoItem\", codigo);\n\t\t\t\t\tintent.putExtra(\"nombreItem\", nombre);\n\t\t\t\t\tintent.putExtra(\"factorItem\", String.valueOf(factor));\n\t\t\t\t\tintent.putExtra(\"stockItem\", String.valueOf(stock));\n\t\t\t\t\tintent.putExtra(\"precioItem\", String.valueOf(precio));\n\t\t\t\t\tintent.putExtra(\"aplicaIvaItem\", aplicaIva);\n\t\t\t\t\tintent.putExtra(\"tipoItem\", tipoItem);\n\t\t\t\t\tintent.putExtra(\"porutiItem\", String.valueOf(poruti));\n\t\t\t\t\tintent.putExtra(\"costopItem\", String.valueOf(costop));\n\t\t\t\t\tintent.putExtra(\"observacionPed\", observacion);\n\t\t\t\t\tintent.putExtra(\"user\", usuario);\n\t\t\t\t\tintent.putExtra(\"nombreUser\", nombreUsuario);\n\t\t\t\t\tintent.putExtra(\"tipoUser\", tipoUsuario);\n\t\t\t\t\t//Env�o los datos del cliente para que no se pierda el valor al quere regresar a la actividad de pedidos\t\t\t\t\n\t\t\t\t\tintent.putExtra(\"clientePedido\", codigoCliente);\n\t\t\t\t\tintent.putExtra(\"nombreClientePedido\", nombreCliente);\n\t\t\t\t\tintent.putExtra(\"negocioCli\", negocioCliente);\n\t\t\t\t\tintent.putExtra(\"tipoCli\", tipoCliente);\n\t\t\t\t\tintent.putExtra(\"secPedido\", String.valueOf(secped));\n\t\t\t\t\tintent.putExtra(\"numPedido\", String.valueOf(numped));\n\t\t\t\t\t//Les paso los detalles almacenados en un Json\n\t\t\t\t\tintent.putExtra(\"datosDetalles\", detallesJson);\n\t\t\t\t\t//Inicio la actividad\n\t\t\t\t\tstartActivity(intent);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tmensaje = \"El item \" + codigo + \" - \" + nombre + \" no puede ser seleccionado por no tener precio\";\n\t\t\t\t\tdialogo.miDialogoToastLargo(getApplicationContext(),mensaje);\n\t\t\t\t}\n\t\t\t}", "public String agregarDetalleIVAFacturaSRI()\r\n/* 418: */ {\r\n/* 419:421 */ this.servicioFacturaProveedorSRI.cargarDetalleIVARetencion(this.facturaProveedorSRI, null);\r\n/* 420: */ \r\n/* 421:423 */ return \"\";\r\n/* 422: */ }", "public void listar(){\r\n // Verifica si la lista contiene elementoa.\r\n if (!esVacia()) {\r\n // Crea una copia de la lista.\r\n Nodo aux = inicio;\r\n // Posicion de los elementos de la lista.\r\n int i = 0;\r\n // Recorre la lista hasta el final.\r\n while(aux != null){\r\n // Imprime en pantalla el valor del nodo.\r\n System.out.print(i + \".[ \" + aux.getValor() + \" ]\" + \" -> \");\r\n // Avanza al siguiente nodo.\r\n aux = aux.getSiguiente();\r\n // Incrementa el contador de la posión.\r\n i++;\r\n }\r\n }\r\n }", "public void CrearArco(String Identificador, E Dato, Double peso, Vertice Verticei, Vertice Verticef){\r\n this.Vi = Verticei;\r\n this.Vf = Verticef;\r\n this.id = Identificador;\r\n this.Dato = Dato;\r\n this.p = peso;\r\n }", "Items(int quantidade,Produto produto){\n\t\tqntd = quantidade;\n\t\tthis.produto = produto;\n\t\t\n\t}", "public void seleccionarBeneficiario(){\n\t\tvisualizarGrabarRequisito = false;\r\n\t\ttry{\r\n\t\t\tlog.info(\"intItemBeneficiarioSeleccionar:\"+intItemBeneficiarioSeleccionar);\r\n\t\t\tif(intItemBeneficiarioSeleccionar.equals(new Integer(0))){\r\n\t\t\t\tbeneficiarioSeleccionado = null;\r\n\t\t\t\tlistaEgresoDetalleInterfaz = new ArrayList<EgresoDetalleInterfaz>();\r\n\t\t\t\tbdTotalEgresoDetalleInterfaz = null;\r\n\t\t\t\t//\r\n\t\t\t\tmostrarPanelAdjuntoGiro = false;\r\n\t\t\t\tdeshabilitarNuevo = false;\r\n\t\t\t\tdeshabilitarNuevoBeneficiario = false;\r\n\t\t\t\treturn;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor(BeneficiarioPrevision beneficiarioPrevision : expedientePrevisionGirar.getListaBeneficiarioPrevision()){\r\n\t\t\t\tif(beneficiarioPrevision.getId().getIntItemBeneficiario().equals(intItemBeneficiarioSeleccionar)){\r\n\t\t\t\t\tbeneficiarioSeleccionado = beneficiarioPrevision;\r\n\t\t\t\t\tlistaEgresoDetalleInterfaz = previsionFacade.cargarListaEgresoDetalleInterfaz(expedientePrevisionGirar, beneficiarioSeleccionado);\t\t\t\t\t\r\n\t\t\t\t\tbdTotalEgresoDetalleInterfaz = ((EgresoDetalleInterfaz)(listaEgresoDetalleInterfaz.get(0))).getBdSubTotal();;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tList<ControlFondosFijos> listaControlValida = new ArrayList<ControlFondosFijos>();\r\n\t\t\tfor(ControlFondosFijos controlFondosFijos : listaControl){\r\n\t\t\t\tAcceso acceso = bancoFacade.obtenerAccesoPorControlFondosFijos(controlFondosFijos);\r\n\t\t\t\tlog.info(controlFondosFijos);\r\n\t\t\t\tlog.info(acceso);\t\t\t\t\r\n\t\t\t\tif(acceso!=null\r\n\t\t\t\t&& acceso.getAccesoDetalleUsar()!=null\r\n\t\t\t\t&& acceso.getAccesoDetalleUsar().getBdMontoMaximo()!=null\r\n\t\t\t\t&& acceso.getAccesoDetalleUsar().getBdMontoMaximo().compareTo(bdTotalEgresoDetalleInterfaz)>=0){\r\n\t\t\t\t\tlistaControlValida.add(controlFondosFijos);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tvisualizarGrabarRequisito = true;\r\n\t\t\tdeshabilitarNuevoBeneficiario = false;\r\n\t\t\t\r\n\t\t\tif(listaControlValida.isEmpty() && intItemBeneficiarioSeleccionar!=0){\r\n\t\t\t\t//Deshabilitamos todos los campos para detener el proceso de grabacion\r\n\t\t\t\tif(validarExisteRequisito()) {\r\n\t\t\t\t\tmensajeAdjuntarRequisito = \"No existe un fondo de cambio con un monto máximo configurado que soporte el monto de giro del expediente.\"+\r\n\t\t\t\t\t \"Este giro será realizado por la Sede Central.\";\r\n\t\t\t\t\tmostrarMensajeAdjuntarRequisito = true;\r\n\t\t\t\t\tmostrarPanelAdjuntoGiro = true;\r\n\t\t\t\t\thabilitarGrabarRequisito = true;\t\r\n\t\t\t\t\tvisualizarGrabarAdjunto = true;\r\n\t\t\t\t\tdeshabilitarNuevo = true;\r\n\t\t\t\t\tdeshabilitarDescargaAdjuntoGiro = false;\r\n\r\n\t\t\t\t}else{\r\n\t\t\t\t\tmensajeAdjuntarRequisito = \"Ya existen requisitos registrados para este expediente.\";\r\n\t\t\t\t\tarchivoAdjuntoGiro = previsionFacade.getArchivoPorRequisitoPrevision(lstRequisitoPrevision.get(0));\r\n\t\t\t\t\tmostrarMensajeAdjuntarRequisito = true;\r\n\t\t\t\t\tmostrarPanelAdjuntoGiro = true;\r\n\t\t\t\t\thabilitarGrabarRequisito = false;\r\n\t\t\t\t\tvisualizarGrabarAdjunto =false;\r\n\t\t\t\t\tdeshabilitarNuevo = true;\r\n\t\t\t\t\tdeshabilitarDescargaAdjuntoGiro = true;\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tvisualizarGrabarRequisito = false;\r\n\t\t\t\tmostrarPanelAdjuntoGiro = false;\r\n\t\t\t\tdeshabilitarNuevo = false;\r\n\t\t\t\tdeshabilitarDescargaAdjuntoGiro = false;\r\n\t\t\t\t\r\n\t\t\t}\r\n\t\t}catch (Exception e){\r\n\t\t\tlog.error(e.getMessage(),e);\r\n\t\t}\r\n\t}", "Vaisseau_estOrdonneeCouverte createVaisseau_estOrdonneeCouverte();", "public void recupera() {\n Cliente clienteActual;\n clienteActual=clienteDAO.buscaId(c.getId());\n if (clienteActual!=null) {\n c=clienteActual;\n } else {\n c=new Cliente();\n }\n }", "public void aplicarDescuento();", "public Venta(Producto producto,Cliente comprador,Cliente vendedor){\n this.fechaCompra=fechaCompra.now();\n this.comprador=comprador;\n this.vendedor=vendedor;\n this.producto=producto;\n \n }", "public void creaAddebiti(Date dataInizio, Date dataFine, ArrayList<Integer> codiciConto) {\n /* variabili e costanti locali di lavoro */\n boolean continua;\n Date dataCorr;\n Modulo modulo;\n Navigatore nav;\n ProgressBar pb;\n OpAddebiti operazione;\n\n try { // prova ad eseguire il codice\n\n /* controllo di sicurezza che le date siano in sequenza */\n continua = Lib.Data.isSequenza(dataInizio, dataFine);\n\n /* esecuzione operazione */\n if (continua) {\n modulo = Albergo.Moduli.Conto();\n nav = modulo.getNavigatoreCorrente();\n pb = nav.getProgressBar();\n operazione = new OpAddebiti(pb, dataInizio, dataFine, codiciConto);\n operazione.avvia();\n }// fine del blocco if\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n }", "private void adicionaMusicasVaziasCD () {\n\t\tfor (int i = 0; i < M; i++) {\n\t\t\tfaixasCD.add(i, \"\");\n\t\t}\n\t}", "private void creaModuloMem() {\n /* variabili e costanti locali di lavoro */\n ArrayList<Campo> campi = new ArrayList<Campo>();\n ModuloRisultati modulo;\n Campo campo;\n\n try { // prova ad eseguire il codice\n\n campo = CampoFactory.intero(Campi.Ris.codicePiatto.getNome());\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.nomePiatto.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"piatto\");\n campo.setToolTipLista(\"nome del piatto\");\n campo.decora()\n .etichetta(\"nome del piatto\"); // le etichette servono per il dialogo ricerca\n campo.setLarghezza(250);\n campi.add(campo);\n\n campo = CampoFactory.testo(Campi.Ris.categoria.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"categoria\");\n campo.setToolTipLista(\"categoria del piatto\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteVolte.getNome());\n campo.setVisibileVistaDefault();\n campo.setLarghezza(80);\n campo.setTitoloColonna(\"quante volte\");\n campo.setToolTipLista(\n \"quante volte questo piatto è stato offerto nel periodo analizzato\");\n campo.decora().etichetta(\"quante volte\");\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quantiCoperti.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"coperti\");\n campo.setToolTipLista(\"numero di coperti che avrebbero potuto ordinare\");\n campo.decora().etichetta(\"n. coperti\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n campo = CampoFactory.intero(Campi.Ris.quanteComande.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"comande\");\n campo.setToolTipLista(\"numero di comande effettive\");\n campo.decora().etichetta(\"n. comande\");\n campo.setLarghezza(80);\n campo.setTotalizzabile(true);\n campi.add(campo);\n\n campo = CampoFactory.percentuale(Campi.Ris.gradimento.getNome());\n campo.setVisibileVistaDefault();\n campo.setTitoloColonna(\"gradimento\");\n campo.setToolTipLista(\n \"percentuale di gradimento (è il 100% se tutti i coperti potenziali lo hanno ordinato)\");\n campo.decora().etichetta(\"% gradimento\");\n campo.setLarghezza(80);\n campi.add(campo);\n\n modulo = new ModuloRisultati(campi);\n setModuloRisultati(modulo);\n\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n } // fine del blocco try-catch\n\n }", "private String insertarCartaVitalTransfusion() {\n int[] valoresEnemigo = {\n// this.dañoEnemigo=valoresEnemigo[0];\n 3,\n// this.curaEnemigo=valoresEnemigo[1];\n 0,\n// this.cartasEnemigo=valoresEnemigo[2];\n 0,\n// this.descarteEnemigo=valoresEnemigo[3];\n 0,\n// this.recursosEnemigo=valoresEnemigo[4];\n 0,\n// this.moverMesaAManoEnemigo=valoresEnemigo[5];\n 0,\n// this.moverDescarteAManoEnemigo=valoresEnemigo[6];\n 0,\n// this.moverDeckAManoEnemigo=valoresEnemigo[7];\n 0,\n// this.moverMesaADeckEnemigo=valoresEnemigo[8];\n 0,\n// this.moverDescarteADeckEnemigo=valoresEnemigo[9];\n 0,\n// this.moverManoADeckEnemigo=valoresEnemigo[10];\n 0,\n// this.moverMesaADescarteEnemigo=valoresEnemigo[11];\n 0,\n// this.moverManoADescarteEnemigo=valoresEnemigo[12];\n 0,\n// this.moverDeckADescarteEnemigo=valoresEnemigo[13];\n 0,\n// this.moverDescarteAMesaEnemigo=valoresEnemigo[14];\n 0,\n// this.moverManoAMesaEnemigo=valoresEnemigo[15];\n 0,\n// this.moverDeckAMesaEnemigo=valoresEnemigo[16];\n 0\n };\n int[] valoresOwner = {\n// this.dañoOwner=valoresOwner[0];\n 0,\n// this.curaOwner=valoresOwner[1];\n 2,\n// this.cartasOwner=valoresOwner[2];\n 0,\n// this.descarteOwner=valoresOwner[3];\n 0,\n// this.recursosOwner=valoresOwner[4];\n 0,\n// this.moverMesaAManoOwner=valoresOwner[5];\n 0,\n// this.moverDescarteAManoOwner=valoresOwner[6];\n 0,\n// this.moverDeckAManoOwner=valoresOwner[7];\n 0,\n// this.moverMesaADeckOwner=valoresOwner[8];\n 0,\n// this.moverDescarteADeckOwner=valoresOwner[9];\n 0,\n// this.moverManoADeckOwner=valoresOwner[10];\n 0,\n// this.moverMesaADescarteOwner=valoresOwner[11];\n 0,\n// this.moverManoADescarteOwner=valoresOwner[12];\n 0,\n// this.moverDeckADescarteOwner=valoresOwner[13];\n 0,\n// this.moverDescarteAMesaOwner=valoresOwner[14];\n 0,\n// this.moverManoAMesaOwner=valoresOwner[15];\n 0,\n// this.moverDeckAMesaOwner=valoresOwner[16];\n 0\n };\n boolean[]valoresPlay={\n //this.OnMoveMesaADescarte=valoresPlay[0];\n false,\n //this.OnMoveMesaADeck=valoresPlay[1];\n false,\n //this.OnMoveMesaAMano=valoresPlay[2];\n false,\n //this.OnMoveDescarteAMesa=valoresPlay[3];\n false,\n //this.OnMoveDescarteADeck=valoresPlay[4];\n false,\n// this.OnMoveDescarteAMano=valoresPlay[5];\n false,\n// this.OnMoveDeckADescarte=valoresPlay[6];\n false,\n// this.OnMoveDeckAMesa=valoresPlay[7];\n false,\n// this.OnMoveDeckAMano=valoresPlay[8];\n false,\n// this.OnMoveManoADescarte=valoresPlay[9];\n false,\n// this.OnMoveManoAMesa=valoresPlay[10];\n true,\n// this.OnMoveManoADeck=valoresPlay[11];\n false,\n// this.OnStartTurnTable=valoresPlay[12];\n false,\n// this.OnStartTurnHand=valoresPlay[13];\n false,\n// this.OnStartTurnDiscard=valoresPlay[14];\n false,\n// this.OnStartTurnDeck=valoresPlay[15];\n false,\n// this.OnEndTurnTable=valoresPlay[16];\n false,\n// this.OnEndTurnHand=valoresPlay[17];\n false,\n// this.OnEndTurnDiscard=valoresPlay[18];\n false,\n// this.OnEndTurnDeck=valoresPlay[19];\n false,\n };\n ArrayList<Integer> datos = new ArrayList<Integer>();\n String nombre = \"\";\n for (int i = 0; i < valoresEnemigo.length; i++) {\n datos.add(valoresEnemigo[i]);\n }\n for (int i = 0; i < valoresOwner.length; i++) {\n datos.add(valoresOwner[i]);\n }\n for (int i = 0; i < valoresPlay.length; i++) {\n if(valoresPlay[i]){\n datos.add(1);\n }else{\n datos.add(0);\n }\n }\n String insert=\"\";\n for(int i=0;i<datos.size();i++){\n if(i<datos.size()-1) {\n insert += datos.get(i) + \", \";\n }else{\n insert += datos.get(i) + \" )\";\n }\n }\n return insert;\n }", "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 }", "private static void cadastroProduto() {\n\n\t\tString nome = Entrada(\"PRODUTO\");\n\t\tdouble PrecoComprado = Double.parseDouble(Entrada(\"VALOR COMPRA\"));\n\t\tdouble precoVenda = Double.parseDouble(Entrada(\"VALOR VENDA\"));\n String informacaoProduto = Entrada(\"INFORMAÇÃO DO PRODUTO\");\n String informacaoTecnicas = Entrada(\"INFORMAÇÕES TÉCNICAS\");\n\n\t\tProduto produto = new Produto(nome, PrecoComprado, precoVenda, informacaoProduto,informacaoTecnicas);\n\n\t\tListaDProduto.add(produto);\n\n\t}", "public void agregarAlInicio(String valor){\r\n // Define un nuevo nodo.\r\n Nodo nuevo = new Nodo();\r\n // Agrega al valor al nodo.\r\n nuevo.setValor(valor);\r\n // Consulta si la lista esta vacia.\r\n if (esVacia()) {\r\n // Inicializa la lista agregando como inicio al nuevo nodo.\r\n inicio = nuevo;\r\n // Caso contrario va agregando los nodos al inicio de la lista.\r\n } else{\r\n // Une el nuevo nodo con la lista existente.\r\n nuevo.setSiguiente(inicio);\r\n // Renombra al nuevo nodo como el inicio de la lista.\r\n inicio = nuevo;\r\n }\r\n // Incrementa el contador de tamaño de la lista.\r\n tamanio++;\r\n }", "@Override\n\tpublic int sacameVida(ElementoSoldado a) {\n\t\treturn 0;\n\t}", "private static void Relatorio() throws Exception \r\n {//Inicio menuRelatorio\r\n byte opcao;\r\n boolean fecharMenu = false;\r\n int idCliente, idProduto, quant;\r\n Produto p = null;\r\n Cliente c = null;\r\n do{\r\n System.out.println(\r\n \"\\n\\t*** MENU RELATORIO ***\\n\" +\r\n \"0 - Mostrar os N produtos mais Vendidos\\n\" +\r\n \"1 - Mostrar os N melhores clientes\\n\" +\r\n \"2 - Mostrar os produtos comprados por um cliente\\n\" +\r\n \"3 - Mostrar Clientes que compraram um produto\\n\" +\r\n \"4 - Sair\"\r\n );\r\n System.out.print(\"Digite sua opcao: \");\r\n opcao = read.nextByte();\r\n switch(opcao){\r\n case 0:\r\n ArrayList<Produto> listP = arqProdutos.toList();\r\n if(listP.isEmpty()) System.out.println(\"\\nNão tem produtos em nosso sistema ainda!\");\r\n else{\r\n System.out.print(\"Digite a quantidade de produtos que deseja saber: \");\r\n quant = read.nextInt();\r\n System.out.println();\r\n //Ordena a lista de forma decrescente:\r\n listP.sort((p1,p2) -> - Integer.compare(p1.getQuantVendidos(), p2.getQuantVendidos()));\r\n for(Produto n: listP){\r\n System.out.println(\"Produto de ID: \" + n.getID() + \" Nome: \" + n.nomeProduto + \"\\tQuantidade vendida: \" + n.getQuantVendidos());\r\n quant--;\r\n if(quant == 0) break;\r\n }\r\n }\r\n break;\r\n case 1:\r\n ArrayList<Cliente> listC = arqClientes.toList();\r\n if(listC.isEmpty()) System.out.println(\"Não ha clientes para mostrar!\");\r\n else{\r\n System.out.print(\"Digite a quantidade de Clientes: \");\r\n quant = read.nextInt();\r\n System.out.println();\r\n //Ordena a lista de forma decrescente:\r\n listC.sort((c1,c2) -> - Float.compare(c1.getTotalGasto(), c2.getTotalGasto()));\r\n for(Cliente n: listC){\r\n System.out.println(\"Cliente de ID: \" + n.getID() + \" Nome: \" + n.nomeCliente + \"\\tGasto total: \" + tf.format(n.getTotalGasto()));\r\n quant--;\r\n if(quant == 0) break; \r\n }\r\n }\r\n break;\r\n case 2:\r\n System.out.print(\"Digite o id do cliente: \");\r\n idCliente = read.nextInt();\r\n c = arqClientes.pesquisar(idCliente - 1);\r\n if (c != null){\r\n int[] idsProdutos = indice_Cliente_Produto.lista(idCliente);\r\n System.out.println(\"\\nO cliente \" + c.nomeCliente + \" de ID \" + c.getID() + \" comprou: \");\r\n for(int i = 0; i < idsProdutos.length; i++){\r\n p = arqProdutos.pesquisar(idsProdutos[i] - 1);\r\n System.out.println(\r\n \"\\n\\tProduto \" + i + \" -> \" + \r\n \" ID: \" + p.getID() + \r\n \" Nome: \" + p.nomeProduto + \r\n \" Marca: \" + p.marca\r\n );\r\n }\r\n }\r\n else {\r\n System.out.println(\"\\nID Invalido!\");\r\n Thread.sleep(1000);\r\n }\r\n break;\r\n case 3:\r\n System.out.print(\"Digite o id do Produto a consultar: \");\r\n idProduto = read.nextInt();\r\n p = arqProdutos.pesquisar(idProduto - 1);\r\n if(p != null){\r\n int[] idsClientes = indice_Produto_Cliente.lista(idProduto);\r\n System.out.println(\"\\nO produto '\" + p.nomeProduto + \"' de ID \" + p.getID() + \" foi comprado por: \");\r\n for(int i = 0; i < idsClientes.length; i++){\r\n c = arqClientes.pesquisar(idsClientes[i] - 1);\r\n System.out.println();\r\n System.out.println(c);\r\n }\r\n }\r\n else{\r\n System.out.println(\"\\nProduto Inexistende!\");\r\n Thread.sleep(1000);\r\n }\r\n break;\r\n case 4:\r\n fecharMenu = true;\r\n break; \r\n default:\r\n System.out.println(\"Opcao invalida!\\n\");\r\n Thread.sleep(1000);\r\n break;\r\n }\r\n }while(!fecharMenu); \r\n }", "public void almacenoDatos(){\n BaseDatosSecundaria administrador= new BaseDatosSecundaria(this);\n SQLiteDatabase bdsecunadaria= administrador.getWritableDatabase();\n _valuesPedido.put(\"Producto\", this._productoNombre);\n _valuesPedido.put(\"Precio\",this._productoPrecio);\n _valuesPedido.put(\"Cantidad\",this._etAdquirir.getText().toString());\n _valuesPedido.put(\"Vendedor\",this.username);\n _valuesPedido.put(\"Id_Producto\",this._productoId);\n bdsecunadaria.insert(\"DATOS\",null,this._valuesPedido);\n bdsecunadaria.close();\n }", "private String elaboraAvvisoScrittura() {\n String testo = VUOTA;\n\n if (usaHeadNonScrivere) {\n testo += TAG_NON_SCRIVERE;\n testo += A_CAPO;\n }// end of if cycle\n\n return testo;\n }", "Vaisseau_seDeplacerVersLaDroite createVaisseau_seDeplacerVersLaDroite();", "private static void atualizaContadorCodigos(ArrayList<Produto> produto) {\n int contadorAtual = produto.size() + 1;\n Produto.setContador(contadorAtual);\n }", "Secuencia createSecuencia();", "public void agregarDatosProductoText() {\n if (cantidadProducto != null && cantidadProducto > 0) {\n //agregando detalle a la Lista de Detalle\n listDetalle.add(new Detallefactura(null, this.producto.getCodBarra(),\n this.producto.getNombreProducto(), cantidadProducto, this.producto.getPrecioVenta(),\n this.producto.getPrecioVenta().multiply(new BigDecimal(cantidadProducto))));\n \n //Seteamos el producto al item del detalle\n //Accedemos al ultimo Item agregado a la lista\n listDetalle.get(listDetalle.size()-1).setCodProducto(producto);\n \n //Seteamos la factura al item del detalle\n //Accedemos al ultimo Item agregado a la lista \n // listDetalle.get(listDetalle.size()-1).setCodFactura(factura);\n \n cantidadProducto = null;\n //limpiamos la variable\n codigoBarra = \"\";\n //Invocamos al metodo que calcula el Total de la Venta para la factura\n totalFacturaVenta();\n\n //Actualizamos el componente ImputText\n RequestContext.getCurrentInstance().update(\"frmFactura:inputCodProducto\");\n //Mensaje de confirmacion de exito de la operacion \n FacesMessage message = new FacesMessage(FacesMessage.SEVERITY_INFO, \"Correcto\", \"Producto agregado correctamente!\");\n FacesContext.getCurrentInstance().addMessage(null, message);\n } else {\n cantidadProducto = null;\n //limpiamos la variable\n codigoBarra = \"\";\n //Actualizamos el componente ImputText\n RequestContext.getCurrentInstance().update(\"frmFactura:inputCodProducto\");\n }\n\n }", "private void cargarDatos() {\r\n txtRucDni.setText(objVentas.getObjCliente().getStr_rucdni());\r\n txtCliente.setText(objVentas.getObjCliente().getStr_razonSocial());\r\n txtDocumento.setText(objVentas.getStr_numeroDocumento());\r\n txtMonto.setText(String.valueOf(Util.redondeo(objVentas.getDbTotal(), 2) ));\r\n txtPaga.requestFocus();\r\n setLocationRelativeTo(null);\r\n\r\n String arr[] = objVentas.getStr_numeroDocumento().split(\"-\");\r\n \r\n \r\n \r\n \r\n List<Ventas> listaVentaDetalle = new ArrayList<>();\r\n listaVentaDetalle = PaqueteBusinessDelegate.getFlujoCajaService().\r\n listarVenta(String.valueOf(gui.getLocal().getInt_idLocal()), Util.SINPAGO, objVentas.getStr_numeroDocumento(), 2);\r\n cargarTabla(listaVentaDetalle);\r\n \r\n int cantidadDocumentos;\r\n if (!this.gui.getListaConfig().get(0).getTipoImpresion().equals(Config.TICKETERA)){\r\n //Determinar la cantidad de productos por documentos\r\n cantidadDocumentos=(listaVentaDetalle.size()/10);\r\n log.info(\"Cantidad: \"+cantidadDocumentos);\r\n\r\n if(listaVentaDetalle.size()%10!=0)\r\n cantidadDocumentos++;\r\n }else{\r\n cantidadDocumentos = 1;\r\n }\r\n \r\n \r\n log.info(\"Cantidad: \"+cantidadDocumentos);\r\n \r\n// System.out.println(\"local : \"+objVentas.getObjLocal().getInt_idLocal()+\" tD :\"+arr[2].trim());\r\n txtNroDocumento.setText(PaqueteBusinessDelegate.getVentasService().\r\n consultaSiguinteCorrelativo(objVentas.getObjLocal().getInt_idLocal(), arr[2].trim()));\r\n \r\n// System.out.println(\"consulta : \"+PaqueteBusinessDelegate.getVentasService().\r\n// consultaSiguinteCorrelativo(objVentas.getObjLocal().getInt_idLocal(), arr[2].trim()));\r\n String documento=txtNroDocumento.getText();\r\n String statico=txtNroDocumento.getText().split(\"/\")[0];\r\n// System.out.println(\"estatico : \"+statico);\r\n statico=statico.split(\"-\")[0].concat(\"-\").concat(statico.split(\"-\")[1]).concat(\"-\");\r\n \r\n\r\n if (cantidadDocumentos>1){\r\n for (int i=1;i<cantidadDocumentos;i++){\r\n \r\n if (i<cantidadDocumentos)\r\n documento+=\";\";\r\n \r\n documento+=statico.concat(String.valueOf( Util.stringTOint(\r\n txtNroDocumento.getText().split(\"/\")[0].split(\"-\")[2])+i)).\r\n concat(\"/\").concat(txtNroDocumento.getText().split(\"/\")[1]);\r\n\r\n \r\n log.info(\"NRO: \"+documento);\r\n }\r\n txtNroDocumento.setText(documento);\r\n }\r\n \r\n \r\n \r\n \r\n }", "public CensoCCVnoREMExcluidos() {\n this.nombre = \"\";\n this.apellidom = \"\";\n this.apellidop = \"\";\n this.rut = \"\";\n this.edad = 0;\n this.razon_exclusion = \"\";\n }", "private int creaSingoloAddebito(int cod, Date data) {\n /* variabili e costanti locali di lavoro */\n int nuovoRecord = 0;\n boolean continua;\n Dati dati;\n int codConto = 0;\n int codListino = 0;\n int quantita = 0;\n double prezzo = 0.0;\n Campo campoConto = null;\n Campo campoListino = null;\n Campo campoQuantita = null;\n Campo campoPrezzo = null;\n Campo campoData = null;\n Campo campoFissoConto = null;\n Campo campoFissoListino = null;\n Campo campoFissoQuantita = null;\n Campo campoFissoPrezzo = null;\n ArrayList<CampoValore> campi = null;\n Modulo modAddebito = null;\n Modulo modAddebitoFisso = null;\n\n try { // prova ad eseguire il codice\n\n modAddebito = Progetto.getModulo(Addebito.NOME_MODULO);\n modAddebitoFisso = Progetto.getModulo(AddebitoFisso.NOME_MODULO);\n\n /* carica tutti i dati dall'addebito fisso */\n dati = modAddebitoFisso.query().caricaRecord(cod);\n continua = dati != null;\n\n /* recupera i campi da leggere e da scrivere */\n if (continua) {\n\n /* campi del modulo Addebito Fisso (da leggere) */\n campoFissoConto = modAddebitoFisso.getCampo(Addebito.Cam.conto.get());\n campoFissoListino = modAddebitoFisso.getCampo(Addebito.Cam.listino.get());\n campoFissoQuantita = modAddebitoFisso.getCampo(Addebito.Cam.quantita.get());\n campoFissoPrezzo = modAddebitoFisso.getCampo(Addebito.Cam.prezzo.get());\n\n /* campi del modulo Addebito (da scrivere) */\n campoConto = modAddebito.getCampo(Addebito.Cam.conto.get());\n campoListino = modAddebito.getCampo(Addebito.Cam.listino.get());\n campoQuantita = modAddebito.getCampo(Addebito.Cam.quantita.get());\n campoPrezzo = modAddebito.getCampo(Addebito.Cam.prezzo.get());\n campoData = modAddebito.getCampo(Addebito.Cam.data.get());\n\n }// fine del blocco if\n\n /* legge i dati dal record di addebito fisso */\n if (continua) {\n codConto = dati.getIntAt(campoFissoConto);\n codListino = dati.getIntAt(campoFissoListino);\n quantita = dati.getIntAt(campoFissoQuantita);\n prezzo = (Double)dati.getValueAt(0, campoFissoPrezzo);\n dati.close();\n }// fine del blocco if\n\n /* crea un nuovo record in addebito */\n if (continua) {\n campi = new ArrayList<CampoValore>();\n campi.add(new CampoValore(campoConto, codConto));\n campi.add(new CampoValore(campoListino, codListino));\n campi.add(new CampoValore(campoQuantita, quantita));\n campi.add(new CampoValore(campoPrezzo, prezzo));\n campi.add(new CampoValore(campoData, data));\n nuovoRecord = modAddebito.query().nuovoRecord(campi);\n continua = nuovoRecord > 0;\n }// fine del blocco if\n\n /* aggiorna la data di sincronizzazione in addebito fisso */\n if (continua) {\n this.getModulo().query().registraRecordValore(cod, Cam.dataSincro.get(), data);\n }// fine del blocco if\n\n } catch (Exception unErrore) { // intercetta l'errore\n Errore.crea(unErrore);\n }// fine del blocco try-catch\n\n /* valore di ritorno */\n return nuovoRecord;\n }", "@Override\n\tpublic void crearNuevaPoblacion() {\n\t\t/* Nos quedamos con los mejores individuos. Del resto, cruzamos la mitad, los mejores,\n\t\t * y el resto los borramos.*/\n\t\tList<IIndividuo> poblacion2 = new ArrayList<>();\n\t\tint numFijos = (int) (poblacion.size()/2);\n\t\t/* Incluimos el 50%, los mejores */\n\t\tpoblacion2.addAll(this.poblacion.subList(0, numFijos));\n\t\t\n\t\t/* De los mejores, mezclamos la primera mitad \n\t\t * con todos, juntandolos de forma aleatoria */\n\t\tList<IIndividuo> temp = poblacion.subList(0, numFijos+1);\n\t\tfor(int i = 0; i < temp.size()/2; i++) {\n\t\t\tint j;\n\t\t\tdo {\n\t\t\t\tj = Individuo.aleatNum(0, temp.size()-1);\n\t\t\t}while(j != i);\n\t\t\t\n\t\t\ttry {\n\t\t\t\tpoblacion2.addAll(cruce(temp.get(i), temp.get(j)));\n\t\t\t} catch (CruceNuloException e) {\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t\t\n\t\t//this.poblacion.clear();\n\t\tthis.poblacion = poblacion2;\n\t}", "public void getSconti() {\r\n\t\tsconti = ac.getScontiDisponibili();\r\n\t\t//la tabella sara' non nulla quando sara' caricato il file VisualizzaLog.fxml\r\n\t\tif(tabellaSconti!= null) {\r\n\t\t\tvaloreScontiCol.setCellValueFactory(new PropertyValueFactory<Sconto, Integer>(\"valore\"));\r\n\t puntiRichiestiCol.setCellValueFactory(new PropertyValueFactory<Sconto, String>(\"puntiRichiesti\"));\r\n\t spesaMinimaCol.setCellValueFactory(new PropertyValueFactory<Sconto, String>(\"spesaMinima\"));\r\n\t \r\n\t Collections.sort(sconti);\r\n\t tabellaSconti.getItems().setAll(sconti);\r\n\t \r\n\t tabellaSconti.setOnMouseClicked(e -> {\r\n\t \tif(aggiungi.isDisabled() && elimina.isDisabled()) \r\n\t \t\ttotale.setText(\"\" + ac.applicaSconto(tabellaSconti.getSelectionModel().getSelectedItem()));\r\n\t });\r\n\t }\r\n\t}" ]
[ "0.619184", "0.614264", "0.6110364", "0.6075752", "0.6072246", "0.60591614", "0.60551685", "0.6041224", "0.60403514", "0.6006461", "0.6005658", "0.5956549", "0.5940723", "0.5933261", "0.59027684", "0.5897068", "0.5893936", "0.5892146", "0.58921087", "0.5883038", "0.5851655", "0.5845636", "0.5840117", "0.58228076", "0.5812577", "0.58081603", "0.58078426", "0.579837", "0.57942647", "0.5773363", "0.5772832", "0.5752123", "0.5743811", "0.5743333", "0.57307816", "0.57241106", "0.5718961", "0.5717377", "0.5716953", "0.5716378", "0.5715814", "0.57072717", "0.5702302", "0.5700696", "0.5691198", "0.5683525", "0.5679902", "0.56721294", "0.56711847", "0.5668706", "0.5666438", "0.5665445", "0.56618917", "0.566123", "0.5657359", "0.56556875", "0.5649668", "0.56483936", "0.5640493", "0.5639776", "0.56383485", "0.5637137", "0.5635367", "0.56308126", "0.56304395", "0.5628381", "0.56264746", "0.5615362", "0.5613089", "0.56030005", "0.5601499", "0.5598086", "0.5594528", "0.55871034", "0.5586162", "0.55849034", "0.5583194", "0.55830514", "0.55818546", "0.5580405", "0.5578404", "0.5574527", "0.55730593", "0.55717", "0.5565859", "0.5560624", "0.5560243", "0.5550635", "0.5550503", "0.55504227", "0.554871", "0.55478936", "0.55466753", "0.5543608", "0.55428624", "0.554024", "0.5537246", "0.5536717", "0.5535589", "0.55323374", "0.55317336" ]
0.0
-1
Handles the HTTP GET method.
@Override protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void doGet( )\n {\n \n }", "@Override\n\tprotected void executeGet(GetRequest request, OperationResponse response) {\n\t}", "@Override\n\tprotected Method getMethod() {\n\t\treturn Method.GET;\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}", "@Override\n protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t}", "@Override\r\n\tprotected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoGet(req, resp);\r\n\t}", "void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException;", "@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 \r\n }", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\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 metGet(request, response);\n }", "public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"GET log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) return;\r\n\tif (\"get-response\".equals( requestId )) {\r\n\t try {\r\n\t\tonMEVPollsForResponse( req, resp );\r\n\t } catch (Exception e) {\r\n\t\tlogError( req, resp, e, \"MEV polling error\" );\r\n\t\tsendError( resp, \"MEV polling error: \" + e.toString() );\r\n\t }\r\n\t}\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\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t\t\n\t}", "@Override\r\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\r\n\t}", "public void doGet() throws IOException {\n\n // search ressource\n byte[] contentByte = null;\n try {\n contentByte = ToolBox.readFileByte(RESOURCE_DIRECTORY, this.url);\n this.statusCode = OK;\n ContentType contentType = new ContentType(this.extension);\n sendHeader(statusCode, contentType.getContentType(), contentByte.length);\n } catch (IOException e) {\n System.out.println(\"Ressource non trouvé\");\n statusCode = NOT_FOUND;\n contentByte = ToolBox.readFileByte(RESPONSE_PAGE_DIRECTORY, \"pageNotFound.html\");\n sendHeader(statusCode, \"text/html\", contentByte.length);\n }\n\n this.sendBodyByte(contentByte);\n }", "public HttpResponseWrapper invokeGET(String path) {\n\t\treturn invokeHttpMethod(HttpMethodType.HTTP_GET, path, \"\");\n\t}", "@Override\n\tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@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\tprotected void doGet(HttpServletRequest request,\n\t\t\tHttpServletResponse response) throws ServletException, IOException {\n\t}", "public Result get(Get get) throws IOException;", "@Override\n public void doGet(HttpServletRequest request, HttpServletResponse response) {\n System.out.println(\"[Servlet] GET request \" + request.getRequestURI());\n\n response.setContentType(FrontEndServiceDriver.APP_TYPE);\n response.setStatus(HttpURLConnection.HTTP_BAD_REQUEST);\n\n try {\n String url = FrontEndServiceDriver.primaryEventService +\n request.getRequestURI().replaceFirst(\"/events\", \"\");\n HttpURLConnection connection = doGetRequest(url);\n\n if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) {\n PrintWriter pw = response.getWriter();\n JsonObject responseBody = (JsonObject) parseResponse(connection);\n\n response.setStatus(HttpURLConnection.HTTP_OK);\n pw.println(responseBody.toString());\n }\n }\n catch (Exception ignored) {}\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 throws ServletException, IOException {\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tSystem.out.println(\"get\");\n\t\tthis.doPost(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doGet(req, resp);\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {}", "@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\n public final void doGet() {\n try {\n checkPermissions(getRequest());\n // GET one\n if (id != null) {\n output(api.runGet(id, getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER)));\n } else if (countParameters() == 0) {\n throw new APIMissingIdException(getRequestURL());\n }\n // Search\n else {\n\n final ItemSearchResult<?> result = api.runSearch(Integer.parseInt(getParameter(PARAMETER_PAGE, \"0\")),\n Integer.parseInt(getParameter(PARAMETER_LIMIT, \"10\")), getParameter(PARAMETER_SEARCH),\n getParameter(PARAMETER_ORDER), parseFilters(getParameterAsList(PARAMETER_FILTER)),\n getParameterAsList(PARAMETER_DEPLOY), getParameterAsList(PARAMETER_COUNTER));\n\n head(\"Content-Range\", result.getPage() + \"-\" + result.getLength() + \"/\" + result.getTotal());\n\n output(result.getResults());\n }\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n }\n }", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tthis.service(req, resp);\r\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\n\t}", "@RequestMapping(value = \"/{id}\", method = RequestMethod.GET)\n public void get(@PathVariable(\"id\") String id, HttpServletRequest req){\n throw new NotImplementedException(\"To be implemented\");\n }", "@Override\npublic void get(String url) {\n\t\n}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\t\r\n\t}", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString action = req.getParameter(\"action\");\r\n\t\t\r\n\t\tif(action == null) {\r\n\t\t\taction = \"List\";\r\n\t\t}\r\n\t\t\r\n\t\tswitch(action) {\r\n\t\t\tcase \"List\":\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t\t\t\t\t\r\n\t\t\tdefault:\r\n\t\t\t\tlistUser(req, resp);\r\n\t\t}\r\n\t\t\r\n\t\t\r\n\t}", "@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}", "@NonNull\n public String getAction() {\n return \"GET\";\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\n\t\tprocess(req,resp);\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "@Override\r\nprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t process(req,resp);\r\n\t }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tprocess(req, resp);\n\t}", "@Override\n\tpublic HttpResponse get(final String endpoint) {\n\t\treturn httpRequest(HTTP_GET, endpoint, null);\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\t}", "@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 }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.setContentType(\"text/plain\");\n // Actual logic goes here.\n PrintWriter out = response.getWriter();\n out.println(\"Wolken,5534-0848-5100,0299-6830-9164\");\n\ttry \n\t{\n Get g = new Get(Bytes.toBytes(request.getParameter(\"userid\")));\n Result r = table.get(g);\n byte [] value = r.getValue(Bytes.toBytes(\"v\"),\n Bytes.toBytes(\"\"));\n\t\tString valueStr = Bytes.toString(value);\n\t\tout.println(valueStr);\n\t}\n\tcatch (Exception e)\n\t{\n\t\tout.println(e);\n\t}\n }", "@Override\r\n public void doGet(String path, HttpServletRequest request, HttpServletResponse response)\r\n throws Exception {\r\n // throw new UnsupportedOperationException();\r\n System.out.println(\"Inside the get\");\r\n response.setContentType(\"text/xml\");\r\n response.setCharacterEncoding(\"utf-8\");\r\n final Writer w = response.getWriter();\r\n w.write(\"inside the get\");\r\n w.close();\r\n }", "@Override\r\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\r\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n System.out.println(\"Console: doGET visited\");\n String result = \"\";\n //get the user choice from the client\n String choice = (request.getPathInfo()).substring(1);\n response.setContentType(\"text/plain;charset=UTF-8\");\n PrintWriter out = response.getWriter();\n //methods call appropriate to user calls\n if (Integer.valueOf(choice) == 3) {\n result = theBlockChain.toString();\n if (result != null) {\n out.println(result);\n response.setStatus(200);\n //set status if result output is not generated\n } else {\n response.setStatus(401);\n return;\n }\n }\n //verify chain method\n if (Integer.valueOf(choice) == 2) {\n response.setStatus(200);\n boolean validity = theBlockChain.isChainValid();\n out.print(\"verifying:\\nchain verification: \");\n out.println(validity);\n }\n }", "@Override\n public DataObjectResponse<T> handleGET(DataObjectRequest<T> request)\n {\n if(getRequestValidator() != null) getRequestValidator().validateGET(request);\n\n DefaultDataObjectResponse<T> response = new DefaultDataObjectResponse<>();\n try\n {\n VisibilityFilter<T, DataObjectRequest<T>> visibilityFilter = visibilityFilterMap.get(VisibilityMethod.GET);\n List<Query> queryList = new LinkedList<>();\n if(request.getQueries() != null)\n queryList.addAll(request.getQueries());\n\n if(request.getId() != null)\n {\n // if the id is specified\n queryList.add(new ById(request.getId()));\n }\n\n DataObjectFeed<T> feed = objectPersister.retrieve(queryList);\n if(feed == null)\n feed = new DataObjectFeed<>();\n List<T> filteredObjects = visibilityFilter.filterByVisible(request, feed.getAll());\n response.setCount(feed.getCount());\n response.addAll(filteredObjects);\n }\n catch(PersistenceException e)\n {\n ObjectNotFoundException objectNotFoundException = new ObjectNotFoundException(String.format(OBJECT_NOT_FOUND_EXCEPTION, request.getId()), e);\n response.setErrorResponse(ErrorResponseFactory.objectNotFound(objectNotFoundException, request.getCID()));\n }\n return response;\n }", "public void handleGet( HttpExchange exchange ) throws IOException {\n switch( exchange.getRequestURI().toString().replace(\"%20\", \" \") ) {\n case \"/\":\n print(\"sending /MainPage.html\");\n sendResponse( exchange, FU.readFromFile( getReqDir( exchange )), 200);\n break;\n case \"/lif\":\n // send log in page ( main page )\n sendResponse ( exchange, FU.readFromFile(getReqDir(exchange)), 200);\n //\n break;\n case \"/home.html\":\n\n break;\n case \"/book.html\":\n\n break;\n default:\n //checks if user is logged in\n\n //if not send log in page\n //if user is logged in then\n print(\"Sending\");\n String directory = getReqDir( exchange ); // dont need to do the / replace as no space\n File page = new File( getReqDir( exchange) );\n\n // IMPLEMENT DIFFERENT RESPONSE CODE FOR HERE IF EXISTS IS FALSE OR CAN READ IS FALSE\n sendResponse(exchange, FU.readFromFile(directory), 200);\n break;\n }\n }", "public int handleGET(String requestURL) throws ClientProtocolException, IOException{\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\r\n\t\thttpGet = new HttpGet(requestURL);\t\t\r\n\t\t\t\t\t\t\r\n\t\tinputsource=null;\r\n\t\t\t\r\n\t\toutputString=\"\";\r\n\t\t\r\n\t\t//taking response by executing http GET object\r\n\t\tCloseableHttpResponse response = httpclient.execute(httpGet);\t\t\r\n\t\r\n\t\t/* \r\n\t\t * \tThe underlying HTTP connection is still held by the response object\r\n\t\t\tto allow the response content to be streamed directly from the network socket.\r\n\t\t\tIn order to ensure correct deallocation of system resources\r\n\t\t\tthe user MUST call CloseableHttpResponse.close() from a finally clause.\r\n\t\t\tPlease note that if response content is not fully consumed the underlying\r\n\t\t\tconnection cannot be safely re-used and will be shut down and discarded\r\n\t\t\tby the connection manager.\r\n\t\t */\r\n\t\t\r\n\t\t\tstatusLine= response.getStatusLine().toString();\t\t//status line\r\n\t\t\t\r\n\t\t\tHttpEntity entity1 = response.getEntity();\t\t\t\t//getting response entity from server response \t\r\n\t\t\t\t\t\r\n\t\t\tBufferedReader br=new BufferedReader(new InputStreamReader(entity1.getContent()));\r\n\r\n\t\t\tString line;\r\n\t\t\twhile((line=br.readLine())!=null)\r\n\t\t\t{\r\n\t\t\t\toutputString=outputString+line.toString();\r\n\t }\r\n\t\t\t\r\n\t\t\t//removing spaces around server response string.\r\n\t\t\toutputString.trim();\t\t\t\t\t\t\t\t\t\r\n\t\t\t\r\n\t\t\t//converting server response string into InputSource.\r\n\t\t\tinputsource = new InputSource(new StringReader(outputString));\t\r\n\t\t\t\r\n\t\t\t// and ensure it is fully consumed\r\n\t\t\tEntityUtils.consume(entity1);\t\t\t//consuming entity.\r\n\t\t\tresponse.close();\t\t\t\t\t\t//closing response.\r\n\t\t\tbr.close();\t\t\t\t\t\t\t\t//closing buffered reader\r\n\t\t\t\r\n\t\t\t//returning response code\r\n\t\t\treturn response.getStatusLine().getStatusCode();\r\n\t\r\n\t}", "@Override\n\tprotected void doGet(SlingHttpServletRequest request, SlingHttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t logger.error(\"BISHUNNN CALLED\");\n\t\tString category = request.getParameter(\"category\").trim();\n\t\tGetHttpCall getHttpCall = new GetHttpCall();\n\t\turl = APIConstants.baseURL+category.toLowerCase();\n\t\tresponseString = getHttpCall.execute(url);\n\t\tresponse.getWriter().write(responseString);\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\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tPrintWriter out = resp.getWriter();\n\t\tout.print(\"<h1>Hello from your doGet method!</h1>\");\n\t}", "public void doGet(HttpServletRequest request,\n HttpServletResponse response)\n throws IOException, ServletException {\n response.setContentType(TYPE_TEXT_HTML.label);\n response.setCharacterEncoding(UTF8.label);\n request.setCharacterEncoding(UTF8.label);\n String path = request.getRequestURI();\n logger.debug(RECEIVED_REQUEST + path);\n Command command = null;\n try {\n command = commands.get(path);\n command.execute(request, response);\n } catch (NullPointerException e) {\n logger.error(REQUEST_PATH_NOT_FOUND);\n request.setAttribute(JAVAX_SERVLET_ERROR_STATUS_CODE, 404);\n command = commands.get(EXCEPTION.label);\n command.execute(request, response);\n }\n }", "public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tString search = req.getParameter(\"searchBook\");\n\t\tString output=search;\n\n\t\t//redirect output to view search.jsp\n\t\treq.setAttribute(\"output\", output);\n\t\tresp.setContentType(\"text/json\");\n\t\tRequestDispatcher view = req.getRequestDispatcher(\"search.jsp\");\n\t\tview.forward(req, resp);\n\t\t\t\n\t}", "public void doGet( HttpServletRequest request, HttpServletResponse response )\n throws ServletException, IOException\n {\n handleRequest( request, response, false );\n }", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}", "public void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\t}", "@GET\n @Produces(MediaType.APPLICATION_JSON)\n public Response handleGet() {\n Gson gson = GSONFactory.getInstance();\n List allEmployees = getAllEmployees();\n\n if (allEmployees == null) {\n allEmployees = new ArrayList();\n }\n\n Response response = Response.ok().entity(gson.toJson(allEmployees)).build();\n return response;\n }", "@Override\n\tprotected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows IOException, ServletException {\n\t\tsuper.doGet(request, response);\t\t\t\n\t}", "private static String sendGET(String getURL) throws IOException {\n\t\tURL obj = new URL(getURL);\n\t\tHttpURLConnection con = (HttpURLConnection) obj.openConnection();\n\t\tcon.setRequestMethod(\"GET\");\n\t\tString finalResponse = \"\";\n\n\t\t//This way we know if the request was processed successfully or there was any HTTP error message thrown.\n\t\tint responseCode = con.getResponseCode();\n\t\tSystem.out.println(\"GET Response Code : \" + responseCode);\n\t\tif (responseCode == HttpURLConnection.HTTP_OK) { // success\n\t\t\tBufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));\n\t\t\tString inputLine;\n\t\t\tStringBuffer buffer = new StringBuffer();\n\n\t\t\twhile ((inputLine = in.readLine()) != null) {\n\t\t\t\tbuffer.append(inputLine);\n\t\t\t}\n\t\t\tin.close();\n\n\t\t\t// print result\n\t\t\tfinalResponse = buffer.toString();\n\t\t} else {\n\t\t\tSystem.out.println(\"GET request not worked\");\n\t\t}\n\t\treturn finalResponse;\n\t}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n //processRequest(request, response);\n }", "@Override\n \tpublic void doGet(HttpServletRequest req, HttpServletResponse resp)\n \t\t\tthrows ServletException, IOException {\n \t\tdoPost(req, resp);\n \t}", "public BufferedReader reqGet(final String route) throws\n ServerStatusException, IOException {\n System.out.println(\"first reqGet\");\n return reqGet(route, USER_AGENT);\n }", "HttpGet getRequest(HttpServletRequest request, String address) throws IOException;", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override \r\nprotected void doGet(HttpServletRequest request, HttpServletResponse response) \r\nthrows ServletException, IOException { \r\nprocessRequest(request, response); \r\n}", "protected void doGet(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\n String action = request.getParameter(\"action\");\r\n\r\n try {\r\n switch (action)\r\n {\r\n case \"/getUser\":\r\n \tgetUser(request, response);\r\n break;\r\n \r\n }\r\n } catch (Exception ex) {\r\n throw new ServletException(ex);\r\n }\r\n }", "@Override\n protected void doGet\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@Override\n\tprotected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tdoProcess(req, resp);\n\t}", "@Test\r\n\tpublic void doGet() throws Exception {\n\t\tCloseableHttpClient httpClient = HttpClients.createDefault();\r\n\t\t// Create a GET object and pass a url to it\r\n\t\tHttpGet get = new HttpGet(\"http://www.google.com\");\r\n\t\t// make a request\r\n\t\tCloseableHttpResponse response = httpClient.execute(get);\r\n\t\t// get response as result\r\n\t\tSystem.out.println(response.getStatusLine().getStatusCode());\r\n\t\tHttpEntity entity = response.getEntity();\r\n\t\tSystem.out.println(EntityUtils.toString(entity));\r\n\t\t// close HttpClient\r\n\t\tresponse.close();\r\n\t\thttpClient.close();\r\n\t}", "private void requestGet(String endpoint, Map<String, String> params, RequestListener listener) throws Exception {\n String requestUri = Constant.API_BASE_URL + ((endpoint.indexOf(\"/\") == 0) ? endpoint : \"/\" + endpoint);\n get(requestUri, params, listener);\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}", "@Override\n protected void doGet(HttpServletRequest request, HttpServletResponse response)\n\t throws ServletException, IOException {\n\tprocessRequest(request, response);\n }", "protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tcommandAction(request,response);\r\n\t}" ]
[ "0.7589609", "0.71665615", "0.71148175", "0.705623", "0.7030174", "0.70291144", "0.6995984", "0.697576", "0.68883485", "0.6873811", "0.6853569", "0.6843572", "0.6843572", "0.6835363", "0.6835363", "0.6835363", "0.68195957", "0.6817864", "0.6797789", "0.67810035", "0.6761234", "0.6754993", "0.6754993", "0.67394847", "0.6719924", "0.6716244", "0.67054695", "0.67054695", "0.67012346", "0.6684415", "0.6676695", "0.6675696", "0.6675696", "0.66747975", "0.66747975", "0.6669016", "0.66621476", "0.66621476", "0.66476154", "0.66365504", "0.6615004", "0.66130257", "0.6604073", "0.6570195", "0.6551141", "0.65378064", "0.6536579", "0.65357745", "0.64957607", "0.64672184", "0.6453189", "0.6450501", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.6411481", "0.64067316", "0.6395873", "0.6379907", "0.63737476", "0.636021", "0.6356937", "0.63410467", "0.6309468", "0.630619", "0.630263", "0.63014317", "0.6283933", "0.62738425", "0.62680805", "0.62585783", "0.62553537", "0.6249043", "0.62457556", "0.6239428", "0.6239428", "0.62376446", "0.62359244", "0.6215947", "0.62125194", "0.6207376", "0.62067443", "0.6204527", "0.6200444", "0.6199078", "0.61876005", "0.6182614", "0.61762017", "0.61755335", "0.61716276", "0.6170575", "0.6170397", "0.616901" ]
0.0
-1
Handles the HTTP POST method.
@Override protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { processRequest(request, response); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\n\tpublic void doPost(Request request, Response response) {\n\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) {\n }", "public void doPost( )\n {\n \n }", "@Override\n public String getMethod() {\n return \"POST\";\n }", "public String post();", "@Override\n\tpublic void doPost(HttpRequest request, AbstractHttpResponse response)\n\t\t\tthrows IOException {\n\t\t\n\t}", "@Override\n public String getMethod() {\n return \"POST\";\n }", "public ResponseTranslator post() {\n setMethod(\"POST\");\n return doRequest();\n }", "protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, java.io.IOException {\n }", "public void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows IOException {\n\n\t}", "public void postData() {\n\n\t}", "@Override\n public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {\n logger.warn(\"doPost Called\");\n handle(req, res);\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n metPost(request, response);\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\r\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n\r\n }", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tpublic void postHandle(WebRequest request, ModelMap model) throws Exception {\n\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\r\n\t\t\tthrows ServletException, IOException {\r\n\r\n\t\t\r\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\t\n\t}", "@Override\n\tprotected HttpMethod requestMethod() {\n\t\treturn HttpMethod.POST;\n\t}", "@Override\n\tprotected void handlePostBody(HashMap<String, HashMap<String, String>> params, DataFormat format) throws Exception {\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n }", "@Override\n\tprotected void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n \r\n }", "@Override\n\n\tpublic void handlePOST(CoapExchange exchange) {\n\t\tFIleStream read = new FIleStream();\n\t\tread.tempWrite(Temp_Path, exchange.getRequestText());\n\t\texchange.respond(ResponseCode.CREATED, \"POST successfully!\");\n\t\t_Logger.info(\"Receive post request:\" + exchange.getRequestText());\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n response.getWriter().println(\"go to post method in manager\");\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\r\n\t}", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\t\n\t}", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n \n }", "public abstract boolean handlePost(FORM form, BindException errors) throws Exception;", "@Override\n protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n super.doPost(req, resp);\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\n\t\t\t\n\t\t \n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\t\tsuper.doPost(req, resp);\n\t}", "public void processPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException\n {\n }", "@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}", "@Override\n\tpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\n\n\t}", "public void doPost(HttpServletRequest request ,HttpServletResponse response){\n\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n\n }", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "public void post(){\n\t\tHttpClient client = new HttpClient();\n\n\t\tPostMethod post = new PostMethod(\"http://211.138.245.85:8000/sso/POST\");\n//\t\tPostMethod post = new PostMethod(\"/eshopclient/product/show.do?id=111655\");\n//\t\tpost.addRequestHeader(\"Cookie\", cookieHead);\n\n\n\t\ttry {\n\t\t\tSystem.out.println(\"��������====\");\n\t\t\tint status = client.executeMethod(post);\n\t\t\tSystem.out.println(status);\n\t\t} catch (HttpException 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\n//\t\ttaskCount++;\n//\t\tcountDown--;\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t}", "public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException {\r\n\tlogTrace( req, \"POST log\" );\r\n\tString requestId = req.getQueryString();\r\n\tif (requestId == null) {\r\n\t try {\r\n\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t } catch (IOException ex) {\r\n\t }\r\n\t logError( req, resp, new Exception(\"Unrecognized POST\"), \"\" );\r\n\t sendError(resp, \"Unrecognized POST\");\r\n\t} else\r\n\t if (\"post-request\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onMEVPostsRequest( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"MEV POST error\" );\r\n\t\t sendError( resp, \"MEV POST error: \" + e.toString() );\r\n\t\t}\r\n\t } else if (\"post-response\".equals( requestId )) {\r\n\t\ttry {\r\n\t\t onPVMPostsResponse( req, resp );\r\n\t\t} catch (Exception e) {\r\n\t\t try {\r\n\t\t\tServletUtil.bufferedRead( req.getInputStream() );\r\n\t\t } catch (IOException ex) {\r\n\t\t }\r\n\t\t logError( req, resp, e, \"PVM POST error\" );\r\n\t\t sendError( resp, \"PVM POST error: \" + e.toString() );\r\n\t\t}\r\n\t }\r\n }", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\t\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request,\n\t\t\tHttpServletResponse response, Object handler,\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest req, HttpServletResponse resp, Object handler, ModelAndView m)\r\n\t\t\tthrows Exception {\n\t\t\r\n\t}", "@Override\n public final void doPost() {\n try {\n checkPermissions(getRequest());\n final IItem jSonStreamAsItem = getJSonStreamAsItem();\n final IItem outputItem = api.runAdd(jSonStreamAsItem);\n\n output(JSonItemWriter.itemToJSON(outputItem));\n } catch (final APIException e) {\n e.setApi(apiName);\n e.setResource(resourceName);\n throw e;\n\n }\n }", "@Override\n\tvoid post() {\n\t\t\n\t}", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException {\n\t\t\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t\tSystem.out.println(\"=========interCpetor Post=========\");\r\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response)\n\t\t\tthrows ServletException, IOException {\n\t\tString method = request.getParameter(\"method\");\n\t\tswitch(method){\n\t\tcase \"Crawl\":\n\t\t\tcrawl(request, response);\n\t\t\tbreak;\n\t\tcase \"Extract\":\n\t\t\textract(request, response);\n\t\t\tbreak;\n\t\tcase \"JDBC\":\n\t\t\tjdbc(request, response);\n\t\t\tbreak;\n\t\tcase \"Indexer\":\n\t\t\tindexer(request, response);\n\t\t\tbreak;\n\t\t}\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n System.out.println(\"teste dopost\");\r\n }", "protected void doPost(HttpServletRequest request,\r\n\t\t\tHttpServletResponse response)\r\n\t/* 43: */throws ServletException, IOException\r\n\t/* 44: */{\r\n\t\t/* 45:48 */doGet(request, response);\r\n\t\t/* 46: */}", "@Override\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp)\n\t\t\tthrows ServletException, IOException {\n\t\tprocess(req, resp);\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\r\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\r\n\tprotected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {\n\tprocess(req,resp);\r\n\t}", "public void handlePost(SessionSrvc session, IObjectContext context)\n throws Exception\n {\n }", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\n\t\tdoGet(request, response);\n\t}", "public void doPost(HttpServletRequest request, HttpServletResponse response) {\r\n\t\tdoGet(request, response);\r\n\t}", "@Override\r\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response, Object handler,\r\n\t\t\tModelAndView modelAndView) throws Exception {\n\t}", "@Override\n protected void doPost\n (HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n processRequest(request, response);\n }", "@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 (JSONException ex) {\r\n Logger.getLogger(PDCBukUpload.class.getName()).log(Level.SEVERE, null, ex);\r\n }\r\n }", "@Override\r\n protected void doPost(HttpServletRequest request,\r\n HttpServletResponse response)\r\n throws ServletException,\r\n IOException {\r\n processRequest(request,\r\n response);\r\n\r\n }", "@Override\r\n\tpublic void doPost(CustomHttpRequest request, CustomHttpResponse response) throws Exception {\n\t\tdoGet(request, response);\r\n\t}", "@Override\n\tpublic void postHandle(HttpServletRequest request, HttpServletResponse response,\n\t\t\tObject handler, ModelAndView modelAndView) throws Exception {\n\n\t}", "protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {\n\t\tdoHandle(request, response);\n\t}", "private void postRequest() {\n\t\tSystem.out.println(\"post request, iam playing money\");\n\t}", "@Override\r\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\r\n throws ServletException, IOException {\r\n processRequest(request, response);\r\n }", "@Override\n public void postHandle(HttpServletRequest request,\n HttpServletResponse response, Object handler,\n ModelAndView modelAndView) throws Exception {\n\n }", "@Override\n protected void doPost(HttpServletRequest request, HttpServletResponse response)\n throws ServletException, IOException {\n try {\n processRequest(request, response);\n } catch (Exception ex) {\n Logger.getLogger(PedidoController.class.getName()).log(Level.SEVERE, null, ex);\n }\n }" ]
[ "0.73289514", "0.71383566", "0.7116213", "0.7105215", "0.7100045", "0.70236707", "0.7016248", "0.6964149", "0.6889435", "0.6784954", "0.67733276", "0.67482096", "0.66677034", "0.6558593", "0.65582114", "0.6525548", "0.652552", "0.652552", "0.652552", "0.65229493", "0.6520197", "0.6515622", "0.6513045", "0.6512626", "0.6492367", "0.64817846", "0.6477479", "0.64725804", "0.6472099", "0.6469389", "0.6456206", "0.6452577", "0.6452577", "0.6452577", "0.6450273", "0.6450273", "0.6438126", "0.6437522", "0.64339423", "0.64253825", "0.6422238", "0.6420897", "0.6420897", "0.6420897", "0.6407662", "0.64041835", "0.64041835", "0.639631", "0.6395677", "0.6354875", "0.63334197", "0.6324263", "0.62959254", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6288832", "0.6280875", "0.6272104", "0.6272104", "0.62711537", "0.62616795", "0.62544584", "0.6251865", "0.62274224", "0.6214439", "0.62137586", "0.621211", "0.620854", "0.62023044", "0.61775357", "0.61775357", "0.61775357", "0.61775357", "0.61775357", "0.61775357", "0.61775357", "0.61638993", "0.61603814", "0.6148914", "0.61465937", "0.61465937", "0.614548", "0.6141879", "0.6136717", "0.61313903", "0.61300284", "0.6124381", "0.6118381", "0.6118128", "0.61063534", "0.60992104", "0.6098801", "0.6096766" ]
0.0
-1
Returns a short description of the servlet.
@Override public String getServletInfo() { return "Short description"; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getServletInfo()\n {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\n return \"Short description\";\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "public String getServletInfo() {\r\n return \"Short description\";\r\n }", "@Override\r\n public String getServletInfo() {\r\n return \"Short description\";\r\n }", "@Override\r\n public String getServletInfo() {\r\n return \"Short description\";\r\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\n\tpublic String getServletInfo() {\n\t\treturn \"Short description\";\n\t}", "@Override\r\n public String getServletInfo()\r\n {\r\n return \"Short description\";\r\n }", "@Override\n public String getServletInfo()\n {\n return \"Short description\";\n }", "@Override\r\n\tpublic String getServletInfo() {\r\n\t\treturn \"Short description\";\r\n\t}", "@Override\r\n public String getServletInfo()\r\n {\r\n return \"Short description\";\r\n }", "@Override\n public String getServletInfo() {\n return \"Short description\";\n }" ]
[ "0.87634975", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8732279", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8699131", "0.8531295", "0.8531295", "0.85282224", "0.85282224", "0.85282224", "0.8527433", "0.8527433", "0.8527433", "0.8527433", "0.8527433", "0.8527433", "0.8516995", "0.8512296", "0.8511239", "0.8510324", "0.84964365" ]
0.0
-1
Test based on a 3x3 board. aka classic tictactoe
private static void test3x3() { MutableBoard simpleBoard = new SimpleBoard(3,3); if (!simpleBoard.putPiece(new Move(1, 1))) throw new AssertionError(); // O if (!simpleBoard.toString().equals("---\n-O-\n---\n")) throw new AssertionError(); if (simpleBoard.wins() != Board.PieceType.NONE) throw new AssertionError(); if (simpleBoard.gameover()) throw new AssertionError(); // Cannot replace any placed position. if (simpleBoard.putPiece(new Move(1, 1))) throw new AssertionError(); // X if (!simpleBoard.toString().equals("---\n-O-\n---\n")) throw new AssertionError(); if (!simpleBoard.putPiece(new Move(0, 1))) throw new AssertionError(); // X if (!simpleBoard.toString().equals("-X-\n-O-\n---\n")) throw new AssertionError(); if (simpleBoard.wins() != Board.PieceType.NONE) throw new AssertionError(); if (simpleBoard.gameover()) throw new AssertionError(); // Create a new light draft board. Board draftBoard = new LightDraftBoard(simpleBoard, new Move(0, 0), Board.PieceType.CIRCLE); if (!draftBoard.toString().equals("OX-\n-O-\n---\n")) throw new AssertionError(); if (draftBoard.wins() != Board.PieceType.NONE) throw new AssertionError(); if (draftBoard.gameover()) throw new AssertionError(); // DraftBoard is immutable. draftBoard = new LightDraftBoard(draftBoard, new Move(1, 2), Board.PieceType.CROSS); if (!draftBoard.toString().equals("OX-\n-OX\n---\n")) throw new AssertionError(); if (draftBoard.wins() != Board.PieceType.NONE) throw new AssertionError(); if (draftBoard.gameover()) throw new AssertionError(); draftBoard = new LightDraftBoard(draftBoard, new Move(2, 2), Board.PieceType.CIRCLE); // wins if (!draftBoard.toString().equals("OX-\n-OX\n--O\n")) throw new AssertionError(); if (draftBoard.wins() != Board.PieceType.CIRCLE) throw new AssertionError(); if (!draftBoard.gameover()) throw new AssertionError(); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Test\n public void test13() { \n Board board13 = new Board();\n board13.put(1,1,1); \n board13.put(1,2,1);\n board13.put(1,3,2);\n board13.put(2,1,2);\n board13.put(2,2,2);\n board13.put(2,3,1);\n board13.put(3,1,1);\n board13.put(3,2,1);\n board13.put(3,3,2);\n assertTrue(board13.checkTie());\n }", "@Test\n public void testTie() {\n Assert.assertTrue(\n new Game(\n new Grid3x3(),\n new PredefinedPlayer(new int[] {0, 2, 4, 5, 7}),\n new PredefinedPlayer(new int[] {1, 3, 6, 8})\n ).play().winner().empty());\n }", "@Test\n public void test14() { \n Board board14 = new Board();\n board14.put(1,1,1); \n board14.put(1,2,1);\n board14.put(1,3,1);\n board14.put(2,1,2);\n board14.put(2,2,2);\n board14.put(2,3,1);\n board14.put(3,1,1);\n board14.put(3,2,1);\n board14.put(3,3,2);\n assertFalse(board14.checkTie());\n }", "@Test(timeout=2000)\n public void fullBoardMatch() {\n ThreesBoard board = new ThreesBoard(); \n \n for (int i = 0; i < ThreesBoard.ROWS; i++) {\n for (int j = 0; j < ThreesBoard.COLUMNS; j++) {\n board.set_tile(i, j, 1); \n }\n }\n board.set_tile(0, 0, 2);\n ThreesController threes = new ThreesController(board);\n threes.move_up();\n assertTrue(threes.getBoard().get_tile(0, 0).getValue() == 3);\n assertTrue(threes.getBoard().get_tile(1, 0).getValue() == 1);\n assertTrue(threes.getBoard().get_tile(2, 0).getValue() == 1);\n }", "private boolean isWin() {\n int continueCount = 1; // number of continue ticTacToees\n \t// west direction\n for (int x = xIndex - 1; x >= 0; x--) {\n Color c = isBlack ? Color.black : Color.white;\n if (getTicTacToe(x, yIndex, c) != null) {\n continueCount++;\n } \n else\n break;\n }\n \t// east direction\n for (int x = xIndex + 1; x <= ROWS; x++) {\n Color c = isBlack ? Color.black : Color.white;\n if (getTicTacToe(x, yIndex, c) != null) {\n continueCount++;\n } \n else\n break;\n }\n if (continueCount >= 3) {\n return true;\n } \n else\n continueCount = 1;\n \n \t\n \t// north direction\n for (int y = yIndex - 1; y >= 0; y--) {\n Color c = isBlack ? Color.black : Color.white;\n if (getTicTacToe(xIndex, y, c) != null) {\n continueCount++;\n } \n else\n break;\n }\n \t// south direction\n for (int y = yIndex + 1; y <= ROWS; y++) {\n Color c = isBlack ? Color.black : Color.white;\n if (getTicTacToe(xIndex, y, c) != null) {\n continueCount++;\n } \n else\n break;\n }\n if (continueCount >= 3) {\n return true;\n } \n else\n continueCount = 1;\n \n \t// northeast direction\n for (int x = xIndex + 1, y = yIndex - 1; y >= 0 && x <= COLS; x++, y--) {\n Color c = isBlack ? Color.black : Color.white;\n if (getTicTacToe(x, y, c) != null) {\n continueCount++;\n } \n else\n break;\n }\n \t// southeast direction\n for (int x = xIndex - 1, y = yIndex + 1; y <= ROWS && x >= 0; x--, y++) {\n Color c = isBlack ? Color.black : Color.white;\n if (getTicTacToe(x, y, c) != null) {\n continueCount++;\n } \n else\n break;\n }\n if (continueCount >= 3) {\n return true;\n } \n else\n continueCount = 1;\n \n \t// northwest direction\n for (int x = xIndex - 1, y = yIndex - 1; y >= 0 && x >= 0; x--, y--) {\n Color c = isBlack ? Color.black : Color.white;\n if (getTicTacToe(x, y, c) != null) {\n continueCount++;\n } \n else\n break;\n }\n \t// southwest direction\n for (int x = xIndex + 1, y = yIndex + 1; y <= ROWS && x <= COLS; x++, y++) {\n Color c = isBlack ? Color.black : Color.white;\n if (getTicTacToe(x, y, c) != null) {\n continueCount++;\n } \n else\n break;\n }\n if (continueCount >= 3) {\n return true;\n } \n else\n continueCount = 1;\n \n return false;\n }", "@Test\n public void checkingASolvableBoard3x3() {\n BoardManager boardManager = new BoardManager(3, 3);\n Tile tiles[][] = new Tile[Board.NUM_ROWS][Board.NUM_COLS];\n List<Tile> array = new ArrayList<>();\n tiles[0][0] = new Tile(0);\n tiles[0][1] = new Tile(7);\n tiles[0][2] = new Tile(1);\n tiles[1][0] = new Tile(8);\n tiles[1][1] = new Tile(3);\n tiles[1][2] = new Tile(2);\n tiles[2][0] = new Tile(6);\n tiles[2][1] = new Tile(5);\n tiles[2][2] = new Tile(4);\n boardManager.getBoard().setTiles(tiles);\n array.add(new Tile(0));\n array.add(new Tile(7));\n array.add(new Tile(1));\n array.add(new Tile(8));\n array.add(new Tile(3));\n array.add(new Tile(2));\n array.add(new Tile(6));\n array.add(new Tile(5));\n array.add(new Tile(4));\n assertTrue(boardManager.isSolvable(array));\n }", "@Test\n public void test9() { \n Board board9 = new Board();\n board9.put(1,1,2);\n board9.put(1,2,2);\n board9.put(1,3,2);\n assertTrue(board9.checkWin());\n }", "public static boolean checkWinThree(int[][] board) {\n boolean win = true; \n\n int counter = 0; // serves as the index of the array checkthree\n int checkthree[] = new int[9]; // stores the numbers of the 3x3\n\n for (int x = 0; x < board.length; x += 3) { // this loops through every 3 row and column. so the program runs at 0 at 3, and at 6\n for (int i = 0; i < board.length; i++) {\n for (int j = x; j < x + 3; j++) { \n //runs in 3s. every third column, every third row.\n //Ex: 0 0, 0 1, 0 2\n // 1 0, 1 1, 1 2\n // 2 0, 2 1, 2 2 \n checkthree[counter] = board[i][j];\n counter++; // increases the index of the array\n }\n if ((i + 1) % 3 == 0) { //every 3rd loop checks the result because it means it finished with the 3x3 grid\n Arrays.sort(checkthree); //sorts the array\n for (int y = 0; y < checkthree.length; y++) { \n if (checkthree[y] != y + 1) {\n win = false;\n return win;\n }\n }\n checkthree = new int[9]; //resets the array to get the next 3x3\n counter = 0; //resets the counter\n }\n }\n }\n return win;\n }", "@Test\n public void testPawnSide() {\n // initialize the complete chess board\n ChessBoard chessBoard = init(\"CHESS\");\n\n // compare the side of the pawn on the table to the correct side\n for (int i = 0; i < 8; ++i) {\n assertEquals(north, chessBoard.getPiece(1, i).getSide());\n assertEquals(south, chessBoard.getPiece(6, i).getSide());\n }\n }", "@Test\n public void checkingANotSolvableBoard3x3() {\n BoardManager boardManager = new BoardManager(3, 3);\n Tile tiles[][] = new Tile[Board.NUM_ROWS][Board.NUM_COLS];\n List<Tile> array = new ArrayList<>();\n tiles[0][0] = new Tile(0);\n tiles[0][1] = new Tile(7);\n tiles[0][2] = new Tile(1);\n tiles[1][0] = new Tile(8);\n tiles[1][1] = new Tile(3);\n tiles[1][2] = new Tile(2);\n tiles[2][0] = new Tile(6);\n tiles[2][1] = new Tile(5);\n tiles[2][2] = new Tile(4);\n boardManager.getBoard().setTiles(tiles);\n\n array.add(new Tile(0));\n array.add(new Tile(7));\n array.add(new Tile(1));\n array.add(new Tile(8));\n array.add(new Tile(3));\n array.add(new Tile(2));\n array.add(new Tile(6));\n array.add(new Tile(5));\n array.add(new Tile(4));\n assertTrue(boardManager.isSolvable(array));\n }", "@Test\n public void test11() { \n Board board11 = new Board();\n board11.put(1,3,1);\n board11.put(2,3,1);\n board11.put(3,3,1);\n assertTrue(board11.checkWin());\n }", "@Test\n public void testVicrotyFullGrid(){\n for (Cell c: modelTest.grid) {\n if (c.getY() == 5)\n c.setColor(Color.BLUE);\n }\n\n modelTest.researchVictory(0,1);\n boolean vicrotyTest = modelTest.getVictory();\n // On a rempli la grille de cellule bleu, on test également la victoire du bleu\n Color winnerTest = modelTest.getWinner();\n\n Assert.assertEquals(vicrotyTest,true);\n Assert.assertEquals(winnerTest,Color.BLUE);\n }", "@Test\n public void testIsActionable_ThirdCornerCase() {\n board.getCell(3, 4).addLevel();\n board.getCell(3, 3).addLevel();\n assertTrue(godPower.isActionable(board, player.getWorker1()));\n }", "@Test\n public void test10() { \n Board board10 = new Board();\n board10.put(1,1,2);\n board10.put(2,2,2);\n board10.put(3,3,2);\n assertTrue(board10.checkWin());\n }", "public boolean CheckVictory()\n {\n\n for (int i = 0; i < 6; i++) {\n if(isFiveAligned(\n getCell(i, 0),\n getCell(i, 1),\n getCell(i, 2),\n getCell(i, 3),\n getCell(i, 4),\n getCell(i, 5) )){\n Winner=getCell(i, 2);\n return true;\n }\n }\n\n for (int i = 0; i < 6; i++) {\n if(isFiveAligned(\n getCell(0,i),\n getCell(1,i),\n getCell(2,i),\n getCell(3,i),\n getCell(4,i),\n getCell(5,i) )){\n Winner=getCell(2, i);\n return true;\n }\n }\n CellType[] arrTypes={getCell(0, 0),getCell(1, 1),getCell(2, 2),getCell(3, 3),\n getCell(4, 4),getCell(5, 5)};\n\n \n if(isFiveAligned(arrTypes))\n {\n Winner=arrTypes[2];\n return true;\n }\n\n CellType[] REVERSE_arrTypes={getCell(0, 5),getCell(1, 4),getCell(2, 3),getCell(3, 2),\n getCell(4, 1),getCell(5, 0)};\n\n \n\n if(isFiveAligned(REVERSE_arrTypes))\n {\n Winner=REVERSE_arrTypes[2]; \n return true;\n }\n\n\n if(isFiveAligned(new CellType[]{getCell(0, 1),\n getCell(1, 2),\n getCell(2, 3),\n getCell(3, 4),\n getCell(4, 5),\n CellType.None\n })) {\n Winner=getCell(3, 4);\n return true;\n }\n \n if(isFiveAligned(new CellType[]{getCell(1, 0),\n getCell(2, 1),\n getCell(3, 2),\n getCell(4, 3),\n getCell(5, 4),\n CellType.None\n })) {\n Winner=getCell(4, 3);\n return true;\n }\n\n if(isFiveAligned(new CellType[]{\n getCell(4, 0),\n getCell(3, 1),\n getCell(2, 2),\n getCell(1, 3),\n getCell(0, 4),\n CellType.None\n \n })){\n Winner=getCell(2, 2);\n return true;}\n\n if(isFiveAligned(new CellType[]{\n getCell(5, 1),\n getCell(4, 2),\n getCell(3, 3),\n getCell(2, 4),\n getCell(1, 5),\n CellType.None\n \n })){\n Winner=getCell(3, 3);\n return true;}\n\n \n \n\n\n \n\n return false;\n }", "public int terminalTest(int[][] gameBoard) {\n for (int col = 0; col < gameBoard.length; col++) {\n for (int row = 0; row < gameBoard[col].length - 3; row++) {\n if (gameBoard[col][row] == 1 &&\n gameBoard[col][row + 1] == 1 &&\n gameBoard[col][row + 2] == 1 &&\n gameBoard[col][row + 3] == 1) {\n return 1;\n } else if (gameBoard[col][row] == 2 &&\n gameBoard[col][row + 1] == 2 &&\n gameBoard[col][row + 2] == 2 &&\n gameBoard[col][row + 3] == 2) {\n return 2;\n }\n }\n }\n\n // check for horizontal win (searching to the right)\n for (int row = 0; row < gameBoard[0].length; row++) {\n for (int col = 0; col < gameBoard.length - 3; col++) {\n if (gameBoard[col][row] == 1 &&\n gameBoard[col + 1][row] == 1 &&\n gameBoard[col + 2][row] == 1 &&\n gameBoard[col + 3][row] == 1) {\n return 1;\n } else if (gameBoard[col][row] == 2 &&\n gameBoard[col + 1][row] == 2 &&\n gameBoard[col + 2][row] == 2 &&\n gameBoard[col + 3][row] == 2) {\n return 2;\n }\n }\n }\n\n // check for diagonal win (searching down + right)\n for (int col = 0; col < gameBoard.length - 3; col++) {\n for (int row = 0; row < gameBoard[col].length - 3; row++) {\n if (gameBoard[col][row] == 1 &&\n gameBoard[col + 1][row + 1] == 1 &&\n gameBoard[col + 2][row + 2] == 1 &&\n gameBoard[col + 3][row + 3] == 1) {\n return 1;\n } else if (gameBoard[col][row] == 2 &&\n gameBoard[col + 1][row + 1] == 2 &&\n gameBoard[col + 2][row + 2] == 2 &&\n gameBoard[col + 3][row + 3] == 2) {\n return 2;\n }\n }\n }\n\n // check for diagonal win (searching down + left)\n for (int col = gameBoard.length - 1; col >= 3; col--) {\n for (int row = 0; row < gameBoard[col].length - 3; row++) {\n if (gameBoard[col][row] == 1 &&\n gameBoard[col - 1][row + 1] == 1 &&\n gameBoard[col - 2][row + 2] == 1 &&\n gameBoard[col - 3][row + 3] == 1) {\n return 1;\n } else if (gameBoard[col][row] == 2 &&\n gameBoard[col - 1][row + 1] == 2 &&\n gameBoard[col - 2][row + 2] == 2 &&\n gameBoard[col - 3][row + 3] == 2) {\n return 2;\n }\n }\n }\n\n return 0; // neither player has won\n }", "private void checkForWin(int x, int y, String s) {\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\tif (grid[x][i].getText() != s)\n\t\t\t\tbreak;\n\t\t\tif (i == 3 - 1) {\n\t\t\t\tgameOver = true;\n\n\t\t\t\tif (grid[x][i].getText() == \"X\")\n\t\t\t\t\twinner = \"Player 1\";\n\t\t\t\telse\n\t\t\t\t\twinner = \"Player 2\";\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\t\tgrid[r][c].setEnabled(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// check row\n\t\tfor (int i = 0; i < 3; i++) {\n\t\t\tif (grid[i][y].getText() != s)\n\t\t\t\tbreak;\n\t\t\tif (i == 3 - 1) {\n\t\t\t\tgameOver = true;\n\n\t\t\t\tif (grid[i][y].getText() == \"X\")\n\t\t\t\t\twinner = \"Player 1\";\n\t\t\t\telse\n\t\t\t\t\twinner = \"Player 2\";\n\n\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\t\tgrid[r][c].setEnabled(false);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t// check diag\n\t\tif (x == y) {\n\t\t\t// we're on a diagonal\n\t\t\tfor (int i = 0; i < 3; i++) {\n\t\t\t\tif (grid[i][i].getText() != s)\n\t\t\t\t\tbreak;\n\t\t\t\tif (i == 3 - 1) {\n\t\t\t\t\tgameOver = true;\n\n\t\t\t\t\tif (grid[i][i].getText() == \"X\")\n\t\t\t\t\t\twinner = \"Player 1\";\n\t\t\t\t\telse\n\t\t\t\t\t\twinner = \"Player 2\";\n\t\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\t\t\tgrid[r][c].setEnabled(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\t\t// check anti diag (thanks rampion)\n\t\tif (x + y == 3 - 1) {\n\t\t\tfor (int i = 0; i < 3; i++) {\n\t\t\t\tif (grid[i][(3 - 1) - i].getText() != s)\n\t\t\t\t\tbreak;\n\t\t\t\tif (i == 3 - 1) {\n\t\t\t\t\tgameOver = true;\n\n\t\t\t\t\tif (grid[i][(3 - 1) - i].getText() == \"X\")\n\t\t\t\t\t\twinner = \"Player 1\";\n\t\t\t\t\telse\n\t\t\t\t\t\twinner = \"Player 2\";\n\t\t\t\t\tfor (int r = 0; r < 3; r++) {\n\t\t\t\t\t\tfor (int c = 0; c < 3; c++) {\n\t\t\t\t\t\t\tgrid[r][c].setEnabled(false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private void checkWinningMove(TicTacToeElement element,int x,int y) {\n int logicalSize = boardProperties.getBoardLength()-1;\r\n // Check column (only the one we just played)\r\n for(int i=0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[x][i] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n\r\n }\r\n // Check row (only the one we just played)\r\n for(int i=0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][y] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // Check diagonal\r\n // normal diagonal\r\n for(int i= 0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][i] != element.getValue()){\r\n break;\r\n }\r\n // Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // anti diagonal\r\n for(int i= 0;i<=logicalSize;i++){\r\n if( gameState.getBoard()[i][logicalSize-i] != element.getValue()){\r\n break;\r\n }\r\n //Be sure to be at the last index\r\n if(i == logicalSize){\r\n gameState.setWinner(element);\r\n }\r\n }\r\n // check draw\r\n if(gameState.getMoveCount() == Math.pow(logicalSize,2)-1){\r\n gameState.setDraw(true);\r\n }\r\n\r\n }", "public void checkBoard(){\n\n //check horizontally for a winner\n for(int i = 0; i < 3; i++) {\n if (boardStatus[i][0].equals(boardStatus[i][1]) && boardStatus[i][1].equals(boardStatus[i][2])) {\n if (boardStatus[i][0].equals(\"X\")) {\n winnerResults = playerOne + \" has won the game!\";\n winnerName = playerOne;\n userExists();\n\n break;\n } else {\n winnerResults = playerTwo + \" has won the game!\";\n winnerName = playerTwo;\n userExists();\n\n break;\n\n }\n }\n\n\n }\n\n //check vertically for a winner\n for(int i = 0; i < 3; i++) {\n if (boardStatus[0][i].equals(boardStatus[1][i]) && boardStatus[1][i].equals(boardStatus[2][i])) {\n if (boardStatus[0][i].equals(\"X\")) {\n winnerResults = playerOne + \" has won the game!\";\n winnerName = playerOne;\n userExists();\n\n break;\n } else {\n winnerResults = playerTwo + \" has won the game!\";\n winnerName = playerTwo;\n userExists();\n\n break;\n }\n }\n }\n\n //diagonally\n\n if((boardStatus[0][0].equals(boardStatus[1][1])) && (boardStatus[0][0].equals(boardStatus[2][2]))){\n\n if (boardStatus[0][0].equals(\"X\")) {\n winnerResults = playerOne + \" has won the game!\";\n winnerName = playerOne;\n userExists();\n\n\n }\n else {\n winnerResults = playerTwo + \" has won the game!\";\n winnerName = playerTwo;\n userExists();\n\n\n }\n\n }\n\n //diagonally\n if (boardStatus[0][2].equals(boardStatus[1][1]) && (boardStatus[0][2].equals(boardStatus[2][0]))) {\n\n if (boardStatus[0][2].equals(\"X\")) {\n winnerResults = playerOne + \" has won the game!\";\n winnerName = playerOne;\n userExists();\n\n } else {\n winnerResults = playerTwo + \" has won the game!\";\n winnerName = playerTwo;\n userExists();\n\n }\n }\n\n //If all the locations on the board have been played but no win conditions have been met\n //the game will end without a winner\n if(boardStatus[0][0] != \"a\" && boardStatus[0][1] != \"b\" && boardStatus[0][2] != \"c\" &&\n boardStatus[1][0] != \"d\" && boardStatus[1][1] != \"e\" && boardStatus[1][2] != \"f\" &&\n boardStatus[2][0] != \"g\" && boardStatus[2][1] != \"h\" && boardStatus[2][2] != \"i\"){\n NoWinnerDialog dialog = new NoWinnerDialog();\n dialog.show(getSupportFragmentManager(), \"NoWinner\");\n }\n\n\n\n\n }", "public static void main(String[] args) throws InterruptedException {\r\n\r\n\t\t/** \r\n\t\t * This is where our program starts.\r\n\t\t * @param args unused\r\n\t\t */\r\n\t\tScanner sc = new Scanner(System.in);\r\n\r\n\t\t//declares the rules of the game\r\n\t\tSystem.out.println(\"Welcome to the Tic Tac Toe Simulator! \"\r\n\t\t\t\t+ \"(apparently we're too advanced to use a pen and paper anymore.. -.-\\\")\\n\");\r\n\r\n\t\tSystem.out.println(\"You will have 9 turns together, make sure to last through all of them and beat your opponent!\\n\");\r\n\r\n\r\n\t\tString tttBoard [][] = { {\" _ \", \" _ \", \" _ \"}, {\" _ \", \" _ \", \" _ \"}, {\" _ \", \" _ \", \" _ \"} };\r\n\t\tint column = 0;\r\n\t\tint row = 0;\r\n\t\tint xWin = 0;\r\n\t\tint oWin = 0;\r\n\r\n\t\t//prints board\r\n\t\tSystem.out.format(\"%4s %3s %3s\\n\", \"0\", \"1\", \"2\");\r\n\t\tfor (int rows = 0; rows < tttBoard.length; rows ++ ) \r\n\t\t{\r\n\t\t\tSystem.out.print(rows);\r\n\t\t\tfor (int col = 0; col < tttBoard[0].length; col ++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(\"|\" + tttBoard[rows][col] + \"\");\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(\"|\");\r\n\t\t}\r\n\r\n\t\tSystem.out.println();\r\n\r\n\t\t//switches between player one and player two input\r\n\t\tfor (int counter = 0; counter<9; counter ++)\r\n\t\t{\r\n\r\n\t\t\t//asks where player one would like to go\r\n\t\t\tif (counter % 2 != 0)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Which column would you like to place your x?\");\r\n\t\t\t\tcolumn = sc.nextInt();\r\n\t\t\t\tSystem.out.println(\"Which row would you like to place your x?\");\r\n\t\t\t\trow = sc.nextInt();\r\n\t\t\t\t//checks for cheaters\r\n\t\t\t\tif (tttBoard [row][column] == (\" x \") || tttBoard [row][column] == (\" o \"))\r\n\t\t\t\t\tSystem.out.println(\"sorry no cheaters in this game\");\r\n\t\t\t\telse\r\n\t\t\t\t\ttttBoard [row][column] = \" x \";\r\n\t\t\t\t//prints move\r\n\t\t\t\tSystem.out.format(\"%4s %3s %3s\\n\", \"0\", \"1\", \"2\");\r\n\t\t\t\tfor (int rows = 0; rows < tttBoard.length; rows ++ ) \r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.print(rows);\r\n\t\t\t\t\tfor (int col = 0; col < tttBoard[0].length; col ++)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"|\" + tttBoard[rows][col] + \"\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tSystem.out.println(\"|\");\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t\t//asks player 2 for their move\r\n\t\t\telse if (counter % 2 == 0)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"Which column would you like to place your o?\");\r\n\t\t\t\tcolumn = sc.nextInt();\r\n\t\t\t\tSystem.out.println(\"Which row would you like to place your o?\");\r\n\t\t\t\trow = sc.nextInt();\r\n\t\t\t\t//checks for cheaters\r\n\t\t\t\tif (tttBoard [row][column] == (\" x \") || tttBoard [row][column] == (\" o \"))\r\n\t\t\t\t\tSystem.out.println(\"sorry no cheaters in this game\");\r\n\t\t\t\telse\r\n\t\t\t\t\ttttBoard [row][column] = \" o \";\r\n\t\t\t\t//prints move\r\n\t\t\t\tSystem.out.format(\"%4s %3s %3s\\n\", \"0\", \"1\", \"2\");\r\n\t\t\t\tfor (int rows = 0; rows < tttBoard.length; rows ++ ) \r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.print(rows);\r\n\t\t\t\t\tfor (int col = 0; col < tttBoard[0].length; col ++) \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tSystem.out.print(\"|\" + tttBoard[rows][col] + \"\");\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tSystem.out.println(\"|\");\r\n\t\t\t\t}\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Thank you for playing!\");\r\n\r\n\t\t//defining win structures\r\n\t\tif \t//defining x will win with 3 in a row for rows\r\n\t\t(tttBoard[0][0].equals(\" x \") && tttBoard[0][1].equals(\" x \") && tttBoard[0][2].equals(\" x \") ||\r\n\t\t\t\ttttBoard[1][0].equals(\" x \") && tttBoard[1][1].equals(\" x \") && tttBoard[1][2].equals(\" x \") ||\r\n\t\t\t\ttttBoard[2][0].equals(\" x \") && tttBoard[2][1].equals(\" x \") && tttBoard[2][2].equals(\" x \") ||\r\n\t\t\t\t//defining x will win with 3 in a row for columns\r\n\t\t\t\ttttBoard[0][0].equals(\" x \") && tttBoard[1][0].equals(\" x \") && tttBoard[2][0].equals(\" x \") ||\r\n\t\t\t\ttttBoard[0][1].equals(\" x \") && tttBoard[1][1].equals(\" x \") && tttBoard[2][1].equals(\" x \") ||\r\n\t\t\t\ttttBoard[0][2].equals(\" x \") && tttBoard[1][2].equals(\" x \") && tttBoard[2][2].equals(\" x \") ||\r\n\t\t\t\t//defining X will win with 3 in a row for diagonal\r\n\t\t\t\ttttBoard[0][0].equals(\" x \") && tttBoard[1][1].equals(\" x \") && tttBoard[2][2].equals(\" x \") ||\r\n\t\t\t\ttttBoard[0][2].equals(\" x \") && tttBoard[1][1].equals(\" x \") && tttBoard[0][2].equals(\" x \"))\r\n\r\n\r\n\t\t\txWin = 1;\r\n\r\n\t\tif //defining o will win with 3 in a row for rows\r\n\t\t(tttBoard[0][0].equals(\" o \") && tttBoard[0][1].equals(\" o \") && tttBoard[0][2].equals(\" o \") ||\r\n\t\t\t\ttttBoard[1][0].equals(\" o \") && tttBoard[1][1].equals(\" o \") && tttBoard[1][2].equals(\" o \") ||\r\n\t\t\t\ttttBoard[2][0].equals(\" o \") && tttBoard[2][1].equals(\" o \") && tttBoard[2][2].equals(\" o \") ||\r\n\t\t\t\t//defining o will win with 3 in a row for columns\r\n\t\t\t\ttttBoard[0][0].equals(\" o \") && tttBoard[1][0].equals(\" o \") && tttBoard[2][0].equals(\" o \") ||\r\n\t\t\t\ttttBoard[0][1].equals(\" o \") && tttBoard[1][1].equals(\" o \") && tttBoard[2][1].equals(\" o \") ||\r\n\t\t\t\ttttBoard[0][2].equals(\" o \") && tttBoard[1][2].equals(\" o \") && tttBoard[2][2].equals(\" o \")||\r\n\t\t\t\t//defining o will win with 3 in a row for diagonal\r\n\t\t\t\ttttBoard[0][0].equals(\" o \") && tttBoard[1][1].equals(\" o \") && tttBoard[2][2].equals(\" o \") ||\r\n\t\t\t\ttttBoard[0][2].equals(\" o \") && tttBoard[1][1].equals(\" o \") && tttBoard[0][2].equals(\" o \"))\r\n\r\n\r\n\t\t\toWin = 1;\r\n\r\n\t\t//informs user of results of the game\r\n\t\tif (oWin == 1 && xWin == 0)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"o wins this game!\");\t\r\n\t\t}\r\n\t\telse if (xWin == 1 && oWin == 0)\t\r\n\t\t{\r\n\t\t\tSystem.out.println(\"o wins this game!\");\t\r\n\t\t}\r\n\t\telse if (xWin == 1 && oWin == 1)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"You both tied, maybe you should try again!\");\r\n\t\t}\r\n\r\n\t}", "@Test\n public void testIsActionable_SecondCornerCase() {\n board.getCell(3, 3).setDome(true);\n board.getCell(4, 3).setDome(true);\n assertFalse(godPower.isActionable(board, player.getWorker1()));\n }", "void testDrawBoard(Tester t) {\r\n initData();\r\n\r\n //testing draw board on a world\r\n t.checkExpect(this.game2.drawBoard(),\r\n new OverlayOffsetAlign(\"center\", \"bottom\",\r\n new TextImage(\"Flood-It!\", Cnst.textHeight, Color.BLUE),\r\n 0, Cnst.boardHeight + Cnst.scale,\r\n new AboveAlignImage(\"center\",\r\n new TextImage(\"Turn Count: \" + Integer.toString(1) + \"/\"\r\n + Integer.toString(100), Cnst.textHeight, Color.BLACK),\r\n this.game2.indexHelp(0,0).drawBoard(2)).movePinhole(0, (Cnst.scale * 7) / 2)\r\n ).movePinhole(0, (Cnst.scale * 76) / 10)\r\n .movePinhole(-Cnst.boardWidth / 2, -Cnst.boardHeight / 2));\r\n\r\n t.checkExpect(this.game3.drawBoard(),\r\n new OverlayOffsetAlign(\"center\", \"bottom\",\r\n new TextImage(\"Flood-It!\", Cnst.textHeight, Color.BLUE),\r\n 0, Cnst.boardHeight + Cnst.scale,\r\n new AboveAlignImage(\"center\",\r\n new TextImage(\"Turn Count: \" + Integer.toString(1) + \"/\"\r\n + Integer.toString(10), Cnst.textHeight, Color.BLACK),\r\n this.game3.indexHelp(0,0).drawBoard(3)).movePinhole(0, (Cnst.scale * 7) / 2)\r\n ).movePinhole(0, (Cnst.scale * 76) / 10)\r\n .movePinhole(-Cnst.boardWidth / 2, -Cnst.boardHeight / 2));\r\n\r\n t.checkExpect(this.game5.drawBoard(),\r\n new OverlayOffsetAlign(\"center\", \"bottom\",\r\n new TextImage(\"Flood-It!\", Cnst.textHeight, Color.BLUE),\r\n 0, Cnst.boardHeight + Cnst.scale,\r\n new AboveAlignImage(\"center\",\r\n new TextImage(\"Turn Count: \" + Integer.toString(5) + \"/\"\r\n + Integer.toString(5), Cnst.textHeight, Color.BLACK),\r\n this.game5.indexHelp(0,0).drawBoard(4)).movePinhole(0, (Cnst.scale * 7) / 2)\r\n ).movePinhole(0, (Cnst.scale * 76) / 10)\r\n .movePinhole(-Cnst.boardWidth / 2, -Cnst.boardHeight / 2));\r\n\r\n //testing draw board on a visible cell\r\n t.checkExpect(this.game2.indexHelp(0, 0).drawBoard(2),\r\n new AboveImage(this.game2.indexHelp(0, 0).drawRow(2),\r\n this.game2.indexHelp(0, 0).bottom.drawBoard(2)));\r\n\r\n t.checkExpect(this.game3.indexHelp(0, 0).drawBoard(3),\r\n new AboveImage(this.game3.indexHelp(0, 0).drawRow(3),\r\n this.game3.indexHelp(0, 0).bottom.drawBoard(3)));\r\n\r\n t.checkExpect(this.game5.indexHelp(0, 0).drawBoard(4),\r\n new AboveImage(this.game5.indexHelp(0, 0).drawRow(4),\r\n this.game5.indexHelp(0, 0).bottom.drawBoard(4)));\r\n\r\n //testing it on an end cell\r\n t.checkExpect(this.game2.indexHelp(-1, 1).drawBoard(2), new EmptyImage());\r\n }", "public void setTestBoard() {\n\n /*game.setNode(new NodeImp(\"2,3\",\"P1\"));\n\n game.setNode(new NodeImp(\"2,5\",\"P1\"));\n\n game.setNode(new NodeImp(\"3,2\",\"P2\"));\n\n game.setNode(new NodeImp(\"3,3\",\"P2\"));\n\n game.setNode(new NodeImp(\"3,4\",\"P1\"));\n\n game.setNode(new NodeImp(\"3,5\",\"P1\"));\n\n game.setNode(new NodeImp(\"4,3\",\"P1\"));\n\n game.setNode(new NodeImp(\"4,4\",\"P2\"));\n\n game.setNode(new NodeImp(\"4,5\",\"P1\"));\n\n game.setNode(new NodeImp(\"5,5\",\"P2\"));\n\n game.setNode(new NodeImp(\"3,3\",\"P2\"));\n\n game.setNode(new NodeImp(\"3,4\",\"P1\"));\n\n game.setNode(new NodeImp(\"4,3\",\"P1\"));\n\n game.setNode(new NodeImp(\"4,4\",\"P2\"));*/\n\n }", "@Test\n public void testVictoryRed(){\n for (Cell c: modelTest.grid) {\n if (c.getX() == 6)\n c.setColor(Color.RED);\n }\n\n modelTest.researchVictory(1,0);\n Color winnerTest = modelTest.getWinner();\n\n Assert.assertEquals(winnerTest,Color.RED);\n }", "@Test\n public void testGetTile() {\n assertEquals(7, board3by3.getTile(0, 0).getId());\n }", "@Test\n public void testCheckVert() throws Exception {\n int[][] game = {\n {1, 1, -1},\n {-1, 1, 0},\n {0, 1, -1}\n };\n\n this.currentGame = new TicTac(game, 0, 1);\n\n System.out.println(\"Game 1: X has won\");\n\n assertEquals(\"X has won\", currentGame.verifyGame()); // X has won (middle column, vertically)\n }", "@Test\n public void testVictoryBlue(){\n for (Cell c: modelTest.grid) {\n if (c.getY() == 5)\n c.setColor(Color.BLUE);\n }\n\n modelTest.researchVictory(0,1);\n Color winnerTest = modelTest.getWinner();\n\n Assert.assertEquals(winnerTest,Color.BLUE);\n }", "public static void main(String[] args) {\n String initialState = \"_________\";\n char[][] ticTacArr = createTicTacArray(initialState);\n printTicTacToeOutput(ticTacArr);\n\n // Setting initial conditions to determine if game is completed\n boolean xHasWin = false;\n boolean oHasWin = false;\n boolean hasEmptyCells = true;\n char currentCharacter = 'X';\n\n // Game play (while no winner)\n while (!oHasWin && !xHasWin & hasEmptyCells) {\n\n // Get validated user coordinates\n int[] XYCoordinates = getXYCoordinates(ticTacArr);\n int xCoordinate = XYCoordinates[0];\n int yCoordinate = XYCoordinates[1];\n\n //Update tic tac board and display\n updateTicTacToe(xCoordinate, yCoordinate, ticTacArr, currentCharacter);\n printTicTacToeOutput(ticTacArr);\n\n // Switching to next players character\n currentCharacter = currentCharacter == 'X' ? 'O' : 'X';\n\n // Updating game conditions\n xHasWin = checkWinCondition('X',ticTacArr);\n oHasWin = checkWinCondition('O',ticTacArr);\n hasEmptyCells = checkForEmptyCells('_', ticTacArr);\n }\n\n // Declare game status\n boolean hasUnevenCount = checkForUnevenCount(ticTacArr);\n printGameStatus(xHasWin, oHasWin, hasEmptyCells, hasUnevenCount);\n\n// // print state prior to player move\n// printTicTacToeOutput(ticTacArr);\n\n /*\n // Work through games status and print result\n boolean xHasWin = checkWinCondition('X',ticTacArr);\n boolean oHasWin = checkWinCondition('O',ticTacArr);\n boolean hasEmptyCells = checkForEmptyCells('_', ticTacArr);\n boolean hasUnevenCount = checkForUnevenCount(ticTacArr);\n printGameStatus(xHasWin, oHasWin, hasEmptyCells, hasUnevenCount);\n */\n }", "@Test\n public void makeMoveTest() {\n\n //get the board of the enemy with the method getBoard() from enemyGameBoard\n board = enemyGameBoard.getBoard();\n\n //try two times to hit a field on the board that is water, and after that assert it is done succesfully\n enemyGameBoard.makeMove(2, 3, false);\n assertTrue(board[2][3].equals(EnemyGameBoard.WATER_HIT));\n enemyGameBoard.makeMove(9, 9, false);\n assertTrue(board[9][9].equals(EnemyGameBoard.WATER_HIT));\n\n //try two times to hit a field on the board that is not water, and after that assert it is done succesfully\n enemyGameBoard.makeMove(5, 4, true);\n assertTrue(board[5][4].equals(EnemyGameBoard.SHIP_HIT));\n enemyGameBoard.makeMove(8, 1, true);\n assertTrue(board[8][1].equals(EnemyGameBoard.SHIP_HIT));\n }", "public static boolean isTieGame3() {\n\t\treturn (spacesLeft == 3 && board[1][0] == ' ' && board[1][1] == ' '\n\t\t\t\t&& board[1][2] == ' ' && board[0][0] == 'X'\n\t\t\t\t&& board[0][2] == 'X' && board[2][1] == 'X')\n\t\t\t\t|| (spacesLeft == 3 && board[1][0] == ' ' && board[1][1] == ' '\n\t\t\t\t\t\t&& board[1][2] == ' ' && board[2][0] == 'X'\n\t\t\t\t\t\t&& board[0][1] == 'X' && board[2][2] == 'X')\n\t\t\t\t|| (spacesLeft == 3 && board[0][1] == ' ' && board[1][1] == ' '\n\t\t\t\t\t\t&& board[2][1] == ' ' && board[0][0] == 'X'\n\t\t\t\t\t\t&& board[2][0] == 'X' && board[1][2] == 'X')\n\t\t\t\t|| (spacesLeft == 3 && board[0][1] == ' ' && board[1][1] == ' '\n\t\t\t\t\t\t&& board[2][1] == ' ' && board[0][2] == 'X'\n\t\t\t\t\t\t&& board[1][0] == 'X' && board[2][2] == 'X');\n\n\t}", "@Test\n public void testIsActionable_FourthCornerCase() {\n board.getCell(3, 3).setDome(true);\n board.getCell(4, 3).setDome(true);\n board.getCell(4, 4).addLevel();\n assertTrue(godPower.isActionable(board, player.getWorker1()));\n }", "@Test\n public void test5() {\n int [][] expectedBoard = {{-1,-1,-1},\n {-1, 0,-1},\n {-1,-1,-1}};\n Board board5 = new Board();\n board5.put(2,2,2);\n assertArrayEquals(board5.getBoard(),expectedBoard); \n }", "private static void winnerOrTie()\n\t{\n\t\t//Check each row for winning or tie condition.\n\t\tif(tictactoeBoard[0] == tictactoeBoard[1] && tictactoeBoard[1] == tictactoeBoard[2] && tictactoeBoard[0] != 1)\n\t\t{\n\t\t\tSystem.out.println(\"Winner\");\n\t\t}\n\t\tif(tictactoeBoard[3] == tictactoeBoard[4] && tictactoeBoard[4] == tictactoeBoard[5] && tictactoeBoard[3] != 4)\n\t\t{\n\t\t\tSystem.out.println(\"Winner\");\n\t\t}\n\t\tif(tictactoeBoard[6] == tictactoeBoard[7] && tictactoeBoard[7] == tictactoeBoard[8] && tictactoeBoard[6] != 7)\n\t\t{\n\t\t\tSystem.out.println(\"Winner\");\n\t\t}\n\t\t//Check diagonally for winning or tie condition.\n\t\tif(tictactoeBoard[0] == tictactoeBoard[4] && tictactoeBoard[4] == tictactoeBoard[8] && tictactoeBoard[0] != 1)\n\t\t{\n\t\t\tSystem.out.println(\"Winner\");\n\t\t}\n\t\tif(tictactoeBoard[6] == tictactoeBoard[4] && tictactoeBoard[4] == tictactoeBoard[2] && tictactoeBoard[6] != 7)\n\t\t{\n\t\t\tSystem.out.println(\"Winner\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//nobody has won yet.\n\t\t\t//changeTurn();\n\t\t}\n\t}", "@Override\r\n\tpublic void mouseClicked(MouseEvent e) {\r\n\t\tSystem.out.println(e.getX()/100 + \", \" + e.getY()/100);\r\n\t\tif (board[e.getX()/100][e.getY()/100].equals(Color.blue)) {\r\n\t\t\tif (turn%2 == 0) {\r\n\t\t\t\tboard[e.getX()/100][e.getY()/100] = Color.yellow;\r\n\t\t\t} else {\r\n\t\t\t\tboard[e.getX()/100][e.getY()/100] = Color.red;\r\n\t\t\t}\r\n\t\t\tturn++;\r\n\t\t\t\r\n\t\t\t//win condition\r\n\t\t\tif(board[0][0] == Color.yellow && board[0][1] == Color.yellow && board[0][2] == Color.yellow && board[0][3] == Color.yellow){\r\n\t\t\t\tboard[0][0] = Color.yellow;\r\n\t\t\t\tboard[0][1] = Color.yellow;\r\n\t\t\t\tboard[0][2] = Color.yellow;\r\n\t\t\t\tboard[0][3] = Color.yellow;\r\n\t\t\t\tboard[1][0] = Color.yellow;\r\n\t\t\t\tboard[1][1] = Color.yellow;\r\n\t\t\t\tboard[1][2] = Color.yellow;\r\n\t\t\t\tboard[1][3] = Color.yellow;\r\n\t\t\t\tboard[2][0] = Color.yellow;\r\n\t\t\t\tboard[2][1] = Color.yellow;\r\n\t\t\t\tboard[2][2] = Color.yellow;\r\n\t\t\t\tboard[2][3] = Color.yellow;\r\n\t\t\t\tboard[3][0] = Color.yellow;\r\n\t\t\t\tboard[3][1] = Color.yellow;\r\n\t\t\t\tboard[3][2] = Color.yellow;\r\n\t\t\t\tboard[3][3] = Color.yellow;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[1][0] == Color.yellow && board[1][1] == Color.yellow && board[1][2] == Color.yellow && board[1][3] == Color.yellow){\r\n\t\t\t\tboard[0][0] = Color.yellow;\r\n\t\t\t\tboard[0][1] = Color.yellow;\r\n\t\t\t\tboard[0][2] = Color.yellow;\r\n\t\t\t\tboard[0][3] = Color.yellow;\r\n\t\t\t\tboard[1][0] = Color.yellow;\r\n\t\t\t\tboard[1][1] = Color.yellow;\r\n\t\t\t\tboard[1][2] = Color.yellow;\r\n\t\t\t\tboard[1][3] = Color.yellow;\r\n\t\t\t\tboard[2][0] = Color.yellow;\r\n\t\t\t\tboard[2][1] = Color.yellow;\r\n\t\t\t\tboard[2][2] = Color.yellow;\r\n\t\t\t\tboard[2][3] = Color.yellow;\r\n\t\t\t\tboard[3][0] = Color.yellow;\r\n\t\t\t\tboard[3][1] = Color.yellow;\r\n\t\t\t\tboard[3][2] = Color.yellow;\r\n\t\t\t\tboard[3][3] = Color.yellow;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[2][0] == Color.yellow && board[2][1] == Color.yellow && board[2][2] == Color.yellow && board[2][3] == Color.yellow){\r\n\t\t\t\tboard[0][0] = Color.yellow;\r\n\t\t\t\tboard[0][1] = Color.yellow;\r\n\t\t\t\tboard[0][2] = Color.yellow;\r\n\t\t\t\tboard[0][3] = Color.yellow;\r\n\t\t\t\tboard[1][0] = Color.yellow;\r\n\t\t\t\tboard[1][1] = Color.yellow;\r\n\t\t\t\tboard[1][2] = Color.yellow;\r\n\t\t\t\tboard[1][3] = Color.yellow;\r\n\t\t\t\tboard[2][0] = Color.yellow;\r\n\t\t\t\tboard[2][1] = Color.yellow;\r\n\t\t\t\tboard[2][2] = Color.yellow;\r\n\t\t\t\tboard[2][3] = Color.yellow;\r\n\t\t\t\tboard[3][0] = Color.yellow;\r\n\t\t\t\tboard[3][1] = Color.yellow;\r\n\t\t\t\tboard[3][2] = Color.yellow;\r\n\t\t\t\tboard[3][3] = Color.yellow;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[0][0] == Color.yellow && board[1][0] == Color.yellow && board[2][0] == Color.yellow && board[3][0] == Color.yellow){\r\n\t\t\t\tboard[0][0] = Color.yellow;\r\n\t\t\t\tboard[0][1] = Color.yellow;\r\n\t\t\t\tboard[0][2] = Color.yellow;\r\n\t\t\t\tboard[0][3] = Color.yellow;\r\n\t\t\t\tboard[1][0] = Color.yellow;\r\n\t\t\t\tboard[1][1] = Color.yellow;\r\n\t\t\t\tboard[1][2] = Color.yellow;\r\n\t\t\t\tboard[1][3] = Color.yellow;\r\n\t\t\t\tboard[2][0] = Color.yellow;\r\n\t\t\t\tboard[2][1] = Color.yellow;\r\n\t\t\t\tboard[2][2] = Color.yellow;\r\n\t\t\t\tboard[2][3] = Color.yellow;\r\n\t\t\t\tboard[3][0] = Color.yellow;\r\n\t\t\t\tboard[3][1] = Color.yellow;\r\n\t\t\t\tboard[3][2] = Color.yellow;\r\n\t\t\t\tboard[3][3] = Color.yellow;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[0][1] == Color.yellow && board[1][1] == Color.yellow && board[2][1] == Color.yellow && board[3][1] == Color.yellow){\r\n\t\t\t\tboard[0][0] = Color.yellow;\r\n\t\t\t\tboard[0][1] = Color.yellow;\r\n\t\t\t\tboard[0][2] = Color.yellow;\r\n\t\t\t\tboard[0][3] = Color.yellow;\r\n\t\t\t\tboard[1][0] = Color.yellow;\r\n\t\t\t\tboard[1][1] = Color.yellow;\r\n\t\t\t\tboard[1][2] = Color.yellow;\r\n\t\t\t\tboard[1][3] = Color.yellow;\r\n\t\t\t\tboard[2][0] = Color.yellow;\r\n\t\t\t\tboard[2][1] = Color.yellow;\r\n\t\t\t\tboard[2][2] = Color.yellow;\r\n\t\t\t\tboard[2][3] = Color.yellow;\r\n\t\t\t\tboard[3][0] = Color.yellow;\r\n\t\t\t\tboard[3][1] = Color.yellow;\r\n\t\t\t\tboard[3][2] = Color.yellow;\r\n\t\t\t\tboard[3][3] = Color.yellow;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[0][2] == Color.yellow && board[1][2] == Color.yellow && board[2][2] == Color.yellow && board[3][2] == Color.yellow){\r\n\t\t\t\tboard[0][0] = Color.yellow;\r\n\t\t\t\tboard[0][1] = Color.yellow;\r\n\t\t\t\tboard[0][2] = Color.yellow;\r\n\t\t\t\tboard[0][3] = Color.yellow;\r\n\t\t\t\tboard[1][0] = Color.yellow;\r\n\t\t\t\tboard[1][1] = Color.yellow;\r\n\t\t\t\tboard[1][2] = Color.yellow;\r\n\t\t\t\tboard[1][3] = Color.yellow;\r\n\t\t\t\tboard[2][0] = Color.yellow;\r\n\t\t\t\tboard[2][1] = Color.yellow;\r\n\t\t\t\tboard[2][2] = Color.yellow;\r\n\t\t\t\tboard[2][3] = Color.yellow;\r\n\t\t\t\tboard[3][0] = Color.yellow;\r\n\t\t\t\tboard[3][1] = Color.yellow;\r\n\t\t\t\tboard[3][2] = Color.yellow;\r\n\t\t\t\tboard[3][3] = Color.yellow;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[0][0] == Color.yellow && board[1][1] == Color.yellow && board[2][2] == Color.yellow && board[3][3] == Color.yellow){\r\n\t\t\t\tboard[0][0] = Color.yellow;\r\n\t\t\t\tboard[0][1] = Color.yellow;\r\n\t\t\t\tboard[0][2] = Color.yellow;\r\n\t\t\t\tboard[0][3] = Color.yellow;\r\n\t\t\t\tboard[1][0] = Color.yellow;\r\n\t\t\t\tboard[1][1] = Color.yellow;\r\n\t\t\t\tboard[1][2] = Color.yellow;\r\n\t\t\t\tboard[1][3] = Color.yellow;\r\n\t\t\t\tboard[2][0] = Color.yellow;\r\n\t\t\t\tboard[2][1] = Color.yellow;\r\n\t\t\t\tboard[2][2] = Color.yellow;\r\n\t\t\t\tboard[2][3] = Color.yellow;\r\n\t\t\t\tboard[3][0] = Color.yellow;\r\n\t\t\t\tboard[3][1] = Color.yellow;\r\n\t\t\t\tboard[3][2] = Color.yellow;\r\n\t\t\t\tboard[3][3] = Color.yellow;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[3][0] == Color.yellow && board[1][2] == Color.yellow && board[2][1] == Color.yellow && board[0][3] == Color.yellow){\r\n\t\t\t\tboard[0][0] = Color.yellow;\r\n\t\t\t\tboard[0][1] = Color.yellow;\r\n\t\t\t\tboard[0][2] = Color.yellow;\r\n\t\t\t\tboard[0][3] = Color.yellow;\r\n\t\t\t\tboard[1][0] = Color.yellow;\r\n\t\t\t\tboard[1][1] = Color.yellow;\r\n\t\t\t\tboard[1][2] = Color.yellow;\r\n\t\t\t\tboard[1][3] = Color.yellow;\r\n\t\t\t\tboard[2][0] = Color.yellow;\r\n\t\t\t\tboard[2][1] = Color.yellow;\r\n\t\t\t\tboard[2][2] = Color.yellow;\r\n\t\t\t\tboard[2][3] = Color.yellow;\r\n\t\t\t\tboard[3][0] = Color.yellow;\r\n\t\t\t\tboard[3][1] = Color.yellow;\r\n\t\t\t\tboard[3][2] = Color.yellow;\r\n\t\t\t\tboard[3][3] = Color.yellow;\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\tif(board[0][0] == Color.red && board[0][1] == Color.red && board[0][2] == Color.red && board[0][3] == Color.red){\r\n\t\t\t\tboard[0][0] = Color.red;\r\n\t\t\t\tboard[0][1] = Color.red;\r\n\t\t\t\tboard[0][2] = Color.red;\r\n\t\t\t\tboard[0][3] = Color.red;\r\n\t\t\t\tboard[1][0] = Color.red;\r\n\t\t\t\tboard[1][1] = Color.red;\r\n\t\t\t\tboard[1][2] = Color.red;\r\n\t\t\t\tboard[1][3] = Color.red;\r\n\t\t\t\tboard[2][0] = Color.red;\r\n\t\t\t\tboard[2][1] = Color.red;\r\n\t\t\t\tboard[2][2] = Color.red;\r\n\t\t\t\tboard[2][3] = Color.red;\r\n\t\t\t\tboard[3][0] = Color.red;\r\n\t\t\t\tboard[3][1] = Color.red;\r\n\t\t\t\tboard[3][2] = Color.red;\r\n\t\t\t\tboard[3][3] = Color.red;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[1][0] == Color.red && board[1][1] == Color.red && board[1][2] == Color.red && board[1][3] == Color.red){\r\n\t\t\t\tboard[0][0] = Color.red;\r\n\t\t\t\tboard[0][1] = Color.red;\r\n\t\t\t\tboard[0][2] = Color.red;\r\n\t\t\t\tboard[0][3] = Color.red;\r\n\t\t\t\tboard[1][0] = Color.red;\r\n\t\t\t\tboard[1][1] = Color.red;\r\n\t\t\t\tboard[1][2] = Color.red;\r\n\t\t\t\tboard[1][3] = Color.red;\r\n\t\t\t\tboard[2][0] = Color.red;\r\n\t\t\t\tboard[2][1] = Color.red;\r\n\t\t\t\tboard[2][2] = Color.red;\r\n\t\t\t\tboard[2][3] = Color.red;\r\n\t\t\t\tboard[3][0] = Color.red;\r\n\t\t\t\tboard[3][1] = Color.red;\r\n\t\t\t\tboard[3][2] = Color.red;\r\n\t\t\t\tboard[3][3] = Color.red;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[2][0] == Color.red && board[2][1] == Color.red && board[2][2] == Color.red && board[2][3] == Color.red){\r\n\t\t\t\tboard[0][0] = Color.red;\r\n\t\t\t\tboard[0][1] = Color.red;\r\n\t\t\t\tboard[0][2] = Color.red;\r\n\t\t\t\tboard[0][3] = Color.red;\r\n\t\t\t\tboard[1][0] = Color.red;\r\n\t\t\t\tboard[1][1] = Color.red;\r\n\t\t\t\tboard[1][2] = Color.red;\r\n\t\t\t\tboard[1][3] = Color.red;\r\n\t\t\t\tboard[2][0] = Color.red;\r\n\t\t\t\tboard[2][1] = Color.red;\r\n\t\t\t\tboard[2][2] = Color.red;\r\n\t\t\t\tboard[2][3] = Color.red;\r\n\t\t\t\tboard[3][0] = Color.red;\r\n\t\t\t\tboard[3][1] = Color.red;\r\n\t\t\t\tboard[3][2] = Color.red;\r\n\t\t\t\tboard[3][3] = Color.red;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[0][0] == Color.red && board[1][0] == Color.red && board[2][0] == Color.red && board[3][0] == Color.red){\r\n\t\t\t\tboard[0][0] = Color.red;\r\n\t\t\t\tboard[0][1] = Color.red;\r\n\t\t\t\tboard[0][2] = Color.red;\r\n\t\t\t\tboard[0][3] = Color.red;\r\n\t\t\t\tboard[1][0] = Color.red;\r\n\t\t\t\tboard[1][1] = Color.red;\r\n\t\t\t\tboard[1][2] = Color.red;\r\n\t\t\t\tboard[1][3] = Color.red;\r\n\t\t\t\tboard[2][0] = Color.red;\r\n\t\t\t\tboard[2][1] = Color.red;\r\n\t\t\t\tboard[2][2] = Color.red;\r\n\t\t\t\tboard[2][3] = Color.red;\r\n\t\t\t\tboard[3][0] = Color.red;\r\n\t\t\t\tboard[3][1] = Color.red;\r\n\t\t\t\tboard[3][2] = Color.red;\r\n\t\t\t\tboard[3][3] = Color.red;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[0][1] == Color.red && board[1][1] == Color.red && board[2][1] == Color.red && board[3][1] == Color.red){\r\n\t\t\t\tboard[0][0] = Color.red;\r\n\t\t\t\tboard[0][1] = Color.red;\r\n\t\t\t\tboard[0][2] = Color.red;\r\n\t\t\t\tboard[0][3] = Color.red;\r\n\t\t\t\tboard[1][0] = Color.red;\r\n\t\t\t\tboard[1][1] = Color.red;\r\n\t\t\t\tboard[1][2] = Color.red;\r\n\t\t\t\tboard[1][3] = Color.red;\r\n\t\t\t\tboard[2][0] = Color.red;\r\n\t\t\t\tboard[2][1] = Color.red;\r\n\t\t\t\tboard[2][2] = Color.red;\r\n\t\t\t\tboard[2][3] = Color.red;\r\n\t\t\t\tboard[3][0] = Color.red;\r\n\t\t\t\tboard[3][1] = Color.red;\r\n\t\t\t\tboard[3][2] = Color.red;\r\n\t\t\t\tboard[3][3] = Color.red;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[0][2] == Color.red && board[1][2] == Color.red && board[2][2] == Color.red && board[3][2] == Color.red){\r\n\t\t\t\tboard[0][0] = Color.red;\r\n\t\t\t\tboard[0][1] = Color.red;\r\n\t\t\t\tboard[0][2] = Color.red;\r\n\t\t\t\tboard[0][3] = Color.red;\r\n\t\t\t\tboard[1][0] = Color.red;\r\n\t\t\t\tboard[1][1] = Color.red;\r\n\t\t\t\tboard[1][2] = Color.red;\r\n\t\t\t\tboard[1][3] = Color.red;\r\n\t\t\t\tboard[2][0] = Color.red;\r\n\t\t\t\tboard[2][1] = Color.red;\r\n\t\t\t\tboard[2][2] = Color.red;\r\n\t\t\t\tboard[2][3] = Color.red;\r\n\t\t\t\tboard[3][0] = Color.red;\r\n\t\t\t\tboard[3][1] = Color.red;\r\n\t\t\t\tboard[3][2] = Color.red;\r\n\t\t\t\tboard[3][3] = Color.red;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[0][0] == Color.red && board[1][1] == Color.red && board[2][2] == Color.red && board[3][3] == Color.red){\r\n\t\t\t\tboard[0][0] = Color.red;\r\n\t\t\t\tboard[0][1] = Color.red;\r\n\t\t\t\tboard[0][2] = Color.red;\r\n\t\t\t\tboard[0][3] = Color.red;\r\n\t\t\t\tboard[1][0] = Color.red;\r\n\t\t\t\tboard[1][1] = Color.red;\r\n\t\t\t\tboard[1][2] = Color.red;\r\n\t\t\t\tboard[1][3] = Color.red;\r\n\t\t\t\tboard[2][0] = Color.red;\r\n\t\t\t\tboard[2][1] = Color.red;\r\n\t\t\t\tboard[2][2] = Color.red;\r\n\t\t\t\tboard[2][3] = Color.red;\r\n\t\t\t\tboard[3][0] = Color.red;\r\n\t\t\t\tboard[3][1] = Color.red;\r\n\t\t\t\tboard[3][2] = Color.red;\r\n\t\t\t\tboard[3][3] = Color.red;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif(board[3][0] == Color.red && board[1][2] == Color.red && board[2][1] == Color.red && board[0][3] == Color.red){\r\n\t\t\t\tboard[0][0] = Color.red;\r\n\t\t\t\tboard[0][1] = Color.red;\r\n\t\t\t\tboard[0][2] = Color.red;\r\n\t\t\t\tboard[0][3] = Color.red;\r\n\t\t\t\tboard[1][0] = Color.red;\r\n\t\t\t\tboard[1][1] = Color.red;\r\n\t\t\t\tboard[1][2] = Color.red;\r\n\t\t\t\tboard[1][3] = Color.red;\r\n\t\t\t\tboard[2][0] = Color.red;\r\n\t\t\t\tboard[2][1] = Color.red;\r\n\t\t\t\tboard[2][2] = Color.red;\r\n\t\t\t\tboard[2][3] = Color.red;\r\n\t\t\t\tboard[3][0] = Color.red;\r\n\t\t\t\tboard[3][1] = Color.red;\r\n\t\t\t\tboard[3][2] = Color.red;\r\n\t\t\t\tboard[3][3] = Color.red;\r\n\t\t\t}\r\n\t\t\trepaint();\r\n\t\t}\r\n\t}", "@Test\n public void overExample3() {\n MarbleSolitaireModel exampleBoard = new TriangleSolitaireModelImpl();\n exampleBoard.move(2, 0, 0, 0);\n assertEquals(false, exampleBoard.isGameOver());\n }", "public boolean win() {\r\n\t\tfor (int n = 0; n < 3; n++) {\r\n\t\t\tfor (int m = 0; m < 7; m++) {\r\n\t\t\t\tif (board[n][m] != 'X') {\r\n\t\t\t\t\tif (board[n + 1][m] == board[n][m] && board[n + 2][m] == board[n][m]\r\n\t\t\t\t\t\t\t&& board[n + 3][m] == board[n][m]) {\r\n\t\t\t\t\t\tsquares[n][m].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n + 1][m].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n + 2][m].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n + 3][m].setText(\"X\");\r\n\r\n\t\t\t\t\t\twinnerChip = board[n][m];\r\n\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int n = 0; n < 6; n++) {\r\n\t\t\tfor (int m = 0; m < 4; m++) {\r\n\t\t\t\tif (board[n][m] != 'X') {\r\n\t\t\t\t\tif (board[n][m + 1] == board[n][m] && board[n][m + 2] == board[n][m]\r\n\t\t\t\t\t\t\t&& board[n][m + 3] == board[n][m]) {\r\n\t\t\t\t\t\tsquares[n][m].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n][m + 1].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n][m + 2].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n][m + 3].setText(\"X\");\r\n\t\t\t\t\t\twinnerChip = board[n][m];\r\n\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int n = 0; n < 3; n++) {\r\n\t\t\tfor (int m = 0; m < 4; m++) {\r\n\t\t\t\tif (board[n][m] != 'X') {\r\n\t\t\t\t\tif (board[n + 1][m + 1] == board[n][m] && board[n + 2][m + 2] == board[n][m]\r\n\t\t\t\t\t\t\t&& board[n + 3][m + 3] == board[n][m]) {\r\n\t\t\t\t\t\tsquares[n][m].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n + 1][m + 1].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n + 2][m + 2].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n + 3][m + 3].setText(\"X\");\r\n\r\n\t\t\t\t\t\twinnerChip = board[n][m];\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int n = 3; n < 6; n++) {\r\n\t\t\tfor (int m = 0; m < 4; m++) {\r\n\t\t\t\tif (board[n][m] != 'X') {\r\n\t\t\t\t\tif (board[n - 1][m + 1] == board[n][m] && board[n - 2][m + 2] == board[n][m]\r\n\t\t\t\t\t\t\t&& board[n - 3][m + 3] == board[n][m]) {\r\n\t\t\t\t\t\tsquares[n][m].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n - 1][m + 1].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n - 2][m + 2].setText(\"X\");\r\n\t\t\t\t\t\tsquares[n - 3][m + 3].setText(\"X\");\r\n\r\n\t\t\t\t\t\twinnerChip = board[n][m];\r\n\t\t\t\t\t\treturn true;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn false;\r\n\r\n\t}", "public boolean winCheck(){\n for(int i=0; i<3; i++){//goes through rows\n for(int j=0; j<4; j++){//goes through columns\n if(board[i][j+3] != 0 && board[i+1][j+2] != 0 && board[i+2][j+1] != 0 && \n board[i+3][j] != 0)\n if(board[i][j+3]==(board[i+1][j+2]))\n if(board[i][j+3]==(board[i+2][j+1]))\n if(board[i][j+3]==(board[i+3][j])){\n GBoard[i][j+3].setIcon(star);\n GBoard[i+1][j+2].setIcon(star);\n GBoard[i+2][j+1].setIcon(star);\n GBoard[i+3][j].setIcon(star);\n wonYet=true;\n return true;\n }\n }\n }\n //checks for subdiagonals\n for(int i=0; i<3; i++){//goes through rows\n for(int j=0; j<4; j++){//goes through columns\n if(board[i][j] != 0 && board[i+1][j+1] != 0 && board[i+2][j+2] != 0 &&\n board[i+3][j+3] != 0)\n if(board[i][j] == (board[i+1][j+1]))\n if(board[i][j] == (board[i+2][j+2]))\n if(board[i][j] == (board[i+3][j+3])){\n GBoard[i][j].setIcon(star);\n GBoard[i+1][j+1].setIcon(star);\n GBoard[i+2][j+2].setIcon(star);\n GBoard[i+3][j+3].setIcon(star);\n wonYet=true;\n return true;\n } \n }\n }\n //check horizontals\n for(int i=0; i<6; i++){//goes through rows\n for(int j=0; j<4; j++){//goes through columns\n if(board[i][j] != 0 && board[i][j+1] != 0 && board[i][j+2] != 0 && \n board[i][j+3] != 0){\n if(board[i][j]==(board[i][j+1]))\n if(board[i][j]==(board[i][j+2]))\n if(board[i][j]==(board[i][j+3])){\n GBoard[i][j].setIcon(star);\n GBoard[i][j+1].setIcon(star);\n GBoard[i][j+2].setIcon(star);\n GBoard[i][j+3].setIcon(star);\n wonYet=true;\n return true;\n }\n }\n }\n }\n //checks for vertical wins\n for(int i=0; i<3; i++){//checks rows\n for(int j=0; j<7; j++){//checks columns\n if(board[i][j] != 0 && board[i+1][j] != 0 && board[i+2][j] != 0 && \n board[i+3][j] != 0){\n if(board[i][j]==(board[i+1][j]))\n if(board[i][j]==(board[i+2][j]))\n if(board[i][j]==(board[i+3][j])){\n GBoard[i][j].setIcon(star);\n GBoard[i+1][j].setIcon(star);\n GBoard[i+2][j].setIcon(star);\n GBoard[i+3][j].setIcon(star);\n wonYet=true;\n return true;\n }\n }\n }\n }\n return false; \n }", "private boolean findTicTacToe(int x, int y) {\n for (Point c : ticTacToeList) {\n if (c != null && c.getX() == x && c.getY() == y)\n return true;\n }\n return false;\n }", "@Test\n public void testIsActionable_FirstCornerCase() {\n board.getCell(3, 4).addLevel();\n board.getCell(3, 3).addLevel();\n board.getCell(4, 3).addLevel();\n assertFalse(godPower.isActionable(board, player.getWorker1()));\n }", "void checkerboard(int checkerSquareArea);", "public static boolean isBlackWin(char[][] board){\r\n for (int r= 0; r < 6; r++ ){\r\n for (int c = 0; c < 7; c++){\r\n if (r < 3){\r\n if (board [r][c] =='b' && board [r + 1][c] =='b' && board [r + 2][c] =='b' && board [r + 3][c] =='b' ){\r\n return true;\r\n }\r\n }\r\n if (c < 4){\r\n if (board [r][c] =='b' && board [r][c + 1] =='b' && board [r ][c + 2] =='b' && board [r][c + 3] =='b' ){\r\n return true;\r\n }\r\n }\r\n\r\n \r\n }\r\n }\r\n \r\n for (int r = 0; r < 3; r++){\r\n for (int c = 0; c < 4; c++){\r\n if (board [r][c] =='b' && board [r + 1][c +1 ] =='b' && board [r + 2][c +2] =='b' && board [r + 3][c +3 ] =='b' ){\r\n return true; }\r\n }\r\n }\r\n\r\n for (int r = 0; r < 3 ; r++){\r\n for (int c = 6; c > 2; c--){\r\n if (board [r][c] =='b' && board [r + 1][c - 1 ] =='b' && board [r + 2][c - 2] =='b' && board [r + 3][c - 3 ] =='b' ){\r\n return true; }\r\n }\r\n }\r\n return false;\r\n }", "@Test\n public void testKnightSide() {\n // initialize the complete chess board\n ChessBoard chessBoard = init(\"CHESS\");\n\n assertEquals(north, chessBoard.getPiece(0, 1).getSide());\n assertEquals(north, chessBoard.getPiece(0, 6).getSide());\n assertEquals(south, chessBoard.getPiece(7, 1).getSide());\n assertEquals(south, chessBoard.getPiece(7, 6).getSide());\n }", "void testDrawCell(Tester t) {\r\n initData();\r\n t.checkExpect(this.game2.indexHelp(0, 0).drawCell(2),\r\n new FrameImage(new RectangleImage(Cnst.boardWidth / 2, Cnst.boardHeight / 2,\r\n OutlineMode.SOLID, Color.ORANGE)));\r\n t.checkExpect(this.game3.indexHelp(0, 0).drawCell(3),\r\n new FrameImage(new RectangleImage(Cnst.boardWidth / 3, Cnst.boardHeight / 3,\r\n OutlineMode.SOLID, Color.GREEN)));\r\n t.checkExpect(this.game5.indexHelp(0, 0).drawCell(4),\r\n new FrameImage(new RectangleImage(Cnst.boardWidth / 4, Cnst.boardHeight / 4,\r\n OutlineMode.SOLID, Color.PINK)));\r\n t.checkExpect(this.game2.indexHelp(-1, -1).drawCell(1), new EmptyImage());\r\n }", "public void testGetCell()\r\n {\r\n board.loadBoardState(\"OOOO\",\r\n \"OOOO\",\r\n \"O+OO\",\r\n \"OOOO\");\r\n assertEquals(MineSweeperCell.MINE, board.getCell(1, 2));\r\n board.loadBoardState(\"OOOO\",\r\n \"OOOO\",\r\n \"O+OO\",\r\n \"OOOO\");\r\n assertEquals(MineSweeperCell.INVALID_CELL, board.getCell(-1, 2));\r\n board.loadBoardState(\"OOOO\",\r\n \"OOOO\",\r\n \"O+OO\",\r\n \"OOOO\");\r\n assertEquals(MineSweeperCell.INVALID_CELL, board.getCell(4, 2));\r\n board.loadBoardState(\"OOOO\",\r\n \"OOOO\",\r\n \"O+OO\",\r\n \"OOOO\");\r\n assertEquals(MineSweeperCell.INVALID_CELL, board.getCell(2, -1));\r\n board.loadBoardState(\"OOOO\",\r\n \"OOOO\",\r\n \"O+OO\",\r\n \"OOOO\");\r\n assertEquals(MineSweeperCell.INVALID_CELL, board.getCell(2, 4));\r\n }", "public TicTacToe(){ \r\n\t\tboard = new char[3][3];\r\n\t}", "@Test\n\tpublic void threePieceBlackCapture()\n\t{\n\t\tData d=new Data();\n\t\td.set(24,90);\n\t\td.set(9,93);\n\t\td.set(31,94);\n\t\td.set(1,91);\n\t\td.set(27,70);\n\t\td.set(12,81);\n\t\td.set(32,92);\n\t\tArrayList<Coordinate> test_arr=d.pieceLost(92);\n\t\tassertTrue(3==test_arr.get(0).getX() && 7==test_arr.get(0).getY()\n\t\t\t&& 4==test_arr.get(1).getX() && 8==test_arr.get(1).getY()\n\t\t\t&& 2==test_arr.get(2).getX() && 8==test_arr.get(2).getY());\n\n\t}", "public static boolean checkWinner(){\n \n if(board[0][0] == board[0][1] && board[0][1] == board[0][2] && (board[0][0] == 'x' || board [0][0] == 'o'))\n return true;\n else if(board[1][0] == board[1][1] && board[1][1] == board[1][2] && (board[1][0] == 'x' || board[1][0] == 'o'))\n return true;\n else if(board[2][0] == board[2][1] && board[2][1] == board[2][2] && (board[2][0] == 'x' || board[2][0] == 'o'))\n return true;\n else if(board[0][0] == board[1][0] && board[1][0] == board[2][0] && (board[0][0] == 'x' || board[0][0] == 'o'))\n return true;\n else if(board[0][1] == board[1][1] && board[1][1] == board[2][1] && (board[0][1] == 'x' || board[0][1] == 'o'))\n return true;\n else if(board[0][2] == board[1][2] && board[1][2] == board[2][2] && (board[0][2] == 'x' || board[0][2] == 'o'))\n return true;\n else if(board[0][0] == board[1][1] && board[1][1] == board[2][2] && (board[0][0] == 'x' || board[0][0] == 'o'))\n return true;\n else if(board[0][2] == board[1][1] && board[1][1] == board[2][0] && (board[0][2] == 'x' || board[0][2] == 'o'))\n return true;\n else\n return false;\n \n }", "public void actionPerformed(ActionEvent evt) {\n if ( player == 0 ) { // Player O - blackstone\n if (jButton[j].getIcon().equals(B)) {\n jButton[j].setIcon(O); // value of current button read left to right and then top to bottom\n \n board[j/csize][j%csize] = 0;\n int win = 1;\n win = checkrow(board,j/csize,0);\n if ( win == 0 ) {\n win = checkcol(board,j%csize,0);\n }\n if ( win == 0 ) {\n win = checkdiag(board,0 , j/csize, j%csize);\n }\n player = 1; // switches player\n markers++;\n\n if ( win == 1 ) {\n exitAction(\"Blackstone wins!\\n\");\n }\n if ( markers == gsize ) { // if all blocks have been taken\n exitAction(\"Draw!\\n\");\n }\n } \n } else { // Player X - whitestone = 1\n if (jButton[j].getIcon().equals(B)) {\n jButton[j].setIcon(X);\n board[j/csize][j%csize] = 1;\n int win = 1;\n win = checkrow(board,j/csize,1);\n if ( win == 0 ) {\n win = checkcol(board,j%csize,1);\n }\n if ( win == 0 ) {\n win = checkdiag(board, 1, j/csize, j%csize );\n }\n player = 0;\n markers++;\n\n if ( win == 1 ) {\n exitAction(\"Whitestone wins!\\n\");\n }\n if ( markers == gsize ) {\n exitAction(\"Draw!\\n\");\n }\n } \n }\n }", "@Test\n public void testPawnPosition() {\n // initialize the complete chess board\n ChessBoard chessBoard = init(\"CHESS\");\n\n // compare the position of the pawn on the table to the correct position\n for (int i = 0; i < 8; ++i) {\n assertEquals(1, chessBoard.getPiece(1, i).getRow());\n assertEquals(i, chessBoard.getPiece(1, i).getColumn());\n\n assertEquals(6, chessBoard.getPiece(6, i).getRow());\n assertEquals(i, chessBoard.getPiece(6, i).getColumn());\n }\n }", "public static void main(String[] args){\n Board b1 = new Board(new int[][]{{1, 2, 3}, {4, 5, 6}, {7, 8, 0}});\n assert b1.dimension() == 3;\n\n assert b1.hamming() == 0 : \"b1 hamming is: \" + b1.hamming();\n assert b1.manhattan() == 0;\n assert b1.isGoal();\n\n Board b2 = new Board(new int[][]{{5, 2, 3}, {4, 1, 6}, {7, 8, 0}});\n assert b2.hamming() == 2;\n assert b2.manhattan() == 4;\n assert !b2.isGoal();\n assert !b1.equals(b2);\n\n Board b3 = new Board(new int[][]{{4, 2, 3}, {5, 1, 6}, {7, 8, 0}});\n assert b3.twin().equals(b2);\n\n Board b4 = new Board(new int[][]{{4, 2, 3}, {5, 0, 6}, {7, 8, 1}});\n for (Board board: b4.neighbors() ){\n System.out.println(board);\n }\n\n Board b5 = new Board(new int[][]{{0, 1, 3}, {4, 2, 5}, {7, 8, 6}});\n assert b5.manhattan() == 4;\n\n Board b6 = new Board(new int[][]{{5, 8, 7}, {1, 4, 6}, {3, 0, 2}});\n assert b6.manhattan() == 17;\n }", "@Test\n public void test12() { \n Board board12 = new Board();\n board12.put(1,3,1);\n \n assertFalse(board12.checkWin());\n }", "public TicTacToe() {\n resetBoard();\n }", "@Test\n public void checkingBoardManagerAlwaysProduceASolvable3x3Board() {\n BoardManager boardManager1 = new BoardManager(3,3);\n List<Tile> flatTile = new ArrayList<>();\n int z = 0;\n for (int i = 0; i < Board.NUM_ROWS; i++) {\n for (int j = 0; j < Board.NUM_COLS; j++) {\n flatTile.add(z, boardManager1.getBoard().getTiles()[i][j]);\n z++;\n }\n }\n BoardManager boardManager2 = new BoardManager(3,3);\n List<Tile> flatTile1 = new ArrayList<>();\n int z1 = 0;\n for (int i1 = 0; i1 < Board.NUM_ROWS; i1++) {\n for (int j = 0; j < Board.NUM_COLS; j++) {\n flatTile1.add(z1, boardManager2.getBoard().getTiles()[i1][j]);\n z1++;\n }\n }\n BoardManager boardManager3 = new BoardManager(3,3);\n List<Tile> flatTile2 = new ArrayList<>();\n int z2 = 0;\n for (int i2 = 0; i2 < Board.NUM_ROWS; i2++) {\n for (int j = 0; j < Board.NUM_COLS; j++) {\n flatTile2.add(z2, boardManager3.getBoard().getTiles()[i2][j]);\n z2++;\n }\n }\n assertTrue(boardManager1.isSolvable(flatTile));\n assertTrue(boardManager2.isSolvable(flatTile1));\n assertTrue(boardManager3.isSolvable(flatTile2));\n }", "public void checkWinner(){\n \n if ((board[0][0] == 'X' && board[0][1] == 'X' && board[0][2] == 'X')||(board[1][0] == 'X' && board[1][1] == 'X' && board[1][2] == 'X')||(board[2][0] == 'X' && board[2][1] == 'X' && board[2][2] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'X' && board[1][0] == 'X' && board[2][0] == 'X')||(board[0][1] == 'X' && board[1][1] == 'X' && board[2][1] == 'X')||(board[0][2] == 'X' && board[1][2] == 'X' && board[2][2] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'X' && board[1][1] == 'X' && board[2][2] == 'X')||(board[0][2] == 'X' && board[1][1] == 'X' && board[2][0] == 'X')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[0][1] == 'O' && board[0][2] == 'O')||(board[1][0] == 'O' && board[1][1] == 'O' && board[1][2] == 'O')||(board[2][0] == 'O' && board[2][1] == 'O' && board[2][2] == 'O')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[1][0] == 'O' && board[2][0] == 'O')||(board[0][1] == 'O' && board[1][1] == 'O' && board[2][1] == 'O')||(board[0][2] == 'O' && board[1][2] == 'O' && board[2][2] == 'O')){\n winner();\n }\n else if ((board[0][0] == 'O' && board[1][1] == 'O' && board[2][2] == 'O')||(board[0][2] == 'O' && board[1][1] == 'O' && board[2][0] == 'O')){\n winner();\n }\n \n }", "public boolean tileOfComputer (int row, int col){\n return this.gameBoard[row][col] == 'o';\n }", "@Test\r\n\tpublic void testDirectCheck() {\n\t\tBoard b = new Board();\r\n\t\tb.state = new Piece[][] //set up the board in the standard way\r\n\t\t\t\t{\r\n\t\t\t\t{new Rook(\"b\"), new Knight(\"b\"),new Bishop(\"b\"),new Queen(\"b\"), new King(\"b\"), new Bishop(\"b\"),\r\n\t\t\t\t\tnew Knight(\"b\"), new Rook(\"b\")},\r\n\t\t\t\t{new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),new Pawn(\"b\"),\r\n\t\t\t\t\t\tnew Pawn(\"b\")},\r\n\t\t\t\t{null,null,null,null,null,null,null,null},\r\n\t\t\t\t{null,null,null,null,null,null,null,null},\r\n\t\t\t\t{null,null,null,null,null,null,null,null},\r\n\t\t\t\t{null,null,null,null,null,new Knight(\"b\"),null,null},\r\n\t\t\t\t{new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),new Pawn(\"w\"),\r\n\t\t\t\t\tnew Pawn(\"w\")},\r\n\t\t\t\t{new Rook(\"w\"), new Knight(\"w\"),new Bishop(\"w\"),new Queen(\"w\"), new King(\"w\"), new Bishop(\"w\"),\r\n\t\t\t\t\tnew Knight(\"w\"), new Rook(\"w\")}\r\n\t\t\t\t};\r\n\t\tassertTrue(b.whiteCheck());\t\r\n\t}", "public static void main(String[]args){\n Scanner reader = new Scanner(System.in);\n TTTBoard board = new TTTBoard();\n \n // Display the empty board\n System.out.println(board);\n\n // Let the non-CPU go first\n int turn = 1;\n int a = 0;\n int b = 0;\n char player;\n\n // Loop while there is no winner and the board is not full \n while (board.getWinner() == '-' && !board.full()){\n if (turn%2!=0){\n player = 'X';\n \n // Prompt the user for a move\n System.out.println(\"Your turn\");\n System.out.print(\"Enter the row and column[1-3, space, 1-3]: \");\n \n // Read the move\n int row = reader.nextInt();\n int column = reader.nextInt();\n \n // Attempt the move\n // If the move is illegal\n // display an error message\n // Else\n // display the board and switch players\n boolean success = board.placeXorO(player, row, column);\n if (!success)\n System.out.println(\"Error: cell already occupied!\");\n else{\n System.out.println(board);\n }\n }else{\n player = 'O';\n int row = board.getRow();\n int column = board.getColumn();\n boolean cool = board.placeXorO(player, row, column);\n while (!cool){\n row = (int) (Math.random()*3+1);\n column = (int) (Math.random()*3+1);\n cool = board.placeXorO(player, row, column);\n }System.out.println(board);\n }turn++;\n }\n \n // Display the results \n char winner = board.getWinner();\n if (winner != '-'){\n System.out.println(winner + \"s win!\");\n }else{\n System.out.println(\"It's a draw!\");\n }\n }", "@Test\n public void test1() {\n int [][] expectedBoard = {{ 1,-1,-1},\n {-1,-1,-1},\n {-1,-1,-1}};\n Board board1 = new Board();\n board1.put(1,1,1);\n assertArrayEquals(board1.getBoard(),expectedBoard); \n }", "private void winConditionCheck()\r\n {\r\n boolean win;\r\n char mark;\r\n for(int row = 0; row < 3; row++)\r\n {\r\n win = true;\r\n mark = buttons[row][0].getText().charAt(0);\r\n if(mark != ' ')\r\n {\r\n for(int column = 0; column < 3; column++)\r\n {\r\n if(mark != buttons[row][column].getText().charAt(0))\r\n {\r\n win = false;\r\n break;\r\n }\r\n }\r\n if(win)\r\n {\r\n gameEnd(mark);\r\n }\r\n }\r\n }\r\n for(int column = 0; column < 3; column++)\r\n {\r\n win = true;\r\n mark = buttons[0][column].getText().charAt(0);\r\n if(mark != ' ')\r\n {\r\n for(int row = 0; row < 3; row++)\r\n {\r\n if(mark != buttons[row][column].getText().charAt(0))\r\n {\r\n win = false;\r\n }\r\n }\r\n if(win)\r\n {\r\n gameEnd(mark);\r\n }\r\n }\r\n }\r\n win = false;\r\n mark = buttons[0][0].getText().charAt(0);\r\n if(mark != ' ')\r\n {\r\n for(int i = 0; i < 3; i++)\r\n {\r\n if(buttons[i][i].getText().charAt(0) != mark)\r\n {\r\n win = false;\r\n break;\r\n }\r\n else\r\n {\r\n win = true;\r\n }\r\n }\r\n if(win)\r\n {\r\n gameEnd(mark);\r\n }\r\n }\r\n mark = buttons[1][1].getText().charAt(0);\r\n if((buttons[0][2].getText().charAt(0) == buttons[1][1].getText().charAt(0)) && (buttons[1][1].getText().charAt(0) == buttons[2][0].getText().charAt(0)) && (buttons[1][1].getText().charAt(0) != ' '))\r\n {\r\n gameEnd(mark);\r\n }\r\n }", "@Test\n public void stateExample3() {\n MarbleSolitaireModel exampleBoard = new TriangleSolitaireModelImpl(3, 1);\n assertEquals(\" O\\n\" +\n \" O O\\n\" +\n \" O O O\\n\" +\n \" O _ O O\\n\" +\n \"O O O O O\", exampleBoard.getGameState());\n }", "@Test\n public void testKnightPosition() {\n // initialize the complete chess board\n ChessBoard chessBoard = init(\"CHESS\");\n\n assertEquals(0, chessBoard.getPiece(0, 1).getRow());\n assertEquals(1, chessBoard.getPiece(0, 1).getColumn());\n\n assertEquals(0, chessBoard.getPiece(0, 6).getRow());\n assertEquals(6, chessBoard.getPiece(0, 6).getColumn());\n\n assertEquals(7, chessBoard.getPiece(7, 1).getRow());\n assertEquals(1, chessBoard.getPiece(7, 1).getColumn());\n\n assertEquals(7, chessBoard.getPiece(7, 6).getRow());\n assertEquals(6, chessBoard.getPiece(7, 6).getColumn());\n }", "@Test\n public void testOneStep1() {\n board sol = new board(3);\n assertEquals(-2, sol.neighbors(1,2));\n }", "private boolean tie(){\r\n\t\tfor (int i=0; i<3; i++){\r\n\t\t\tfor (int j=0; j<3; j++){\r\n\t\t\t\tif (board[i][j] == '-')\r\n\t\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn true; \r\n\t}", "@Test\n\tpublic void runConspicuous(){\n\t\tTestCase tc = new TestCase(\"MateInTwoWithKnightInConspicuousPosition\",\"r2qrk2/1bp1b1pp/p1np4/1p1Q1NB1/4n3/2P5/PP3PPP/RN2R1K1 w - - 0 1\",\"f5h6\");\n\t\tSystem.out.println(\"Running \" + tc.getDescription());\n\t\tSystem.out.println(\"WC# \" + MoveUtil.getMoveCountForTeam(tc.getBoard(), 1));\n\t\tSystem.out.println(\"BC# \" + MoveUtil.getMoveCountForTeam(tc.getBoard(), -1));\n\t\trunUnitTest(tc.getBoard(),tc.getTestAgainstMoves().get(0).getSquare());\n\t}", "private static String gameStatus(char[][] board){\n\t\t\n\t\tfor (int i = 0; i < 3; i++){\n\t\t\t// check horizontal lines && vertical lines for player x\n\t\t\tif ((board[i][0] == 'X' && board[i][1] == 'X' && board[i][2] == 'X') || \n\t\t\t\t\t(board[0][i] == 'X' && board[1][i] == 'X' && board[2][i] == 'X')){\n\t\t\t\twinner = 'X';\n\t\t\t\treturn \"true\";\n\t\t\t}\n\t\t}\n\t\t//check diags for x\n\t\tif ((board[0][0] == 'X' && board[1][1] == 'X' && board[2][2] == 'X') || \n\t\t\t\t(board[0][2] == 'X' && board[1][1] == 'X' && board[2][0] == 'X')){\n\t\t\twinner = 'X';\n\t\t\treturn \"true\";\n\t\t}\n\t\t\n\t\tfor (int i = 0; i < 3 ; i++) {\n\t\t\t// check horizontal and vertical lines for player o\n\t\t\tif ((board[i][0] == 'O' && board[i][1] == 'O' && board[i][2] == 'O') || \n\t\t\t\t\t(board[0][i] == 'O' && board[1][i] == 'O' && board[2][i] == 'O')){\n\t\t\t\twinner = 'O';\n\t\t\t\treturn \"true\";\n\t\t\t}\n\t\t}\n\t\t//check diags for o\n\t\tif ((board[0][0] == 'O' && board[1][1] == 'O' && board[2][2] == 'O') || \n\t\t\t\t(board[0][2] == 'O' && board[1][1] == 'O' && board[2][0] == 'O')){\n\t\t\twinner = 'O';\n\t\t\treturn \"true\";\n\t\t}\n\n\t\t// check for tie\n\t\tint emptyCells = 9;\n\t\tfor (int i = 0; i < 3; i++){\n\t\t\tfor (int j = 0; j < 3; j++){\n\t\t\t\tif (board[i][j]!='\\0') emptyCells -= 1;\t\t\n\t\t\t}\n\t\t}\n\t\t// if all cells are filled, game is over with a tie\n\t\tif (emptyCells == 0) return \"tie\";\n\n\t\t// otherwise game is not over and return false\n\t\t//printBoard(board);\n\n\t\treturn \"false\";\n\t}", "@Test\n public void overExample3() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl();\n exampleBoard.move(1, 3, 3, 3);\n assertEquals(false, exampleBoard.isGameOver());\n }", "private boolean winningBoard(char[][] board){\n for(int i = 0; i < boardHeight; i++ ){\n for(int j = 0; j < boardWidth; j++) {\n\n //if white was made it to the other side\n if(board[i][j] == 'P' && i == 0){\n return true;\n }\n\n //if black has made it to the other side\n if(board[i][j] == 'p' && i == boardHeight -1){\n return true;\n }\n }\n }\n //no winners\n return false;\n }", "@Test\n public void isONGroundTestTrue(){\n TileMap tileMap = new TileMap(24, 24, new byte[][]{{0,0}},new byte[][]{{1,1},{1,1},{1,1},{1,1}}, tilepath);\n Rect cBox = new Rect(2,2,24,22);\n assertEquals(true, tileMap.isOnGround(cBox));\n }", "public void go(){\n \n turn = true;\n \n // if AI, do computery things\n if(type==\"AI\"){\n \n //let user know that AI is going\n System.out.print(\"\\tThe computer will now make a move..\");\n delay(1000, TicTacToe.game.gridSize); //take a second to go to make it appear as if computer is thinking\n \n while(turn){\n //AI selects a random empty cell and places corrosponding mark\n index = (int)Math.round((TicTacToe.game.gridSize*TicTacToe.game.gridSize-1)*Math.random());\n move(index, TicTacToe.game);\n }\n \n } else {\n //if human, do human stuff\n \n System.out.println(\"\\tPlease place an X on the grid. You can\");\n TicTacToe.user_input = TicTacToe.getInput(\"\\tdo this by typing 1A, 1B, 1C, 2A, etc.: \");\n\n //while it's the player's turn...\n while(turn) {\n \n //validate user input\n if(valid_input(TicTacToe.user_input)){\n \n if(TicTacToe.user_input.length()==2){\n \n column = Integer.parseInt(TicTacToe.user_input.substring(0,1));\n row = letterToNumber(TicTacToe.user_input.substring(1,2));\n \n } else {\n \n column = Integer.parseInt(TicTacToe.user_input.substring(0,2));\n row = letterToNumber(TicTacToe.user_input.substring(2,3));\n \n }\n \n index = TicTacToe.game.gridSize*(row-1)+(column-1);\n \n if(index > (TicTacToe.game.gridSize*TicTacToe.game.gridSize)-1 || index < 0){\n \n TicTacToe.user_input = TicTacToe.getInput(\"That's not a valid spot! Please choose another spot: \");\n } else {\n \n //if valid input, and cell isn't taken already,\n //place mark in selected cell and end turn\n move(index, TicTacToe.game);\n \n if(turn){\n \n TicTacToe.user_input = TicTacToe.getInput(\"That space is already in play! Please choose another spot: \");\n }\n \n }\n \n } else {\n \n TicTacToe.user_input = TicTacToe.getInput(\"That's not valid input. Please choose another spot: \");\n }\n }\n }\n }", "public boolean isGameOver(int x, int y, int z){\n Coords position = new Coords(x,y,z);\n if(!position.isCorrect) return false;\n for(int i=-1; i<2; i++)\n for(int j=-1; j<2; j++)\n for(int k=-1; k<2; k++){\n if(i==0 && j==0 && k==0) continue;\n Coords c2 = new Coords(position.getX()+i,position.getY()+j,position.getZ()+k);\n Coords c3 = new Coords(position.getX()+2*i,position.getY()+2*j,position.getZ()+2*k);\n Coords c4 = new Coords(position.getX()+3*i,position.getY()+3*j,position.getZ()+3*k);\n if(c2.isCorrect && c3.isCorrect && c4.isCorrect){\n if(board[position.getX()][position.getY()][position.getZ()]==\n board[c2.getX()][c2.getY()][c2.getZ()]&&board[c2.getX()][c2.getY()][c2.getZ()]\n ==board[c3.getX()][c3.getY()][c3.getZ()]&&board[c4.getX()][c4.getY()][c4.getZ()]\n ==board[c3.getX()][c3.getY()][c3.getZ()]) return true;}\n c4 = new Coords(position.getX()-i,position.getY()-j,position.getZ()-k);\n if(c2.isCorrect && c3.isCorrect && c4.isCorrect){\n if(board[position.getX()][position.getY()][position.getZ()]==\n board[c2.getX()][c2.getY()][c2.getZ()]&&board[c2.getX()][c2.getY()][c2.getZ()]\n ==board[c3.getX()][c3.getY()][c3.getZ()]&&board[c4.getX()][c4.getY()][c4.getZ()]\n ==board[c3.getX()][c3.getY()][c3.getZ()]) return true;}\n }\n return false;\n }", "@Test\n public void moveExample5() {\n MarbleSolitaireModel exampleBoard = new TriangleSolitaireModelImpl();\n exampleBoard.move(2, 0, 0, 0);\n exampleBoard.move(4, 0, 2, 0);\n exampleBoard.move(3, 2, 3, 0);\n exampleBoard.move(3, 0, 1, 0);\n exampleBoard.move(0, 0, 2, 0);\n exampleBoard.move(1, 1, 3, 1);\n exampleBoard.move(4, 2, 4, 0);\n exampleBoard.move(4, 4, 4, 2);\n exampleBoard.move(2, 2, 4, 4);\n\n assertEquals(true, exampleBoard.isGameOver());\n assertEquals(\" _\\n\" +\n \" _ _\\n\" +\n \" O _ _\\n\" +\n \" _ O _ _\\n\" +\n \"O _ O _ O\", exampleBoard.getGameState());\n }", "public String autoPlayAdvanced(int sign) {\n boolean validTurn = false;\n int temp1 = 0;\n int temp2 = 0;\n int sign2 = 0;\n //copy the board\n TicTacToe TTTemp = new TicTacToe(TTT.getSize());\n for (int i = 0; i < TTTemp.getSize(); i++) {\n for (int j = 0; j < TTTemp.getSize(); j++) {\n TTTemp.setTile(TTT.getTile(i, j), i, j);\n }\n }\n\n //player turn finding\n if (sign == 1) {\n sign2 = 2;\n } else {\n sign2 = 1;\n }\n\n int done = 0;\n //cycle to determine \"best\" or random move\n while (!validTurn) {\n switch (done) {\n case 0: //Win condition check\n loop:\n for (int i = 0; i < TTTemp.getSize(); i++) {\n for (int j = 0; j < TTTemp.getSize(); j++) {\n if (TTTemp.getTile(i, j) == 0) {\n TTTemp.setTile(sign, i, j);\n\n //if after changing empty tile to your sign...\n switch (TTTemp.check(sign)) {\n case \"Not won\":\n TTTemp.setTile(-1, i, j);\n done = 1;\n break;\n case \"Tie\":\n done = 1;\n break loop;\n default: //won in any way\n temp1 = i;\n temp2 = j;\n validTurn = TTT.safeChangeTile(sign, i, j);\n done = 2;\n break loop;\n }\n }\n }\n }\n break;\n case 1: //Player win condition check\n //copy board again\n for (int i = 0; i < TTTemp.getSize(); i++) {\n for (int j = 0; j < TTTemp.getSize(); j++) {\n TTTemp.setTile(TTT.getTile(i, j), i, j);\n }\n }\n\n loop:\n for (int i = 0; i < TTTemp.getSize(); i++) {\n for (int j = 0; j < TTTemp.getSize(); j++) {\n if (TTTemp.getTile(i, j) == 0) {\n TTTemp.setTile(sign2, i, j);\n\n //if after changing empty tile to player sign...\n switch (TTTemp.check(sign2)) {\n case \"Not won\":\n TTTemp.setTile(-1, i, j);\n done = 2;\n break;\n case \"Tie\":\n done = 2;\n break loop;\n default: //player might win\n temp1 = i;\n temp2 = j;\n validTurn = TTT.safeChangeTile(sign, i, j);\n done = 2;\n break loop;\n }\n }\n\n }\n }\n break;\n default: //if \"best\" move wasn't found mark a random tile\n temp1 = new Random().nextInt(TTT.getSize());\n temp2 = new Random().nextInt(TTT.getSize());\n validTurn = TTT.safeChangeTile(sign, temp1, temp2);\n break;\n }\n }\n\n // return selected tile\n return temp1 + \" \" + temp2;\n }", "public int AI(){\n for(int i=0; i<3; i++){\n for(int j=0; j<7; j++){\n if(board[i][j]==0 && board[i+1][j]==2 && board[i+2][j]==2 && board[i+3][j]==2){\n return j;\n \n }\n }\n }\n //checks for horizontals (Y-YY)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i][j+1]==0 && board[i][j+2]==2 && board[i][j+3]==2){\n if((i==5)||\n (i==4&&board[5][j+1]!=0) ||\n (i==3&&board[5][j+1]!=0&&board[4][j+1]!=0) ||\n (i==2&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0) ||\n (i==1&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0) ||\n (i==0&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0&&board[1][j+1]!=0) ||\n (i==0&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0&&board[1][j+1]!=0&&board[0][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for horizontals (YY-Y)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i][j+1]==2 && board[i][j+2]==0 && board[i][j+3]==2){\n if((i==5)||\n (i==4&&board[5][j+2]!=0) ||\n (i==3&&board[5][j+2]!=0&&board[4][j+2]!=0) ||\n (i==2&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0) ||\n (i==1&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0) ||\n (i==0&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0&&board[1][j+2]!=0) ||\n (i==0&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0&&board[1][j+2]!=0&&board[0][j+2]!=0)){\n return j+2;\n }\n }\n }\n }\n //checks for horizontals (-YYY)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==0 && board[i][j+1]==2 && board[i][j+2]==2 && board[i][j+3]==2){\n if((i==5)||\n (i==4&&board[5][j]!=0) ||\n (i==3&&board[5][j]!=0&&board[4][j]!=0) ||\n (i==2&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0) ||\n (i==1&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0) ||\n (i==0&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0&&board[1][j]!=0) ||\n (i==0&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0&&board[1][j]!=0&&board[0][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for horizontals (YYY-)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i][j+1]==2 && board[i][j+2]==2 && board[i][j+3]==0){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+3;\n }\n }\n }\n }\n //checks for diagonal (-YYY)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==0 && board[i+2][j+1]==2 && board[i+1][j+2]==2 && board[i][j+3]==2){\n if((i+3==5)||\n (i+2==4&&board[5][j]!=0)||\n (i+1==3&&board[5][j]!=0&&board[4][j]!=0)||\n (i==2&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0)||\n (i==1&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0)||\n (i==0&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0&&board[1][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for diagonal (Y-YY)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==2 && board[i+2][j+1]==0 && board[i+1][j+2]==2 && board[i][j+3]==2){\n if((i==2&&board[5][j+1]!=0)||\n (i==1&&board[5][j+1]!=0&&board[4][j+1]!=0)||\n (i==0&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for diagonal (YY-Y)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==2 && board[i+2][j+1]==2 && board[i+1][j+2]==0 && board[i][j+3]==2){\n if((i==2&&board[5][j+2]!=0&&board[4][j+2]!=0)||\n (i==1&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0)||\n (i==0&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0)){\n return j+2;\n }\n }\n }\n }\n //checks for diagonal (YYY-)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==2 && board[i+2][j+1]==2 && board[i+1][j+2]==2 && board[i][j+3]==0){\n if((i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0)||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0)||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0)){\n return j+3;\n }\n }\n }\n }\n //checks for subdiagonal (-YYY)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==0 && board[i+1][j+1]==2 && board[i+2][j+2]==2 && board[i+3][j+3]==2){\n if((i==0&&board[1][j]!=0)||\n (i==1&&board[2][j]!=0)||\n (i==2&&board[3][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for subdiagonal (Y-YY)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i+1][j+1]==0 && board[i+2][j+2]==2 && board[i+3][j+3]==2){\n if((i==0&&board[2][j+1]!=0)||\n (i==1&&board[3][j+1]!=0)||\n (i==2&&board[4][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for subdiagonal (YY-Y)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i+1][j+1]==2 && board[i+2][j+2]==0 && board[i+3][j+3]==2){\n if((i==0&&board[3][j+2]!=0)||\n (i==1&&board[4][j+2]!=0)||\n (i==2&&board[5][j+2]!=0)){\n return j+2;\n }\n }\n }\n }\n //checks for subdiagonal (YYY-)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==2 && board[i+1][j+1]==2 && board[i+2][j+2]==2 && board[i+3][j+3]==0){\n if((i==0&&board[4][j+3]!=0)||\n (i==1&&board[5][j+3]!=0)||\n (i==2)){\n return j+3;\n }\n }\n }\n }\n //BLOCK CHECKER\n //columns\n for(int i=0; i<3; i++){\n for(int j=0; j<7; j++){\n if(board[i][j]==0 && board[i+1][j]==1 && board[i+2][j]==1 && board[i+3][j]==1){\n return j; \n }\n }\n }\n //Checks for blocks horizontal (R-RR)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i][j+1]==0 && board[i][j+2]==1 && board[i][j+3]==1){\n if((i==5)||\n (i==4&&board[5][j+1]!=0) ||\n (i==3&&board[5][j+1]!=0&&board[4][j+1]!=0) ||\n (i==2&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0) ||\n (i==1&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0) ||\n (i==0&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0&&board[1][j+1]!=0) ||\n (i==0&&board[5][j+1]!=0&&board[4][j+1]!=0&&board[3][j+1]!=0&&board[2][j+1]!=0&&board[1][j+1]!=0&&board[0][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for horizontal blocks (RR-R)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i][j+1]==1 && board[i][j+2]==0 && board[i][j+3]==1){\n if((i==5)||\n (i==4&&board[5][j+2]!=0) ||\n (i==3&&board[5][j+2]!=0&&board[4][j+2]!=0) ||\n (i==2&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0) ||\n (i==1&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0) ||\n (i==0&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0&&board[1][j+2]!=0) ||\n (i==0&&board[5][j+2]!=0&&board[4][j+2]!=0&&board[3][j+2]!=0&&board[2][j+2]!=0&&board[1][j+2]!=0&&board[0][j+2]!=0)){\n return j+2;\n }\n }\n }\n }\n \n //checks for horizontals (-RRR)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==0 && board[i][j+1]==1 && board[i][j+2]==1 && board[i][j+3]==1){\n if((i==5)||\n (i==4&&board[5][j]!=0) ||\n (i==3&&board[5][j]!=0&&board[4][j]!=0) ||\n (i==2&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0) ||\n (i==1&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0) ||\n (i==0&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0&&board[1][j]!=0) ||\n (i==0&&board[5][j]!=0&&board[4][j]!=0&&board[3][j]!=0&&board[2][j]!=0&&board[1][j]!=0&&board[0][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for horizontals (RRR-)\n for(int i=0; i<6; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i][j+1]==1 && board[i][j+2]==1 && board[i][j+3]==0){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+3;\n }\n }\n }\n }\n //checks for diagonal (-RRR)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==0 && board[i+2][j+1]==1 && board[i+1][j+2]==1 && board[i][j+3]==1){\n if((i+3==5)||\n (i+2==4&&board[i+3][j]!=0)||\n (i+1==3&&board[i+3][j]!=0&&board[i+2][j]!=0)||\n (i==2&&board[i+3][j]!=0&&board[i+2][j]!=0&&board[i+1][j]!=0)||\n (i==1&&board[i+3][j]!=0&&board[i+2][j]!=0&&board[i+1][j]!=0&&board[i][j]!=0)||\n (i==0&&board[i+3][j]!=0&&board[i+2][j]!=0&&board[i+1][j]!=0&&board[i][j]!=0&&board[i-1][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for diagonal (R-RR)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==1 && board[i+2][j+1]==0 && board[i+1][j+2]==1 && board[i][j+3]==1){\n if((i+2==4&&board[i+3][j+1]!=0)||\n (i+1==3&&board[i+3][j+1]!=0&&board[i+2][j+1]!=0)||\n (i==2&&board[i+3][j+1]!=0&&board[i+2][j+1]!=0&&board[i+1][j+1]!=0)||\n (i==1&&board[i+3][j+1]!=0&&board[i+2][j+1]!=0&&board[i+1][j+1]!=0&&board[i][j+1]!=0)||\n (i==0&&board[i+3][j+1]!=0&&board[i+2][j+1]!=0&&board[i+1][j+1]!=0&&board[i][j+1]!=0&&board[i-1][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for diagonal (RR-R)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==1 && board[i+2][j+1]==1 && board[i+1][j+2]==0 && board[i][j+3]==1){\n if((i==2&&board[i+2][j+2]!=0)){//||\n return j+2;\n }\n }\n }\n }\n //checks for diagonal (RRR-)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i+3][j]==1 && board[i+2][j+1]==1 && board[i+1][j+2]==1 && board[i][j+3]==0){\n if((i==0&&board[1][j+3]!=0)||\n (i==1&&board[2][j+3]!=0)||\n (i==2&&board[3][j+3]!=0)){\n return j+3;\n }\n }\n }\n }\n //checks for subdiagonal blocks(-RRR)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==0 && board[i+1][j+1]==1 && board[i+2][j+2]==1 && board[i+3][j+3]==1){\n if((i==0&&board[1][j]!=0)||\n (i==1&&board[2][j]!=0)||\n (i==2&&board[3][j]!=0)){\n return j;\n }\n }\n }\n }\n //checks for subdiagonal blocks(Y-YY)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i+1][j+1]==0 && board[i+2][j+2]==1 && board[i+3][j+3]==1){\n if((i==0&&board[2][j+1]!=0)||\n (i==1&&board[3][j+1]!=0)||\n (i==2&&board[4][j+1]!=0)){\n return j+1;\n }\n }\n }\n }\n //checks for subdiagonal blocks(YY-Y)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i+1][j+1]==1 && board[i+2][j+2]==0 && board[i+3][j+3]==1){\n if((i==0&&board[3][j+2]!=0)||\n (i==1&&board[4][j+2]!=0)||\n (i==2&&board[5][j+2]!=0)){\n return j+2;\n }\n }\n }\n }\n //checks for subdiagonal blocks(YYY-)\n for(int i=0; i<3; i++){\n for(int j=0; j<4; j++){\n if(board[i][j]==1 && board[i+1][j+1]==1 && board[i+2][j+2]==1 && board[i+3][j+3]==0){\n if((i==0&&board[4][j+3]!=0)||\n (i==1&&board[5][j+3]!=0)||\n (i==2)){\n return j+3;\n }\n }\n }\n }\n //INTERMEDIATE BLOCKING\n //If horizontal (RR--) make it (RRY-)\n for(int i=0; i<6; i++){\n for(int j=0; j<3; j++){\n if(board[i][j]==1 && board[i][j+1]==1 && board[i][j+2]==0){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+2;\n }\n }\n }\n }\n //If horizontal (--RR) make it (-YRR)\n for(int i=0; i<6; i++){\n for(int j=0; j<3; j++){\n if(board[i][j+1]==0 && board[i][j+2]==1 && board[i][j+3]==1){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+1;\n }\n }\n }\n }\n //The following attempts to set the computer up for a win, instead of first just generating a random number\n for(int i=0; i<3; i++){\n for(int j=0; j<7; j++){\n if(board[i+1][j]==0 && board[i+2][j]==2 && board[i+3][j]==2){\n return j;\n \n }\n }\n }\n //If horizontal (-YY-) make it (-YYY)\n for(int i=0; i<6; i++){\n for(int j=0; j<3; j++){\n if(board[i][j]==0 && board[i][j+1]==2 && board[i][j+2]==2 && board[i][j+3]==0){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+3;\n }\n }\n }\n }\n //If horizontal (YY--) make it (YYY-)\n for(int i=0; i<6; i++){\n for(int j=0; j<3; j++){\n if(board[i][j]==2 && board[i][j+1]==2 && board[i][j+2]==0 && board[i][j+3]==0){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+2;\n }\n }\n }\n }\n //If horizontal (--YY) make it (-YYY)\n for(int i=0; i<6; i++){\n for(int j=0; j<3; j++){\n if(board[i][j]==0 && board[i][j+1]==0 && board[i][j+2]==2 && board[i][j+3]==2){\n if((i==5)||\n (i==4&&board[5][j+3]!=0) ||\n (i==3&&board[5][j+3]!=0&&board[4][j+3]!=0) ||\n (i==2&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0) ||\n (i==1&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0) ||\n (i==0&&board[5][j+3]!=0&&board[4][j+3]!=0&&board[3][j+3]!=0&&board[2][j+3]!=0&&board[1][j+3]!=0&&board[0][j+3]!=0)){\n return j+1;\n }\n }\n }\n }\n boolean sent = false;\n //The following code will simply generate a random number.\n int x = (int)((Math.random())*7);\n if(!wonYet){ \n while(!sent){\n if(board[0][x]!=0)\n x = (int)((Math.random())*7);\n else if(board[1][x]!=0)\n x = (int)((Math.random())*7);\n else if(board[2][x]!=0)\n x = (int)((Math.random())*7);\n else if(board[3][x]!=0)\n x = (int)((Math.random())*7);\n else if(board[4][x]!=0)\n x = (int)((Math.random())*7);\n else if(board[5][x]!=0)\n x = (int)((Math.random())*7);\n sent = true;\n } \n return x;\n }\n return -1; \n }", "public void testPlaceFirstTile3() {\n \tPlacement placement = new Placement(Color.GREEN, 5, 26, Color.BLUE, 5, 27);\n Score score = null;\n try {\n \t\tscore = board.calculate(placement);\n \t\tboard.place(placement);\n } catch (ContractAssertionError e) {\n fail(e.getMessage());\n }\n \n Score expected = new Score();\n expected.setValue(Color.GREEN, 1);\n assertEquals(expected, score);\n \n Placement placement2 = new Placement(Color.GREEN, 5, 19, Color.BLUE, 5, 18);\n Score score2 = null;\n try {\n \t\tscore2 = board.calculate(placement2);\n \t\tboard.place(placement2);\n } catch (ContractAssertionError e) {\n fail(e.getMessage());\n }\n Score expected2 = new Score();\n expected2.setValue(Color.RED, 1);\n assertEquals(expected2, score2);\n }", "public boolean tieGame() {\n\t\tint counter = 0;\n\t\tfor(int col = 0; col <= size - 1; col ++) \n\t\t\tfor(int dep = 0; dep <= size - 1; dep ++)\n\t\t\t\tif(board[0][col][dep] != -1) {\n\t\t\t\t\tcounter += 1;\n\t\t\t\t\tif(counter == size * size) \n\t\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\treturn false;\n\t}", "public TicTacToe(int n) {\n this.n = n;\n rows = new int[n][3];\n cols = new int[n][3];\n diagonals = new int[2][3];\n }", "void testStitchCells(Tester t) {\r\n initData();\r\n\r\n //testing stitch cells on a world\r\n t.checkExpect(this.game6.indexHelp(-1, -1).right, null);\r\n t.checkExpect(this.game6.indexHelp(-1, -1).bottom, null);\r\n t.checkExpect(this.game6.indexHelp(0, 0).top, null);\r\n t.checkExpect(this.game6.indexHelp(0, 0).left, null);\r\n\r\n //stitching the cells together\r\n this.game6.stitchCells();\r\n\r\n //show that the cells point to the right other cells\r\n t.checkExpect(this.game6.indexHelp(-1, -1).right, \r\n this.game6.indexHelp(0, -1));\r\n t.checkExpect(this.game6.indexHelp(-1, -1).bottom, \r\n this.game6.indexHelp(-1, 0));\r\n t.checkExpect(this.game6.indexHelp(0, 0).top, \r\n this.game6.indexHelp(0, -1));\r\n t.checkExpect(this.game6.indexHelp(0, 0).left,\r\n this.game6.indexHelp(-1, 0));\r\n\r\n //first showing that these cells' fields are null\r\n t.checkExpect(this.c1.right, null);\r\n t.checkExpect(this.c2.left, null);\r\n t.checkExpect(this.c3.top, null);\r\n\r\n //now stitch the cells together so they point to each right and down\r\n this.c1.stitchCells(this.c2, this.c3);\r\n\r\n //testing the references \r\n t.checkExpect(this.c1.right, this.c2);\r\n t.checkExpect(this.c1.bottom, this.c3);\r\n t.checkExpect(this.c2.left, this.c1);\r\n t.checkExpect(this.c3.top, this.c1);\r\n }", "@Test\n public void initialiseEmptyBoardTest() {\n String[][] newBoard = new String[15][10];\n newBoard = enemyGameBoard.initialiseEmptyBoard();\n int counter = 0;\n for(int i = 0; i < GameConstants.BOARD_SIZE_X; i++) {\n for (int j = 0; j < GameConstants.BOARD_SIZE_Y; j++){\n assertTrue(newBoard[i][j].equals(\"WATER\"));\n counter++;\n }\n }\n assertTrue(counter == 150); \n }", "private void checkVictory() {\n\t\tboolean currentWin = true;\n\t\t\n\t\t//Vertical win\n\t\tfor (int i = 0; i<DIVISIONS; i++){\n\t\t\tif (gameArray[i][yGuess] != currentPlayer){\n\t\t\t\tcurrentWin = false;\n\t\t\t}\n\t\t}\n\t\tif (currentWin){\n\t\t\tgameWon = true;\n\t\t}\n\t\t\n\t\t//Horizontal win\n\t\tcurrentWin = true;\n\t\tfor (int i = 0; i<DIVISIONS; i++){\n\t\t\tif (gameArray[xGuess][i] != currentPlayer){\n\t\t\t\tcurrentWin = false;\n\t\t\t}\n\t\t}\n\t\tif (currentWin){\n\t\t\tgameWon = true;\n\t\t}\n\t\t\n\t\t//Top left bottom right diagonal win\n\t\tcurrentWin = true;\n\t\tif (xGuess == yGuess){\n\t\tfor (int i = 0; i<DIVISIONS; i++){\n\t\t\tif (gameArray[i][i] != currentPlayer){\n\t\t\t\tcurrentWin = false;\n\t\t\t}\n\t\t}\n\t\tif (currentWin){\n\t\t\tgameWon = true;\n\t\t}\n\t\t}\n\t\t\n\t\t//Bottom left top right diagonal win\n\t\tcurrentWin = true;\n\t\tif (yGuess + xGuess == DIVISIONS - 1){\n\t\t\tfor (int i = 0; i<DIVISIONS; i++){\n\t\t\t\tif (gameArray[i][(DIVISIONS - 1) -i] != currentPlayer){\n\t\t\t\t\tcurrentWin = false;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (currentWin){\n\t\t\t\tgameWon = true;\n\t\t\t}\n\t\t}\n\t\t\n\t}", "boolean checkWin(Tile initialTile);", "@Test\n public void moveExample5() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl();\n exampleBoard.move(1, 3, 3, 3);\n exampleBoard.move(2, 1, 2, 3);\n exampleBoard.move(2, 4, 2, 2);\n exampleBoard.move(2, 6, 2, 4);\n exampleBoard.move(4, 6, 2, 6);\n exampleBoard.move(3, 4, 3, 6);\n exampleBoard.move(4, 4, 4, 6);\n exampleBoard.move(3, 2, 3, 4);\n exampleBoard.move(2, 4, 4, 4);\n exampleBoard.move(4, 3, 4, 5);\n exampleBoard.move(4, 6, 4, 4);\n exampleBoard.move(4, 1, 4, 3);\n exampleBoard.move(5, 3, 3, 3);\n exampleBoard.move(3, 0, 3, 2);\n exampleBoard.move(2, 2, 4, 2);\n exampleBoard.move(0, 2, 2, 2);\n exampleBoard.move(0, 4, 2, 4);\n exampleBoard.move(5, 2, 3, 2);\n exampleBoard.move(5, 4, 3, 4);\n exampleBoard.move(3, 2, 1, 2);\n exampleBoard.move(3, 4, 1, 4);\n exampleBoard.move(2, 6, 4, 6);\n\n assertEquals(true, exampleBoard.isGameOver());\n assertEquals(\" _ O _\\n\"\n + \" O _ O\\n\"\n + \"O _ _ _ _ _ _\\n\"\n + \"_ _ _ O _ _ _\\n\"\n + \"O _ _ _ _ _ O\\n\"\n + \" _ _ _\\n\"\n + \" O O O\", exampleBoard.getGameState());\n }", "protected int winnable(Board b){\r\n\t\t//checks if two tiles are the same (and not empty) and checks if\r\n\t\t//the third tile required to win is empty for a winning condition\r\n\t\tint condition = 0;\r\n\t\tif ((b.getTile(1) == b.getTile(2)) && (b.getTile(3) == ' ')\r\n\t\t\t\t&& (b.getTile(1) != ' ') && (b.getTile(1) == this.getSymbol()))\r\n\t\t\t\tcondition =3;\r\n\t\telse if ((b.getTile(1) == b.getTile(3)) && (b.getTile(2) == ' ')\r\n\t\t\t\t&& (b.getTile(1) != ' ') && (b.getTile(1) == this.getSymbol()))\r\n\t\t\tcondition = 2;\r\n\t\telse if ((b.getTile(2) == b.getTile(3)) && (b.getTile(1) == ' ')\r\n\t\t\t\t&& (b.getTile(2) != ' ') && (b.getTile(2) == this.getSymbol()))\r\n\t\t\tcondition = 1;\r\n\t\telse if ((b.getTile(4) == b.getTile(5)) && (b.getTile(6) == ' ')\r\n\t\t\t\t&& (b.getTile(4) != ' ') && (b.getTile(4) == this.getSymbol()))\r\n\t\t\tcondition = 6;\r\n\t\telse if ((b.getTile(4) == b.getTile(6)) && (b.getTile(5) == ' ')\r\n\t\t\t\t&& (b.getTile(4) != ' ') && (b.getTile(5) == this.getSymbol()))\r\n\t\t\tcondition = 5;\r\n\t\telse if ((b.getTile(5) == b.getTile(6)) && (b.getTile(4) == ' ')\r\n\t\t\t\t&& (b.getTile(5) != ' ') && (b.getTile(5) == this.getSymbol()))\r\n\t\t\tcondition = 4;\r\n\t\telse if ((b.getTile(7) == b.getTile(8)) && (b.getTile(9) == ' ')\r\n\t\t\t\t&& (b.getTile(7) != ' ') && (b.getTile(7) == this.getSymbol()))\r\n\t\t\tcondition = 9;\r\n\t\telse if ((b.getTile(7) == b.getTile(9)) && (b.getTile(8) == ' ')\r\n\t\t\t\t&& (b.getTile(7) != ' ') && (b.getTile(7) == this.getSymbol()))\r\n\t\t\tcondition = 8;\r\n\t\telse if ((b.getTile(8) == b.getTile(9)) && (b.getTile(7) == ' ')\r\n\t\t\t\t&& (b.getTile(8) != ' ') && (b.getTile(8) == this.getSymbol()))\r\n\t\t\tcondition = 7;\r\n\t\telse if ((b.getTile(1) == b.getTile(4)) && (b.getTile(7) == ' ')\r\n\t\t\t\t&& (b.getTile(1) != ' ') && (b.getTile(1) == this.getSymbol()))\r\n\t\t\tcondition = 7;\r\n\t\telse if ((b.getTile(1) == b.getTile(7)) && (b.getTile(4) == ' ')\r\n\t\t\t\t&& (b.getTile(1) != ' ') && (b.getTile(1) == this.getSymbol()))\r\n\t\t\tcondition = 4;\r\n\t\telse if ((b.getTile(4) == b.getTile(7)) && (b.getTile(1) == ' ')\r\n\t\t\t\t&& (b.getTile(4) != ' ') && (b.getTile(4) == this.getSymbol()))\r\n\t\t\tcondition = 1;\r\n\t\telse if ((b.getTile(2) == b.getTile(5)) && (b.getTile(8) == ' ')\r\n\t\t\t\t&& (b.getTile(2) != ' ') && (b.getTile(2) == this.getSymbol()))\r\n\t\t\tcondition = 8;\r\n\t\telse if ((b.getTile(2) == b.getTile(8)) && (b.getTile(5) == ' ')\r\n\t\t\t\t&& (b.getTile(2) != ' ') && (b.getTile(2) == this.getSymbol()))\r\n\t\t\tcondition = 5;\r\n\t\telse if ((b.getTile(5) == b.getTile(8)) && (b.getTile(2) == ' ')\r\n\t\t\t\t&& (b.getTile(5) != ' ') && (b.getTile(5) == this.getSymbol()))\r\n\t\t\tcondition = 2;\r\n\t\telse if ((b.getTile(3) == b.getTile(6)) && (b.getTile(9) == ' ')\r\n\t\t\t\t&& (b.getTile(3) != ' ') && (b.getTile(3) == this.getSymbol()))\r\n\t\t\tcondition = 9;\r\n\t\telse if ((b.getTile(3) == b.getTile(9)) && (b.getTile(6) == ' ')\r\n\t\t\t\t&& (b.getTile(3) != ' ') && (b.getTile(3) == this.getSymbol()))\r\n\t\t\tcondition = 6;\r\n\t\telse if ((b.getTile(6) == b.getTile(9)) && (b.getTile(3) == ' ')\r\n\t\t\t\t&& (b.getTile(6) != ' ') && (b.getTile(6) == this.getSymbol()))\r\n\t\t\tcondition = 3;\r\n\t\telse if ((b.getTile(1) == b.getTile(5)) && (b.getTile(9) == ' ')\r\n\t\t\t\t&& (b.getTile(1) != ' ') && (b.getTile(1) == this.getSymbol()))\r\n\t\t\tcondition = 9;\r\n\t\telse if ((b.getTile(1) == b.getTile(5)) && (b.getTile(5) == ' ')\r\n\t\t\t\t&& (b.getTile(1) != ' ') && (b.getTile(1) == this.getSymbol()))\r\n\t\t\tcondition = 5;\r\n\t\telse if ((b.getTile(5) == b.getTile(9)) && (b.getTile(1) == ' ')\r\n\t\t\t\t&& (b.getTile(5) != ' ') && (b.getTile(5) == this.getSymbol()))\r\n\t\t\tcondition = 1;\r\n\t\telse if ((b.getTile(3) == b.getTile(5)) && (b.getTile(7) == ' ')\r\n\t\t\t\t&& (b.getTile(3) != ' ') && (b.getTile(3) == this.getSymbol()))\r\n\t\t\tcondition = 7;\r\n\t\telse if ((b.getTile(3) == b.getTile(7)) && (b.getTile(5) == ' ')\r\n\t\t\t\t&& (b.getTile(3) != ' ') && (b.getTile(3) == this.getSymbol()))\r\n\t\t\tcondition = 5;\r\n\t\telse if ((b.getTile(5) == b.getTile(7)) && (b.getTile(3) == ' ')\r\n\t\t\t\t&& (b.getTile(5) != ' ') && (b.getTile(5) == this.getSymbol()))\r\n\t\t\tcondition = 3;\r\n\t\treturn condition;\r\n\t}", "public int checkWin(){\n //check for horizontal and vertical wins\n for(int i=0; i<3; i++){\n if(gameBoard[i][0].equals(\"O\") && gameBoard[i][1].equals(\"O\") && gameBoard[i][2].equals(\"O\")){\n return 1;\n }\n else if(gameBoard[i][0].equals(\"X\") && gameBoard[i][1].equals(\"X\") && gameBoard[i][2].equals(\"X\")){\n return 2;\n }\n else if(gameBoard[0][i].equals(\"O\") && gameBoard[1][i].equals(\"O\") && gameBoard[2][i].equals(\"O\")){\n return 1;\n }\n else if(gameBoard[0][i].equals(\"X\") && gameBoard[1][i].equals(\"X\") && gameBoard[2][i].equals(\"X\")){\n return 2;\n }\n }\n //check for both diagonal cases\n if(gameBoard[0][0].equals(\"O\") && gameBoard[1][1].equals(\"O\") && gameBoard[2][2].equals(\"O\")){\n return 1;\n }\n else if(gameBoard[0][2].equals(\"O\") && gameBoard[1][1].equals(\"O\") && gameBoard[2][0].equals(\"O\")){\n return 1;\n }\n else if(gameBoard[0][0].equals(\"X\") && gameBoard[1][1].equals(\"X\") && gameBoard[2][2].equals(\"X\")){\n return 2;\n }\n else if(gameBoard[0][2].equals(\"X\") && gameBoard[1][1].equals(\"X\") && gameBoard[2][0].equals(\"X\")){\n return 2;\n }\n return 0;\n }", "@Test\n public void testQueenSide() {\n // initialize the complete chess board\n ChessBoard chessBoard = init(\"CHESS\");\n\n assertEquals(north, chessBoard.getPiece(0, 3).getSide());\n assertEquals(south, chessBoard.getPiece(7, 3).getSide());\n }", "public void next(){\n\t\tboolean[][] newBoard = new boolean[rows][columns]; //create a temporary board, same size as real game board\n\t\tfor(int i = 0; i < rows; i++){\n\t\t\tfor(int j = 0; j < columns; j++){\n\t\t\t\tnewBoard[i][j] = false; //set all to false\n\t\t\t}\n\t\t}\n\t\tint cellCounter = 0;\n\t\tfor (int i = (rows - 1); i >= 0; i--) {\n\t\t\tfor (int j = (columns - 1); j >= 0; j--) { //iterate through the game board\n\t\t\t\tfor (int k = (i - 1); k < (i + 2); k++) {\n\t\t\t\t\tfor (int m = (j - 1); m < (j + 2); m++) {//iterate around the testable element\n\t\t\t\t\t\tif (!(k == i && m == j)) {\n\t\t\t\t\t\t\tif (!((k < 0 || k > (rows - 1)) || (m < 0 || m > (columns - 1)))) { //if not out of bounds and not the original point\n\t\t\t\t\t\t\t\tif (theGrid[k][m]) {\n\t\t\t\t\t\t\t\t\tcellCounter++; //if a cell is alive at the surrounding point, increase the counter\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif (cellCounter == 3 || cellCounter == 2 && theGrid[i][j]) { //if meets the criteria\n\t\t\t\t\tnewBoard[i][j] = true; //create on new board\n\t\t\t\t}\n\t\t\t\tcellCounter = 0; //reset cell counter\n\t\t\t}\n\t\t}\n\t\t//transpose onto new grid\n\t\tfor(int i = 0; i < rows; i++){\n\t\t\tfor(int j = 0; j < columns; j++){\n\t\t\t\tif(newBoard[i][j]){ //read temp board, set temp board data on real game board\n\t\t\t\t\ttheGrid[i][j] = true;\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\ttheGrid[i][j] = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void stateCheckerboardConvertionTest() {\n\t\tVTicTacToe tempEnvironment = new VTicTacToe();\n\t\tint[] tempTestStates = { 0, 13, 39, 26, 17087 };\n\n\t\tint tempState;\n\t\tint[][] tempCheckerboard;\n\t\tfor (int i = 0; i < tempTestStates.length; i++) {\n\t\t\ttempCheckerboard = tempEnvironment.stateToCheckerboard(tempTestStates[i]);\n\t\t\tSystem.out.println(\"The checkerboard of \" + tempTestStates[i] + \" is: \"\n\t\t\t\t\t+ Arrays.deepToString(tempCheckerboard));\n\t\t\ttempState = tempEnvironment.checkerboardToState(tempCheckerboard);\n\t\t\tSystem.out.println(\"The state ID is \" + tempState);\n\t\t} // Of for i\n\n\t}", "public boolean check3DDiagnolWinner(Cell play) {\n\t\t// for dim & row & col || dim & #-row & col || dim & #-row & #-col || dim & row & #-col\n\t\tif(board[0][0][0] == board[1][1][1] && board[1][1][1]==board[2][2][2] && board[2][2][2]==board[3][3][3] && board[3][3][3].equals(play) ||\n\t\t\t\tboard[0][0][3] == board[1][1][2] && board[1][1][2]==board[2][2][1] && board[2][2][1]==board[3][3][0] && board[3][3][0].equals(play) ||\n\t\t\t\tboard[0][3][3] == board[1][2][2] && board[1][2][2]==board[2][1][1] && board[2][1][1]==board[3][0][0] && board[3][0][0].equals(play) ||\n\t\t\t\tboard[0][3][0] == board[1][2][1] && board[1][2][1]==board[2][1][2] && board[2][1][2]==board[3][0][3] && board[3][0][3].equals(play)){\n\t\t\t//\t\t\t\t\t\t\t\tSystem.out.println(\"3D Diagnol win by \"+play.toString());\n\t\t\treturn true;\n\n\t\t}\n\n\t\treturn false;\n\n\t}", "@Test public void testMultipleConfirmed() throws IOException {\n CrosswordBoard okBoard = new CrosswordBoard(\"puzzles/multipleConfirmed.puzzle\");\n assertEquals(\" _ _ _ \\n_ _ _ \\n _ _ _ \\n _ \\n _ \\n _ \\n\", okBoard.toString());\n assertEquals(Outcome.SUCCESS, okBoard.tryWord(\"1across\", \"car\", \"p1\"));\n assertEquals(Outcome.SUCCESS, okBoard.tryWord(\"3across\", \"tax\", \"p1\"));\n assertEquals(\" c a r \\n_ _ _ \\n t a x \\n _ \\n _ \\n _ \\n\", okBoard.toString());\n assertEquals(Outcome.SUCCESS, okBoard.tryWord(\"1down\", \"bob\", \"p1\"));\n assertEquals(\" b _ _ \\n_ o _ \\n b _ _ \\n _ \\n _ \\n _ \\n\", okBoard.toString());\n\n assertEquals(Outcome.SUCCESS, okBoard.tryWord(\"1across\", \"car\", \"p1\"));\n assertEquals(\" c a r \\n_ _ _ \\n _ _ _ \\n _ \\n _ \\n _ \\n\", okBoard.toString());\n assertEquals(Outcome.SUCCESS, okBoard.tryWord(\"2across\", \"mat\", \"p1\"));\n assertEquals(Outcome.SUCCESS, okBoard.tryWord(\"3across\", \"tax\", \"p1\"));\n // same as word already there\n assertEquals(Outcome.SAME_WORD, okBoard.tryChallenge(\"1across\", \"car\", \"p2\"));\n // originally correct\n assertEquals(Outcome.FAILED, okBoard.tryChallenge(\"1across\", \"cat\", \"p2\"));\n // confirmed since was originally correct\n assertEquals(Outcome.CONFIRMED, okBoard.tryChallenge(\"1across\", \"cat\", \"p2\"));\n assertEquals(Outcome.FAILED, okBoard.tryChallenge(\"2across\", \"sat\", \"p2\"));\n assertEquals(Outcome.FAILED, okBoard.tryChallenge(\"3across\", \"tap\", \"p2\"));\n // no one has claimed the id \"1down\" yet\n assertEquals(Outcome.SUCCESS, okBoard.tryWord(\"1down\", \"cat\", \"p2\"));\n // p2 already claimed \"1down\"\n assertEquals(Outcome.WORD_OWNED, okBoard.tryWord(\"1down\", \"cat\", \"p1\"));\n // p2 was originally correct\n assertEquals(Outcome.FAILED, okBoard.tryChallenge(\"1down\", \"car\", \"p1\"));\n assertEquals(Outcome.FINISHED, okBoard.tryWord(\"4down\", \"xray\", \"p2\"));\n // finished because of the previous move\n assertEquals(Outcome.FINISHED, okBoard.tryWord(\"4down\", \"xray\", \"p2\"));\n assertEquals(2, okBoard.showScore(\"p1\"));\n assertEquals(-1, okBoard.showScore(\"p2\"));\n }", "public boolean checkSwitch(int row, int col){\n boolean output = false;\n Tile[] updownleftright = new Tile[4]; //Array which holds the four adjacent tiles\n if (row - 1 >= 0) updownleftright[0] = tiles[row - 1][col];\n else updownleftright[0] = nulltile;\n \n if (row + 1 < sidelength) updownleftright[1] = tiles[row + 1][col];\n else updownleftright[1] = nulltile;\n \n if (col - 1 >= 0) updownleftright[2] = tiles[row][col - 1];\n else updownleftright[2] = nulltile;\n \n if (col + 1 < sidelength) updownleftright[3] = tiles[row][col + 1];\n else updownleftright[3] = nulltile;\n \n for (int i = 0; i < 4; i ++) //Goes through the array and checks to see if any adjacent tile is the blank tile\n {\n if (updownleftright[i].getCurPic() == blankindex){\n tiles[row][col].swap(updownleftright[i]);\n return true;\n }\n }\n return false;\n }", "public static boolean isBasicJumpValid(int[][] board, int player, int fromRow, int fromCol, int toRow, int toCol) {\r\n\t\t\r\n\t\tboolean ans = false;\r\n\t\t//is the impot is legal\r\n\t\tif(fromRow<8&fromCol<8&toRow<8&toCol<8&fromRow>-1&fromCol>-1&toRow>-1&toCol>-1&player>-2&player<2&player!=0){\r\n\t\t\tif (board [toRow][toCol]==0){/*is the target slot avalibel*/\r\n\t\t\t\tif (board[fromRow][fromCol]==1||board[fromRow][fromCol]==2){/*is the player is red*/\t\t\t\r\n\t\t\t\t\tif((board[(fromRow+toRow)/2][(fromCol+toCol)/2]==-1)||(board[(fromRow+toRow)/2][(fromCol+toCol)/2]==-2)){/*is thier enemy solduers between the begning and the target*/\r\n\t\t\t\t\t\tif (board[fromRow][fromCol]==1){/*is thie simpol soldiuer in the bignning slot*/\r\n\t\t\t\t\t\t\tif(fromRow==toRow-2&&(fromCol==toCol+2||fromCol==toCol-2)){/*is eating diagonally upward and the move is two square*/\r\n\t\t\t\t\t\t\t\tans = 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\telse{/*is thir queen in the starting slot*/\r\n\t\t\t\t\t\t\tif(((fromRow==toRow+2)||(fromRow==toRow-2))&&((fromCol==toCol+2)||(fromCol==toCol-2))){\r\n\t\t\t\t\t\t\t\t/*if is eating diagonally and the move is two square*/\r\n\t\t\t\t\t\t\t\tans = true;\r\n\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}\r\n\t\t\t\t}\r\n\t\t\t\tif (board[fromRow][fromCol]==-1|board[fromRow][fromCol]==-2){/*is the solduer is blue*/\r\n\t\t\t\t\tif((board[(fromRow+toRow)/2][(fromCol+toCol)/2]==1)||(board[(fromRow+toRow)/2][(fromCol+toCol)/2]==2)){/*thie is an enemu betwen the teget and the begning*/\r\n\t\t\t\t\t\tif (board[fromRow][fromCol]==-1){\r\n\t\t\t\t\t\t\tif(fromRow==toRow+2&&(fromCol==toCol+2||fromCol==toCol-2)){/*is eating diagonally downward and the move is two square*/\r\n\t\t\t\t\t\t\t\tans = 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\telse{\r\n\t\t\t\t\t\t\tif(((fromRow==toRow+2)||(fromRow==toRow-2))&&((fromCol==toCol+2)||(fromCol==toCol-2))){\r\n\t\t\t\t\t\t\t\t/*if is eating diagonally and the move is two square*/\r\n\t\t\t\t\t\t\t\tans = true;\r\n\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}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn ans;\r\n\t}", "public static void main(String args[]) {\n\t char[][] board = new char[3][3];\r\n\r\n\t //Initialize the board with dashes (empty positions)\r\n\t System.out.println(\"Game initiated!\");\r\n\t for(int i = 0; i < 3; i++) {\r\n\t for(int j = 0; j < 3; j++) {\r\n\t board[i][j] = '-';\r\n\t }\r\n\t }\r\n\r\n\t //Check who plays first\r\n\t System.out.println(\"Let's start the Tic Tac Toe game!\");\r\n\t String player = checkPlayFirst();\r\n\t System.out.println(player + \" plays first.\");\r\n\r\n\t //Create a player1 boolean that is true if it is player 1's turn and false if it is player 2's turn\r\n\t boolean player1 = true;\r\n\r\n\t //Create a gameEnded boolean and use it as the condition in the while loop\r\n\t boolean gameEnded = false;\r\n\t while(!gameEnded) {\r\n\t //Draw the board\r\n\t showBoard(board);\r\n\r\n\t //Select X or O\r\n\t char inputCharUser = playerInput(player);\r\n\r\n\t //Enter position of the input\r\n\t userPosition(inputCharUser, board);\r\n\r\n\t //Check to see if either player has won\r\n\t if(playerHasWon(board) == 'X') {\r\n\t System.out.println(player + \" wins!\");\r\n\t gameEnded = true;\r\n\t }\r\n\t else if(playerHasWon(board) == 'O') {\r\n\t System.out.println(player + \" wins!\");\r\n\t gameEnded = true;\r\n\t }\r\n\t else {\r\n\t //If neither player has won, check to see if there has been a tie (if the board is full)\r\n\t if(boardIsFull(board)) {\r\n\t System.out.println(\"It's a tie!\");\r\n\t gameEnded = true;\r\n\t } else {\r\n\t //If player1 is true, make it false, and vice versa; this way, the players alternate each turn\r\n\t player1 = !player1;\r\n\t }\r\n\t }\r\n\t while(gameEnded == true) {\r\n\t System.out.println(\"Play another game? Y | N\");\r\n\t char option = value.next().charAt(0);\r\n\r\n\t if(option == 'Y') {\r\n\t //Initilise the board with '-' to again start playing\r\n\t gameEnded = false;\r\n\t for (int i = 0; i < 3; i++) {\r\n\t for (int j = 0; j < 3; j++) {\r\n\t board[i][j] = '-';\r\n\t }\r\n\t }\r\n\t }\r\n\t else\r\n\t break;\r\n\t }\r\n\t }\r\n\r\n\t //Final game board\r\n\t showBoard(board);\r\n\t }", "@Test\n public void moveExample4() {\n MarbleSolitaireModel exampleBoard = new TriangleSolitaireModelImpl();\n exampleBoard.move(2, 0, 0, 0);\n exampleBoard.move(4, 0, 2, 0);\n exampleBoard.move(3, 2, 3, 0);\n exampleBoard.move(3, 0, 1, 0);\n exampleBoard.move(0, 0, 2, 0);\n exampleBoard.move(1, 1, 3, 1);\n exampleBoard.move(4, 2, 4, 0);\n\n assertEquals(false, exampleBoard.isGameOver());\n assertEquals(\" _\\n\" +\n \" _ _\\n\" +\n \" O _ O\\n\" +\n \" _ O _ O\\n\" +\n \"O _ _ O O\", exampleBoard.getGameState());\n }", "@Test\n public void testO() {\n Assert.assertSame(\n new Game(\n new Grid3x3(),\n new PredefinedPlayer(new int[] {1, 4, 2}),\n new PredefinedPlayer(new int[] {0, 3, 6})\n ).play().winner(),\n State.O);\n }", "private boolean win(int row, int col, int player)\n {\n int check;\n // horizontal line\n // Start checking at a possible and valid leftmost point\n for (int start = Math.max(col - 3, 0); start <= Math.min(col,\n COLUMNS - 4); start++ )\n {\n // Check 4 chess horizontally from left to right\n for (check = 0; check < 4; check++ )\n {\n // The coordinate of column increases 1 every time\n if (chessBoard[row][start + check] != player)\n {\n break;\n }\n }\n // If the checking passed, win\n if (check == 4)\n {\n return true;\n }\n }\n\n // vertical line\n // Start checking at the point inputed if there exists at least 3 rows under\n // it.\n if (row + 3 < ROWS)\n {\n // Check another 3 chess vertically from top to bottom\n for (check = 1; check < 4; check++ )\n {\n // The coordinate of row increases 1 every time\n // Check if the chess all belong to the player\n if (chessBoard[row + check][col] != player)\n {\n break;\n }\n }\n // If the checking passed, win\n if (check == 4)\n {\n return true;\n }\n }\n\n // diagonal line \"\\\"\n // Start checking at a possible and valid leftmost and upmost point\n for (int start = Math.max(Math.max(col - 3, 0), col - row); start <= Math\n .min(Math.min(col, COLUMNS - 4), col + ROWS - row - 4); start++ )\n {\n // Check 4 chess diagonally from left and top to right and bottom\n for (check = 0; check < 4; check++ )\n {\n // The coordinate of row increases 1 every time\n // The coordinate of column increases 1 every time\n // Check if the chess all belong to the player\n if (chessBoard[row - col + start + check][start + check] != player)\n {\n break;\n }\n }\n // If the checking passed, win\n if (check == 4)\n {\n return true;\n }\n }\n\n // diagonal line \"/\"\n // Start checking at a possible and valid leftmost and downmost point\n for (int start = Math.max(Math.max(col - 3, 0),\n col - ROWS + row + 1); start <= Math.min(Math.min(col, COLUMNS - 4),\n col + row - 3); start++ )\n {\n // Check 4 chess diagonally from left and bottom to right and up\n for (check = 0; check < 4; check++ )\n {\n // The coordinate of row decreases 1 every time\n // The coordinate of column increases 1 every time\n // Check if the chess all belong to the player\n if (chessBoard[row + col - start - check][start + check] != player)\n {\n break;\n }\n }\n // If the checking passed, win\n if (check == 4)\n {\n return true;\n }\n }\n // no checking passed, not win\n return false;\n }", "public int evaluate(int[][] gameBoard) {\n for (int r = 0; r < 3; r++) {\n if (gameBoard[r][0] == gameBoard[r][1] && gameBoard[r][1] == gameBoard[r][2]) {\n if (gameBoard[r][0] == ai)\n return +10;\n else if (gameBoard[r][0] == human)\n return -10;\n }\n }\n // Checking for Columns for victory.\n for (int c = 0; c < 3; c++) {\n if (gameBoard[0][c] == gameBoard[1][c] && gameBoard[1][c] == gameBoard[2][c]) {\n //gameLogic.getWinType();\n if (gameBoard[0][c] == ai)\n return +10;\n else if (gameBoard[0][c] == human)\n return -10;\n }\n }\n // Checking for Diagonals for victory.\n if (gameBoard[0][0] == gameBoard[1][1] && gameBoard[1][1] == gameBoard[2][2]) {\n if (gameBoard[0][0] == ai)\n return +10;\n else if (gameBoard[0][0] == human)\n return -10;\n }\n if (gameBoard[0][2] == gameBoard[1][1] && gameBoard[1][1] == gameBoard[2][0]) {\n if (gameBoard[0][2] == ai)\n return +10;\n else if (gameBoard[0][2] == human)\n return -10;\n }\n // Else if none of them have won then return 0\n return 0;\n }", "@Test\n public void stateExample3() {\n MarbleSolitaireModel exampleBoard = new MarbleSolitaireModelImpl(2, 4);\n assertEquals(\" O O O\\n\"\n + \" O O O\\n\"\n + \"O O O O _ O O\\n\"\n + \"O O O O O O O\\n\"\n + \"O O O O O O O\\n\"\n + \" O O O\\n\"\n + \" O O O\", exampleBoard.getGameState());\n }", "public void testScoreboardCaseThree () throws Exception {\n \n // RunID TeamID Prob Time Result\n \n String [] runsData = {\n\n \"1,1,A,1,No\", // 20\n \"2,1,A,3,Yes\", // 3 (first Yes counts only Min.Pts)\n \"3,1,A,5,No\", // 20\n \"4,1,A,7,Yes\", // 20 (all runs count!)\n \"5,1,A,9,No\", // 20\n\n \"6,1,B,11,No\", // zero (not solved)\n \"7,1,B,13,No\", // zero (not solved)\n\n \"8,2,A,30,Yes\", // 30\n\n \"9,2,B,35,No\", // zero -- not solved\n \"10,2,B,40,No\", // zero -- not solved\n \"11,2,B,45,No\", // zero -- not solved\n \"12,2,B,50,No\", // zero -- not solved\n \"13,2,B,55,No\", // zero -- not solved\n };\n \n // Rank TeamId Solved Penalty\n \n String [] rankData = {\n \"1,team1,1,23\",\n \"2,team2,1,30\"\n };\n \n // TODO when SA supports count all runs, replace rankData\n \n /**\n * Case 3 tests when all runs are counted, the current SA\n * does not support this scoring method. The commented\n * rankData is the proper results\n */\n \n// String [] rankData = {\n// \"1,team2,1,30\"\n// \"2,team1,1,83\",\n// };\n \n scoreboardTest (2, runsData, rankData);\n }", "@Test public void testPlayBoardCluesRep() throws IOException {\n CrosswordBoard okBoard = new CrosswordBoard(\"puzzles/test.puzzle\");\n // check name and description of puzzle\n assertEquals(\"ANIMALS\", okBoard.getName());\n assertEquals(\"One particular animal\", okBoard.getDescription());\n // check that clues gets the right clues\n Map<String, String> getClues = Map.of(\"1DOWN\", \"winged mammal\", \"2ACROSS\", \"feline companion\");\n for (String key : getClues.keySet()) {\n assertEquals(getClues.get(key), okBoard.getClues().get(key));\n }\n // makes sure that a change in the copy doesn't change rep in clues\n getClues = okBoard.getClues();\n getClues.replace(\"1DOWN\", \"animal of the night\");\n assertEquals(getClues.keySet().size(), okBoard.getClues().size());\n assertEquals(\"winged mammal\", okBoard.getClues().get(\"1DOWN\"));\n\n // test play board initially\n List<List<CrosswordCharacter>> expectedPlayBoard = new ArrayList<>();\n expectedPlayBoard.add(List.of(new CrosswordCharacter(), new CrosswordCharacter('_', 1, Direction.DOWN, true),\n new CrosswordCharacter()));\n expectedPlayBoard.add(List.of(new CrosswordCharacter('_', 2, Direction.ACROSS, true),\n new CrosswordCharacter('_', 2, Direction.ACROSS, false),\n new CrosswordCharacter('_', 2, Direction.ACROSS, false)));\n expectedPlayBoard.add(List.of(new CrosswordCharacter(), new CrosswordCharacter('_', 1, Direction.DOWN, false),\n new CrosswordCharacter()));\n List<List<CrosswordCharacter>> getPlayBoard = okBoard.getPlayBoard();\n for (int i = 0; i < expectedPlayBoard.size(); i++) {\n for (int j = 0; j < expectedPlayBoard.get(0).size(); j++) {\n assertEquals(expectedPlayBoard.get(i).get(j).getChar(), getPlayBoard.get(i).get(j).getChar());\n }\n }\n // test play board after one turn\n assertEquals(Outcome.SUCCESS, okBoard.tryWord(\"1DOWN\", \"Cat\", \"p1\"));\n expectedPlayBoard.clear();\n expectedPlayBoard.add(List.of(new CrosswordCharacter(), new CrosswordCharacter('c', 1, Direction.DOWN, true),\n new CrosswordCharacter()));\n expectedPlayBoard.add(List.of(new CrosswordCharacter('_', 2, Direction.ACROSS, true),\n new CrosswordCharacter('a', 2, Direction.ACROSS, false),\n new CrosswordCharacter('_', 2, Direction.ACROSS, false)));\n expectedPlayBoard.add(List.of(new CrosswordCharacter(), new CrosswordCharacter('t', 1, Direction.DOWN, false),\n new CrosswordCharacter()));\n getPlayBoard = okBoard.getPlayBoard();\n for (int i = 0; i < expectedPlayBoard.size(); i++) {\n for (int j = 0; j < expectedPlayBoard.get(0).size(); j++) {\n assertEquals(expectedPlayBoard.get(i).get(j).getChar(), getPlayBoard.get(i).get(j).getChar());\n }\n }\n // test play board after two turns\n assertEquals(Outcome.SUCCESS, okBoard.tryChallenge(\"1DOWN\", \"bat\", \"p2\"));\n expectedPlayBoard.clear();\n expectedPlayBoard.add(List.of(new CrosswordCharacter(), new CrosswordCharacter('b', 1, Direction.DOWN, true),\n new CrosswordCharacter()));\n expectedPlayBoard.add(List.of(new CrosswordCharacter('_', 2, Direction.ACROSS, true),\n new CrosswordCharacter('a', 2, Direction.ACROSS, false),\n new CrosswordCharacter('_', 2, Direction.ACROSS, false)));\n expectedPlayBoard.add(List.of(new CrosswordCharacter(), new CrosswordCharacter('t', 1, Direction.DOWN, false),\n new CrosswordCharacter()));\n getPlayBoard = okBoard.getPlayBoard();\n for (int i = 0; i < expectedPlayBoard.size(); i++) {\n for (int j = 0; j < expectedPlayBoard.get(0).size(); j++) {\n assertEquals(expectedPlayBoard.get(i).get(j).getChar(), getPlayBoard.get(i).get(j).getChar());\n }\n }\n // makes sure that a change in the copy doesn't change rep in playBoard\n expectedPlayBoard = okBoard.getPlayBoard();\n expectedPlayBoard.get(0).set(1, new CrosswordCharacter('a', 1, Direction.DOWN, true));\n for (int i = 0; i < expectedPlayBoard.size(); i++) {\n for (int j = 0; j < expectedPlayBoard.get(0).size(); j++) {\n if (i == 0 && j == 1) {\n assertFalse(expectedPlayBoard.get(i).get(j).getChar() == getPlayBoard.get(i).get(j).getChar());\n continue;\n }\n assertEquals(expectedPlayBoard.get(i).get(j).getChar(), getPlayBoard.get(i).get(j).getChar());\n }\n }\n }", "public TicTacToeBoard() {\n setBackground(Color.GREEN);//set background color is orange\n addMouseListener(this);// add listener\n addMouseMotionListener(\n new MouseMotionListener() { // mouseMotionListener into mouseListener\n public void mouseDragged(MouseEvent e) {\n }\n \n public void mouseMoved(MouseEvent e) {\n int x1 = (e.getX() - MARGIN + GRID_SPAN / 2) / GRID_SPAN; \n // set the mouse click position as the position on ticTacToeboard \n int y1 = (e.getY() - MARGIN + GRID_SPAN / 2) / GRID_SPAN;\n // game is over, can't go\n // out of ticTacToeboard area, can't go\n // have ticTacToe on the position, can't go\n if (x1 < 0 || x1 > ROWS || y1 < 0 || y1 > COLS || gameOver\n || findTicTacToe(x1, y1))\n setCursor(new Cursor(Cursor.DEFAULT_CURSOR)); // set original model\n else\n setCursor(new Cursor(Cursor.HAND_CURSOR)); // set hand model\n }\n });\n }", "public static void main(String[] args) {\r\n\t\tint[][] blocks = new int[3][3];\r\n\t\tint k = 0;\r\n\t\tfor (int i = 0; i < 3; i++) {\r\n\t\t\tfor (int j = 0; j < 3; j++) {\r\n\t\t\t\tblocks[i][j] = k;\r\n\t\t\t\tk++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tBoard board = new Board(blocks);\r\n\t\tSystem.out.println(board.isGoal());\r\n\t\tSystem.out.println(board.hamming());\r\n\t\tSystem.out.println(board.manhattan());\r\n\r\n\t\tint[][] blocks2 = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 8, 0 } };\r\n\t\tBoard board2 = new Board(blocks2);\r\n\t\tSystem.out.println(board2.isGoal());\r\n\t\tSystem.out.println(board2.hamming());\r\n\t\tSystem.out.println(board2.manhattan());\r\n\r\n\t\tint[][] blocks3 = { { 1, 2, 3 }, { 4, 5, 6 }, { 7, 0, 8 } };\r\n\t\tBoard board3 = new Board(blocks3);\r\n\t\tSystem.out.println(board3.isGoal());\r\n\t\tSystem.out.println(board3.hamming());\r\n\t\tSystem.out.println(board3.manhattan());\r\n\r\n\t\tint[][] blocks4 = { { 1, 2, 3 }, { 4, 5, 6 }, { 0, 8, 7 } };\r\n\t\tBoard board4 = new Board(blocks4);\r\n\t\tSystem.out.println(board4.isGoal());\r\n\t\tSystem.out.println(board4.hamming());\r\n\t\tSystem.out.println(board4.manhattan());\r\n\r\n\t\tint[][] blocks5 = { { 8, 1, 3 }, { 4, 0, 2 }, { 7, 6, 5 } };\r\n\t\tBoard board5 = new Board(blocks5);\r\n\t\tSystem.out.println(board5.isGoal());\r\n\t\tSystem.out.println(board5.hamming());\r\n\t\tSystem.out.println(board5.manhattan());\r\n\t\tSystem.out.println(board5.toString());\r\n\t\tList<Board> neighborsList = board5.neighborsList();\r\n\t\tfor (Board b : neighborsList) {\r\n\t\t\tSystem.out.println(b.toString());\r\n\t\t}\r\n\t}" ]
[ "0.7135146", "0.7105412", "0.69119847", "0.686839", "0.68643284", "0.6801614", "0.67940176", "0.67537075", "0.67443544", "0.67385703", "0.67315817", "0.6668784", "0.6665237", "0.6653783", "0.66101056", "0.65934753", "0.65897334", "0.6579375", "0.65700096", "0.65657026", "0.65633607", "0.6507478", "0.64642596", "0.6463795", "0.6458224", "0.6458182", "0.6450029", "0.64454544", "0.64438224", "0.64068747", "0.6400774", "0.64007485", "0.6398034", "0.6395748", "0.6395423", "0.63832104", "0.6372484", "0.6371487", "0.6359449", "0.6358658", "0.63572025", "0.63327837", "0.63206005", "0.6316023", "0.63127387", "0.63068795", "0.6303869", "0.6298772", "0.6286147", "0.6269997", "0.6266609", "0.62634283", "0.6252894", "0.62461424", "0.6243664", "0.6237234", "0.62292355", "0.6228829", "0.6225553", "0.6221735", "0.6201598", "0.62008536", "0.6189379", "0.6187797", "0.6181964", "0.6179528", "0.6172487", "0.61701536", "0.6170015", "0.61690867", "0.61655384", "0.6158726", "0.61454725", "0.6144733", "0.6141509", "0.6129341", "0.61249", "0.6124318", "0.61225605", "0.61163944", "0.6115541", "0.61137116", "0.6113672", "0.61111665", "0.6109926", "0.6109783", "0.6093346", "0.6085407", "0.6082263", "0.60802794", "0.60778123", "0.60722065", "0.6070375", "0.60638946", "0.6063158", "0.6060927", "0.6060651", "0.6057496", "0.60566884", "0.6054236" ]
0.68317103
5
We want the highest winning % to be first. A "normal" sort places lower values before higher. So this looks "backwards" from a "normal" sort.
@Override public int compareTo(Team arg) { if (this.getPct() < arg.getPct()) return 1; if (this.getPct() > arg.getPct()) return -1; // return 0; // Don't just return 0 if the records are the same. // We need some tie-breaker so that the ordering is // "complete" for all possible Teams. // Use the city name for now, although they might // not be unique across all divisions! return this.city.compareTo(arg.city); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void sortScores(){\r\n // TODO: Use a single round of bubble sort to bubble the last entry\r\n // TODO: in the high scores up to the correct location.\r\n \tcount=0;\r\n \tfor(int i=Settings.numScores-1; i>0;i--){\r\n \t\tif(scores[i]>scores[i-1]){\r\n \t\t\tint tempS;\r\n \t\t\ttempS=scores[i];\r\n \t\t\tscores[i]=scores[i-1];\r\n \t\t\tscores[i-1]=tempS;\r\n \t\t\t\r\n \t\t\tString tempN;\r\n \t\t\ttempN=names[i];\r\n \t\t\tnames[i]=names[i-1];\r\n \t\t\tnames[i-1]=tempN;\r\n \t\t\tcount++;\r\n \t\t}\r\n \t}\r\n }", "public static List<Double> sortScores(List<Double> results) {\n\t\t\n\t\t\n\t\tfor (int i = 0; i < results.size()-1; i++) {\n\t\t\tif (results.get(i)>results.get(i+1)) {\n\t\t\t\t//highScore = results.get(i);\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tDouble temp = results.get(i);\n\t\t\t\t\n\t\t\t\tresults.set(i, results.get(i+1));\n\t\t\t\t\n\t\t\tresults.set(i+1, temp);\n\t\t\t\t\n\t\t\t}\n\t\t\n\t\t}\n\t\n\t\t\n\t\treturn results;\n\t\t//return null;\n\t}", "public void sortScoresDescendently(){\n this.langsScores.sort((LangScoreBankUnit o1, LangScoreBankUnit o2) -> {\n return Double.compare(o2.getScore(),o1.getScore());\n });\n }", "public void sortHighScores(){\n for(int i=0; i<MAX_SCORES;i++){\n long score = highScores[i];\n String name= names[i];\n int j;\n for(j = i-1; j>= 0 && highScores[j] < score; j--){\n highScores[j+1] = highScores[j];\n names[j+1] = names[j];\n }\n highScores[j+1] = score;\n names[j+1] = name;\n }\n }", "private void sortByAmount(){\n int stopPos = 0;\n while(colours.size()-stopPos > 0){\n int inARow = 1;\n for(int i = colours.size() - 1; i > stopPos; i--){\n if(colours.get(i-1).getAmount() < colours.get(i).getAmount()){\n rgb temp = new rgb(colours.get(i-1));\n colours.set(i-1, colours.get(i));\n colours.set(i, temp);\n }else{\n inARow++;\n }\n }\n stopPos++;\n if(inARow == colours.size()){\n break;\n }\n }\n }", "public void sortGivenArray_popularity() { \n int i, j, k; \n for(i = movieList.size()/2; i > 0; i /= 2) {\n for(j = i; j < movieList.size(); j++) {\n Movie key = movieList.get(j);\n for(k = j; k >= i; k -= i) {\n if(key.rents > movieList.get(k-i).rents) {\n movieList.set(k, movieList.get(k-i));\n } else {\n break; \n }\n }\n movieList.set(k, key);\n }\n } \n }", "public static void sort(int[] a)\r\n\t {\r\n\t int[] b = new int[10];\r\n\t int max = getMax(a);\r\n\t int place = 1;\r\n\t System.out.println(max);\r\n\t while (max / place > 0)\r\n\t {\r\n\t \tint[] bucket = new int[10];\r\n\t for (int i = 0; i < a.length; i++)\r\n\t {\r\n\t \tbucket[(a[i]/place) % 10]++;\r\n\t }\t \r\n\t for (int i = 1; i < 10; i++)\r\n\t {\r\n\t \tbucket[i] += bucket[i - 1];\r\n\t } \r\n\t for (int i = a.length - 1; i >= 0; i--)\r\n\t {\r\n\t \tb[--bucket[(a[i]/place)%10]] = a[i];\r\n\t } \r\n\t for (int i=0; i<a.length; i++)\r\n\t {\r\n\t \ta[i] = b[i];\r\n\t }\t \r\n\t place *= 10; \r\n\t }\r\n\t }", "public static List<Double> sortScores(List<Double> results) {\n\t\tfor (int i = 0; i < results.size(); i++) {\n\t\t\tint index = i;\n\t\t\tfor (int j = i + 1; j < results.size(); j++) {\n\t\t\t\tif (results.get(j) < results.get(index)) {\n\t\t\t\t\tindex = j;\n\t\t\t\t}\n\t\t\t}\n\t\t\tdouble temp = results.get(index);\n\t\t\tresults.set(index, results.get(i));\n\t\t\tresults.set(i, temp);\n\t\t}\n\t\treturn results;\n\t}", "public void sortHighscores(){\n Collections.sort(highscores);\n Collections.reverse(highscores);\n }", "public void sort()\n\t{\n\t\tfor(int i=0;i<bowlers.size()-1;i++)\n\t\t{\n\t\t\tfor(int j=i+1;j<bowlers.size();j++)\n\t\t\t{\n\t\t\t\tif(bowlers.get(i).getBall()<bowlers.get(j).getBall())\n\t\t\t\t{\n\t\t\t\t\tBowler bowler=bowlers.get(i);\n\t\t\t\t\tbowlers.set(i,bowlers.get(j));\n\t\t\t\t\tbowlers.set(j,bowler);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tfor(int i=0;i<bowlers.size();i++)\n\t\t{\n\t\tSystem.out.println(bowlers.get(i).getBall());\n\t\t}\n\t}", "private int adjust(int val) {\r\n if(sortDescending == false) return val;\r\n return 0 - val;\r\n }", "@Override\n\tpublic int compareTo(ComparisonHolder arg0) {\n\t\tif(percent > arg0.percent) {\n\t\t\treturn -1;\n\t\t}else if(percent < arg0.percent) {\n\t\t\treturn 1;\n\t\t}\n\t\n\t\treturn 0;\n\t}", "public static void sortByFitlvl() {\n Collections.sort(Population);\n if (debug) {\n debugLog(\"\\nSorted: \");\n printPopulation();\n }\n }", "public void wiggleSortInitial(int[] nums) {\n int[] freq = new int[nums.length];\n \n for (int i = 0; i < nums.length; i++) \n freq[i] = nums[i];\n \n Arrays.sort(freq);\n \n int p1 = 0, p2 = nums.length - 1, i = 0;\n \n while (i < nums.length) {\n nums[i++] = freq[p1++];\n if (i < nums.length) nums[i++] = freq[p2--];\n }\n }", "private void sortResults(){\r\n this.sortedPlayers = new ArrayList<>();\r\n int size = players.size();\r\n while (size > 0) {\r\n Player lowestPointsPlayer = this.players.get(0);\r\n for(int i = 0; i<this.players.size(); i++){\r\n if(lowestPointsPlayer.getPoints() <= this.players.get(i).getPoints()){\r\n lowestPointsPlayer = this.players.get(i);\r\n }\r\n }\r\n this.sortedPlayers.add(lowestPointsPlayer);\r\n this.players.remove(lowestPointsPlayer);\r\n size--;\r\n }\r\n\r\n\r\n }", "private void sortEScores() {\n LinkedHashMap<String, Double> sorted = eScores\n .entrySet()\n .stream()\n .sorted(Collections.reverseOrder(Map.Entry.comparingByValue()))\n .collect(\n toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e2,\n LinkedHashMap::new));\n eScores = sorted;\n }", "private void sortByRank(Card[] hand) {\n\t\tfor (int i = 0; i < hand.length; i++) {\n\t\t\tfor (int j = i + 1; j < hand.length; j++) {\n\t\t\t\tif (hand[i].getRank().getValue() > hand[j].getRank().getValue()) {\n\t\t\t\t\tCard temp = hand[i];\n\t\t\t\t\thand[i] = hand[j];\n\t\t\t\t\thand[j] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "private static void sort(int[] arr) {\n\t\tint lesserIndex=-1;\n\t\tint arrLen = arr.length ; \n\t\tfor(int i=0; i<arrLen; i++){\n\t\t\tif(arr[i]<0){\n\t\t\t\tlesserIndex++; \n\t\t\t\tint tmp = arr[lesserIndex]; \n\t\t\t\tarr[lesserIndex] = arr[i];\n\t\t\t\tarr[i] = tmp; \n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tint negBound = lesserIndex+1;\n\t\tint posIndex = negBound;\n\t\t\n\t\tfor(int negIngex = 0;negIngex<negBound && posIndex<arr.length; negIngex+=2, posIndex+=1){\n\t\t\tint tmp = arr[posIndex]; \n\t\t\tarr[posIndex] = arr[negIngex] ; \n\t\t\tarr[negIngex] = tmp ;\n\t\t\tnegBound++;\n\t\t}\n\t\t\n\t\t\n\t\tfor(int a : arr) {\n\t\t\tSystem.out.print(a);\n\t\t}\n\t\t\n\t}", "private void sortByWeight()\n\t{\n\t\tfor(int i=1; i<circles.size(); i++)\n\t\t{\n\t\t\tPVCircle temp = circles.get(i);\n\t\t\tint thisWeight = circles.get(i).getWeight();\n\t\t\tint j;\n\t\t\tfor(j=i-1; j>=0; j--)\n\t\t\t{\n\t\t\t\tint compWeight = circles.get(j).getWeight();\n\t\t\t\tif(thisWeight < compWeight)\n\t\t\t\t\tbreak;\n\t\t\t\telse\n\t\t\t\t\tcircles.set(j+1, circles.get(j));\n\t\t\t}\n\t\t\tcircles.set(j+1, temp);\n\t\t}\n\t\t\n\t}", "void sort() {\n\t\tint n = array.length;\n\t\tint temp = 0;\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 1; j < (n - i); j++) {\n\t\t\t\tif (array[j - 1] > array[j]) { // if the first term is larger\n\t\t\t\t\t\t\t\t\t\t\t\t// than the last term, then the\n\t\t\t\t\t\t\t\t\t\t\t\t// temp holds the previous term\n\t\t\t\t\ttemp = array[j - 1];\n\t\t\t\t\tarray[j - 1] = array[j];// swaps places within the array\n\t\t\t\t\tarray[j] = temp;\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\t}", "static int hireAssistant(int tab[]) {\n int best = 0;\n for(int i = 0; i<tab.length; i++) {\n if(tab[i] > best)\n best = tab[i];\n }\n return best;\n }", "private void mostValuePerWeightFirst(Instance instance) {\n ArrayList<Pair> order = new ArrayList<Pair>();\n\n for (int i = 0; i < instance.getSize(); i++) {\n order.add(i, new Pair(i, instance.getValue(i), instance.getWeight(i)));\n }\n\n // Sort items according to c_i/w_i >= c_i+1/w_i+1\n order.sort(new Comparator<Pair>() {\n @Override\n public int compare(Pair o1, Pair o2) {\n return o1.compareTo(o2) * -1;\n }\n });\n\n setSolution(order);\n }", "@Override\n public void crunch(float values[]){\n int biggest = 0;\n int smallest = 0;\n\n for(int j = 0; j <= values.length -1; j++){\n for(int i = 0; i <= values.length -1; i++){\n if(values[i+1] > values[i]){\n biggest = i+1;\n smallest = i;\n } else{\n biggest = i;\n smallest = i+1;\n }\n }\n if(smallest != 0){\n values[biggest] /= values[smallest];\n }\n }\n }", "private static double getHighestScore (List<Double> inputScores) {\n\n\t\tCollections.sort(inputScores, Collections.reverseOrder());\n\n\t\treturn inputScores.get(0);\n\n\t}", "public static int majorityElementSorting(int[] nums) {\n if (nums == null || nums.length == 0) throw new IllegalArgumentException();\n else if (nums.length == 1) return nums[0];\n\n Arrays.sort(nums);\n return nums[nums.length / 2];\n }", "public void sortPassing(){\n\t\tpassing.sort(PlayingCard.PlayingCardComparator_ACEHIGH);\n\t}", "private void sort() {\n ScoreComparator comparator = new ScoreComparator();\n Collections.sort(scores, comparator);\n }", "public void wiggleSortSubOptimal(int[] nums) {\n Arrays.sort(nums);\n \n for (int i = 1; i < nums.length - 1; i += 2)\n swap(nums, i, i + 1);\n }", "void sort(double arr[], long start, long end) \n { \n double biggest = 0, temp;\n int biggestIndex = 0;\n for(int j = 0; j > arr.length+1; j++){\n for(int i = 0; i < arr.length-j; i++){\n if(arr[i] > biggest){\n biggest = arr[i];\n biggestIndex = i;\n }\n }\n temp = arr[arr.length-1];\n arr[arr.length-1] = biggest;\n arr[biggestIndex] = temp;\n biggest = 0;\n biggestIndex = 0;\n }\n }", "@Override\r\n\t\t\tpublic int compare(Entry<Integer, Double> o1, Entry<Integer, Double> o2) {\n\t\t\t\tif ((o1.getValue()-o2.getValue())>0) {\r\n\t\t\t\t\t\r\n\t\t\t\t\treturn 1;\r\n\t\t\t\t} else if ((o1.getValue()-o2.getValue())<0) {\r\n\t\t\t\t\treturn -1;\r\n\t\t\t\t} else {\r\n\t\t\t\t\treturn 0;\r\n\t\t\t\t}\r\n\t\t\t}", "private Map<String, Double> sortBottomPercents(final String gradingScaleName, final Map<String, Double> percents) {\n\n\t\tMap<String, Double> rval = null;\n\n\t\tif (StringUtils.equals(gradingScaleName, \"Pass / Not Pass\")) {\n\t\t\trval = new TreeMap<>(Collections.reverseOrder()); // P before NP.\n\t\t} else {\n\t\t\trval = new TreeMap<>(new LetterGradeComparator()); // letter grade mappings\n\t\t}\n\t\trval.putAll(percents);\n\n\t\treturn rval;\n\t}", "@Override\r\n public int compareTo(final QueryResultEntry comparative) {\r\n return (mScore > comparative.mScore ? -1 : (mScore == comparative.mScore ? 0 : 1));\r\n }", "public int best(){\n List<Integer> points = count();\n Integer max = 0;\n for (Integer p: points){\n if (p <= 21 && max < p){\n max = p;\n }\n }\n return max;\n }", "public void sort() {\n\t\tdivider(0, array.size() - 1);\n\t}", "void order() {\n for (int i = 0; i < numVertices; i++) {\n if (simp[i][numParams] < simp[best][numParams]) {\n best = i;\n }\n if (simp[i][numParams] > simp[worst][numParams]) {\n worst = i;\n }\n }\n nextWorst = best;\n for (int i = 0; i < numVertices; i++) {\n if (i != worst) {\n if (simp[i][numParams] > simp[nextWorst][numParams]) {\n nextWorst = i;\n }\n }\n }\n }", "public static void sort(int[] vals)\n\t{\n\t\tint sortedIndex = 0;\n\t\twhile (sortedIndex < vals.length - 1)\n\t\t{\n\t\t\tif (vals[sortedIndex] > vals[sortedIndex + 1])\n\t\t\t{\n\t\t\t\tswap(vals, sortedIndex, sortedIndex + 1);\n\t\t\t\tint k = sortedIndex - 1;\n\t\t\t\twhile (vals[k] > vals[k + 1] && k >= 0)\n\t\t\t\t{\n\t\t\t\t\tswap(vals, k, k + 1);\n\t\t\t\t\tk--;\n\t\t\t\t}\n\t\t\t}\n\t\t\tsortedIndex++;\n\t\t}\n\t}", "@SuppressWarnings({ \"unchecked\", \"rawtypes\" })\n\tprivate static ArrayList<Result> sortByScore(ArrayList<Result> sortThis){\n\t\tArrayList<Result> sorted = sortThis;\n\t\tCollections.sort(sorted, new Comparator(){\n\t\t\t\n\t\t\tpublic int compare(Object o1, Object o2){\n\t\t\t\tResult r1 = (Result) o1;\n\t\t\t\tResult r2 = (Result) o2;\n\n\t\t\t\tDouble Score1 = new Double(r1.getScore());\n\t\t\t\tDouble Score2 = new Double(r2.getScore());\n\t\t\t\treturn Score1.compareTo(Score2);\n\t\t\t}\n\t\t});\n\t\tCollections.reverse(sorted);\n\t\t\n\t\treturn sorted;\n\t}", "public double getBestScore();", "public void sortBySuit() {\r\n List<Card> newHand = new ArrayList<Card>();\r\n while (hand.size() > 0) {\r\n int minPos = 0;\r\n Card minCard = hand.get(0);\r\n for (int i = 1; i < hand.size(); i++) {\r\n Card curCard = hand.get(i);\r\n if (curCard.getSuit().ordinal() < minCard.getSuit().ordinal() ||\r\n (curCard.getSuit().ordinal() == minCard.getSuit().ordinal() && curCard.getRank().ordinal() < minCard.getRank().ordinal())) {\r\n minPos = i;\r\n minCard = curCard;\r\n }\r\n }\r\n hand.remove(minPos);\r\n newHand.add(minCard);\r\n }\r\n hand = newHand;\r\n }", "@Override\n public int compareTo(Player p) {\n if (p.playerWorth>playerWorth)return 1;\n else if (p.playerWorth<playerWorth) return -1;\n return 0;\n }", "public static Vector<Double> getPerfectRanking(Vector<Double> rels){\n Vector<Double> ideal = new Vector<Double>();\n for(int i=0;i<rels.size();i++){\n ideal.add(rels.get(i));\n }\n Comparator<Double> comp = Collections.reverseOrder(); \t\t\n Collections.sort(ideal,comp);\n return ideal;\n }", "public int getWorstScore()\n {\n return -1;\n }", "public static Student[] sortScore( Student s[]){\n\t\tStudent temp ;\r\n\t\tfor(int i=0; i<s.length; i++){\r\n\t\t\tfor(int j=i+1; j<s.length;j++)\r\n\t\t\t\tif(s[i].score > s[j].score){\r\n\t\t\t\t\ttemp = s[i];\r\n\t\t\t\t\ts[i] = s[j];\r\n\t\t\t\t\ts[j]= temp;\r\n\t\t\t\t} \t\t\t\r\n\t\t\t}\r\n\t\t\r\n\r\n\r\n\r\n\t\tSystem.out.println(\"Students with score<50 are: \");\r\n\t\tfor(int i=0; i<s.length;i++){\r\n\t\t\tif(s[i].score<50){\r\n\t\t\ts[i].Display();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Students with score>=50 and <65 are: \");\r\n\t\tfor(int i=0; i<s.length;i++){\r\n\t\t\tif(s[i].score>=50 && s[i].score<65){\r\n\t\t\ts[i].Display();\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t\tSystem.out.println(\"Students with score>=65 and <80 are: \");\r\n\t\tfor(int i=0; i<s.length;i++){\r\n\t\t\tif(s[i].score>=65 && s[i].score<80){\r\n\t\t\ts[i].Display();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"Students with score>=80 and <100 are: \");\r\n\t\tfor(int i=0; i<s.length;i++){\r\n\t\t\tif(s[i].score>=80 && s[i].score<=100){\r\n\t\t\ts[i].Display();\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn s;\r\n\r\n\r\n\t}", "public void sort(int[] a) {\n\t\tint n = a.length;\n\t\tint temp;\n\t\tfor (int gap = n / 2; gap > 0; gap /= 2) {\n\t\t\tfor (int i = gap; i < n; i++) {\n\t\t\t\tfor (int j = i - gap; j >= 0; j -= gap) {\n\t\t\t\t ++totalValCmp;\n\t\t\t\t if (a[j] > a[j + gap]) {\n\t\t\t\t\t temp = a[j];\n\t\t\t\t\t a[j] = a[j + gap];\n\t\t\t\t\t a[j + gap] = temp;\n\t\t\t\t\t ++totalswaps;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void main(String[] args) {\n int maxposition = -1;\n int i = 0;\n Random rnd = new Random();\n Scanner scanner = new Scanner(System.in);\n int arraylength = 0;\n while (arraylength < 2 || arraylength > 100){\n System.out.print(\"Enter desirable array range between 2 and 100 - \");\n arraylength = scanner.nextInt();\n }\n int array[] = new int[arraylength];\n for (i = 0; i <= (array.length - 1); i++) {\n array[i] = rnd.nextInt(255);\n }\n System.out.print(\"initial given array: \" + array[0]);\n for (i = 1; i <= (array.length - 1); i++) {\n System.out.print(\", \" + array[i]);\n }\n System.out.println(\";\");\n int max = array[0];\n//sorting\n // taking local maximums left\n while (maxposition != array.length - 1) {\n for (i = 1; maxposition < 0; i++) {\n if (i > array.length - 2) {\n maxposition = array.length - 1;\n }\n else {\n if (array[i] > array[i - 1]) {\n if (array[i] > array[i + 1]){\n max = array[i];\n maxposition = i;\n }\n }\n if (array[i] = array[i - 1]) {\n if (array[i] > array[i + 1]){\n max = array[i];\n maxposition = i;\n }\n }\n }\n }\n for (i = maxposition; i > 0; i--) {\n if (array[i] > array[i - 1]) {\n max = array[i];\n array[i] = array[i - 1];\n array[i - 1] = max;\n }\n }\n if (maxposition != array.length - 1) {\n maxposition = -1;\n }\n \n }\n // taking local minimums right\n maxposition = -1;\n max = array[0];\n while (maxposition != array.length - 1) {\n for (i = 1; maxposition < 0; i++) {\n if (i > array.length - 2) {\n maxposition = array.length - 1;\n }\n else {\n if (array[i] < array[i - 1]) {\n if (array[i] < array[i + 1]){\n max = array[i];\n maxposition = i;\n }\n }\n }\n }\n for (i = maxposition; i < arraylength -1; i++) {\n if (array[i] < array[i + 1]) {\n max = array[i];\n array[i] = array[i + 1];\n array[i + 1] = max;\n }\n }\n if (maxposition != array.length - 1) {\n maxposition = -1;\n }\n \n }\n\n // while (array[arraylength - 1] > array[arraylength - 2]) {\n // for (i = array.length - 1; i > 0; i--) {\n // if (array[i] > array[i - 1]) {\n // max = array[i];\n // array[i] = array[i - 1];\n // array[i - 1] = max;\n // }\n // }\n // }\n\n//showing user sorted array\n System.out.print(\"array sorted descending: \" + array[0]);\n for (i = 1; i <= (array.length - 1); i++) {\n System.out.print(\", \" + array[i]);\n }\n System.out.println(\";\");\n\t}", "public void oldSort()\n\t{\n\t\tfor (int index = 0; index < arraySize; index++) {\n\t\t\tfor (int secondIndex = index + 1; secondIndex < arraySize; secondIndex++) {\n\t\t\t\tint temp = 0;\n\t\t\t\tif (array[index] > array[secondIndex]) {\n\t\t\t\t\ttemp = array[index];\n\t\t\t\t\tarray[index] = array[secondIndex];\n\t\t\t\t\tarray[secondIndex] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t}", "@Override\r\n public int compare(BarterOffer o1, BarterOffer o2) {\r\n return Double.compare(o1.getBestBid(), o2.getBestBid());\r\n }", "public static void sort(int[] v) {\n\t\tint biggest_value=v[0];\n\t\tint lowest_value =v[0];\n\t\t\n\t\tfor(int i=0;i<v.length;i++) {\n\t\t\tif(v[i]>biggest_value) {\n\t\t\t\tbiggest_value = v[i];\n\t\t\t}\n\t\t\tif(v[i]<lowest_value) {\n\t\t\t\tlowest_value = v[i];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//Define a amplitude dos valores existentes no vetor\n\t\tint range = biggest_value - lowest_value;\n\t\t\n\t\t//Cria o vetor de frequência com o tamanho da amplitude+1, para que contenha todos os\n\t\t//valores existentes no vetor\n\t\tint[] frequency = new int[range+1];\n\t\t\n\t\t//Cria um normalizador, que será responsável por normalizar o posicionamento dos valores\n\t\t//no vetor de frequência\n\t\tint normalizer = lowest_value*(-1);\n\t\t\n\t\t//Faz a contagem de elementos existentes no vetor de entrada, salvando suas ocorrências\n\t\t//no vetor de frequência\n\t\tfor(int i=0;i<v.length;i++) {\n\t\t\tfrequency[normalizer+v[i]] += 1;\n\t\t}\n\t\t\n\t\t//Torna o vetor de frequência em cumulativo\n\t\tfor(int i=1;i<frequency.length;i++) {\n\t\t\tfrequency[i]+=frequency[i-1];\n\t\t}\n\t\t\n\t\t//Cria o vetor que será o ordenado\n\t\tint[] ordered_array = new int[v.length];\n\t\t\n\t\t//Distribui valores de frequência no array ordenado\n\t\tfor(int i=v.length-1;i>-1;i--) {\n\t\t\tordered_array[frequency[v[i]+normalizer]-1] = v[i];\n\t\t\tfrequency[v[i]+normalizer]-=1;\n\t\t}\n\t\t\n\t\t//Redefine v pelo vetor ordenado\n\t\tfor(int i=0;i<v.length;i++) {\n\t\t\tv[i]=ordered_array[i];\n\t\t}\n\t}", "public void wiggleSort(int[] nums) {\n for (int i = 0; i < nums.length - 1; i++) {\n if ((i % 2 == 0 && nums[i] > nums[i + 1]) || (i % 2 == 1 && nums[i] < nums[i + 1])) swap(nums, i, i + 1);\n }\n }", "public void wiggleSort(int[] nums) {\n\n // At position 0 we need a[0] < a[1] and in position 1 we need a[1] > a[2]\n for(int i=0; i < nums.length-1; i++) {\n boolean isEven = i%2==0;\n if(isEven) {\n if(nums[i] > nums[i+1]) { // a[0] should less than a[1]\n ArrayUtils.swap(nums,i,i+1);\n }\n } else {\n if(nums[i] < nums[i+1]) { // a[1] should greater than a[2]\n ArrayUtils.swap(nums,i,i+1);\n }\n }\n }\n }", "@Override\n\t\t\t\tpublic int compare(Pair o1, Pair o2) {\n\t\t\t\t\tif(o1.getAvg() - o2.getAvg() > 0){\n\t\t\t\t\t\treturn -1;\n\t\t\t\t\t}else if(o1.getAvg() - o2.getAvg() < 0){\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}else{\n\t\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}", "public static void sort (int[] data)\n {\n \t\n \tfor(int i = 0; i < data.length-1; i++)\n \t{\n \t\tint max = data[i];\n \t\tint indexOfMax = i;\n \t\t\n \t\tfor(int j = i + 1; j < data.length; j++)\n \t\t{\n \t\t\tif(data[j] > max)\n \t\t\t{\n \t\t\t\tmax = data[j];\n \t\t\t\tindexOfMax = j;\n \t\t\t}\n \t\t}\n \t\t\n \t\tdata[indexOfMax] = data[i];\n \t\tdata[i] = max;\n \t}\n \t\n // Your TA will help you write selection sort in lab. \n }", "public static void SortPlayers () {\r\n boolean sorted = false;\r\n Player temp;\r\n\r\n while (!sorted) {\r\n sorted = true;\r\n for (int i = 0; i < player.length - 1; i++) {\r\n if (player[i].score > player[i + 1].score) {\r\n\r\n // SWAP THE OBJECTS' POSITION IN THE ARRAY\r\n temp = player[i];\r\n player[i] = player[i + 1];\r\n player[i + 1] = temp;\r\n\r\n sorted = false;\r\n }\r\n\r\n }\r\n }\r\n\r\n }", "@Override\n\t\tpublic int compare(RankingEntry o1, RankingEntry o2) {\n\t\t\tif (o2.getMurderCount() == o1.getMurderCount()) {\n\t\t\t\treturn o1.getDeathCount() - o2.getDeathCount();\n\t\t\t}\n\t\t\treturn o2.getMurderCount() - o1.getMurderCount();\n\t\t}", "int main()\n{\n int i,n;\n float arr [100];\n cin >> n;\n \n for(i=0;i<n;++i)\n {\n cin >> arr[i];\n }\n \n for(i=1;i<n;++i)\n {\n if(arr[0]<arr[i])\n arr[0]=arr[i];\n }\n cout<< arr[0];\n}", "public PlayerProfile[] getLeaderboardOrdered() {\r\n PlayerProfile[] temp = new PlayerProfile[players.length];\r\n for(int i = 0; i < players.length; i++) {\r\n temp[i] = players[i].getPlayerProfile();\r\n }\r\n int n = temp.length;\r\n //bubble sort...\r\n for (int i = 0; i < n-1; i++)\r\n for (int j = 0; j < n-i-1; j++)\r\n if (temp[j].getWins() > temp[j+1].getWins())\r\n {\r\n // swap arr[j+1] and arr[j]\r\n PlayerProfile temp2 = temp[j];\r\n temp[j] = temp[j+1];\r\n temp[j+1] = temp2;\r\n }\r\n return temp;\r\n }", "public static void main(String[] args) {\n\t\t\n\t\tint [] arr= {3,43,2,320,143,4};\n\t\t\n\t\tint temp=0;\n\t\tint lenth=arr.length;\n\t\t\n\t\tfor(int i=0;i<lenth;i++) {\n\t\t\t\n\t\t\tfor(int j=1;j<(lenth-i);j++)\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif(arr[j-1]>arr[j]) {\n\t\t\t\t\ttemp=arr[j-1];\n\t\t\t\t\tarr[j-1]=arr[j];\n\t\t\t\t\t\t\tarr[j]=temp;\n\t\t\t\t\tSystem.out.println(arr[j]);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\t\t\n\t\t\n\n\t}", "private void discretization(int[] nums) {\n\t\tint[] sorted = nums.clone();\n\t\tArrays.sort(sorted);\n\t\tfor (int i = 0; i < nums.length; i++) {\n\t\t\tnums[i] = Arrays.binarySearch(sorted, nums[i]);\n\t\t}\n\t}", "@Override\r\n\tpublic void sortASC(int[] array) {\n\t\t\r\n\t\tfor (int i = 0; i < array.length; i++) {\r\n\t\t\tfor (int j = i + 1; j < array.length; j++) {\r\n\t\t\t\t\r\n\t\t\t\tif (array[i] > array[j]) {\r\n\t\t\t\t\tint temp = array[i];\r\n\t\t\t\t\tarray[i] = array[j];\r\n\t\t\t\t\tarray[j] = temp;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t\r\n\t}", "@Override\n public int compareTo(Object o) { \n if(this.getGrade()==((BoardCandidate)o).getGrade()){\n return (int)(Math.random()*10-Math.random()*10);\n }\n return this.getGrade()-((BoardCandidate)o).getGrade();\n }", "public int getBestScore() {\n\t\tInteger score = this.hand.countValue().lower(22);\n\t\tif(score!=null) {\n\t\t\treturn score;\n\t\t}\n\t\telse {\n\t\t\treturn this.hand.countValue().higher(21);\n\t\t}\n\t}", "public int determineHighestVal() {\n if (playerCards[0].value > playerCards[1].value) {\n return playerCards[0].value;\n }\n return playerCards[1].value;\n\n }", "public void calculateHighscores(){\n if((newPlayer.getScore() > (getRecord())) && (newPlayer.getScore() > getRecord2()) && (newPlayer.getScore() > getRecord3())){\n setRecord3(getRecord2());\n setRecord2(getRecord());\n setRecord(newPlayer.getScore());\n newPlayer.resetScore();\n }\n if((newPlayer.getScore() > getRecord2()) && (newPlayer.getScore() > getRecord3()) && (newPlayer.getScore() < getRecord())){\n setRecord3(getRecord2());\n setRecord2(newPlayer.getScore());\n newPlayer.resetScore();\n }\n if((newPlayer.getScore() > getRecord3()) && newPlayer.getScore() < getRecord2()){\n setRecord3(newPlayer.getScore());\n newPlayer.resetScore();\n }else{\n newPlayer.resetScore();\n\n }\n }", "@Override\n\t\t\tpublic int compare(Entry<String, Double> o1,\n\t\t\t\t\tEntry<String, Double> o2) {\n\t\t\t\tif(o1.getValue()>o2.getValue()){\n\t\t\t\t\treturn -1;\n\t\t\t\t}else if(o1.getValue()<o2.getValue()){\n\t\t\t\t\treturn 1;\n\t\t\t\t}else{\n\t\t\t\t\treturn 0;\n\t\t\t\t}\n\t\t\t}", "public int robBetter(int[] nums) {\n int prev = 0, pprev = 0;\n for (int n : nums) {\n int c = Math.max (prev, pprev + n);\n pprev = prev;\n prev = c;\n }\n return prev;\n }", "private void sortPlayerScores(){\n text=\"<html>\";\n for (int i = 1; i <= Options.getNumberOfPlayers(); i++){\n if(Collections.max(playerScores.entrySet(), (entry1, entry2) -> entry1.getValue() - entry2.getValue()).getKey() != null){\n Integer pl = Collections.max(playerScores.entrySet(), (entry1, entry2) -> entry1.getValue() - entry2.getValue()).getKey();\n if(pl != null && playerScores.containsKey(pl)){\n text += \"<p>Player \" + pl + \" Scored : \" + playerScores.get(pl) + \" points </p></br>\";\n playerScores.remove(pl);\n }\n }\n }\n text += \"</html>\";\n }", "public static int[] sort( int[] arr )\n {\n int m = arr.length / 2; //find the half way point \n if (arr.length == 1) { //base case: when the array has one number\n\t return arr; }\n else \n\t int[] firstH = new int[m]; //array holding the first half\n\t int[] secondH = new int[m]; //array holding the second half\n\t for (int i = 0; i < firstH.length; i++) { //fills both arrays up with the respective halves\n\t firstH[i] = arr[i];\n\t secondH[i] = arr[arr.length - 1 - i];\n\t }\n\t return merge(sort(firstH),sort(secondH)); //recursive that calls sort again on both halves, halfing them further until they reach the base case and merge will kick in, merging them together until you reach the top again and merge the original 2 halves \n }", "public void SortByPrice() {\n for (int i = 1; i < LastIndex; i++) {\n int x = i;\n while (x >= 1) {\n if (ForChild[x - 1].getPrice() > ForChild[x].getPrice()) {\n Confectionery sweets = ForChild[x - 1];\n ForChild[x - 1] = ForChild[x];\n ForChild[x] = sweets;\n\n }\n x -= 1;\n }\n }\n }", "static String[] sortWordsByScore(String[] words) {\n\n if(words.length == 0) return new String[0];\n String[] sorted = new String[words.length];\n\n int minScore = -1; //minScore(words[0]);\n int currentIndex = 1;\n int index = 0;\n\n getMinScoreWordIndex(words, minScore);\n\n System.out.println(tracker);\n while(currentIndex <= tracker.size()){\n\n\n System.out.println(tracker.get(index));\n \n sorted[index] = words[tracker.get(index)];\n\n index++;\n currentIndex++;\n// tracker.clear();\n }\n\n return sorted;\n }", "@Override\n public void sort() {\n int cont = 0;\n int mov = 0;\n for (int i = 0; i < (100 - 1); i++) {\n int menor = i;\n for (int j = (i + 1); j < 100; j++){\n if (array[menor] > array[j]){\n cont= cont + 1;\n menor = j;\n mov = mov + 1;\n }\n }\n swap(menor, i);\n mov = mov + 3;\n }\n System.out.println(cont + \" comparações\");\n System.out.println(mov + \" Movimenteções\");\n }", "public void sortAlternate(int[] nums){\n Arrays.sort(nums);\n }", "public static boolean testSort() {\r\n Manager inst;\r\n try {\r\n inst = new PokemonTable();\r\n } catch (IOException e) {\r\n e.printStackTrace();\r\n return false;\r\n }\r\n LinkedList<Pokemon> list;\r\n list = inst.sortByAttack(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getAttack() < list.get(i).getAttack()) {\r\n System.out.println(\"attack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByAttack(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getAttack() > list.get(i).getAttack()) {\r\n System.out.println(\"attack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByDefense(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getDefense() < list.get(i).getDefense()) {\r\n System.out.println(\"defense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByDefense(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getDefense() > list.get(i).getDefense()) {\r\n System.out.println(\"defense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByFavorite(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (!list.get(i - 1).getFavorite() && list.get(i).getFavorite()) {\r\n System.out.println(\"favorite sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByFavorite(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getFavorite() && !list.get(i).getFavorite()) {\r\n System.out.println(\"favorite sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByHp(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getHp() < list.get(i).getHp()) {\r\n System.out.println(\"hp sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByHp(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getHp() > list.get(i).getHp()) {\r\n System.out.println(\"hp sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByLegendary(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (!list.get(i - 1).isLegendary() && list.get(i).isLegendary()) {\r\n System.out.println(\"legendary sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByLegendary(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).isLegendary() && !list.get(i).isLegendary()) {\r\n System.out.println(\"legendary sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByName(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getName().compareTo(list.get(i).getName()) > 0) {\r\n System.out.println(\"name sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortByName(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getName().compareTo(list.get(i).getName()) < 0) {\r\n System.out.println(\"name sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpAttack(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpAttack() < list.get(i).getSpAttack()) {\r\n System.out.println(\"spAttack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpAttack(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpAttack() > list.get(i).getSpAttack()) {\r\n System.out.println(\"spAttack sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpDefense(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpDefense() < list.get(i).getSpDefense()) {\r\n System.out.println(\"spDefense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpDefense(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpDefense() > list.get(i).getSpDefense()) {\r\n System.out.println(\"spDefense sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpeed(true);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpeed() < list.get(i).getSpeed()) {\r\n System.out.println(\"speed sort\");\r\n return false;\r\n }\r\n }\r\n list = inst.sortBySpeed(false);\r\n for (int i = 1; i < list.size(); i++) {\r\n if (list.get(i - 1).getSpeed() > list.get(i).getSpeed()) {\r\n System.out.println(\"speed sort\");\r\n return false;\r\n }\r\n }\r\n return true;\r\n }", "public static List<String> sortScores(List<Double> results) {\n\t\treturn null;\n\t}", "private void sort() {\n Collections.sort(mEntries, new Comparator<BarEntry>() {\n @Override\n public int compare(BarEntry o1, BarEntry o2) {\n return o1.getX() > o2.getX() ? 1 : o1.getX() < o2.getX() ? -1 : 0;\n }\n });\n }", "private void sorter(int[] array){\r\n\r\n for (int i = 0; i < array.length-1; i++)\r\n for (int j = 0; j < array.length-i-1; j++)\r\n if (array[j] > array[j+1])\r\n {\r\n int temp = array[j];\r\n array[j] = array[j+1];\r\n array[j+1] = temp;\r\n }\r\n }", "@Override\n\t\t\tpublic int compare(Entry<Integer, Double> o1, Entry<Integer, Double> o2) {\n\t\t\t\treturn -(int) (o1.getValue().compareTo(o2.getValue()));\n\t\t\t}", "private static void selectionSort(double[] numbers) {\n for (int top = numbers.length-1; top > 0; top-- ) {\n int maxloc = 0;\n for (int i = 1; i <= top; i++) {\n if (numbers[i] > numbers[maxloc])\n maxloc = i;\n }\n double temp = numbers[top];\n numbers[top] = numbers[maxloc];\n numbers[maxloc] = temp;\n }\n }", "public static int[] partialSort(int[] a) {\n for (int i = 0; i < 2; i++) {\n for (int j = 0; j < 2 - i; j++) {\n if (a[j] > a[j+1]) {\n int temp = a[j+1];\n a[j+1] = a[j];\n a[j] = temp;\n }\n }\n }\n return a;\n}", "public static void sort(int[] arr){\n\t\tint temp;\n\t\tfor(int i=0; i<arr.length; i++){\n\t\t\tfor(int j=1; j<arr.length-i; j++)\n\t\t\tif(arr[j-1] > arr[j]){\n\t\t\t\ttemp = arr[j-1];\n\t\t\t\tarr[j-1] = arr[j];\n\t\t\t\tarr[j] = temp;\n\t\t\t}\n\t\t\t\n\t\t}\n\t}", "private void sortRating()\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.getRating().compareTo(b.getRating());\n if(result < 0)\n {\n movieList.set(j-1, b);\n movieList.set(j, a);\n }\n else if(result == 0)\n {\n 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 }\n }", "private static void generateWorstUnsortArray(int[] array) {\n\n if (array.length == 2) {\n\n int swap = array[0];\n array[0] = array[1];\n array[1] = swap;\n } else if (array.length > 2) {\n\n int i, j;\n int m = (array.length + 1) / 2;\n int left[] = new int[m];\n int right[] = new int[array.length - m];\n\n for (i = 0, j = 0; i < array.length; i = i + 2, j++) {\n\n left[j] = array[i];\n }\n\n for (i = 1, j = 0; i < array.length; i= i + 2, j++) {\n\n right[j] = array[i];\n }\n\n generateWorstUnsortArray(left);\n generateWorstUnsortArray(right);\n merge(array, left, right);\n }\n }", "@Test\n public void testSort() {\n initialize();\n var realList = new HighScoreList();\n realList.setList(list);\n realList.sort();\n\n assertEquals(300, realList.getList().get(0).getScore());\n assertEquals(200, realList.getList().get(1).getScore());\n assertEquals(100, realList.getList().get(2).getScore());\n }", "public void sortByValue() {\n\t\tArrayList<Card> newHand = new ArrayList<Card>();\n\t\twhile (this.cardsInhand.size() > 0) {\n\t\t\tint pos = 0; // Position of minimal card.\n\t\t\tCard c = this.cardsInhand.get(0); // Minimal card.\n\t\t\tfor (int i = 1; i < this.cardsInhand.size(); i++) {\n\t\t\t\tCard c1 = this.cardsInhand.get(i);\n\t\t\t\tif (c1.getValue() < c.getValue() || (c1.getValue() == c.getValue() && c1.getSuit() < c.getSuit())) {\n\t\t\t\t\tpos = i;\n\t\t\t\t\tc = c1;\n\t\t\t\t}\n\t\t\t}\n\t\t\tthis.cardsInhand.remove(pos);\n\t\t\tnewHand.add(c);\n\t\t}\n\t\tthis.cardsInhand = newHand;\n\t}", "@Override\n\t\t\tpublic int compare(Sprite s1, Sprite s2) {\n\t\t\t\tif(!s1.sort)\n\t\t\t\t\treturn -1;\n\t\t\t\tif(!s2.sort)\n\t\t\t\t\treturn 1;\n\t\n\t\t\t\t\n\t\t if (s1.position.y+s1.height < s2.position.y+s2.height) {\n\t\t return -1;\n\t\t }else {\n\t\t return 1;\n\t\t }\n\t\t\t}", "private void sortScoreboard() {\n score.setSortType(TableColumn.SortType.DESCENDING);\n this.scoreboard.getSortOrder().add(score);\n score.setSortable(true);\n scoreboard.sort();\n }", "private void calcWinner(){\n //local class for finding ties\n class ScoreSorter implements Comparator<Player> {\n public int compare(Player p1, Player p2) {\n return p2.calcFinalScore() - p1.calcFinalScore();\n }\n }\n\n List<Player> winners = new ArrayList<Player>();\n int winningScore;\n\n // convert queue of players into List<Player> for determining winner(s)\n while (players.size() > 0) {\n winners.add(players.remove());\n } \n\n // scoreSorter's compare() should sort in descending order by calcFinalScore()\n // Arrays.sort(winnersPre, new scoreSorter()); // only works w/ normal arrays :(\n Collections.sort(winners, new ScoreSorter());\n\n // remove any players that don't have the winning score\n winningScore = winners.get(0).calcFinalScore();\n for (int i = winners.size()-1; i > 0; i--) { // remove non-ties starting from end, excluding 0\n if (winners.get(i).calcFinalScore() < winningScore) {\n winners.remove(i);\n }\n }\n\n // Announce winners\n boolean hideCalculatingWinnerPopUp = false;\n String winnersString = \"\";\n if (winners.size() > 1) {\n winnersString = \"There's a tie with \" + winners.get(0).calcFinalScore() + \" points. The following players tied: \";\n for (Player p : winners) {\n winnersString += p.getName() + \" \";\n }\n view.showPopUp(hideCalculatingWinnerPopUp, winnersString);\n } else {\n view.showPopUp(hideCalculatingWinnerPopUp, winners.get(0).getName() + \" wins with a score of \" + winners.get(0).calcFinalScore() + \" points! Clicking `ok` will end and close the game.\");\n }\n }", "public void sortHand(){\n\t\thand.sort(PlayingCard.PlayingCardComparator_ACEHIGH);\n\t}", "public static void main(String[] args) {\r\n\t\tint arr[] = {1,0,5,6,3,2,3,7,9,8,4};\r\n\t\tint temp;\r\n\t\t\r\n\t\tfor(int i = 0; i < 10; i ++) {\r\n\t\t\tfor(int j = 0; j < 10 - i; j ++) {\r\n\t\t\t\tif(arr[j] > arr[j+1]){\r\n\t\t\t\t\ttemp = arr[j+1];\r\n\t\t\t\t\tarr[j+1] = arr[j];\r\n\t\t\t\t\tarr[j] = temp;\r\n\t\t\t\t}\t\t\t\t\t\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0; i < 11; i ++) {\r\n\t\t\tSystem.out.println(arr[i]);\r\n\t\t}\r\n\t}", "private void sortDice() {\r\n for (int index = 0; index < dice.size(); index++) {\r\n for (int subIndex = index; subIndex < dice.size(); subIndex++) {\r\n if (dice.get(subIndex).compareTo((dice.get(index))) > 0) {\r\n final Integer temp = dice.get(index);\r\n dice.set(index, dice.get(subIndex));\r\n dice.set(subIndex, temp);\r\n }\r\n }\r\n }\r\n }", "void sort (int [] items) {\r\n\tint length = items.length;\r\n\tfor (int gap=length/2; gap>0; gap/=2) {\r\n\t\tfor (int i=gap; i<length; i++) {\r\n\t\t\tfor (int j=i-gap; j>=0; j-=gap) {\r\n\t\t \t\tif (items [j] <= items [j + gap]) {\r\n\t\t\t\t\tint swap = items [j];\r\n\t\t\t\t\titems [j] = items [j + gap];\r\n\t\t\t\t\titems [j + gap] = swap;\r\n\t\t \t\t}\r\n\t \t}\r\n\t }\r\n\t}\r\n}", "public void sortColors(int[] nums) {\n\n int min = 0;\n int max = nums.length -1;\n\n\n for(int i = 0 ; i <= max ; i++) { // i 是当前待移动下标\n if(nums[i] == 0 && i!=min){\n swap(i, min , nums);\n min++;\n i--;\n }\n if(nums[i] == 2 && i!=max){\n swap(i, max, nums);\n max--;\n i--;\n }\n }\n return;\n }", "public void sortByFuelConsumption(){\n for (int d = carPark.getCars().size() / 2; d >= 1; d /= 2)\n for (int i = d; i < carPark.getCars().size(); i++)\n for (int j = i; j >= d && carPark.getCars().get(j-d).getFuelConsumption() > carPark.getCars().get(j).getFuelConsumption(); j -= d) {\n Car temp = carPark.getCars().get(j);\n carPark.getCars().remove(j);\n carPark.getCars().add(j - 1, temp);\n }\n }", "public void sort() {\n compares = 0;\n shuttlesort((int[]) indexes.clone(), indexes, 0, indexes.length);\n }", "private void sort(int[] inputArray) {\n\t\tint temp;\n\t\tfor(int i=0;i<inputArray.length;i++) {\n\t\t\tfor(int j=0;j<inputArray.length-1-i;j++) {\n\t\t\t\tif(inputArray[j]>inputArray[j+1]) { // if(inputArray[j]<inputArray[j+1]) for descending\n\t\t\t\t\ttemp = inputArray[j];\n\t\t\t\t\tinputArray[j] = inputArray[j+1];\n\t\t\t\t\tinputArray[j+1] = temp;\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println(\"Pass: \" + (i+1));\n\t\t\tfor(int k=0;k<inputArray.length;k++) {\n\t\t\t\tSystem.out.print(inputArray[k] + \"\\t\");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\tSystem.out.println();\n\t\tSystem.out.println(\"Arry in Ascending order is:\");\n\t\tfor(int i=0;i<inputArray.length;i++) {\n\t\t\tSystem.out.print(inputArray[i] + \"\\t\");\n\t\t}\n\t}", "static void sort(int[] a)\n {\n for ( int j = 1; j<a.length; j++)\n {\n int i = j - 1;\n while(i>=0 && a[i]>a[i+1])\n {\n int temp = a[i];\n a[i] = a[i+1];\n a[i+1] = temp;\n i--;\n }\n }\n }", "public void sortSpeeds() {\n\n//\t\tSystem.out.println(\"BEGIN: SORT SPEEDS\");\n\t\tthis.printMoves();\n\n\t\tArrayList<Move> temp = new ArrayList<Move>();\n\t\tint i = 1;\n\t\tint x = 0;\n\t\tboolean y = true;\n\n\t\ttemp.add(niceMoves.get(0));\n\t\tint size = niceMoves.size();\n\n\t\twhile (i < niceMoves.size()) {\n\n//\t\t\tSystem.out.println(\"Reiterating.\");\n\t\t\ty = true;\n\n\t\t\twhile (y) {\n\n\t\t\t\t//System.out.println(\"I: \" + i + \" X: \" + x);\n\n\t\t\t\ttry {\n\n\t\t\t\t\tif (niceMoves.get(i).getSpeed() > temp.get(x).getCalcedSpeed()) {\n\n//\t\t\t\t\t\tSystem.out.println(\"Adding \" + niceMoves.get(i).getCaster() + \" to spot \" + x);\n\t\t\t\t\t\ttemp.add(x, niceMoves.get(i));\n\t\t\t\t\t\ty = false;\n\t\t\t\t\t}\n\t\t\t\t\t//X has cycled through temp, meaning nicemoves.i should be added to the end\n\t\t\t\t\t//The only way to check for this is to let it overflow lol\n\t\t\t\t} catch (Exception E) {\n//\t\t\t\t\tSystem.out.println(\"Adding \" + niceMoves.get(i).getCaster() + \" to spot \" + x);\n\t\t\t\t\ttemp.add(x, niceMoves.get(i));\n\t\t\t\t\ty = false;\n\n\t\t\t\t}\n\n\t\t\t\tx += 1;\n\t\t\t}\n\n\t\t\ti += 1;\n\t\t\tx = 0;\n\t\t}\n\n\t\tniceMoves = temp;\n\n//\t\tSystem.out.println();\n//\t\tSystem.out.println(\"Sorting Complete! New Order: \");\n//\t\tthis.printMoves();\n\t\t//end of sort speeds\n\t}", "public synchronized ColumnSort getDefaultSort() {\r\n return f_title.equals(SUMMARY_COLUMN) ? ColumnSort.SORT_UP : ColumnSort.UNSORTED;\r\n }", "private void sortPopulation() {\n println(\"sortPopulation()\", 1);\n //population_size = population.size();\n for(int i = 1; i < population_size; i++) {\n \n //current is the one we're going to put in the right place\n Individual current = population[i];\n double current_fitness = current.getFitness();\n \n //Test to see if current's fitness is better than the previous one; if so, then it's out of order\n double last_fitness = population[i - 1].getFitness();\n \n //if(current_fitness < last_fitness) {\n if(population[i].isLessThan(population[i - 1])) {\n \n println(population[i].getFitness() + \" < \" + population[i - 1].getFitness(), 5);\n //Now, search from the beginning to see where it goes\n int j = 0;\n //System.out.print(\"j = \" + Integer.toString(j) + \" \");\n //while(current_fitness >= population[j].getFitness() && j < population_size - 1) {\n while(population[j].isLessThanOrEqual(population[i]) && j < population_size - 1) {\n j++;\n //System.out.print(\"j = \" + Integer.toString(j) + \" \");\n }\n //We've found the correct place\n Individual temp = new Individual();\n temp = population[i];\n for(int q = i; q > j; q--) {\n population[q] = population[q - 1];\n //System.out.print(\"q = \" + Integer.toString(q) + \" \");\n }\n population[j] = temp;\n }\n }\n }", "private static int leftBump(int[] a) {\n for (int i = 2; i <= a.length; i++) {\n if (a[i] < a[i - 1]) {\n return i - 1;\n }\n }\n return -1;\n }", "public int compareTo(Object o) {\n if (o instanceof HighScore) {\n if (((HighScore) o).score < score)\n return -1;\n else if (((HighScore) o).score == score)\n return 0;\n else\n return 1;\n }\n return -1;\n }", "public static void testSort() {\n\t\tint[] test = {-1,-2,-3,4,1,3,0,3,-2,1,-2,2,-1,1,-5,4,-3};\n\t\tArrays.sort(test);\n\t\tfor (int e : test) {\n\t\t\tSystem.out.print(e + \", \");\n\t\t}\n\t}" ]
[ "0.65203846", "0.63473254", "0.6268759", "0.61292666", "0.6126006", "0.59853315", "0.59782207", "0.5961426", "0.593894", "0.58888906", "0.58739036", "0.579205", "0.57827", "0.5753479", "0.5753018", "0.5727485", "0.5712451", "0.57047635", "0.5701688", "0.56943107", "0.5654163", "0.5607477", "0.5606605", "0.5606537", "0.55879605", "0.5568961", "0.55685043", "0.55639684", "0.5547893", "0.553876", "0.5533092", "0.55266213", "0.5525026", "0.5507305", "0.54913217", "0.54913074", "0.54809314", "0.5471388", "0.54709935", "0.5468382", "0.54497564", "0.54486406", "0.5427865", "0.5426892", "0.54222965", "0.5415953", "0.5404392", "0.538597", "0.5378691", "0.53783673", "0.5376318", "0.5370196", "0.5368341", "0.5364564", "0.535478", "0.5351773", "0.5345532", "0.5341726", "0.533016", "0.53228426", "0.5316382", "0.5300198", "0.5297747", "0.52775514", "0.527659", "0.52723676", "0.5266087", "0.5262488", "0.5258116", "0.5258064", "0.5249277", "0.52449083", "0.5243057", "0.524264", "0.52340066", "0.5232774", "0.5229188", "0.5225039", "0.5223634", "0.5212691", "0.5210754", "0.5209914", "0.520807", "0.52030134", "0.5202626", "0.5197995", "0.5187546", "0.51790875", "0.5175315", "0.51751125", "0.51666784", "0.5158716", "0.51538646", "0.5152668", "0.51515573", "0.5144861", "0.51394457", "0.51326686", "0.5123906", "0.51235205", "0.5123102" ]
0.0
-1
called on main thread
@Override public void onTrimMemory(int level) { if (level == ComponentCallbacks2.TRIM_MEMORY_UI_HIDDEN) { // Log.d(TAG, "APP in BACKGROUND"); Timber.i("APP in BACKGROUND"); status = ApplicationBackgroundStatus.BACKGROUND; sendNewStatus(); } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\t\tpublic void run() {\n\t\t\t\t\r\n\t\t\t}", "@Override\r\n\t\tprotected void run() {\n\t\t\t\r\n\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n\t\t\tpublic void run() {\n\n\t\t\t}", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "public void run() {\n\t\t\t\t\t\t}", "@Override\r\n\tpublic void run() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void run() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void run() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void run() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void run() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void run() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void run() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void run() {\n\t\t\r\n\t}", "@Override\r\n\tpublic void run() {\n\t\t\r\n\t}", "@Override\r\n\t\t\t\tpublic void run() {\n\r\n\t\t\t\t}", "@Override\r\n\t\t\t\tpublic void run() {\n\r\n\t\t\t\t}", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run()\n {\n }", "@Override\n public void run()\n {\n }", "@Override\n public void run() {\n }", "@Override\n\t\tpublic void run() {\n\t\t\t\n\t\t}", "@Override\n\t\tpublic void run() {\n\t\t\t\n\t\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t}", "@Override\n\t\tpublic void run() {\n\n\t\t}", "public void run() {\n\t\t\r\n\t}", "public void run() {\n\t\t\r\n\t}", "@Override\n\tpublic void run() {\n\t\t\n\t\t\t\t\t\t\n\t}", "protected void run() {\r\n\t\t//\r\n\t}", "@Override\r\n public void run() {}", "@Override\r\n\tpublic void run() {\n\t}", "@Override\r\n\tpublic void run() {\n\t}", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n\tpublic void run()\n\t{\n\n\t}", "@Override\r\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n \t\n }", "@Override\n\tpublic void run() {\n\n\t}", "@Override\n\tpublic void run() {\n\n\t}", "@Override\n\tpublic void run() {\n\n\t}", "@Override\n\tpublic void run() {\n\n\t}", "@Override\n\tpublic void run() {\n\n\t}", "public void run() {\n\t\t\t\t\n\t\t\t}", "@Override\n public void run() {\n\n }", "@Override\n public void run() {\n\n }", "@Override\n public void run() {\n\n }", "@Override\n public void run() {\n\n }", "@Override\n public void run() {\n\n }", "@Override\n public void run() {\n\n }", "@Override\n public void run(){\n }", "@Override\r\n\tpublic void run() {\n\r\n\t}", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n\tpublic void run()\n\t{\n\t}", "@Override\r\n\tpublic void runn() {\n\t\t\r\n\t}", "@Override\n\tpublic void run() {\n\t}", "public void run() {\n\t\t\n\t}", "public void run() {\n }", "public void run() {\n\t\t}", "public void run() {\n\t\t}", "public void run() {\n\t\t}", "public void run() {\n }", "public void run() {\n }", "public void run() {\n }", "@Override\n public void run() {\n }", "@Override\n public void run() {\n }" ]
[ "0.73365766", "0.73365766", "0.72773236", "0.7254053", "0.7254053", "0.7124422", "0.7068514", "0.7068514", "0.70667046", "0.70667046", "0.70667046", "0.7065162", "0.7065162", "0.7065162", "0.7065162", "0.7065162", "0.7065162", "0.7065162", "0.7063541", "0.7062392", "0.7062392", "0.7062392", "0.7062392", "0.7062392", "0.7062392", "0.7062392", "0.7062392", "0.7062392", "0.7058395", "0.7058395", "0.70260936", "0.70260936", "0.7021116", "0.7021116", "0.69594", "0.6954606", "0.6954606", "0.69485164", "0.69485164", "0.69485164", "0.69485164", "0.69485164", "0.69485164", "0.69485164", "0.69485164", "0.69485164", "0.69485164", "0.69485164", "0.69485164", "0.69485164", "0.69485164", "0.69485164", "0.69485164", "0.69295156", "0.69281393", "0.69281393", "0.68848187", "0.6881594", "0.6881096", "0.6859465", "0.6859465", "0.6825589", "0.6825589", "0.6825589", "0.6825589", "0.6825589", "0.6825589", "0.6825589", "0.682034", "0.68084615", "0.6801133", "0.6800435", "0.6795852", "0.6795852", "0.6795852", "0.6795852", "0.6795852", "0.67919827", "0.6780882", "0.6780882", "0.6780882", "0.6780882", "0.6780882", "0.6780882", "0.6776558", "0.6762196", "0.6746909", "0.6746909", "0.67324436", "0.67295784", "0.6721092", "0.67199326", "0.66972727", "0.6696336", "0.6696336", "0.6696336", "0.66780525", "0.66780525", "0.6666597", "0.6659838", "0.6659838" ]
0.0
-1
Performs the alignment. Abstract.
public abstract void doAlignment(String sq1, String sq2);
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void alignLocation();", "public void align( Alignment alignment, Properties param ) {\n\t\t// For the classes : no optmisation cartesian product !\n\t\tfor ( OWLEntity cl1 : ontology1.getClassesInSignature()){\n\t\t\tfor ( OWLEntity cl2: ontology2.getClassesInSignature() ){\n\t\t\t\tdouble confidence = match(cl1,cl2);\n\t\t\t\tif (confidence > 0) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\taddAlignCell(cl1.getIRI().toURI(),cl2.getIRI().toURI(),\"=\", confidence);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tSystem.out.println(e.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\tfor (OWLEntity cl1:getDataProperties(ontology1)){\n\t\t\tfor (OWLEntity cl2:getDataProperties(ontology2)){\n\t\t\t\tdouble confidence = match(cl1,cl2);\n\t\t\t\tif (confidence > 0) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\taddAlignCell(cl1.getIRI().toURI(),cl2.getIRI().toURI(),\"=\", confidence);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tSystem.out.println(e.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfor (OWLEntity cl1:getObjectProperties(ontology1)){\n\t\t\tfor (OWLEntity cl2:getObjectProperties(ontology2)){\n\t\t\t\tdouble confidence = match(cl1,cl2);\n\t\t\t\tif (confidence > 0) {\n\t\t\t\t\ttry {\n\t\t\t\t\t\taddAlignCell(cl1.getIRI().toURI(),cl2.getIRI().toURI(),\"=\", confidence);\n\t\t\t\t\t} catch (Exception e) {\n\t\t\t\t\t\tSystem.out.println(e.toString());\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t}\n\n\n\n\n\n\n\n\n\t}", "public void run() {\n\n\n\t\tStructurePairAligner aligner = new StructurePairAligner();\n\t\taligner.setDebug(true);\n\t\ttry {\n\t\t\taligner.align(structure1,structure2);\n\t\t} catch (StructureException e){\n\t\t\tlogger.warning(e.getMessage());\n\n\t\t}\n\n\n\n\t\tAlternativeAlignment[] aligs = aligner.getAlignments();\n\t\t//cluster similar results together \n\t\tClusterAltAligs.cluster(aligs);\n\t\tshowAlignment(aligner,aligs);\n\n\t\t//logger.info(\"done!\");\n\n\t\tparent.notifyCalcFinished();\n\n\t}", "public void setAlignment(int align)\n {\n this.align = align;\n }", "public void setAlignment(int paramInt) {\n/* */ this.newAlign = paramInt;\n/* */ switch (paramInt) {\n/* */ case 3:\n/* */ this.align = 0;\n/* */ return;\n/* */ case 4:\n/* */ this.align = 2;\n/* */ return;\n/* */ } \n/* */ this.align = paramInt;\n/* */ }", "int align();", "@Override\n public void align(@NonNull PbVnAlignment alignment) {\n boolean noAgentiveA0 = alignment.proposition().predicate().ancestors(true).stream()\n .allMatch(s -> s.roles().stream()\n .map(r -> ThematicRoleType.fromString(r.type()).orElse(ThematicRoleType.NONE))\n .noneMatch(ThematicRoleType::isAgentive));\n\n for (PropBankPhrase phrase : alignment.sourcePhrases(false)) {\n List<NounPhrase> unaligned = alignment.targetPhrases(false).stream()\n .filter(i -> i instanceof NounPhrase)\n .map(i -> ((NounPhrase) i))\n .collect(Collectors.toList());\n if (phrase.getNumber() == ArgNumber.A0) {\n // TODO: seems like a hack\n if (alignment.proposition().predicate().verbNetId().classId().startsWith(\"51\") && noAgentiveA0) {\n for (NounPhrase unalignedPhrase : unaligned) {\n if (unalignedPhrase.thematicRoleType() == ThematicRoleType.THEME) {\n alignment.add(phrase, unalignedPhrase);\n break;\n }\n }\n } else {\n for (NounPhrase unalignedPhrase : unaligned) {\n if (EnumSet.of(ThematicRoleType.AGENT, ThematicRoleType.CAUSER,\n ThematicRoleType.STIMULUS, ThematicRoleType.PIVOT)\n .contains(unalignedPhrase.thematicRoleType())) {\n alignment.add(phrase, unalignedPhrase);\n break;\n }\n }\n }\n } else if (phrase.getNumber() == ArgNumber.A1) {\n for (NounPhrase unalignedPhrase : unaligned) {\n if (unalignedPhrase.thematicRoleType() == ThematicRoleType.THEME\n || unalignedPhrase.thematicRoleType() == ThematicRoleType.PATIENT) {\n alignment.add(phrase, unalignedPhrase);\n break;\n }\n }\n } else if (phrase.getNumber() == ArgNumber.A3) {\n if (containsNumber(phrase)) {\n continue;\n }\n for (NounPhrase unalignedPhrase : unaligned) {\n if (unalignedPhrase.thematicRoleType().isStartingPoint()) {\n alignment.add(phrase, unalignedPhrase);\n break;\n }\n }\n } else if (phrase.getNumber() == ArgNumber.A4) {\n if (containsNumber(phrase)) {\n continue;\n }\n for (NounPhrase unalignedPhrase : unaligned) {\n if (unalignedPhrase.thematicRoleType().isEndingPoint()) {\n alignment.add(phrase, unalignedPhrase);\n break;\n }\n }\n }\n\n\n }\n }", "public int getAlignment() {\n/* */ return this.newAlign;\n/* */ }", "public void prepareAlignment(String sq1, String sq2) {\n if(F == null) {\n this.n = sq1.length(); this.m = sq2.length();\n this.seq1 = strip(sq1); this.seq2 = strip(sq2);\n F = new float[3][n+1][m+1];\n B = new TracebackAffine[3][n+1][m+1];\n for(int k = 0; k < 3; k++) {\n for(int i = 0; i < n+1; i ++) {\n for(int j = 0; j < m+1; j++)\n B[k][i][j] = new TracebackAffine(0,0,0);\n }\n }\n }\n\n //alignment already been run and existing matrix is big enough to reuse.\n else if(seq1.length() <= n && seq2.length() <= m) {\n this.n = sq1.length(); this.m = sq2.length();\n this.seq1 = strip(sq1); this.seq2 = strip(sq2);\n }\n\n //alignment already been run but matrices not big enough for new alignment.\n //create all new matrices.\n else {\n this.n = sq1.length(); this.m = sq2.length();\n this.seq1 = strip(sq1); this.seq2 = strip(sq2);\n F = new float[3][n+1][m+1];\n B = new TracebackAffine[3][n+1][m+1];\n for(int k = 0; k < 3; k++) {\n for(int i = 0; i < n+1; i ++) {\n for(int j = 0; j < m+1; j++)\n B[k][i][j] = new TracebackAffine(0,0,0);\n }\n }\n }\n }", "public void setAlignmentX(AlignX anAlignX) { }", "public void mergeAlignment() {\n \n SAMFileReader unmappedSam = null;\n if (this.unmappedBamFile != null) {\n unmappedSam = new SAMFileReader(IoUtil.openFileForReading(this.unmappedBamFile));\n }\n \n // Write the read groups to the header\n if (unmappedSam != null) header.setReadGroups(unmappedSam.getFileHeader().getReadGroups());\n \n int aligned = 0;\n int unmapped = 0;\n \n final PeekableIterator<SAMRecord> alignedIterator = \n new PeekableIterator(getQuerynameSortedAlignedRecords());\n final SortingCollection<SAMRecord> alignmentSorted = SortingCollection.newInstance(\n SAMRecord.class, new BAMRecordCodec(header), new SAMRecordCoordinateComparator(),\n MAX_RECORDS_IN_RAM);\n final ClippedPairFixer pairFixer = new ClippedPairFixer(alignmentSorted, header);\n \n final CloseableIterator<SAMRecord> unmappedIterator = unmappedSam.iterator();\n SAMRecord nextAligned = alignedIterator.hasNext() ? alignedIterator.next() : null;\n SAMRecord lastAligned = null;\n \n final UnmappedReadSorter unmappedSorter = new UnmappedReadSorter(unmappedIterator);\n while (unmappedSorter.hasNext()) {\n final SAMRecord rec = unmappedSorter.next();\n rec.setReadName(cleanReadName(rec.getReadName()));\n if (nextAligned != null && rec.getReadName().compareTo(nextAligned.getReadName()) > 0) {\n throw new PicardException(\"Aligned Record iterator (\" + nextAligned.getReadName() +\n \") is behind the umapped reads (\" + rec.getReadName() + \")\");\n }\n rec.setHeader(header);\n \n if (isMatch(rec, nextAligned)) {\n if (!ignoreAlignment(nextAligned)) {\n setValuesFromAlignment(rec, nextAligned);\n if (programRecord != null) {\n rec.setAttribute(ReservedTagConstants.PROGRAM_GROUP_ID,\n programRecord.getProgramGroupId());\n }\n aligned++;\n }\n nextAligned = alignedIterator.hasNext() ? alignedIterator.next() : null;\n }\n else {\n unmapped++;\n }\n \n // Add it if either the read or its mate are mapped, unless we are adding aligned reads only\n final boolean eitherReadMapped = !rec.getReadUnmappedFlag() || (rec.getReadPairedFlag() && !rec.getMateUnmappedFlag());\n \n if (eitherReadMapped || !alignedReadsOnly) {\n pairFixer.add(rec);\n }\n }\n unmappedIterator.close();\n alignedIterator.close();\n \n final SAMFileWriter writer =\n new SAMFileWriterFactory().makeBAMWriter(header, true, this.targetBamFile);\n int count = 0;\n CloseableIterator<SAMRecord> it = alignmentSorted.iterator();\n while (it.hasNext()) {\n SAMRecord rec = it.next();\n if (!rec.getReadUnmappedFlag()) {\n if (refSeq != null) {\n byte referenceBases[] = refSeq.get(rec.getReferenceIndex()).getBases();\n rec.setAttribute(SAMTag.NM.name(),\n SequenceUtil.calculateSamNmTag(rec, referenceBases, 0, bisulfiteSequence));\n rec.setAttribute(SAMTag.UQ.name(),\n SequenceUtil.sumQualitiesOfMismatches(rec, referenceBases, 0, bisulfiteSequence));\n }\n }\n writer.addAlignment(rec);\n if (++count % 1000000 == 0) {\n log.info(count + \" SAMRecords written to \" + targetBamFile.getName());\n }\n }\n writer.close();\n \n \n log.info(\"Wrote \" + aligned + \" alignment records and \" + unmapped + \" unmapped reads.\");\n }", "public void setAlign(String align) {\n this.align = align;\n }", "void setAlignment(Alignment alignment) {\n this.alignment = alignment;\n }", "public int getAlignment()\n {\n return align;\n }", "public int getAlignment() {\r\n return Alignment;\r\n }", "public int getAlignment() {\r\n return Alignment;\r\n }", "public void setTextAlign(TEXT_ALIGN align);", "int getAlignValue();", "public void alignment() {\n\t\toptArray = new int[lenA+1][lenB+1];\n\n\t\t//Initializing the array:\n\t\toptArray[0][0] = 0;\n\t\tfor(int i=1;i<=lenA;i++) {\n\t\t\toptArray[i][0] = i*g;\n\t\t}\n\t\tfor(int j=1;j<=lenB;j++) {\n\t\t\toptArray[0][j] = j*g;\n\t\t}\n\n\t\t//Starting the 'recurrsion':\n\t\tint p;\n\t\tString pair;\n\t\tfor(int i=1;i<=lenA;i++) {\n\t\t\tfor(int j=1;j<=lenB;j++) {\n\t\t\t\tpair = wordA.charAt(i-1) + \" \" + wordB.charAt(j-1);\n\t\t\t\tp = penaltyMap.get(pair);\n\t\t\t\toptArray[i][j] = min(p+optArray[i-1][j-1], g+optArray[i-1][j], g+optArray[i][j-1]);\n\t\t\t}\n\t\t}\n\t}", "@Test\n \tpublic void testSimpleAlignments()\n \t{\n \t\tSystem.out.format(\"\\n\\n-------testSimpleAlignments() ------------------------\\n\");\n \t\tPseudoDamerauLevenshtein DL = new PseudoDamerauLevenshtein();\n \t\t//DL.init(\"AB\", \"CD\", false, true);\n \t\t//DL.init(\"ACD\", \"ADE\", false, true);\n \t\t//DL.init(\"AB\", \"XAB\", false, true);\n \t\t//DL.init(\"AB\", \"XAB\", true, true);\n \t\t//DL.init(\"fit\", \"xfity\", true, true);\n \t\t//DL.init(\"fit\", \"xxfityyy\", true, true);\n \t\t//DL.init(\"ABCD\", \"BACD\", false, true);\n \t\t//DL.init(\"fit\", \"xfityfitz\", true, true);\n \t\t//DL.init(\"fit\", \"xfitfitz\", true, true);\n \t\t//DL.init(\"fit\", \"xfitfitfitfitz\", true, true);\n \t\t//DL.init(\"setup\", \"set up\", true, true);\n \t\t//DL.init(\"set up\", \"setup\", true, true);\n \t\t//DL.init(\"hobbies\", \"hobbys\", true, true);\n \t\t//DL.init(\"hobbys\", \"hobbies\", true, true);\n \t\t//DL.init(\"thee\", \"The x y the jdlsjds salds\", true, false);\n \t\tDL.init(\"Bismark\", \"... Bismarck lived...Bismarck reigned...\", true, true);\n \t\t//DL.init(\"refugee\", \"refuge x y\", true, true);\n \t\t//StringMatchingStrategy.APPROXIMATE_MATCHING_MINPROB\n \t\tList<PseudoDamerauLevenshtein.Alignment> alis = DL.computeAlignments(0.65);\n \t\tSystem.out.format(\"----------result of testSimpleAlignments() ---------------------\\n\\n\");\n \t\tfor (Alignment ali: alis)\n \t\t{\n \t\t\tali.print();\n \t\t}\n \t}", "TableSectionBuilder align(String align);", "public Alignment()\n\t{\n\t}", "@Override\r\n\tpublic int getAlignmentSize() {\r\n\t\treturn getSize();\r\n\t}", "Alignment getAlignment() {\n return alignment;\n }", "private static interface AlignmentAction {\n public void alignFurniture(AlignedPieceOfFurniture [] alignedFurniture, \n HomePieceOfFurniture leadPiece);\n }", "public void format(List<Alignment> alignmentList);", "public String getAlign() {\n return align;\n }", "public void alignF() {\r\n\t\tfor (int x = 1; x <= seq1.length; x++) {\r\n\t\t\tfor (int y = 1; y <= seq2.length; y++) {\r\n\t\t\t\tdouble w1 = profile.getGextend()\r\n\t\t\t\t\t\t* profile.getGapExtend()[struct2[y - 1]]\r\n\t\t\t\t\t\t+ profile.getGopen()\r\n\t\t\t\t\t\t* profile.getGapInsert()[struct2[y - 1]];\r\n\t\t\t\tinsF[x][y] = Math.max(scoreF[x - 1][y] + w1, insF[x - 1][y]\r\n\t\t\t\t\t\t+ profile.getGextend()\r\n\t\t\t\t\t\t* profile.getGapExtend()[struct2[y - 1]]);\r\n\t\t\t\tdelF[x][y] = Math.max(scoreF[x][y - 1] + w1, delF[x][y - 1]\r\n\t\t\t\t\t\t+ profile.getGextend()\r\n\t\t\t\t\t\t* profile.getGapExtend()[struct2[y - 1]]);\r\n\t\t\t\tdouble temp = scoreF[x - 1][y - 1] + match(x, y);\r\n\t\t\t\tscoreF[x][y] = Math.max(temp, Math.max(insF[x][y], delF[x][y]));\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void alignSelectedFurniture(final AlignmentAction alignmentAction) {\n final List<HomePieceOfFurniture> selectedFurniture = getMovableSelectedFurniture();\n if (selectedFurniture.size() >= 2) {\n final List<Selectable> oldSelection = this.home.getSelectedItems();\n final HomePieceOfFurniture leadPiece = this.leadSelectedPieceOfFurniture;\n final AlignedPieceOfFurniture [] alignedFurniture = \n AlignedPieceOfFurniture.getAlignedFurniture(selectedFurniture, leadPiece);\n this.home.setSelectedItems(selectedFurniture);\n alignmentAction.alignFurniture(alignedFurniture, leadPiece);\n if (this.undoSupport != null) {\n UndoableEdit undoableEdit = new AbstractUndoableEdit() {\n @Override\n public void undo() throws CannotUndoException {\n super.undo();\n undoAlignFurniture(alignedFurniture); \n home.setSelectedItems(oldSelection);\n }\n \n @Override\n public void redo() throws CannotRedoException {\n super.redo();\n home.setSelectedItems(selectedFurniture);\n alignmentAction.alignFurniture(alignedFurniture, leadPiece);\n }\n \n @Override\n public String getPresentationName() {\n return preferences.getLocalizedString(FurnitureController.class, \"undoAlignName\");\n }\n };\n this.undoSupport.postEdit(undoableEdit);\n }\n }\n }", "public final String getAlignAttribute() {\n return getAttributeValue(\"align\");\n }", "public Alignment getAlignment() {\n return alignment;\n }", "public void defenceAlign() {\n\t\tdouble angle = angleToX();\n\t\tdouble angleSign = Math.signum(angle);\n\t\tdouble unsignedAngle = Math.abs(angle);\n\t\t\n\t\tdouble toRotate = angleSign * (90 - unsignedAngle);\n//\t\tSystem.out.printf(\"Rotate by: %f.2\\n\", toRotate);\n\t\tSystem.out.println(CommandQueue.commandQueue2D.size());\n\t\trotate(toRotate);\n\t}", "public void setHorizontalAlignment( short align )\n {\n this.halign = align;\n }", "public void handleCellAlign( ICellContent cell )\n \t{\n \t\t/*\n \t\t * in fireforx, the text-align is used by text item, it defines the\n \t\t * alignment of the content in the text item instead of the text item in\n \t\t * its container. we can put a text item with a width into the cell to\n \t\t * see the difference. We must use computeStyle as the text-align is not\n \t\t * inherited across the table.\n \t\t */\n \t\tIStyle cellStyle = cell.getComputedStyle( );\n \t\tCSSValue vAlign = cellStyle.getProperty( IStyle.STYLE_VERTICAL_ALIGN );\n \t\tif ( null == vAlign || IStyle.BASELINE_VALUE == vAlign )\n \t\t{\n \t\t\t// The default vertical-align value of cell is top.\n \t\t\tvAlign = IStyle.TOP_VALUE;\n \t\t}\n \t\twriter.attribute( HTMLTags.ATTR_VALIGN, vAlign.getCssText( ) );\n \t\thandleHorizontalAlign( cellStyle );\n \t}", "public void printAlignment(SWGAlignment alignment){\n\t\t\tString \torigSeq1 = alignment.getOriginalSequence1().toString(),\n\t\t\t\t\torigSeq2 = alignment.getOriginalSequence2().toString(),\n\t\t\t\t\talnSeq1 = new String(alignment.getSequence1()),\n\t\t\t\t\talnSeq2 = new String(alignment.getSequence2());\n\t\t\tint \tstart1 = alignment.getStart1(),\n\t\t\t\t\tstart2 = alignment.getStart2(),\n\t\t\t\t\tgap1 = alignment.getGaps1(),\n\t\t\t\t\tgap2 = alignment.getGaps2();\n\t\t\t\n\t\t\tString seq1, seq2, mark;\n\t\t\tif(start1>=start2){\n\t\t\t\tseq1=origSeq1.substring(0, start1) + alnSeq1 + origSeq1.substring(start1+alnSeq1.length()-gap1);\n\t\t\t\tString \tseq2Filler = start1==start2?\"\":String.format(\"%\"+(start1-start2)+\"s\", \"\"),\n\t\t\t\t\t\tmarkFiller = start1==0?\"\":String.format(\"%\"+start1+\"s\", \"\");\n\t\t\t\tseq2= seq2Filler + origSeq2.substring(0, start2) + alnSeq2 + origSeq2.substring(start2+alnSeq2.length()-gap2);\n\t\t\t\tmark= markFiller+String.valueOf(alignment.getMarkupLine());\n\t\t\t}else{\n\t\t\t\tseq2=origSeq2.substring(0, start2) + alnSeq2 + origSeq2.substring(start2+alnSeq2.length()-gap2);\n\t\t\t\tString \tmarkFiller = start2==0?\"\":String.format(\"%\"+start2+\"s\", \"\");\n\t\t\t\tseq1=String.format(\"%\"+(start2-start1)+\"s\", \"\") + origSeq1.substring(0, start1) + alnSeq1 + origSeq1.substring(start1+alnSeq1.length()-gap1);\n\t\t\t\tmark=markFiller+String.valueOf(alignment.getMarkupLine());\n\t\t\t}\n\t\t\tSystem.out.println(alignment.getSummary());\n\t\t\tSystem.out.println(seq1);\n\t\t\tSystem.out.println(mark);\n\t\t\tSystem.out.println(seq2);\n\t\t}", "public void alignColumns() {\n\t\tif ( isReferenceToPrimaryKey() ) alignColumns(referencedTable);\n\t}", "public void align() {\n // get min values\n int x = Integer.MAX_VALUE;\n int y = x;\n for (int i = 0; i < nodeCount; i++) {\n if (xs[i] < x)\n x = xs[i];\n if (ys[i] < y)\n y = ys[i];\n }\n for (int i = 0; i < buildingCount; i++) {\n if (buildingXs[i] < x)\n x = buildingXs[i];\n if (buildingYs[i] < y)\n y = buildingYs[i];\n for (int j = 0; j < buildingApi[i].length; j++) {\n if (buildingApi[i][j][0] < x)\n x = buildingApi[i][j][0];\n if (buildingApi[i][j][1] < y)\n y = buildingApi[i][j][1];\n }\n }\n // now alter them all\n int dx = x - 1;\n int dy = y - 1;\n System.out.println(\"Shifting by (\" + (-dx) + \",\" + (-dy) + \").\");\n for (int i = 0; i < nodeCount; i++) {\n xs[i] -= dx;\n ys[i] -= dy;\n }\n for (int i = 0; i < buildingCount; i++) {\n buildingXs[i] -= dx;\n buildingYs[i] -= dy;\n for (int j = 0; j < buildingApi[i].length; j++) {\n buildingApi[i][j][0] -= dx;\n buildingApi[i][j][1] -= dy;\n }\n }\n }", "public boolean getAligning() {\n return aligning_;\n }", "public void setAlignment(@Nullable Layout.Alignment alignment) {\n if (mAlignment == alignment) {\n return;\n }\n mAlignment = alignment;\n mNeedUpdateLayout = true;\n }", "public void setAlignedSequence( Sequence alseq ) {\n\t\tthis.alignedsequence = alseq;\n\t\tif(alseq.id == null) alseq.id = id;\n\t\tif(seq != null) alseq.name = seq.getGroup();\n\t\tif(alseq.group == null) alseq.group = group;\n\t}", "public HBuilder setAlign(String align) \r\n\t\t{\r\n\t\t\th.align = align;\r\n\t\t\treturn this;\r\n\t\t}", "public static void main(String[] args) {\n\t\t\n\t\t List<Result> outputK = new ArrayList<Result>();\n\n\t\t\t\n\t\t\tint alignment_type = Integer.parseInt(args[0]);\n\t\t\t\n\t\t\tif(alignment_type==1){\n\t\t\t\t\n\t\t\t\tGlobalAlignment gb = new GlobalAlignment();\n\n\t\t\t\toutputK = \tgb.PerformGlobalAlignment(args[1],args[2],args[3],args[4],Integer.parseInt(args[5]),Integer.parseInt(args[6]));\n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\tfor(int i=0;i<outputK.size();i++){\n\t\t\t\t\tResult r = outputK.get(i);\n\t\t\t\t\t\n\t\t\t\t\tSystem.out.println(r.score);\n \tSystem.out.println(\"id1 \"+r.id1+\" \"+r.startpos1+\" \"+r.seq1);\n\t\t\t\t\tSystem.out.println(\"id2 \"+r.id2+\" \"+r.startpos2+\" \"+r.seq2);\n//\t\t\t\t\t\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t}else if(alignment_type==2){\n\t\t\t\t\n\t\t\t\tLocalAlignment loc = new LocalAlignment();\n\t\t\t\toutputK = \tloc.PerformLocalAlignment(args[1],args[2],args[3],args[4],Integer.parseInt(args[5]),Integer.parseInt(args[6]));\n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\tfor(int i=0;i<outputK.size();i++){\n\t\t\t\t\tResult r = outputK.get(i);\n\n\t\t\t\t\tSystem.out.println(r.score);\n System.out.println(\"id1 \"+r.id1+\" \"+r.startpos1+\" \"+r.seq1);\n\t\t\t\t\tSystem.out.println(\"id2 \"+r.id2+\" \"+r.startpos2+\" \"+r.seq2);\n\n\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}else if(alignment_type==3){\n\t\t\t\t\n\t\t \tDoveTail dt = new DoveTail();\t\t\n\t\t\t\toutputK = \tdt.PerformDoveTailAlignment(args[1],args[2],args[3],args[4],Integer.parseInt(args[5]),Integer.parseInt(args[6]));\n\t\t\t\t\n \n\t\t\t\t\n\t\t\t\tfor(int i=0;i<outputK.size();i++){\n\t\t\t\t\tResult r = outputK.get(i);\n\n\t\t\t\t\tSystem.out.println(r.score);\n System.out.println(\"id1 \"+r.id1+\" \"+r.startpos1+\" \"+r.seq1);\n\t\t\t\t\tSystem.out.println(\"id2 \"+r.id2+\" \"+r.startpos2+\" \"+r.seq2);\n\n\t\t\t\t}\n\t\t\t\t\n\n\t\t\t}else{\n\t\t\t\tSystem.out.println(\"Enter 1,2 or 3\");\n\t\t\t}\n\t\t\n\t\n\t}", "public boolean getAligning() {\n return aligning_;\n }", "public void setAlignment(Position alignment)\n {\n int align = alignment.value;\n JLabel jl = getComponent();\n if ((align&NORTH.value) != 0)\n jl.setVerticalAlignment(SwingConstants.TOP);\n else if ((align&SOUTH.value) != 0)\n jl.setVerticalAlignment(SwingConstants.BOTTOM);\n else\n jl.setVerticalAlignment(SwingConstants.CENTER);\n if ((align&EAST.value) != 0)\n jl.setHorizontalAlignment(SwingConstants.RIGHT);\n else if ((align&WEST.value) != 0)\n jl.setHorizontalAlignment(SwingConstants.LEFT);\n else\n jl.setHorizontalAlignment(SwingConstants.CENTER);\n invalidateSize();\n }", "public void alignCenter() {\n\t\ttop.middle();\n\t}", "public final int align() throws RecognitionException {\r\n int align = 0;\r\n\r\n\r\n Token INTEGER38=null;\r\n\r\n try {\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:180:5: ( ALIGN INTEGER )\r\n // D:\\\\workspace\\\\s\\\\JLLVM_b\\\\src\\\\cn\\\\edu\\\\sjtu\\\\jllvm\\\\VMCore\\\\Parser\\\\LLVM.g:180:7: ALIGN INTEGER\r\n {\r\n match(input,ALIGN,FOLLOW_ALIGN_in_align874); \r\n\r\n INTEGER38=(Token)match(input,INTEGER,FOLLOW_INTEGER_in_align876); \r\n\r\n align = Integer.parseInt((INTEGER38!=null?INTEGER38.getText():null));\r\n\r\n }\r\n\r\n }\r\n catch (RecognitionException re) {\r\n reportError(re);\r\n recover(input,re);\r\n }\r\n\r\n finally {\r\n \t// do for sure before leaving\r\n }\r\n return align;\r\n }", "public void setAlignmentY(AlignY anAlignX) { }", "public void setAlignment(int alignment) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"0d789012-3f1e-4d4b-b335-4dd81825c6f2\");\n if ((alignment & (alignment - 1)) != 0 || alignment > 0xffff) {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"252dca05-27a1-4fd3-bd09-346445020cc4\");\n throw new IllegalArgumentException(\"Invalid value for alignment, must be power of two and no bigger than \" + 0xffff + \" but is \" + alignment);\n }\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"a3b0ab7b-7be3-4be3-89fd-5fe6bd660d8c\");\n this.alignment = alignment;\n }", "public BasicAlignment (Glyph glyph)\r\n {\r\n super(glyph);\r\n }", "public int getAlignment()\n {\n return bouquet.getAlignment();\n }", "public AlignmentCalc(AlignmentGui parent, Structure s1, Structure s2 ) {\n\n\t\tthis.parent= parent;\n\n\t\tstructure1 = s1;\n\t\tstructure2 = s2;\n\n\t}", "@Override\n public boolean isFinished() {\n return this.isAligned;\n }", "boolean hasAligning();", "Builder addEducationalAlignment(AlignmentObject value);", "private void alignSingle(RevisionDocument doc, double[][] probMatrix,\n\t\t\tdouble[][] fixedMatrix, int option) throws Exception {\n\t\tint oldLength = probMatrix.length;\n\t\tint newLength = probMatrix[0].length;\n\t\tif (doc.getOldSentencesArray().length != oldLength\n\t\t\t\t|| doc.getNewSentencesArray().length != newLength) {\n\t\t\tthrow new Exception(\"Alignment sentence does not match\");\n\t\t} else {\n\t\t\t/*\n\t\t\t * Rules for alignment 1. Allows one to many and many to one\n\t\t\t * alignment 2. No many to many alignments (which would make the\n\t\t\t * annotation even more difficult)\n\t\t\t */\n\t\t\tif (option == -1) { // Baseline 1, using the exact match baseline\n\t\t\t\tfor (int i = 0; i < oldLength; i++) {\n\t\t\t\t\tfor (int j = 0; j < newLength; j++) {\n\t\t\t\t\t\tif (probMatrix[i][j] == 1) {\n\t\t\t\t\t\t\tdoc.predictNewMappingIndex(j + 1, i + 1);\n\t\t\t\t\t\t\tdoc.predictOldMappingIndex(i + 1, j + 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (option == -2) { // Baseline 2, using the similarity\n\t\t\t\t\t\t\t\t\t\t// baseline\n\t\t\t\tfor (int i = 0; i < oldLength; i++) {\n\t\t\t\t\tfor (int j = 0; j < newLength; j++) {\n\t\t\t\t\t\tif (probMatrix[i][j] > 0.5) {\n\t\t\t\t\t\t\tdoc.predictNewMappingIndex(j + 1, i + 1);\n\t\t\t\t\t\t\tdoc.predictOldMappingIndex(i + 1, j + 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else { // current best approach\n\t\t\t\tfor (int i = 0; i < oldLength; i++) {\n\t\t\t\t\tfor (int j = 0; j < newLength; j++) {\n\t\t\t\t\t\tif (fixedMatrix[i][j] == 1) {\n\t\t\t\t\t\t\tdoc.predictNewMappingIndex(j + 1, i + 1);\n\t\t\t\t\t\t\tdoc.predictOldMappingIndex(i + 1, j + 1);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// Code for improving\n\t\t\t}\n\t\t}\n\t}", "com.ctrip.ferriswheel.proto.v1.Placement getAlign();", "boolean getAligning();", "public AlignByCamera ()\n\t{\n\t\trequires(Subsystems.transmission);\n\t\trequires(Subsystems.goalVision);\n\n\t\tthis.motorRatio = DEFAULT_ALIGNMENT_SPEED;\n\t}", "protected void setValuesFromAlignment(final SAMRecord rec, final SAMRecord alignment) {\n for (final SAMRecord.SAMTagAndValue attr : alignment.getAttributes()) {\n // Copy over any non-reserved attributes.\n if (RESERVED_ATTRIBUTE_STARTS.indexOf(attr.tag.charAt(0)) == -1) {\n rec.setAttribute(attr.tag, attr.value);\n }\n }\n rec.setReadUnmappedFlag(alignment.getReadUnmappedFlag());\n rec.setReferenceIndex(alignment.getReferenceIndex());\n rec.setAlignmentStart(alignment.getAlignmentStart());\n rec.setReadNegativeStrandFlag(alignment.getReadNegativeStrandFlag());\n if (!alignment.getReadUnmappedFlag()) {\n // only aligned reads should have cigar and mapping quality set\n rec.setCigar(alignment.getCigar()); // cigar may change when a\n // clipCigar called below\n rec.setMappingQuality(alignment.getMappingQuality());\n }\n if (rec.getReadPairedFlag()) {\n rec.setProperPairFlag(alignment.getProperPairFlag());\n rec.setInferredInsertSize(alignment.getInferredInsertSize());\n rec.setMateUnmappedFlag(alignment.getMateUnmappedFlag());\n rec.setMateReferenceIndex(alignment.getMateReferenceIndex());\n rec.setMateAlignmentStart(alignment.getMateAlignmentStart());\n rec.setMateNegativeStrandFlag(alignment.getMateNegativeStrandFlag());\n }\n \n // If it's on the negative strand, reverse complement the bases\n // and reverse the order of the qualities\n if (rec.getReadNegativeStrandFlag()) {\n SAMRecordUtil.reverseComplement(rec);\n }\n \n if (clipAdapters && rec.getAttribute(ReservedTagConstants.XT) != null){\n CigarUtil.softClip3PrimeEndOfRead(rec, rec.getIntegerAttribute(ReservedTagConstants.XT));\n }\n }", "public AlignX getAlignmentX() { return AlignX.Left; }", "public void setHAlign(int hAlign) {\n this.hAlign = hAlign;\n }", "protected int getAlignment() {\n writeline(\"/home/ubuntu/results/coverage/ZipArchiveEntry/ZipArchiveEntry_5_10.coverage\", \"12abfd3b-e43a-46a7-92b9-993595740399\");\n return this.alignment;\n }", "public Builder setAligning(boolean value) {\n bitField0_ |= 0x00000008;\n aligning_ = value;\n onChanged();\n return this;\n }", "public void setHorizontalAlignment(int alignment) {\n if (alignment == horizontalAlignment) return;\n int oldValue = horizontalAlignment;\n if ((alignment == LEFT) || (alignment == CENTER) || \n\t (alignment == RIGHT)|| (alignment == LEADING) || \n\t (alignment == TRAILING)) {\n horizontalAlignment = alignment;\n } else {\n throw new IllegalArgumentException(\"horizontalAlignment\");\n }\n firePropertyChange(\"horizontalAlignment\", oldValue, horizontalAlignment); \n invalidate();\n repaint();\n }", "Builder addEducationalAlignment(AlignmentObject.Builder value);", "void xsetAlignmentRefs(org.landxml.schema.landXML11.AlignmentNameRefs alignmentRefs);", "String validateAlignment() {\n\t\treturn null;\n\t}", "@XmlElement(\"IsAligned\")\n boolean IsAligned();", "public String[] getStrAlign() {\n if (state) return new String[]{alignB, alignA};\n return new String[]{alignA, alignB};\n }", "public void setVerticalAlignment( short align )\n {\n this.valign = align;\n }", "public void setVAlign(int vAlign) {\n this.vAlign = vAlign;\n }", "public static void setAlignment(Node child, FlowAlignment value) {\n setConstraint(child, ALIGNMENT, value);\n }", "public Alignment(Properties props) {\r\n\t\talignmentThreshold = Integer.parseInt(props.getProperty(\"alignmentThreshold\"));\r\n\t}", "public void handleHorizontalAlign( IStyle style )\n \t{\n \t\tCSSValue hAlign = style.getProperty( IStyle.STYLE_TEXT_ALIGN );\n \t\tif ( null != hAlign )\n \t\t{\n \t\t\twriter.attribute( HTMLTags.ATTR_ALIGN, hAlign.getCssText( ) );\n \t\t}\n \t}", "private void alignForRead(Bytes<?> bytes) {\n bytes.readPositionForHeader(usePadding);\n }", "private AminoAction AlignLeft(final SketchDocument doc) {\n return named(\"Align Left\", groupOnly(doc, new AminoAction() {\n @Override\n public void execute() throws Exception {\n double val = apply(doc.getSelection(), Double.MAX_VALUE, new Accumulate<Double>() {\n public Double accum(SketchNode node, Double value) {\n return Math.min(value, node.getInputBounds().getX() + node.getTranslateX());\n }\n });\n \n apply(doc.getSelection(), val, new Accumulate<Double>() {\n public Double accum(SketchNode node, Double value) {\n double x = node.getInputBounds().getX() + node.getTranslateX();\n node.setTranslateX(node.getTranslateX() + value - x);\n return value;\n }\n });\n }\n }));\n }", "void updateFrom(ClonalGeneAlignmentParameters alignerParameters);", "public PVector Align(ArrayList<Animal> animals)\n {\n PVector sum = new PVector(0,0);\n int count = 0;\n for(Animal other : animals)\n {\n float d = PVector.dist(pos, other.pos);\n if ((d > 0) && (d < alignDist))\n {\n sum.add(other.velocity);\n count++;\n }\n }\n if (count > 0)\n {\n sum.div(animals.size());\n sum.setMag(maxSpeed);\n sum.sub(velocity);\n sum.limit(maxForce);\n }\n \n return sum;\n }", "public double passAlign() {\n \tdouble angle;\n \tif (MasterController.ourSide == TeamSide.LEFT) {\n \t\tangle = angleToX();\n \t} else {\n \t\tangle = angleToNegX();\n \t}\n \tdouble amount = -0.7 * angle;\n\t\tDebug.log(\"Angle: %f, Rotating: %f\", angle, amount);\n\t\trotate(amount); // TODO: Test if works as expected\n\t\treturn amount;\n\t}", "private void renderStringAligned(String text, int textX, int textY, int width, int color) {\n if (super.getBidiFlag()) {\n int stringWidth = super.getStringWidth(bidirectionalReorder(text));\n textX = textX + width - stringWidth;\n }\n \n renderString(text, textX, textY, color, false);\n }", "void displayResults(boolean newFrame)\n {\n Vector alorders = new Vector();\n SequenceI[][] results = new SequenceI[jobs.length][];\n AlignmentOrder[] orders = new AlignmentOrder[jobs.length];\n for (int j = 0; j < jobs.length; j++)\n {\n if (jobs[j].hasResults())\n {\n Object[] res = ((MsaWSJob) jobs[j]).getAlignment();\n alorders.add(res[1]);\n results[j] = (SequenceI[]) res[0];\n orders[j] = (AlignmentOrder) res[1];\n\n // SequenceI[] alignment = input.getUpdated\n }\n else\n {\n results[j] = null;\n }\n }\n Object[] newview = input.getUpdatedView(results, orders, getGapChar());\n // trash references to original result data\n for (int j = 0; j < jobs.length; j++)\n {\n results[j] = null;\n orders[j] = null;\n }\n SequenceI[] alignment = (SequenceI[]) newview[0];\n ColumnSelection columnselection = (ColumnSelection) newview[1];\n Alignment al = new Alignment(alignment);\n // TODO: add 'provenance' property to alignment from the method notes\n // accompanying each subjob\n if (dataset != null)\n {\n al.setDataset(dataset);\n }\n\n propagateDatasetMappings(al);\n // JBNote- TODO: warn user if a block is input rather than aligned data ?\n\n if (newFrame)\n {\n AlignFrame af = new AlignFrame(al, columnselection,\n AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);\n\n // initialise with same renderer settings as in parent alignframe.\n af.getFeatureRenderer().transferSettings(this.featureSettings);\n // update orders\n if (alorders.size() > 0)\n {\n if (alorders.size() == 1)\n {\n af.addSortByOrderMenuItem(WebServiceName + \" Ordering\",\n (AlignmentOrder) alorders.get(0));\n }\n else\n {\n // construct a non-redundant ordering set\n Vector names = new Vector();\n for (int i = 0, l = alorders.size(); i < l; i++)\n {\n String orderName = new String(\" Region \" + i);\n int j = i + 1;\n\n while (j < l)\n {\n if (((AlignmentOrder) alorders.get(i))\n .equals(((AlignmentOrder) alorders.get(j))))\n {\n alorders.remove(j);\n l--;\n orderName += \",\" + j;\n }\n else\n {\n j++;\n }\n }\n\n if (i == 0 && j == 1)\n {\n names.add(new String(\"\"));\n }\n else\n {\n names.add(orderName);\n }\n }\n for (int i = 0, l = alorders.size(); i < l; i++)\n {\n af.addSortByOrderMenuItem(\n WebServiceName + ((String) names.get(i)) + \" Ordering\",\n (AlignmentOrder) alorders.get(i));\n }\n }\n }\n\n Desktop.addInternalFrame(af, alTitle, AlignFrame.DEFAULT_WIDTH,\n AlignFrame.DEFAULT_HEIGHT);\n\n }\n else\n {\n System.out.println(\"MERGE WITH OLD FRAME\");\n // TODO: modify alignment in original frame, replacing old for new\n // alignment using the commands.EditCommand model to ensure the update can\n // be undone\n }\n }", "public GIZAWordAlignment(String f2e_line1, String f2e_line2,\n String f2e_line3, String e2f_line1, String e2f_line2, String e2f_line3)\n throws IOException {\n init(f2e_line1, f2e_line2, f2e_line3, e2f_line1, e2f_line2, e2f_line3);\n }", "public void align(ArrayList<RevisionDocument> trainDocs,\n\t\t\tArrayList<RevisionDocument> testDocs, int option) throws Exception {\n\t\tHashtable<DocumentPair, double[][]> probMatrix = aligner\n\t\t\t\t.getProbMatrixTable(trainDocs, testDocs, option);\n\t\tIterator<DocumentPair> it = probMatrix.keySet().iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tDocumentPair dp = it.next();\n\t\t\tString name = dp.getFileName();\n\t\t\tfor (RevisionDocument doc : testDocs) {\n\t\t\t\tif (doc.getDocumentName().equals(name)) {\n\t\t\t\t\tdouble[][] sim = probMatrix.get(dp);\n\t\t\t\t\tdouble[][] fixedSim = aligner.alignWithDP(dp, sim, option);\n\t\t\t\t\talignSingle(doc, sim, fixedSim, option);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "@Override\n public String getTextAlign() {\n return graphicsEnvironmentImpl.getTextAlign(canvas);\n }", "private void doReplaceWithAligned(Structure struct) {\n\t\tDataTypeComponent[] otherComponents = struct.getDefinedComponents();\n\t\tfor (int i = 0; i < otherComponents.length; i++) {\n\t\t\tDataTypeComponent dtc = otherComponents[i];\n\t\t\tDataType dt = dtc.getDataType();\n\t\t\tint length = (dt instanceof Dynamic) ? dtc.getLength() : -1;\n\t\t\tdoAdd(dt, length, false, dtc.getFieldName(), dtc.getComment(), false);\n\t\t}\n\t\tadjustInternalAlignment(false);\n\t\tdataMgr.dataTypeChanged(this);\n\t}", "@Test\n\tpublic void testFindAlignment1() {\n\t\tint[] s = new int[cs5x3.length];\n\t\tfor (int i = 0; i < s.length; i++)\n\t\t\ts[i] = -1;\n\t\tAlignment.AlignmentScore score = testme3.findAlignment(s);\n\t\t// AAG-- 3\n\t\t// --GCC 3\n\t\t// -CGC- 2\n\t\t// -AGC- 3\n\t\t// --GCT 2\n\t\tassertEquals(13, score.actual);\n\t\tscore = testme4.findAlignment(s);\n\t\t// AAG-- 3\n\t\t// --GCC 3\n\t\t// -CGC- 2\n\t\t// -AGC- 3\n\t\t// -AGC- 3 [reverse strand]\n\t\tassertEquals(14, score.actual);\n\t}", "@ReactMethod\n public void setAlignment(int alignment, Promise promise){\n if (woyouService == null) {\n Toast.makeText(this.reactContext, R.string.printer_disconnect, Toast.LENGTH_LONG).show();\n promise.reject(\"0\", \"\");\n }\n\n try {\n woyouService.setAlignment(alignment, null);\n promise.resolve(null);\n } catch (RemoteException e) {\n promise.reject(\"0\", e.getMessage());\n }\n }", "CrossAlign getCrossAlign();", "private void alignCenter(int newWidth) {\n for (Shape child : shape.getChildren()) {\n GraphicsAlgorithm ga = child.getGraphicsAlgorithm();\n int diff = (newWidth - ga.getWidth()) / 2;\n gaService.setLocation(ga, ga.getX() + diff, ga.getY());\n }\n }", "protected int matches(Alignment alignment) {\n\t\treturn 1;\n\t}", "public void setHorizontalAlignment(int horizontalAlignment)\n {\n field.setHorizontalAlignment(horizontalAlignment);\n }", "@Test\n \tpublic void testSimpleFilterAlignments()\n \t{\n \t\tString searchTerm = \"hobbys\";\n \t\tString searchText = \"hobbies\";\n \t\tPDL.init(searchTerm, searchText, true, true);\n \t\talignments.clear();\n \t\tPseudoDamerauLevenshtein.Alignment ali1 = PDL.new Alignment(searchTerm, searchText, 1.0, 0, 5, 0, 0);\n \t\tPseudoDamerauLevenshtein.Alignment ali2 = PDL.new Alignment(searchTerm, searchText, 0.5, 0, 5, 0, 0);\n \t\talignments.add(ali1);\n \t\talignments.add(ali2);\n \t\talignments = PseudoDamerauLevenshtein.filterAlignments(alignments);\n \t\tAssert.assertEquals(1, alignments.size());\n \t\tAssert.assertEquals(ali1, alignments.get(0));\n \t}", "public void setHorizontalAlign(int align) {\r\n this.halign = align;\r\n updateToolbar();\r\n\r\n }", "public int getHorizontalAlignment() {\n return horizontalAlignment;\n }", "TableSectionBuilder vAlign(String vAlign);", "Builder addEducationalAlignment(String value);", "public void alignSelectedFurnitureSideBySide() {\n alignSelectedFurniture(new AlignmentAction() {\n public void alignFurniture(AlignedPieceOfFurniture [] alignedFurniture, \n HomePieceOfFurniture leadPiece) {\n alignFurnitureSideBySide(alignedFurniture, leadPiece);\n }\n });\n }", "public float getAlignment(int axis) {\n if (view != null) {\n return view.getAlignment(axis);\n }\n return 0;\n }", "public short alignment(int total, int req) {\n \treturn (short)((total + (req-1))/req*req - total);\n }", "@SuppressWarnings(\"unchecked\")\n public TCS alignment(final Alignment alignment) {\n if (Alignment.AlignmentType.V == alignment.getAlignmentType())\n cellStyle_p.setVerticalAlignment(alignment.idx);\n else\n cellStyle_p.setAlignment(alignment.idx);\n\n return (TCS) this;\n }" ]
[ "0.70294404", "0.680898", "0.6721915", "0.6647452", "0.6636087", "0.65958613", "0.6529025", "0.65070933", "0.64349604", "0.6428772", "0.63790804", "0.6280131", "0.6269029", "0.6169826", "0.6110803", "0.6110803", "0.6097728", "0.6079906", "0.6008203", "0.59926724", "0.59009147", "0.58501136", "0.58108187", "0.5808074", "0.58074474", "0.5799328", "0.57920825", "0.57853943", "0.5779896", "0.5771916", "0.57448256", "0.5738305", "0.57375664", "0.57145876", "0.5674147", "0.5651436", "0.5641964", "0.56203645", "0.56202483", "0.56087697", "0.5597672", "0.5592311", "0.5567877", "0.55491245", "0.55445486", "0.5542614", "0.5533265", "0.54831314", "0.54629654", "0.54606164", "0.5457601", "0.5444736", "0.5418554", "0.540027", "0.53847075", "0.5383938", "0.5374856", "0.53466547", "0.53425604", "0.5334898", "0.5325663", "0.53186184", "0.5315891", "0.52877295", "0.52856994", "0.52836967", "0.5280714", "0.5262514", "0.52534574", "0.5250941", "0.52491075", "0.52460474", "0.52287877", "0.5228511", "0.5219297", "0.5199103", "0.5195818", "0.5193778", "0.5191198", "0.5153208", "0.5145923", "0.5137307", "0.5136698", "0.5128746", "0.51168454", "0.51110375", "0.5106753", "0.51063347", "0.5093545", "0.5069321", "0.50577474", "0.5029633", "0.5027684", "0.5025135", "0.5020845", "0.50141966", "0.4992641", "0.49919924", "0.49856365", "0.49787027" ]
0.7558881
0
first time running this alignment. Create all new matrices.
public void prepareAlignment(String sq1, String sq2) { if(F == null) { this.n = sq1.length(); this.m = sq2.length(); this.seq1 = strip(sq1); this.seq2 = strip(sq2); F = new float[3][n+1][m+1]; B = new TracebackAffine[3][n+1][m+1]; for(int k = 0; k < 3; k++) { for(int i = 0; i < n+1; i ++) { for(int j = 0; j < m+1; j++) B[k][i][j] = new TracebackAffine(0,0,0); } } } //alignment already been run and existing matrix is big enough to reuse. else if(seq1.length() <= n && seq2.length() <= m) { this.n = sq1.length(); this.m = sq2.length(); this.seq1 = strip(sq1); this.seq2 = strip(sq2); } //alignment already been run but matrices not big enough for new alignment. //create all new matrices. else { this.n = sq1.length(); this.m = sq2.length(); this.seq1 = strip(sq1); this.seq2 = strip(sq2); F = new float[3][n+1][m+1]; B = new TracebackAffine[3][n+1][m+1]; for(int k = 0; k < 3; k++) { for(int i = 0; i < n+1; i ++) { for(int j = 0; j < m+1; j++) B[k][i][j] = new TracebackAffine(0,0,0); } } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void makeInitialDistanceMatrix() {\n\t\ttry {\n\t\t\tfor(int i=1;i<=totalGenes;i++) {\n\t\t\t\tTreeMap<String, Double> temp1 = new TreeMap<>();\n\t\t\t\tif(distanceMatrix.containsKey(i+\"\"))\n\t\t\t\t\ttemp1 = distanceMatrix.get(i+\"\");\n\t\t\t\tfor(int j=i+1;j<=totalGenes;j++) {\n\t\t\t\t\tdouble dist = getDist(i, j);\n\t\t\t\t\tTreeMap<String, Double> temp2 = new TreeMap<>();\n\t\t\t\t\tif(distanceMatrix.containsKey(j+\"\"))\n\t\t\t\t\t\ttemp2 = distanceMatrix.get(j+\"\");\n\t\t\t\t\ttemp2.put(i+\"\", dist);\n\t\t\t\t\tdistanceMatrix.put(j+\"\", temp2);\n\t\t\t\t\ttemp1.put(j+\"\", dist);\n\t\t\t\t\tupdateMinMatrix(i+\"\",j+\"\",dist);\n\t\t\t\t}\n\t\t\t\tdistanceMatrix.put(i+\"\", temp1);\n\t\t\t}\n\t\t} catch(Exception e) {\n\t\t\te.printStackTrace();\n\t\t}\n\t}", "private void initialise() {\n \thashFamily = new Hash[this.r];\n for(int i= 0; i < this.r;i++)\n {\n \tthis.hashFamily[i] = new Hash(this.s * 2);\n }\n this.net = new OneSparseRec[this.r][this.s *2];\n for(int i = 0 ; i < this.r; i++)\n \tfor(int j =0 ; j< this.s * 2 ; j++)\n \t\tthis.net[i][j] = new OneSparseRec();\n \n }", "private void buildMatrix() {\n\n int totalnumber=this.patents.size()*this.patents.size();\n\n\n\n int currentnumber=0;\n\n\n for(int i=0;i<this.patents.size();i++) {\n ArrayList<Double> temp_a=new ArrayList<>();\n for (int j=0;j<this.patents.size();j++) {\n if (i==j) temp_a.add(0.0); else if (i<j)\n {\n double temp = distance.distance(this.patents.get(i), this.patents.get(j));\n temp = (new BigDecimal(temp).setScale(2, RoundingMode.UP)).doubleValue();\n temp_a.add(temp);\n\n\n // simMatrix.get(i).set(j, temp);\n // simMatrix.get(j).set(i, temp);\n } else {\n temp_a.add(simMatrix.get(j).get(i));\n }\n currentnumber++;\n System.out.print(\"\\r\"+ProgressBar.barString((int)((currentnumber*100/totalnumber)))+\" \"+currentnumber);\n\n }\n simMatrix.add(temp_a);\n }\n System.out.println();\n\n }", "public void start()\n\t{\n\t\tfor(int i=0;i<n;i++)\n\t\t{\n\t\t\tfor(int j=0;j<n;j++)\n\t\t\t{\n\t\t\t\tcost[i][j] = temp[i][j];\n\t\t\t\tmatrix[i][j]=0;\n\t\t\t}\n\t\t}\n\t\n\t\tfor(int k=0;k<n;k++)\n\t\t{\n\t\t\trowLabelMultiple[k]=0;\n\t\t\tcolumnLabelMultiple[k]=0;\n\t\t}\t\t\t\n\t}", "public void allocArrays() {\n Preconditions.checkState(needsAllocArrays(), \"Arrays already allocated\");\n int expectedSize = this.modCount;\n this.table = newTable(Hashing.closedTableSize(expectedSize, 1.0d));\n this.entries = newEntries(expectedSize);\n this.elements = new Object[expectedSize];\n }", "@Before\n public void setUp() throws Exception {\n myM = new Matrix();\n /** matrix1 = new int[4][4];\n for (int i = 0; i < matrix1.length; i++) {\n for (int j = 0; j < matrix1[0].length; j++) {\n if( i == j) {\n matrix1[i][j] = 1;\n }\n }\n }\n matrix2 = new int[6][6];\n for (int i = 0; i < matrix2.length; i++) {\n for (int j = 0; j < matrix2[0].length; j++) {\n matrix2[i][j] = i;\n }\n }\n matrix3 = new int[3][4];\n for (int i = 0; i < matrix3.length; i++) {\n for (int j = 0; j < matrix3[0].length; j++) {\n if( i == j) {\n matrix3[i][j] = 1;\n }\n\n }\n } **/\n }", "private void resetMatrix() {\n mSuppMatrix.reset();\n setImageViewMatrix(getDrawMatrix());\n checkMatrixBounds();\n }", "public void generateMatrix() {\n\n flow = new int[MATRIX_TAM][MATRIX_TAM];\n loc = new int[MATRIX_TAM][MATRIX_TAM];\n\n for (int i = 0; i < MATRIX_TAM; i++) {\n for (int j = 0; j < MATRIX_TAM; j++) {\n\n //fill the distances matrix\n if (i != j) {\n loc[i][j] = rn.nextInt(MAX_DISTANCE - MIN_DISTANCE + 1) + MIN_DISTANCE;\n } else {\n loc[i][j] = 0;\n }\n\n //fill the flow matrix\n if (i != j) {\n flow[i][j] = rn.nextInt(MAX_FLOW - MIN_FLOW + 1) + MIN_FLOW;\n } else {\n flow[i][j] = 0;\n }\n\n }\n }\n\n }", "public void populateMatrices(Matrix arrayOfMatrices[]){\n String[] rows;\n String[] columns;\n matrixCounter=0;\n try{ \n br = new BufferedReader(new FileReader(\"E:\\\\NUST\\\\6th Semester\\\\Advanced Programming - AP\\\\Labs\\\\Advanced Programming Lab-1\\\\src\\\\pk\\\\edu\\\\nust\\\\seecs\\\\bscs2\\\\advancedprogramming\\\\lab1\\\\matrices.txt\") );\n br.readLine(); //skipping first line that explains the format of matrices\n while( (currentLine = br.readLine()) != null){ \n if (currentLine.trim().length() > 0){ \n //parse the string. Get the rows and columns. Count length of rows and columns. ADD DELETE FEATURE\n rows = currentLine.split(\";\"); //get rows of current matrix\n currentMatrixRows = rows.length;\n columns = rows[0].split(\"\\\\s\"); //get each element of current row\n currentMatrixColumns = columns.length;\n //call the Matrix parameterized constructor to create a matrix of dimenstions currentMatrixRows x currentMatrixColumns\n arrayOfMatrices[matrixCounter] = new Matrix(currentMatrixRows, currentMatrixColumns); \n \n for(int i=0; i< rows.length; i++){\n columns = rows[i].split(\"\\\\s\"); //get each element of current row \n if(columns.length != currentMatrixColumns){\n System.out.println(\"INVALID MATRIX ENTERED. NUMBER OF COLUMNS IN EVERY ROW SHOULD BE EQUAL.\");\n System.exit(0); \n }\n for(int j=0; j< columns.length ; j++){ \n arrayOfMatrices[matrixCounter].setMatrixElement(i, j, Integer.parseInt(columns[j]) );\n }\n }\n //matrices.add(temp);\n totalMatrices++;\n //arrayOfMatrices[matrixCounter].toString();\n matrixCounter++;\n \n }\n } \n }catch(IOException e){\n e.printStackTrace(); \n }finally{ \n try{\n if(br!=null)\n br.close();\n }catch(IOException e){\n e.printStackTrace();\n }\n } \n \n \n// for(int i=0; i<totalMatrices;i++){\n// arrayOfMatrices[i] = new Matrix(2,3);\n// }\n }", "public void initialize() {\n\t\tnumRows = gridConfig.getNumRows();\n\t\tnumCols = gridConfig.getNumCols();\n\t\tgridCellCount = numRows * numCols;\n\t\tcreateMaps();\n\t\tsetCurrSimulationMap();\n\t\tcellWidth = SIZE / numCols;\n\t\tcellHeight = SIZE / numRows;\n\t\tcurrentGrid = new Cell[numRows][numCols];\n\t\tnewGrid = new Cell[numRows][numCols];\n\t\tempty(currentGrid);\n\t\tempty(newGrid);\n\t\tsetShapes();\n\t\tsetInitialStates();\n\t}", "public void reAllocate() {\n\t\tmat_ = new double[n_][hbw_ + 1];\n\t}", "public void run() {\n\n\n\t\tStructurePairAligner aligner = new StructurePairAligner();\n\t\taligner.setDebug(true);\n\t\ttry {\n\t\t\taligner.align(structure1,structure2);\n\t\t} catch (StructureException e){\n\t\t\tlogger.warning(e.getMessage());\n\n\t\t}\n\n\n\n\t\tAlternativeAlignment[] aligs = aligner.getAlignments();\n\t\t//cluster similar results together \n\t\tClusterAltAligs.cluster(aligs);\n\t\tshowAlignment(aligner,aligs);\n\n\t\t//logger.info(\"done!\");\n\n\t\tparent.notifyCalcFinished();\n\n\t}", "private void buildTables() {\n\t\tint k = G.getK();\n\t\tint numEachPod = k * k / 4 + k;\n \n\t\tbuildEdgeTable(k, numEachPod);\n\t\tbuildAggTable(k, numEachPod);\n\t\tbuildCoreTable(k, numEachPod); \n\t}", "private void initializeFinalSlide() {\r\n\t\tSourceCode finalText = lang.newSourceCode(new Offset(100, 0, \"mainMatrix\", AnimalScript.DIRECTION_NE), \"finalText\",null);\r\n\t\tfinalText.addCodeLine(\"ShiftRows finished succesffully!\", null, 0, null);\r\n\t\tfinalText.addCodeLine(\"The computation did 30 assignments and 30 accesses.\", null, 0, null);\r\n\t\tfinalText.addCodeLine(\"The resulting matrix may now be used as the new state matrix for the\", null, 0, null);\r\n\t\tfinalText.addCodeLine(\"next steps of the AES algorithm.\", null, 0, null);\r\n\t}", "public static void createArrays() {\n\t\tinitArrays();\n\t\tcreateNodeTable();\n\t\tcreateEdgeTables();\n\t\t// Helper.Time(\"Read File\");\n\t\tcreateOffsetTable();\n\t}", "private void creates() {\n \tDBPeer.fetchTableColumns();\n \tDBPeer.fetchTableRows();\n \tDBPeer.fetchTableIndexes();\n \t\n for (int i = 0; i < creates.size(); i++) {\n creates.get(i).init();\n }\n \n DBPeer.updateTableColumns();\n DBPeer.updateTableRows();\n DBPeer.updateTableIndexes();\n }", "private void initMleCluster() {\n\t\tpseudoTf = new double[documents.size()][];\n\t\tpseudoTermIndex = new int[documents.size()][];\n\t\tpseudoTermWeight = new double[documents.size()][];\n\t\t\n\t\tfor(int docIdx=0; docIdx<documents.size(); docIdx++) {\n\t\t\tcountOnePseudoDoc(docIdx);\n\t\t}\n\t}", "private void initMatrix() {\n\t\ttry {\n\t\t\tRandom random = new Random();\n\t\t\tfor (int row=0; row<_numRows; ++row) {\n\t\t\t\tfor (int column=0; column<_numColumns; ++column) {\n\t\t\t\t\t// generate alive cells, with CHANCE_OF_ALIVE chance\n\t\t\t\t\tboolean value = (random.nextInt(100) < CHANCE_OF_ALIVE);\n\t\t\t\t\t_matrix.setCellValue(row, column, value);\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (Exception e) {\n\t\t\t// This is not supposed to happend because we use only legal row and column numbers\n\t\t}\n\t}", "protected void applyMatrices () {\n combinedMatrix.set(projectionMatrix).mul(transformMatrix);\n getShader().setUniformMatrix(\"u_projTrans\", combinedMatrix);\n }", "public static void generateMatrix() {\r\n Random random = new Random();\r\n for (int i = 0; i < dim; i++)\r\n {\r\n for (int j = 0; j < dim; j++)\r\n {\r\n if (i != j)\r\n \r\n adjacencyMatrix[i][j] = I; \r\n }\r\n }\r\n for (int i = 0; i < dim * dim * fill; i++)\r\n {\r\n adjacencyMatrix[random.nextInt(dim)][random.nextInt(dim)] =\r\n random.nextInt(maxDistance + 1);\r\n }\r\n \r\n\r\n\r\n \r\n //print(adjacencyMatrix);\r\n \r\n \r\n //This makes the main matrix d[][] ready\r\n for (int i = 0; i < dim; i++) {\r\n for (int j = 0; j < dim; j++)\r\n {\r\n d[i][j] = adjacencyMatrix[i][j];\r\n if (i == j)\r\n {\r\n d[i][j] = 0;\r\n }\r\n }\r\n }\r\n }", "private void initializeAll() {\n initialize(rows);\n initialize(columns);\n initialize(boxes);\n }", "public void pushMatrix()\n\t{\n\t\tmats.push( new Matrix4f( mat ) );\n\t}", "private void setupStuff() {\n\t\tm_seenNumbers = new double[featureArray.length][];\n\t\tm_Weights = new double[featureArray.length][];\n\t\tm_NumValues = new int[featureArray.length];\n\t\tm_SumOfWeights = new double[featureArray.length];\n\t\tfeatureTotals = new int[featureArray.length];\n\n\t\tfor (int i = 0; i < featureArray.length; i++) {\n\t\t\tm_NumValues[i] = 0;\n\t\t\tm_seenNumbers[i] = new double[100];\n\t\t\tm_Weights[i] = new double[100];\n\t\t}\n\n\t\t/*\n\t\t * initialize structures for probabilities of each class and of each\n\t\t * feature\n\t\t */\n\t\tclassCounts = new double[MLearner.NUMBER_CLASSES];\n\t\tprobs = new HashMap[MLearner.NUMBER_CLASSES][featureArray.length];\n\t\tRealprobs = new HashMap[MLearner.NUMBER_CLASSES][featureArray.length];\n\t\tfor (int i = 0; i < MLearner.NUMBER_CLASSES; i++) {\n\t\t\tfor (int j = 0; j < featureArray.length; j++) {\n\t\t\t\tif (featureArray[j]) {//only create if we are using that\n\t\t\t\t\t// feature\n\t\t\t\t\tprobs[i][j] = new HashMap();\n\t\t\t\t\tif (EmailInternalConfigurationWindow.isFeatureDiscrete(j)) {\n\t\t\t\t\t\tprobs[i][j].put(\"_default\", new Double(0));\n\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tclassCounts[i] = 0;\n\t\t}\n\n\t}", "private void initializeDNA() {\n\t\tint numInputs = population.numInputs;\n\t\tint numOutputs = population.numOutputs;\n\t\tfor (int i = 1; i <= numInputs; i++) {\n\t\t\tsubmitNewNode(new NNode(i, NNode.INPUT));\n\t\t}\n\t\tfor (int j = numInputs + 1; j <= numInputs + numOutputs; j++) {\n\t\t\tsubmitNewNode(new NNode(j, NNode.OUTPUT));\n\t\t}\n\n\t\tfor (int i = 0; i < numInputs; i++) {\n\t\t\tfor (int j = 0; j < numOutputs; j++) {\n\t\t\t\tint start = i + 1;\n\t\t\t\tint end = numInputs + 1 + j;\n\t\t\t\tint innovation = population.getInnovation(start, end);\n\t\t\t\tGene g = new Gene(innovation, start, end, Braincraft\n\t\t\t\t\t\t.randomWeight(), true);\n\t\t\t\tpopulation.registerGene(g);\n\t\t\t\tsubmitNewGene(g);\n\t\t\t}\n\t\t}\n\t}", "public static void start(){\n mngr.getStpWds();\n mngr.getDocuments();\n mngr.calculateWeights();\n mngr.getInvertedIndex();\n mngr.getClusters();\n mngr.getCategories();\n mngr.getUserProfiles();\n mngr.makeDocTermMatrix();\n\n }", "protected void initTransforms() {\n for (int i = 0; i < cornerCount; i++) {\n int index = cornerOffset + i;\n identityVertexMatrix[index] = new idx3d_Matrix();\n }\n\n // 0:urf\n identityVertexMatrix[cornerOffset + 0].rotate(0, -HALF_PI, 0);\n // 1:dfr\n identityVertexMatrix[cornerOffset + 1].rotate(0, 0, PI);\n // 2:ubr\n identityVertexMatrix[cornerOffset + 2].rotate(0, PI, 0);\n // 3:drb\n identityVertexMatrix[cornerOffset + 3].rotate(0, 0, PI);\n identityVertexMatrix[cornerOffset + 3].rotate(0, -HALF_PI, 0);\n // 4:ulb\n identityVertexMatrix[cornerOffset + 4].rotate(0, HALF_PI, 0);\n // 5:dbl\n identityVertexMatrix[cornerOffset + 5].rotate(PI, 0, 0);\n // 6:ufl\n //--no transformation---\n // 7:dlf\n identityVertexMatrix[cornerOffset + 7].rotate(0, HALF_PI, 0);\n identityVertexMatrix[cornerOffset + 7].rotate(PI, 0, 0);\n //\n // We can clone the normalmatrix here form the vertex matrix, because\n // the vertex matrix consists of rotations only.\n for (int i = 0; i < cornerCount; i++) {\n identityNormalMatrix[i] = identityVertexMatrix[i].getClone();\n }\n\n /**\n * Edges\n */\n // Move all edge parts to front up (fu) and then rotate them in place\n for (int i = 0; i < edgeCount; i++) {\n int index = edgeOffset + i;\n idx3d_Matrix vt = new idx3d_Matrix();\n idx3d_Matrix nt = new idx3d_Matrix();\n identityVertexMatrix[index] = vt;\n identityNormalMatrix[index] = nt;\n // The vertex matrix is the same as the normal matrix, but with\n // an additional shift, which is made before the rotation.\n if (i >= 12) {\n switch ((i - 12) % 24) {\n case 12:\n case 13:\n case 2:\n case 3:\n case 4:\n case 17:\n case 6:\n case 19:\n case 20:\n case 21:\n case 10:\n case 11:\n vt.shift(PART_LENGTH*((i+12)/24), 0f, 0f);\n break;\n default:\n vt.shift(-PART_LENGTH*((i+12)/24), 0f, 0f);\n break;\n }\n }\n // Now we do the rotation with the normal matrix only\n switch (i % 12) {\n case 0: // ur\n nt.rotate(0, HALF_PI, 0f);\n nt.rotate(0, 0, HALF_PI);\n break;\n case 1: // rf\n nt.rotate(0, -HALF_PI, 0);\n nt.rotate(HALF_PI, 0, 0);\n break;\n case 2: // dr\n nt.rotate(0, -HALF_PI, HALF_PI);\n break;\n case 3: // bu\n nt.rotate(0, PI, 0);\n break;\n case 4: // rb\n nt.rotate(0, 0, HALF_PI);\n nt.rotate(0, -HALF_PI, 0);\n break;\n case 5: // bd\n nt.rotate(PI, 0, 0);\n break;\n case 6: // ul\n nt.rotate(-HALF_PI, -HALF_PI, 0);\n break;\n case 7: // lb\n nt.rotate(0, 0, -HALF_PI);\n nt.rotate(0, HALF_PI, 0);\n break;\n case 8: // dl\n nt.rotate(HALF_PI, HALF_PI, 0);\n break;\n case 9: // fu\n //--no transformation--\n break;\n case 10: // lf\n nt.rotate(0, 0, HALF_PI);\n nt.rotate(0, HALF_PI, 0);\n break;\n case 11: // fd\n nt.rotate(0, 0, PI);\n break;\n }\n // Finally, we concatenate the rotation to the vertex matrix\n vt.transform(nt);\n }\n /* Sides\n */\n // Move all side parts to the front side and rotate them into place\n for (int i = 0; i < sideCount; i++) {\n int index = sideOffset + i;\n idx3d_Matrix vt = new idx3d_Matrix();\n idx3d_Matrix nt = new idx3d_Matrix();\n identityVertexMatrix[index] = vt;\n identityNormalMatrix[index] = nt;\n // The vertex matrix is the same as the normal matrix, but with\n // an additional shift, which is made before the rotation.\n switch (i / 6) {\n // central part\n case 0 :\n // vt.shift(0, 0, 0);\n break;\n // inner ring\n case 1:\n vt.shift(-PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 2:\n vt.shift(-PART_LENGTH, PART_LENGTH, 0);\n break;\n case 3:\n vt.shift(PART_LENGTH, PART_LENGTH, 0);\n break;\n case 4:\n vt.shift(PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 5:\n vt.shift(0, -PART_LENGTH, 0);\n break;\n case 6:\n vt.shift(-PART_LENGTH, 0, 0);\n break;\n case 7:\n vt.shift(0, PART_LENGTH, 0);\n break;\n case 8:\n vt.shift(PART_LENGTH, 0, 0);\n break;\n // outer ring corners\n /*\n * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\n * | .0 | .2 | .3 | .1 |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |75 |129|81 |105|57 | | |62 |140|92 |116|68 | | |66 |144|96 |120|72 | | |59 |137|89 |113|65 | |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |123|27 |33 | 9 |135| | |110|14 |44 |20 |146| | |114|18 |48 |24 |126| | |107|11 |41 |17 |143| |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | .3|99 |51 | 3 |39 |87 |.1 | .1|86 |38 | 2 |50 |98 |.3 | .2|90 |42 | 0 |30 |78 |.0 | .0|83 |35 | 5 |47 |95 |.2 |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |147|21 |45 |15 |111| | |134| 8 |32 |26 |122| | |138|12 |36 | 6 |102| | |131|29 |53 |23 |119| |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | |69 |117|93 |141|63 | | |56 |104|80 |128|74 | | |60 |108|84 |132|54 | | |77 |125|101|149|71 | |\n * + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ + +---+---+---+---+---+ +\n * | .2 | .0 | .1 | .3 |\n * +---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+\n */\n case 9:\n vt.shift(-2f*PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 10:\n vt.shift(-2f*PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 11:\n vt.shift(2f*PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 12:\n vt.shift(2f*PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n // outer ring central edges\n case 13:\n vt.shift(0, -2f*PART_LENGTH, 0);\n break;\n case 14:\n vt.shift(-2f*PART_LENGTH, 0, 0);\n break;\n case 15:\n vt.shift(0, 2f*PART_LENGTH, 0);\n break;\n case 16:\n vt.shift(2f*PART_LENGTH, 0, 0);\n break;\n // outer ring clockwise shifted edges\n case 17:\n vt.shift(-PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 18:\n vt.shift(-2f*PART_LENGTH, PART_LENGTH, 0);\n break;\n case 19:\n vt.shift(PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 20:\n vt.shift(2f*PART_LENGTH, -PART_LENGTH, 0);\n break;\n // outer ring counter-clockwise shifted edges\n case 21:\n vt.shift(PART_LENGTH, -2f*PART_LENGTH, 0);\n break;\n case 22:\n vt.shift(-2f*PART_LENGTH, -PART_LENGTH, 0);\n break;\n case 23:\n vt.shift(-PART_LENGTH, 2f*PART_LENGTH, 0);\n break;\n case 24:\n vt.shift(2f*PART_LENGTH, PART_LENGTH, 0);\n break;\n\n }\n\n switch (i % 6) {\n case 0 : // r\n nt.rotate(0f, 0f, -HALF_PI);\n nt.rotate(0f, -HALF_PI, 0f);\n break;\n case 1 : // u\n nt.rotate(0f, 0f, HALF_PI);\n nt.rotate(-HALF_PI, 0f, 0f);\n break;\n case 2 : // f\n //--no transformation--\n break;\n case 3 : // l\n nt.rotate(0f, 0f, PI);\n nt.rotate(0f, HALF_PI, 0f);\n break;\n case 4 : // d\n nt.rotate(0f, 0f, PI);\n nt.rotate(HALF_PI, 0f, 0f);\n break;\n case 5 : // b\n nt.rotate(0f, 0f, HALF_PI);\n nt.rotate(0f, PI, 0f);\n break;\n }\n // Finally, we concatenate the rotation to the vertex matrix\n vt.transform(nt);\n }\n\n\n // Center part\n identityVertexMatrix[centerOffset] = new idx3d_Matrix();\n identityNormalMatrix[centerOffset] = new idx3d_Matrix();\n\n // copy all vertex locationTransforms into the normal locationTransforms.\n // create the locationTransforms\n for (int i = 0; i < partCount; i++) {\n\n locationTransforms[i] = new idx3d_Group();\n locationTransforms[i].matrix.set(identityVertexMatrix[i]);\n locationTransforms[i].normalmatrix.set(identityNormalMatrix[i]);\n\n explosionTransforms[i] = new idx3d_Group();\n explosionTransforms[i].addChild(parts[i]);\n locationTransforms[i].addChild(explosionTransforms[i]);\n }\n }", "public void initialise() \n\t{\n\t\tthis.docids = scoresMap.keys();\n\t\tthis.scores = scoresMap.getValues();\n\t\tthis.occurrences = occurrencesMap.getValues();\t\t\n\t\tresultSize = this.docids.length;\n\t\texactResultSize = this.docids.length;\n\n\t\tscoresMap.clear();\n\t\toccurrencesMap.clear();\n\t\tthis.arraysInitialised = true;\n\t}", "public void initIdentity() \r\n\t{\r\n\t\tm[0][0] = 1.0f; m[0][1] = 0.0f; m[0][2] = 0.0f; m[0][3] = 0.0f;\r\n\t\tm[1][0] = 0.0f; m[1][1] = 1.0f; m[1][2] = 0.0f; m[1][3] = 0.0f;\r\n\t\tm[2][0] = 0.0f; m[2][1] = 0.0f; m[2][2] = 1.0f; m[2][3] = 0.0f;\r\n\t\tm[3][0] = 0.0f; m[3][1] = 0.0f; m[3][2] = 0.0f; m[3][3] = 1.0f;\r\n\t}", "protected void inflate() {\n matrix.walkInOptimizedOrder(inflateVisitor);\n }", "private static Node setupMatrix()\n {\n Node thomasAnderson = graphDb.createNode();\n thomasAnderson.setProperty( \"name\", \"Thomas Anderson\" );\n thomasAnderson.setProperty( \"age\", 29 );\n \n Node trinity = graphDb.createNode();\n trinity.setProperty( \"name\", \"Trinity\" );\n Relationship rel = thomasAnderson.createRelationshipTo( trinity, \n MatrixRelationshipTypes.KNOWS );\n rel.setProperty( \"age\", \"3 days\" );\n \n Node morpheus = graphDb.createNode();\n morpheus.setProperty( \"name\", \"Morpheus\" );\n morpheus.setProperty( \"rank\", \"Captain\" );\n morpheus.setProperty( \"occupation\", \"Total badass\" );\n thomasAnderson.createRelationshipTo( morpheus, MatrixRelationshipTypes.KNOWS );\n rel = morpheus.createRelationshipTo( trinity, \n MatrixRelationshipTypes.KNOWS );\n rel.setProperty( \"age\", \"12 years\" );\n \n Node cypher = graphDb.createNode();\n cypher.setProperty( \"name\", \"Cypher\" );\n cypher.setProperty( \"last name\", \"Reagan\" );\n rel = morpheus.createRelationshipTo( cypher, \n MatrixRelationshipTypes.KNOWS );\n rel.setProperty( \"disclosure\", \"public\" );\n \n Node smith = graphDb.createNode();\n smith.setProperty( \"name\", \"Agent Smith\" );\n smith.setProperty( \"version\", \"1.0b\" );\n smith.setProperty( \"language\", \"C++\" );\n rel = cypher.createRelationshipTo( smith, MatrixRelationshipTypes.KNOWS );\n rel.setProperty( \"disclosure\", \"secret\" );\n rel.setProperty( \"age\", \"6 months\" );\n \n Node architect = graphDb.createNode();\n architect.setProperty( \"name\", \"The Architect\" );\n smith.createRelationshipTo( architect, MatrixRelationshipTypes.CODED_BY );\n \n return thomasAnderson;\n }", "public void initialize() {\n grow(0);\n }", "private void fillAll() {\n this.fill_M0();\n this.fill_W();\n this.fill_C();\n }", "public void creation(){\n\t for(int i=0; i<N;i++) {\r\n\t\t for(int j=0; j<N;j++) {\r\n\t\t\t tab[i][j]=0;\r\n\t\t }\r\n\t }\r\n\t resDiagonale(); \r\n \r\n\t //On remplit le reste \r\n\t conclusionRes(0, nCarre); \r\n \t\t\r\n\t \r\n\t isDone=true;\r\n }", "@Test\n public void testMatrixCreation() throws Exception {\n\n testUtilities_3.createAndTestMatrix(false);\n\n }", "private void makeInitial(){\r\n for (int row = 0; row < 9; row++)\r\n System.arraycopy(solution[row], 0, initial[row], 0, 9);\r\n List<Position> fields = new ArrayList<Position>();\r\n for (int row = 0; row < 9; row++)\r\n for (int col = 0; col < 9; col++)\r\n fields.add(new Position(row, col));\r\n Collections.shuffle(fields);\r\n for (int index = 0; index < 40; index ++)\r\n initial[fields.get(index).row][fields.get(index).col] = 0;\r\n }", "public static void main(String[] args) throws IOException {\n\n\t\t\n\t\tdouble[] columnwise = {1.,2.,3.,4.,5.,6.,7.,8.,9.,10.,11.,12.};\n\t\tdouble[] condmat = {1.,3.,7.,9.};\n\t\tint[] matrixDimension = new int[10]; // dont except to ever use more than 4 cells. would by 99x99\n\n\tString[] inputARGNull = null ;\n\t\tArrayList<Integer> inputTestData = new ArrayList<>(Arrays.asList(11,2,3,6,11,18,45,88));\n\n//\t\tSystem.out.println();\n//\t\tSystem.out.println(inputTestData.toString());\n//\t\tSystem.out.println(\"Test Running Class: \" +this.getClass() ) ;\t\n//\t\tMatrix testRunMatrix = new Matrix(2, 3, inputTestData );\n\n\t\tMatrix testRunMatrix = new Matrix();\n\t\ttestRunMatrix.setName(\"testRunMatrix\");\n\t\ttestRunMatrix.displayCompact();\n//\t\tclearScreen();\n\n\t\tMatrix firstRunMatrixParams = new Matrix(3,3, inputTestData);\n\t\tfirstRunMatrixParams.setName(\"firstRunMatrixParams\");\n\t\tfirstRunMatrixParams.displayCompact();\n//\t\tclearScreen();\n\t\t\n\t\tMatrix secondRunMatrixParams = new Matrix(3,3, columnwise); // or condmat\n\t\tsecondRunMatrixParams.setName(\"secondRunMatrixParams\");\n\t\tsecondRunMatrixParams.displayCompact();\n//\t\tclearScreen();\n\t\t\n\t//\tfirstRunMatrixParams.displayDeepString();\n\t//\tsecondRunMatrixParams.displayDeepString();\n\t\tmatrixDimension[0]=2;\n\t\tmatrixDimension[1]=3;\n\t\n\t\tMatrix outOfSeqTestMatrix = new Matrix(matrixDimension, columnwise);\n\t\tsecondRunMatrixParams.setName(\"outOfSeqTestMatrix\");\n\t\tsecondRunMatrixParams.displayCompact();\n\t\t\n\t\tMatrix addResult = firstRunMatrixParams.Add(secondRunMatrixParams);\n\t\taddResult.setName(\"addResult\");\n\t\t\n\t\taddResult.displayCompact();\n//\t\tclearScreen();\n\t\t\n//\t\taddResult = addResult.Multiply((22/7));\n\t\taddResult = addResult.Multiply(3.623);\n\t\taddResult.displayMore();\n\t\t\n\t\t\n\t\tString[] testInput1 = new String[]{\"-c\",\"5x4\",\"12\", \"32\", \"43\", \"44\", \"5\",\"5\",\"5\",\"4\",\"4\",\".999999999\",\"0\",\"0\",\"0\",\"9\",\"4\",\"2.71826\",\"3.14159\",\"33\",\"11\",\"0.1136\",\"888\",\"7\",\"6\",\"5\"};\n\t\tInputStringObj myTestCase = new InputStringObj(\"-c\", testInput1);\n\t\tInputNumericObj myNumTest = new InputNumericObj(myTestCase);\n\t\t\n\t\tSystem.out.println(\"And Now a Matrix from a Numeric Object\");\n\n\t\tMatrix numObjBasedMatrix = new Matrix(myNumTest,\"TestMatrix.java_string\");\n\t\tnumObjBasedMatrix.setName(\"numObjBasedMatrix\");\n\t\tnumObjBasedMatrix.displayCompact();\n\tSystem.out.println(\"\");\n\tSystem.out.println(\"\");\n\t\tnumObjBasedMatrix.displayMore();\n\t\t\n\t\t\n//\t\tclearScreen();\n\t\t\n\t}", "private void initialLockers() {\n for (int i = 0; i < board.length; i++) {\n for (int j = 0; j < board[0].length; j++) {\n board[i][j] = new ReentrantLock();\n }\n }\n }", "@Before\n public void setup() {\n threeByTwo = new Matrix(new int[][] {{1, 2, 3}, {2, 5, 6}});\n compareTwoByThree = new Matrix(new int[][] {{1, 42, 32}, {2, 15, 65}});\n oneByOne = new Matrix(new int[][] {{4}});\n rightOneByOne = new Matrix(new int[][] {{8}});\n twoByFour = new Matrix(new int[][] {{1, 2, 3, 4}, {2, 5, 6, 8}});\n twoByThree = new Matrix(new int[][] {{4, 5}, {3, 2}, {1, 1}});\n threeByThree = new Matrix(new int[][] {{4, 5, 6}, {3, 2, 0}, {1, 1, 1}});\n rightThreeByThree = new Matrix(new int[][] {{1, 2, 3}, {5, 2, 0}, {1, 1, 1}});\n emptyMatrix = new Matrix(new int[0][0]);\n // this is the known correct result of multiplying M1 by M2\n twoByTwoResult = new Matrix(new int[][] {{13, 12}, {29, 26}});\n threeByThreeResult = new Matrix(new int[][] {{35, 24, 18}, {13, 10, 9}, {7, 5, 4}});\n oneByOneSum = new Matrix(new int[][] {{12}});\n oneByOneProduct = new Matrix(new int[][] {{32}});\n }", "public void generate() {\n\t\t\n\t\t// For this system, there are two particles per cell:\n\t\tint nc = size[0][0]*size[0][1]*size[0][2];\n\t\tn = 3*nc;\n\t\t\n\t\t// The AB2 Lattice:\n\t\tAB2Lattice ab2 = new AB2Lattice();\n\t\tab2.setSizeInCells(size[0][0],size[0][1],size[0][2]);\n\t\t\n\t\t// Stick them in the latt member:\n\t\tlatt = new VectorD3[2][];\n\t\tlatt[0] = new VectorD3[n];\t\t\n\t\tSystem.arraycopy(ab2.getLattice(0),0,latt[0], 0, nc);\n\t\tSystem.arraycopy(ab2.getLattice(1),0,latt[0], nc, 2*nc);\n\t\tlatt_name[0] = \"AB2\";\n\t\tab2.saveAsWRL(\"initAB2\");\n\t\t\n\t\t// Build the A and B lattices, A first, then B second:\n\n\t\t// The seperate A and B2 lattices\n\t\tFaceCentredCubicABCLattice fcc = new FaceCentredCubicABCLattice();\n\t\t\n\t\t// Create the new system at the new size:\n\t\tNtp = n-nc;\n\t\tfcc.setSizeInCells(size[1][0],size[1][1],size[1][2]);\n\n\t\t// Copy the two FCC lattices into the 1th phase:\n\t\tlatt[1] = new VectorD3[n];\n\t\tlatt_name[1] = \"FCC\";\n\t\tSystem.arraycopy(fcc.getLattice(), 0, latt[1], 0, n);\n\n\t\t/* Define distances between neighbouring atoms in the same stacking plane \n\t\t * taking advantage of the fact that both lattices have the same Unit Cell: */\n\t\tdouble[] c_uc = new double[3];\n\t\tc_uc = ab2.getUnitCell();\n\t\tuc.x = c_uc[0];\n\t\tuc.y = c_uc[1];\n\t\tuc.z = c_uc[2];\n\t\t\n\t\t// Put the lattices in the class members, for later use:\n\t\tlats[0] = (Lattice)ab2;\n\t\tlats[1] = (Lattice)fcc;\n\t\t\n\t}", "private void run()\r\n {\n List<Cluster> clusters = createClusters();\r\n\r\n //compute MAX_WIDTH and MAX_HEIGHT\r\n computeCloudDimensions(clusters);\r\n\r\n double scale = 1.05;\r\n //try to layout words\r\n while (!doPacking(clusters))\r\n {\r\n //increase cloud dimensions\r\n MAX_WIDTH *= scale;\r\n MAX_HEIGHT *= scale;\r\n }\r\n\r\n doPacking(clusters);\r\n }", "public static void twoStarAlign() {\n if (star1DcEq != null && star2DcEq != null) {\r\n star3DcEq = ccm.starVectorProduct(star1DcEq, star2DcEq);\r\n }\r\n if (star1DcTel != null && star2DcTel != null) {\r\n star3DcTel = ccm.starVectorProduct(star1DcTel, star2DcTel);\r\n }\r\n if (star3DcTel == null || star3DcEq == null) {\r\n //GuiUpdater.updateLog(\"Error: Null Matrixes found. Check your input!!\", Color.RED);\r\n \tLog.e(TAG, \"Error: Null Matrix calculation for 3rd star. Possible null matrixes\");\r\n }\r\n\r\n //Construct two 3X3 matrix for eq direction cosines \r\n //and telescope direction cosines\r\n double star1DcEqD[] = star1DcEq.getColumnPackedCopy();\r\n double star2DcEqD[] = star2DcEq.getColumnPackedCopy();\r\n double star3DcEqD[] = star3DcEq.getColumnPackedCopy();\r\n double starsDcEqD[][] = {\r\n {star1DcEqD[0], star2DcEqD[0], star3DcEqD[0]},\r\n {star1DcEqD[1], star2DcEqD[1], star3DcEqD[1]},\r\n {star1DcEqD[2], star2DcEqD[2], star3DcEqD[2]}};\r\n Matrix eqDirectionCosines = new Matrix(starsDcEqD);\r\n\r\n double star1DcTelD[] = star1DcTel.getColumnPackedCopy();\r\n double star2DcTelD[] = star2DcTel.getColumnPackedCopy();\r\n double star3DcTelD[] = star3DcTel.getColumnPackedCopy();\r\n double starsDcTelD[][] = {\r\n {star1DcTelD[0], star2DcTelD[0], star3DcTelD[0]},\r\n {star1DcTelD[1], star2DcTelD[1], star3DcTelD[1]},\r\n {star1DcTelD[2], star2DcTelD[2], star3DcTelD[2]}};\r\n Matrix telDirectionCosines = new Matrix(starsDcTelD);\r\n\r\n T = telDirectionCosines.times(eqDirectionCosines.inverse());\r\n //GuiUpdater.updateLog(\"Two Star Alignment completed successfuly!\");\r\n Log.i(TAG, \"++ twoStarAlign() ++ \\nT=\");\r\n T.print(5, 2);\r\n }", "public void checkAndDisplayMatrix() {\n if (checkMatrixBounds()) {\n setImageViewMatrix(getDrawMatrix());\n }\n }", "private void restartArray() {\n for (int i = 0; i < 8; i++) {\n for (int j = 0; j < 8; j++) {\n Start.shemaArray[i][j].baseModel.state = 0;\n }\n }\n }", "private void newGroup()\n\t{\n\t\t// There is no need anymore to take care of the meta-data.\n\t\t// That is done once in DenormaliserMeta.getFields()\n\t\t//\n data.targetResult = new Object[meta.getDenormaliserTargetFields().length];\n \n for (int i=0;i<meta.getDenormaliserTargetFields().length;i++)\n {\n data.targetResult[i] = null;\n\n data.counters[i]=0L; // set to 0\n data.sum[i]=null;\n }\n\t}", "public static void main(String[] args) throws IOException {\n\t String FinalContigWritePath=args[0];\n\t\tString ContigAfterPath=args[1];\n\t\tString ContigSPAdesPath=args[2];\n\t\tString MUMmerFile1=args[3];\n\t\tString MUMmerFile2=args[4];\n\t\tint SizeOfContigAfter=CommonClass.getFileLines(ContigAfterPath)/2;\n\t String ContigSetAfterArray[]=new String[SizeOfContigAfter];\n\t int RealSizeOfContigSetAfter=CommonClass.FastaToArray(ContigAfterPath,ContigSetAfterArray); \n\t System.out.println(\"The real size of ContigSetAfter is:\"+RealSizeOfContigSetAfter);\n\t\t//low.\n\t\tint SizeOfContigSPAdes=CommonClass.getFileLines(ContigSPAdesPath);\n\t String ContigSetSPAdesArray[]=new String[SizeOfContigSPAdes+1];\n\t int RealSizeOfContigSetSPAdes=CommonClass.FastaToArray(ContigSPAdesPath,ContigSetSPAdesArray); \n\t System.out.println(\"The real size of ContigSetSPAdes is:\"+RealSizeOfContigSetSPAdes);\n\t\t//Loading After.\n\t\tint LoadingContigAfterCount=0;\n\t\tString LoadingContigAfterArray[]=new String[RealSizeOfContigSetAfter]; \n\t\tfor(int r=0;r<RealSizeOfContigSetAfter;r++)\n\t\t{\n\t\t\t if(ContigSetAfterArray[r].length()>=64)\n\t\t\t {\n\t\t\t\t LoadingContigAfterArray[LoadingContigAfterCount++]=ContigSetAfterArray[r];\n\t\t\t }\n\t\t}\n\t\tSystem.out.println(\"File After loading process end!\");\n\t\t//Alignment1.\n\t\tint SizeOfMUMmerFile1 = CommonClass.getFileLines(MUMmerFile1);\n\t\tString MUMerArray1[] = new String[SizeOfMUMmerFile1];\n\t\tint RealSizeMUMmer1 = CommonClass.FileToArray(MUMmerFile1, MUMerArray1);\n\t\tSystem.out.println(\"The real size of MUMmer1 is:\" + RealSizeMUMmer1);\n\t\t//Alignment.\n\t\tint SizeOfMUMmerFile2 = CommonClass.getFileLines(MUMmerFile2);\n\t\tString MUMerArray2[] = new String[SizeOfMUMmerFile2];\n\t\tint RealSizeMUMmer2 = CommonClass.FileToArray(MUMmerFile2, MUMerArray2);\n\t\tSystem.out.println(\"The real size of MUMmer2 is:\" + RealSizeMUMmer2);\n\t\t//Get ID1.\n\t\tSet<Integer> hashSet = new HashSet<Integer>();\n\t\tfor(int f=4;f<RealSizeMUMmer1;f++)\n\t\t{\n\t\t\tString[] SplitLine1 = MUMerArray1[f].split(\"\\t|\\\\s+\");\n\t\t\tif(SplitLine1.length==14 && (SplitLine1[13].equals(\"[CONTAINS]\") || SplitLine1[13].equals(\"[BEGIN]\") || SplitLine1[13].equals(\"[END]\")))\n\t\t\t{\n\t\t\t\tString[] SplitLine2 = SplitLine1[11].split(\"_\");\n\t\t\t\tint SPAdes_id = Integer.parseInt(SplitLine2[1]);\n\t\t\t\thashSet.add(SPAdes_id);\n\t\t\t}\n\t\t}\n\t\t//Get ID2.\n\t\tfor(int g=4;g<RealSizeMUMmer2;g++)\n\t\t{\n\t\t\tString[] SplitLine11 = MUMerArray2[g].split(\"\\t|\\\\s+\");\n\t\t\tString[] SplitLine12 = SplitLine11[12].split(\"_\");\n\t\t\tint SPAdes_id = Integer.parseInt(SplitLine12[1]);\n\t\t\thashSet.add(SPAdes_id);\n\t\t}\n\t //Write.\n\t\tint LineNum1=0;\n\t for(int x=0;x<LoadingContigAfterCount;x++)\n\t {\n\t\t\t FileWriter writer1= new FileWriter(FinalContigWritePath+\"contig.AfterMerge.fa\",true);\n\t writer1.write(\">\"+(LineNum1++)+\":\"+LoadingContigAfterArray[x].length()+\"\\n\"+LoadingContigAfterArray[x]+\"\\n\");\n\t writer1.close();\n\t }\n\t //Filter.\n\t\tint CountAdd=0;\n\t\tSet<String> HashSetSave = new HashSet<String>();\n\t for(int k=0;k<RealSizeOfContigSetSPAdes;k++)\n\t {\n\t \tif(!hashSet.contains(k))\n\t \t{\n\t \t\tHashSetSave.add(ContigSetSPAdesArray[k]);\n\t \t}\n\t }\n\t\tSystem.out.println(\"The real size of un-useded contigs is:\" + HashSetSave.size());\n\t\t//Write.\n\t\tIterator<String> it = HashSetSave.iterator();\n\t\twhile (it.hasNext()) {\n\t\t\tString SPAdesString = it.next();\n\t\t\tint Flag=1;\n\t\t for(int x=0;x<LoadingContigAfterCount;x++)\n\t\t {\n\t\t \tif((LoadingContigAfterArray[x].length()>=SPAdesString.length())&&(LoadingContigAfterArray[x].contains(SPAdesString)))\n\t\t \t{\n\t\t \t\tFlag=0;\n\t\t \t\tbreak;\n\t\t \t}\n\t\t }\n\t\t\tif(Flag==1)\n\t\t\t{\n\t\t\t\tFileWriter writer = new FileWriter(FinalContigWritePath+\"contig.AfterMerge.fa\",true);\n\t\t\t\twriter.write(\">Add:\"+(LineNum1++)+\"\\n\"+SPAdesString+\"\\n\");\n\t\t\t\twriter.close();\n\t\t\t\tCountAdd++;\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"The real size of add Complementary contigs is:\" + CountAdd);\n\t\tSystem.out.println(\"File write process end!\");\n }", "@Override\n public void create() {\n theMap = new ObjectSet<>(2048, 0.5f);\n generate();\n }", "public TransformationMatrix() {\n\t\ta11 = 1; a12 = 0; a13 = 0; a14 = 0;\n\t\ta21 = 0; a22 = 1; a23 = 0; a24 = 0;\n\t\ta31 = 0; a32 = 0; a33 = 1; a34 = 0;\n\t}", "public void prepare() {\n this.shifts = new ArrayList<>();\n this.rates = new ArrayList<>();\n // bootstrap shifts and rates\n this.prepareShifts();\n this.prepareRates();\n }", "public void initAsteroids(){\n for (int i = 0; i<field.length; i++){\n //initiate the asteroid with random location\n //NOTE: will need some kind of checking in the future to ensure asteroids don't overlap)\n field[i] = new Asteroid(randFloat(),randFloat(),randFloat());\n }\n }", "void makeZero(){\n nnz = 0;\n for(int i=0; i<this.matrixSize; i++){\n this.rows[i] = new List();\n }\n }", "private void generateMaps() {\r\n\t\tthis.tablesLocksMap = new LinkedHashMap<>();\r\n\t\tthis.blocksLocksMap = new LinkedHashMap<>();\r\n\t\tthis.rowsLocksMap = new LinkedHashMap<>();\r\n\t\tthis.waitMap = new LinkedHashMap<>();\r\n\t}", "public void makeMatrixList()\r\n\t{\r\n\t\t// get the fully connected matrix as the first one:\r\n\t\t//matrixList.add(fullConnectedArcMatrix);\r\n // the maximum number of arcs:\r\n\t\tint maximumNumOfArc = varNum * (varNum - 1) / 2;\r\n\t\t// the minimum number of arcs should be varNum - 1, or there will be vertices that are not connected: \r\n\t\tint minimumNumOfArc = varNum - 1;\r\n\t //log.debug(\"minimum number of arcs for \" + varNum + \"variables: \" + minimumNumOfArc + \"/n\");\r\n\t\t// the maximum number of 0 in the upper triangle should be no more than n(n-1)/2 - (n-1)\r\n\t\tint maxZeroNum = varNum*(varNum - 1)/2 - varNum + 1;\r\n\t\t//log.debug(\"maximum number of 0 in matrix for \" + varNum + \"variables: \" + maxZeroNum + \"/n\");\r\n\t\t\r\n\t\t//GenerateAllDAGs ga = new GenerateAllDAGs();\r\n\t\t//getAllDAGs(int maxZeroNum, int maximumNumOfArc, int varNum)\r\n\t\tmatrixList = GenerateAllDAGs.getAllDAGs(maxZeroNum, maximumNumOfArc, varNum);\r\n\t\t\r\n\t}", "private void declareArrays() {\n int iNumTimesteps = m_oLegend.getNumberOfTimesteps(),\n i, j, k;\n \n //Create arrays to hold raw data.\n mp_fLiveTreeVolumeTotals = new double[m_iNumSpecies][iNumTimesteps + 1][m_iNumSizeClasses];\n mp_fSnagVolumeTotals = new double[m_iNumSpecies][iNumTimesteps + 1][m_iNumSizeClasses]; \n mp_iLiveTreeCounts = new long[m_iNumSpecies][iNumTimesteps + 1][m_iNumSizeClasses];\n mp_iSnagCounts = new long[m_iNumSpecies][iNumTimesteps + 1][m_iNumSizeClasses];\n mp_fLiveTreeDBHTotal = new double[m_iNumSpecies][iNumTimesteps + 1];\n mp_fSnagDBHTotal = new double[m_iNumSpecies][iNumTimesteps + 1];\n mp_fTallestLiveTrees = new float[m_iNumSpecies+1][iNumTimesteps + 1][10];\n mp_fTallestSnags = new float[m_iNumSpecies+1][iNumTimesteps + 1][10];\n \n //Initialize all values with 0s\n for (i = 0; i < mp_fTallestLiveTrees.length; i++) {\n for (j = 0; j < mp_fTallestLiveTrees[i].length; j++) {\n for (k = 0; k < mp_fTallestLiveTrees[i][j].length; k++) {\n mp_fTallestLiveTrees[i][j][k] = 0;\n mp_fTallestSnags[i][j][k] = 0;\n }\n }\n }\n \n for (i = 0; i < m_iNumSpecies; i++) {\n for (j = 0; j <= iNumTimesteps; j++) {\n mp_fLiveTreeDBHTotal[i][j] = 0;\n mp_fSnagDBHTotal[i][j] = 0;\n for (k = 0; k < m_iNumSizeClasses; k++) {\n mp_iLiveTreeCounts[i][j][k] = 0;\n mp_iSnagCounts[i][j][k] = 0;\n mp_fLiveTreeVolumeTotals[i][j][k] = 0;\n mp_fSnagVolumeTotals[i][j][k] = 0;\n }\n }\n }\n }", "private void initialize()\n\t{\n\t\tfor(int i = 0 ; i < SOM.length; i++)\n\t\t{\n\t\t\tfor(int j=0; j < SOM[0].length; j++)\n\t\t\t{ \n\t\t\t\tSOM[i][j] = new Node(INPUT_DIMENSION,i,j);\n\t\t\t}\n\t\t}\n\t\t\n\t\tSOM_HORIZONTAL_LENGTH = SOM[0].length;\n\t\tSOM_VERTICAL_LENGTH = SOM.length;\n\t}", "public void mine() {\n\t\t\n\t\t/** generate candidate elements **/\n\t\tgce.generateCE();\n\t\t\n\t\t/** generate patterns **/\n\t\tgcp.setCEList(gce.getCEList());\n\t\tgcp.generateCP();\n\t\t\n\t}", "public void prepare(){\n\n\t\t/* For every cell in the cell space */\n\t\tfor (int i=0;i<GlobalAttributes.xCells;i++){\n\t\t\tfor(int j=0;j<GlobalAttributes.yCells;j++){\n\n\t\t\t\t/* Set the cell state to the starting configuration */\n\t\t\t\tgrid[i][j].topSubcellValue=source[i][j].topSubcellValue;\n\t\t\t\tgrid[i][j].bottomSubcellValue=source[i][j].bottomSubcellValue;\n\t\t\t\tgrid[i][j].leftSubcellValue=source[i][j].leftSubcellValue;\n\t\t\t\tgrid[i][j].rightSubcellValue=source[i][j].rightSubcellValue;\n\n\t\t\t\t/* Set the \"current\" difference matrix value to\n\t\t\t\t * the value in the fixed initial matrix */\n\t\t\t\tdifferent[i][j]=fixeddifferent[i][j];\t\t\t\t\n\t\t\t}\n\t\t}\n\n\t\t/* Reset the differences counter to the fixed version */\n\t\tdifferences=fixeddifferences;\n\t}", "public void buildModel() {\n space = new RabbitsGrassSimulationSpace(gridSize);\n space.setModel(this);\n space.spreadGrass(numInitGrass);\n\n for (int i = 0; i < numInitRabbits; i++) {\n addNewRandomRabbit();\n }\n }", "private void inititalzeAnimalMatrixCounter() {\r\n\t\tCounterProperties cp = new CounterProperties();\r\n\t\tcp.set(AnimationPropertiesKeys.FILLED_PROPERTY, true);\r\n\t\tcp.set(AnimationPropertiesKeys.FILL_PROPERTY, Color.BLUE);\r\n\t\tcounter = lang.newCounter(mainMatrix);\r\n\t\tlang.newCounterView(counter, new Offset(200, 0, \"header\", AnimalScript.DIRECTION_NW), cp, true, true);\r\n\t}", "void displayResults(boolean newFrame)\n {\n Vector alorders = new Vector();\n SequenceI[][] results = new SequenceI[jobs.length][];\n AlignmentOrder[] orders = new AlignmentOrder[jobs.length];\n for (int j = 0; j < jobs.length; j++)\n {\n if (jobs[j].hasResults())\n {\n Object[] res = ((MsaWSJob) jobs[j]).getAlignment();\n alorders.add(res[1]);\n results[j] = (SequenceI[]) res[0];\n orders[j] = (AlignmentOrder) res[1];\n\n // SequenceI[] alignment = input.getUpdated\n }\n else\n {\n results[j] = null;\n }\n }\n Object[] newview = input.getUpdatedView(results, orders, getGapChar());\n // trash references to original result data\n for (int j = 0; j < jobs.length; j++)\n {\n results[j] = null;\n orders[j] = null;\n }\n SequenceI[] alignment = (SequenceI[]) newview[0];\n ColumnSelection columnselection = (ColumnSelection) newview[1];\n Alignment al = new Alignment(alignment);\n // TODO: add 'provenance' property to alignment from the method notes\n // accompanying each subjob\n if (dataset != null)\n {\n al.setDataset(dataset);\n }\n\n propagateDatasetMappings(al);\n // JBNote- TODO: warn user if a block is input rather than aligned data ?\n\n if (newFrame)\n {\n AlignFrame af = new AlignFrame(al, columnselection,\n AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);\n\n // initialise with same renderer settings as in parent alignframe.\n af.getFeatureRenderer().transferSettings(this.featureSettings);\n // update orders\n if (alorders.size() > 0)\n {\n if (alorders.size() == 1)\n {\n af.addSortByOrderMenuItem(WebServiceName + \" Ordering\",\n (AlignmentOrder) alorders.get(0));\n }\n else\n {\n // construct a non-redundant ordering set\n Vector names = new Vector();\n for (int i = 0, l = alorders.size(); i < l; i++)\n {\n String orderName = new String(\" Region \" + i);\n int j = i + 1;\n\n while (j < l)\n {\n if (((AlignmentOrder) alorders.get(i))\n .equals(((AlignmentOrder) alorders.get(j))))\n {\n alorders.remove(j);\n l--;\n orderName += \",\" + j;\n }\n else\n {\n j++;\n }\n }\n\n if (i == 0 && j == 1)\n {\n names.add(new String(\"\"));\n }\n else\n {\n names.add(orderName);\n }\n }\n for (int i = 0, l = alorders.size(); i < l; i++)\n {\n af.addSortByOrderMenuItem(\n WebServiceName + ((String) names.get(i)) + \" Ordering\",\n (AlignmentOrder) alorders.get(i));\n }\n }\n }\n\n Desktop.addInternalFrame(af, alTitle, AlignFrame.DEFAULT_WIDTH,\n AlignFrame.DEFAULT_HEIGHT);\n\n }\n else\n {\n System.out.println(\"MERGE WITH OLD FRAME\");\n // TODO: modify alignment in original frame, replacing old for new\n // alignment using the commands.EditCommand model to ensure the update can\n // be undone\n }\n }", "public void calcMatrix() {\n \n FockState rowState = new FockState(_systemSize, _epsilon, _mass);\n FockState opedState = new FockState(_systemSize, _epsilon, _mass);\n Integer column;\n int[] momenta = new int[_phiPow-1]; \n for(int row=0; row<_numStates; row++) {\n \n // Run through the matrix rows\n \t// Set the row state and create the row Map\n \t\n rowState.setAsIndex(row);\n Map<Integer, Double> rowMap = new HashMap<Integer, Double>();\n \t\t_elements.add(row, rowMap);\n\n \t// Reset the momenta combinations array\n \t\n \tfor(int i=0; i<(_phiPow-1); i++) {\n momenta[i]=0;\n } \n for(int j=0; j<_momCombs; j++) {\n \n // Run through the various momenta combinations\n \n for(int opType=0; opType<_opCombs; opType++) {\n \n // Run through the various operator combinations\n \n opedState.makeSameAs(rowState);\n applyOperators(opedState, momenta, opType); \n if(opedState.isValid()==true) {\n \t\n \t// Calculate the column\n \t\n \tcolumn = opedState.calcIndex(); \n \tif((column != null) && (column < _numStates)) {\n \t\t\n \t\t// If the resulting state is valid and within the cutoff, store the result\n \t\t\n \t\tstore(row, column, momenta);\n \n \t} \t\n } \n }\n \n // Increment the momenta label array unless this is the final run through\n \n if(j != (_momCombs-1)) {\n \tincrementMomentaLabel(momenta);\n } \n } \n }\n \n }", "private void setup() {\n Collections.sort(samples);\n this.pos = 0;\n }", "public static void newProject() {\n\n //create the arena representation\n //populateBlocks();\n //populateSensors();\n }", "public void makeEmpty() {\r\n for (int i = 0; i < tableSize; i++) {\r\n table[i] = new DList<Entry<K, V>>();\r\n }\r\n }", "private void initialize() {\n\t\tfor(String key: count_e_f.keySet()){\n\t\t\tcount_e_f.put(key, 0.0);\n\t\t}\n\t\t\n\t\tfor(Integer key: total_f.keySet()){\n\t\t\ttotal_f.put(key, 0.0);\n\t\t}\n\t\t\n\t\t//This code is not efficient.\n//\t\tfor(Entry<String, Integer> german : mainIBM.gerWordsIdx.entrySet()){\n//\t\t\tfor(Entry<String, Integer> english : mainIBM.engWordsIdx.entrySet()){\n//\t\t\t\tcount_e_f.put(english.getValue() + \"-\" + german.getValue(), 0.0);\n//\t\t\t}\n//\t\t\ttotal_f.put(german.getValue(), 0.0);\n//\t\t}\t\n\n\t}", "public void beginInitialization() {\n SQLiteDatabase db = this.helper.getWritableDatabase();\n db.beginTransaction();\n populateMeasurementVersionsCache(db);\n }", "public void makeEmpty() {\n defTable = new DList[sizeBucket];\n for(int i=0; i<sizeBucket; i++) {\n defTable[i] = new DList();\n }\n size = 0;\n }", "protected void onStart() {\n // Allocate while starting to improve chances of thread-local\n // isolation\n queue = new Runnable[INITIAL_QUEUE_CAPACITY];\n // Initial value of seed need not be especially random but\n // should differ across threads and must be nonzero\n int p = poolIndex + 1;\n seed = p + (p << 8) + (p << 16) + (p << 24); // spread bits\n }", "@Override\r\n\tprotected void compute() {\n\t\tint length = end - start + 1;\r\n\r\n\t\tif (length < 4 || length <= result.length / 4) {\r\n\r\n\t\t\trand();\r\n\r\n\t\t} else {\r\n\r\n\t\t\tint mid = (start + end + 1) >>> 1;\r\n\t\t\tMatrixRandomInit left = new MatrixRandomInit(result,ratio,start, mid - 1);\r\n\t\t\tMatrixRandomInit right = new MatrixRandomInit(result,ratio,mid, end);\r\n\r\n\t\t\tForkJoinTask<Void> leftTask = left.fork();\r\n\t\t\tForkJoinTask<Void> rightTask = right.fork();\r\n\r\n\t\t\tleftTask.join();\r\n\t\t\trightTask.join();\r\n\t\t}\r\n\t}", "private void begin(){\n for(int i = 0; i < height; i++){ //y\n for(int j = 0; j < width; j++){ //x\n for(int k = 0; k < ids.length; k++){\n if(m.getTileids()[j][i].equals(ids[k])){\n map[j][i] = Handler.memory.getTiles()[k];\n //Handler.debug(\"is tile null: \" + (Handler.memory.getTiles()[k] == null));\n \n k = ids.length;\n }else if(k == (ids.length - 1)){\n Handler.debug(\"something went wrong\", true);\n\n }\n }\n }\n }\n mt.setCleared(clear);\n mt.setMap(map);\n \n \n }", "private void initGameMatrix() {\n double matrixTileHeight = this.fieldPane.getMaxHeight() / 11;\n double matrixTileWidth = this.fieldPane.getMaxWidth() / 11;\n\n for (int i = 0; i < this.fieldPane.getMaxWidth(); i += matrixTileWidth) {\n for (int j = 0; j < this.fieldPane.getMaxHeight(); j += matrixTileHeight) {\n Rectangle2D r = new Rectangle2D(j, i, matrixTileWidth, matrixTileHeight);\n gameMatrix.add(r);\n }\n }\n }", "public void generate(){\r\n\t\tcleanMatrix();\r\n\t\tint a = 0;\r\n\t\twhile(a < parameterObj.getHeight()){\r\n\t\t\tletterMatrix[a][0]= parameterObj.getTypeChar();\r\n\t\t\tletterMatrix[a][parameterObj.getWidth()-1]= parameterObj.getTypeChar();\r\n\t\t\ta++;\r\n\t\t}\r\n\t\tint middleHeight=parameterObj.getHeight()/2;\r\n\t\tint middleWidht=parameterObj.getWidth()/2;\r\n\t\tletterMatrix[middleHeight][middleWidht] = parameterObj.getTypeChar();\r\n\t\ta=middleWidht;\r\n\t\twhile(a > 0){\r\n\t\t\tletterMatrix[a][a]= parameterObj.getTypeChar();\r\n\t\t\ta--;\r\n\t\t}\r\n\t\ta = middleWidht;\r\n\t\tint b = middleHeight;\r\n\t\twhile(a > 0){\r\n\t\t\tletterMatrix[a][b]= parameterObj.getTypeChar();\r\n\t\t\ta--;\r\n\t\t\tb++;\r\n\t\t}//fin while\r\n\t}", "public SparseScoreMatrix(String fileName, int alignmentLimit)\r\n throws IOException\r\n {\r\n System.out.println(\"Reading sparse matrix.\");\r\n \r\n BufferedReader input = open_file(new File(fileName));\r\n if (input == null) \r\n throw new IOException(\"Could not open sparse matrix file \" + fileName); \r\n \r\n String line = read_a_line(input);\r\n StringTokenizer st = new StringTokenizer(line.substring(1), \"\\t\");\r\n \r\n this.names = new String[AGS_console.GD.size()];\r\n //this.matchNames = new ArrayList[GD.size()];\r\n this.matchIndexes = new ArrayList[AGS_console.GD.size()];\r\n this.scores = new ArrayList[AGS_console.GD.size()];\r\n \r\n for (int i=0; i<AGS_console.GD.size(); i++)\r\n {\r\n //this.matchNames[i] = new ArrayList<String>(alignmentLimit);\r\n this.matchIndexes[i] = new ArrayList<Integer>(alignmentLimit/3);\r\n this.scores[i] = new ArrayList<Integer>(alignmentLimit/3);\r\n }\r\n \r\n int count = 0;\r\n while (st.hasMoreTokens())\r\n {\r\n this.names[count] = st.nextToken();\r\n count++;\r\n }\r\n \r\n \r\n // Read line by line and fetch every score to list\t \r\n int row_count = 0;\r\n String nextHit = \"\";\r\n while (more_records(input))\r\n {\r\n line = read_a_line(input);\r\n if ((line.length()==0))\r\n {\r\n break;\r\n }\r\n st = new StringTokenizer(line, \"\\t\");\r\n \r\n int column_count = 0;\r\n while (st.hasMoreTokens())\r\n {\r\n nextHit = st.nextToken();\r\n //this.matchNames[row_count].add(nextHit);\r\n this.matchIndexes[row_count].add(AGS_console.GD.getGeneLocationByPreComputedIndex(nextHit));\r\n int nextNumber = Integer.parseInt(st.nextToken());\r\n this.scores[row_count].add(nextNumber);\r\n column_count++;\r\n }\r\n row_count++;\r\n }\r\n input.close();\r\n \r\n // Set ONLY self-scoring genes\r\n for (int i=0; i<this.matchIndexes.length; i++)\r\n {\r\n if (this.matchIndexes[i].size()<=1) // Scores only itself or (nothing--which should not happen)\r\n {\r\n AGS_console.GD.allGenes[i].noScoresFound = true;\r\n }\r\n } \r\n }", "public void build() {\n\t\tgenerate();\n\t\tstoreAns();\n\t\t// display();\n\t}", "private void fillRots() {\n for (int joint=0;joint<numObjects;joint++){\n // 1) Find first non-null rotation of joint <code>joint</code>\n int start;\n for (start=0;start<keyframes.size();start++){\n if (((PointInTime)keyframes.get(start)).usedRot.get(joint)) break;\n }\n if (start==keyframes.size()){ // if they are all null then fill with identity\n for (int i=0;i<keyframes.size();i++)\n ((PointInTime)keyframes.get(i)).look[joint].setRotationQuaternion(new Quaternion());\n continue; // we're done so lets break\n }\n if (start!=0){ // if there -are- null elements at the begining, then fill with first non-null\n \n ((PointInTime)keyframes.get(start)).look[joint].getRotation(unSyncbeginRot);\n for (int i=0;i<start;i++)\n ((PointInTime)keyframes.get(i)).look[joint].setRotationQuaternion(unSyncbeginRot);\n }\n int lastgood=start;\n for (int i=start+1;i<keyframes.size();i++){\n if (((PointInTime)keyframes.get(i)).usedRot.get(joint)){\n fillQuats(joint,lastgood,i); // fills gaps\n lastgood=i;\n }\n }\n // fillQuats(joint,lastgood,keyframes.size()-1); // fills tail\n ((PointInTime)keyframes.get(lastgood)).look[joint].getRotation(unSyncbeginRot);\n \n for (int i=lastgood+1;i<keyframes.size();i++){\n ((PointInTime)keyframes.get(i)).look[joint].setRotationQuaternion(unSyncbeginRot);\n }\n }\n }", "public void makeSmartMatrix() {\n int colCount = findLongestWordLength();\n int rowCount = wordsArray.length + 2; //a row for each word and one for the summation word and a row for the carry over numbers\n smartMatrix = new String[rowCount][colCount];\n //fill the matrix\n for (int i = 0; i < rowCount; i++) {\n for (int j = 0; j < colCount; j++) {\n //do something\n if (i == 0) {\n //carry row\n smartMatrix[i][j] = \"Carry\" + Math.abs(colCount - 1 - j);\n } else if (i == rowCount - 1) {\n //summation row\n if (j < summationLetters.length) {\n smartMatrix[i][j] = summationLetters[j];\n } else {\n smartMatrix[i][j] = \"blank\";\n }\n } else {\n //words rows\n if (j < wordsArray[i - 1].length()) {\n smartMatrix[i][j] = wordsArray[i - 1].substring(j, j + 1);\n } else {\n smartMatrix[i][j] = \"blank\";\n }\n }\n }\n }\n \n for (int j = 0; j < findLongestWordLength(); j++) {\n for (int i = 1; i <= wordsArray.length; i++) {\n if (\"blank\".equals(smartMatrix[i][findLongestWordLength() - 1])) {\n lastToFirst(smartMatrix[i]);\n }\n }\n }\n System.out.println(Arrays.deepToString(smartMatrix));\n }", "public void reconstruct() {\n if(dna.size() != number) {\n init();\n imageChanged = false;\n }\n \n // Image has changed, uncomplete one element o \n if(imageChanged) {\n imageComplete = false;\n imageChanged = false;\n }\n \n // Check the completness of the reconstruction\n for(Item i : dna) {\n if(!i.isComplete()) {\n imageComplete = false;\n break;\n }\n }\n \n // Stop calculation if it is complete\n if(imageComplete) {\n return;\n }\n \n for(Item i : dna) { \n // Calculate fitness\n float[] fit = fitness(i);\n // Mutate depends on fitness\n mutate(i, fit);\n // Set fitness for drawing\n i.fitness = fit;\n }\n \n if(!complete) \n generations++;\n }", "public void setup() {\n\t\tsize(1300, 800);\n\t\tint seed = 4346;\n\t\tran = new Random(seed);\n\t\trandompolys = randomPolygons(210);// prepare the input polygons\n\n\t\tDouble segment_len = useAbey ? null : segment_max_length;\n\t\tPack pack = new Pack(randompolys, margin, segment_len, rotSteps, WID, HEI, preferX);\n\t\tpack.packOneSheet(useAbey);\n\t\tpacks.add(pack);\n\n\t\tfor (int i = 0; i < 100; i++) { // packing one sheet after another, 100 is estimated\n\t\t\tint size = packs.size();\n\t\t\tif (packs.get(size - 1).isEmpty()) {\n\t\t\t\tprintln(size + \" sheets\");\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tpack = packs.get(size - 1).clone();\n\t\t\tpack.packOneSheet(useAbey);\n\t\t\tpacks.add(pack);\n\t\t}\n\t\treport();\n\t}", "public void inicialAleatorio() {\n //aqui adiciona naquele vetor que de auxilio\n alocacao.add(Estados.ELETRICISTAS);\n alocacao.add(Estados.ELETRICISTAS2);\n alocacao.add(Estados.QUALIDADE);\n alocacao.add(Estados.QUALIDADE2);\n alocacao.add(Estados.FABRICACAO_ESTRUTURAL);\n alocacao.add(Estados.FABRICACAO_ESTRUTURAL2);\n alocacao.add(Estados.FABRICACAO_ESTRUTURAL3);\n alocacao.add(Estados.PLANEJAMENTO);\n\n //biblioteca que sorteia aleatoriamente os departamentos\n Collections.shuffle(alocacao);\n\n for (int i = 0; i < 4; i++) {\n matrix[1][i] = alocacao.get(i);\n\n }\n\n for (int i = 0; i < 4; i++) {\n matrix[3][i] = alocacao.get(i + 4);\n }\n\n }", "private void prepare()\n {\n AmbulanceToLeft ambulanceToLeft = new AmbulanceToLeft();\n addObject(ambulanceToLeft,717,579);\n Car2ToLeft car2ToLeft = new Car2ToLeft();\n addObject(car2ToLeft,291,579);\n Car3 car3 = new Car3();\n addObject(car3,45,502);\n CarToLeft carToLeft = new CarToLeft();\n addObject(carToLeft,710,262);\n Car car = new Car();\n addObject(car,37,190);\n AmbulanceToLeft ambulanceToLeft2 = new AmbulanceToLeft();\n addObject(ambulanceToLeft2,161,264);\n }", "public void generate()\n {\n System.out.println(\"Initial allocated space for Set: Not supported\");\n// System.out.println(\"Initial allocated space for Set: \" + theMap.capacity());\n final long startTime = TimeUtils.nanoTime();\n Mnemonic m = new Mnemonic(123456789L);\n// GridPoint2 gp = new GridPoint2(0, 0);\n for (int x = -width; x < width; x++) {\n for (int y = -height; y < height; y++) {\n// for (int z = -height; z < height; z++) {\n\n// long z = (x & 0xFFFFFFFFL) << 32 | (y & 0xFFFFFFFFL);\n// z = ((z & 0x00000000ffff0000L) << 16) | ((z >>> 16) & 0x00000000ffff0000L) | (z & 0xffff00000000ffffL);\n// z = ((z & 0x0000ff000000ff00L) << 8 ) | ((z >>> 8 ) & 0x0000ff000000ff00L) | (z & 0xff0000ffff0000ffL);\n// z = ((z & 0x00f000f000f000f0L) << 4 ) | ((z >>> 4 ) & 0x00f000f000f000f0L) | (z & 0xf00ff00ff00ff00fL);\n// z = ((z & 0x0c0c0c0c0c0c0c0cL) << 2 ) | ((z >>> 2 ) & 0x0c0c0c0c0c0c0c0cL) | (z & 0xc3c3c3c3c3c3c3c3L);\n// z = ((z & 0x2222222222222222L) << 1 ) | ((z >>> 1 ) & 0x2222222222222222L) | (z & 0x9999999999999999L);\n// theMap.put(z, null); // uses 23312536 bytes of heap\n// long z = szudzik(x, y);\n// theMap.put(z, null); // uses 18331216 bytes of heap?\n// unSzudzik(pair, z);\n// theMap.put(0xC13FA9A902A6328FL * x ^ 0x91E10DA5C79E7B1DL * y, null); // uses 23312576 bytes of heap\n// theMap.put((x & 0xFFFFFFFFL) << 32 | (y & 0xFFFFFFFFL), null); // uses 28555456 bytes of heap\n theMap.add(new Vector2(x - width * 0.5f, y - height * 0.5f)); // crashes out of heap with 720 Vector2\n// gp.set(x, y);\n// theMap.add(gp.hashCode());\n// long r, s;\n// r = (x ^ 0xa0761d65L) * (y ^ 0x8ebc6af1L);\n// s = 0xa0761d65L * (z ^ 0x589965cdL);\n// r -= r >> 32;\n// s -= s >> 32;\n// r = ((r ^ s) + 0xeb44accbL) * 0xeb44acc8L;\n// theMap.add((int)(r - (r >> 32)));\n\n// theMap.add(m.toMnemonic(szudzik(x, y)));\n }\n }\n// }\n// final GridPoint2 gp = new GridPoint2(x, y);\n// final int gpHash = gp.hashCode(); // uses the updated GridPoint2 hashCode(), not the current GDX code\n// theMap.put(gp, gpHash | 0xFF000000); //value doesn't matter; this was supposed to test ObjectMap\n //theMap.put(gp, (53 * 53 + x + 53 * y) | 0xFF000000); //this is what the hashCodes would look like for the current code\n \n //final int gpHash = x * 0xC13F + y * 0x91E1; // updated hashCode()\n //// In the updated hashCode(), numbers are based on the plastic constant, which is\n //// like the golden ratio but with better properties for 2D spaces. These don't need to be prime.\n \n //final int gpHash = 53 * 53 + x + 53 * y; // equivalent to current hashCode()\n long taken = TimeUtils.timeSinceNanos(startTime);\n System.out.println(taken + \"ns taken, about 10 to the \" + Math.log10(taken) + \" power.\");\n// System.out.println(\"Post-assign allocated space for Set: \" + theMap.capacity());\n System.out.println(\"Post-assign allocated space for Set: Not supported\");\n }", "public void initialise(Graph graph) {\n Entry[][] matrix = graph.matrix();\n matrix[START_INDEX][0] = new Entry(0.0, 0.0);\n double initial = 1.0 / graph.size();\n\n for (int i = 1; i < graph.size(); i++) {\n matrix[i][0] = new Entry(initial, initial);\n }\n }", "private void generate()\r\n {\r\n mapPieces = myMap.Generate3();\r\n mapWidth = myMap.getMapWidth();\r\n mapHeight = myMap.getMapHeight();\r\n }", "private void initializeGraphAsEmpty() {\n int max = getNumNodes();\n\n parentMatrix = new int[getNumNodes()][max];\n childMatrix = new int[getNumNodes()][max];\n\n for (int i = 0; i < getNumNodes(); i++) {\n parentMatrix[i][0] = 1; //set first node\n childMatrix[i][0] = 1;\n }\n\n for (int i = 0; i < getNumNodes(); i++) {\n for (int j = 1; j < max; j++) {\n parentMatrix[i][j] = -5; //set first node\n childMatrix[i][j] = -5;\n }\n }\n }", "PEKSInitial() {\n\t\tprimeP = BigInteger.probablePrime(512, new Random());// generate a 512\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// bit prime\n\t\tprimeQ = BigInteger.probablePrime(512, new Random());// generate a 512\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// bit prime\n\t\tgenerator = new BigInteger(512, new Random());// a 512 bit number, may\n\t\t \t\t\t\t\t\t\t\t\t\t// not prime\n\t\tprimeM = primeP.multiply(primeQ);// compute m=p*q\n\t\tfainM = (primeP.subtract(BigInteger.ONE)).multiply(primeQ\n\t\t\t\t.subtract(BigInteger.ONE));// eluer function of m\n\t\t//keyVector.add(generator);\n\t\t//File outputFile = new File(\"Data Records\\\\123456.txt\");\n\t\t//ht.put(generator,outputFile.getAbsolutePath());\n\t}", "private void setupTransformationMatrix(ShapeRenderer renderer){\n\t\trenderer.identity();\n\t\trenderer.translate(cx, cy, 0);\n\t\trenderer.rotate(0, 0, 1, angle); \n\t\trenderer.translate(-cx, -cy, 0);\n\t}", "private void setNewTable() {\n\n for (List<Entity> list:\n masterList) {\n for (Entity entity :\n list) {\n entity.removeFromWorld();\n }\n list.clear();\n }\n\n gameFacade.setGameTable(gameFacade.newFullPlayableTable(\"asd\",\n 6, 0.5, 2, 2));\n for (Bumper bumper :\n gameFacade.getBumpers()) {\n Entity bumperEntity = factory.newBumperEntity(bumper);\n targets.add(bumperEntity);\n getGameWorld().addEntity(bumperEntity);\n }\n\n for (Target target :\n gameFacade.getTargets()) {\n Entity targetEntity = factory.newTargetEntity(target);\n targets.add(targetEntity);\n getGameWorld().addEntity(targetEntity);\n }\n }", "public void randomInit() {\n Plain plain = new Plain(width + 2);\n grid = new Living[width + 2][width + 2];\n for (int i = 1; i < grid.length - 1; i++) {\n for (int j = 1; j < grid[i].length - 1; j++) {\n int randomNum = (int) (Math.random() * 5);\n switch (randomNum) {\n case 0:\n grid[i][j] = new Badger(plain, i, j, 0);\n break;\n case 1:\n grid[i][j] = new Empty(plain, i, j);\n break;\n case 2:\n grid[i][j] = new Fox(plain, i, j, 0);\n break;\n case 3:\n grid[i][j] = new Grass(plain, i, j);\n break;\n case 4:\n grid[i][j] = new Rabbit(plain, i, j, 0);\n break;\n }\n }\n }\n }", "private Grid(Grid oldGrid) {\n\n grid = new String[Main.Y_SIZE][Main.X_SIZE][Main.Z_SIZE];\n this.gateDatabase = oldGrid.gateDatabase;\n this.netDatabase = oldGrid.netDatabase;\n\n for (int i = 0; i < Main.Z_SIZE; i++) {\n for (int k = 0; k < Main.X_SIZE; k++) {\n for (int n = 0; n < Main.Y_SIZE; n++) {\n grid[n][k][i] = oldGrid.grid[n][k][i];\n }\n }\n }\n }", "public Matrix() {\n\tmatrix = new Object[DEFAULT_SIZE][DEFAULT_SIZE];\n }", "protected abstract void startBatch(Matrix metadata);", "public void start() {\r\n for (int i = 0; i < gridSize; i++){\r\n increaseGridSize();\r\n }\r\n createRectangles();\r\n addRectanglesToGrid(grid, rectangles);\r\n Collections.shuffle(rectangles);\r\n setBoard();\r\n }", "static void setupLCA() {\n maxDepth = 0;\n depth = new int[N]; // store the depth of each node\n firstParents = new int[N]; // the immediate parent\n firstParents[0] = 0;\n depth[0] = 0;\n dfs(0);\n int power = 1;\n // Increase the power higher until we go over the maxDepth\n // This will be one more than we need\n while (1 << power <= maxDepth) {\n power++;\n }\n parent = new int[power][N]; // go up 2^power from node i of N\n // Now, use that initial information acquired from the dfs to build\n // base cases of the sparse tables!\n for (int node = 0; node < N; node++) {\n parent[0][node] = firstParents[node];\n }\n // Necessary to set everything else to zero for now, so\n // that we never get confused if we are out of bounds\n\n // Must fill it up with -1's\n for (int p = 1; p < parent.length; p++) {\n for (int i = 0; i < N; i++) {\n parent[p][i] = -1;\n }\n }\n // p represents going up by 1 << p\n for (int p = 1; p < parent.length; p++) {\n for (int node = 0; node < N; node++) {\n if (parent[p - 1][node] != -1) {\n int myParent = parent[p - 1][node];\n parent[p][node] = parent[p-1][myParent];\n }\n }\n }\n }", "public void mergeAlignment() {\n \n SAMFileReader unmappedSam = null;\n if (this.unmappedBamFile != null) {\n unmappedSam = new SAMFileReader(IoUtil.openFileForReading(this.unmappedBamFile));\n }\n \n // Write the read groups to the header\n if (unmappedSam != null) header.setReadGroups(unmappedSam.getFileHeader().getReadGroups());\n \n int aligned = 0;\n int unmapped = 0;\n \n final PeekableIterator<SAMRecord> alignedIterator = \n new PeekableIterator(getQuerynameSortedAlignedRecords());\n final SortingCollection<SAMRecord> alignmentSorted = SortingCollection.newInstance(\n SAMRecord.class, new BAMRecordCodec(header), new SAMRecordCoordinateComparator(),\n MAX_RECORDS_IN_RAM);\n final ClippedPairFixer pairFixer = new ClippedPairFixer(alignmentSorted, header);\n \n final CloseableIterator<SAMRecord> unmappedIterator = unmappedSam.iterator();\n SAMRecord nextAligned = alignedIterator.hasNext() ? alignedIterator.next() : null;\n SAMRecord lastAligned = null;\n \n final UnmappedReadSorter unmappedSorter = new UnmappedReadSorter(unmappedIterator);\n while (unmappedSorter.hasNext()) {\n final SAMRecord rec = unmappedSorter.next();\n rec.setReadName(cleanReadName(rec.getReadName()));\n if (nextAligned != null && rec.getReadName().compareTo(nextAligned.getReadName()) > 0) {\n throw new PicardException(\"Aligned Record iterator (\" + nextAligned.getReadName() +\n \") is behind the umapped reads (\" + rec.getReadName() + \")\");\n }\n rec.setHeader(header);\n \n if (isMatch(rec, nextAligned)) {\n if (!ignoreAlignment(nextAligned)) {\n setValuesFromAlignment(rec, nextAligned);\n if (programRecord != null) {\n rec.setAttribute(ReservedTagConstants.PROGRAM_GROUP_ID,\n programRecord.getProgramGroupId());\n }\n aligned++;\n }\n nextAligned = alignedIterator.hasNext() ? alignedIterator.next() : null;\n }\n else {\n unmapped++;\n }\n \n // Add it if either the read or its mate are mapped, unless we are adding aligned reads only\n final boolean eitherReadMapped = !rec.getReadUnmappedFlag() || (rec.getReadPairedFlag() && !rec.getMateUnmappedFlag());\n \n if (eitherReadMapped || !alignedReadsOnly) {\n pairFixer.add(rec);\n }\n }\n unmappedIterator.close();\n alignedIterator.close();\n \n final SAMFileWriter writer =\n new SAMFileWriterFactory().makeBAMWriter(header, true, this.targetBamFile);\n int count = 0;\n CloseableIterator<SAMRecord> it = alignmentSorted.iterator();\n while (it.hasNext()) {\n SAMRecord rec = it.next();\n if (!rec.getReadUnmappedFlag()) {\n if (refSeq != null) {\n byte referenceBases[] = refSeq.get(rec.getReferenceIndex()).getBases();\n rec.setAttribute(SAMTag.NM.name(),\n SequenceUtil.calculateSamNmTag(rec, referenceBases, 0, bisulfiteSequence));\n rec.setAttribute(SAMTag.UQ.name(),\n SequenceUtil.sumQualitiesOfMismatches(rec, referenceBases, 0, bisulfiteSequence));\n }\n }\n writer.addAlignment(rec);\n if (++count % 1000000 == 0) {\n log.info(count + \" SAMRecords written to \" + targetBamFile.getName());\n }\n }\n writer.close();\n \n \n log.info(\"Wrote \" + aligned + \" alignment records and \" + unmapped + \" unmapped reads.\");\n }", "@Override\n\tpublic void beginGeneration() {\n\t\tfor(int seqIndex = 0; seqIndex < NUM_SEQUENCES; ++seqIndex) {\n\t\t\tfor(int pieceIndex = 0; pieceIndex < SEQUENCE_LENGTH; ++pieceIndex) {\n\t\t\t\tsequences[seqIndex][pieceIndex] = random.nextInt(State.N_PIECES);\n\t\t\t}\n\t\t}\n\t}", "void init_embedding() {\n\n\t\tg_heir = new int[50]; // handles up to 8^50 points\n\t\tg_levels = 0; // stores the point-counts at the associated levels\n\n\t\t// reset the embedding\n\n\t\tint N = m_gm.getNodeCount();\n\t\tif (areUsingSubset) {\n\t\t\tN = included_points.size();\n\t\t}\n\t\t\n\t\tm_embed = new float[N*g_embedding_dims];\n\n\t\tfor (int i = 0; i < N; i++) {\n\t\t\tfor (int j = 0; j < g_embedding_dims; j++) {\n\t\t\t\tm_embed[i * (g_embedding_dims) + j] = ((float) (myRandom\n\t\t\t\t\t\t.nextInt(10000)) / 10000.f) - 0.5f;\n\t\t\t}\n\t\t}\n\n\t\t// calculate the heirarchy\n\t\tg_levels = fill_level_count(N, g_heir, 0);\n\t\tg_levels = 1;\n\t\t\n\t\t// generate vector data\n\n\t\tg_current_level = g_levels - 1;\n\t\tg_vel = new float[g_embedding_dims * N];\n\t\tg_force = new float[g_embedding_dims * N];\n\n\t\t// compute the index sets\n\n\t\tg_idx = new IndexType[N * (V_SET_SIZE + S_SET_SIZE)];\n\t\tfor (int i = 0; i < g_idx.length; i++) {\n\n\t\t\tg_idx[i] = new IndexType();\n\t\t}\n\n\t\tg_done = false; // controls the movement of points\n\t\tg_interpolating = false; // specifies if we are interpolating yet\n\n\t\tg_cur_iteration = 0; // total number of iterations\n\t\tg_stop_iteration = 0; // total number of iterations since changing\n\t\t\t\t\t\t\t\t// levels\n\t}", "private void initiateGameTerrainMatrix(GameTerrain gameTerrain){\n\t\tMatrix4f transformationMatrix = MathFuncs.initializeTransformingMatrix(new Vector3f(gameTerrain.getX(), 0, gameTerrain.getZ()), 0, 0, 0, 1);\r\n\t\t//Load up the transformation matrix\r\n\t\tgameTerrainShader.loadTransformationMatrix(transformationMatrix);\r\n\t}", "private void initMatrix(Canvas canvas) {\n\t\tint height = canvas.getHeight();\n\t\tint width = canvas.getWidth();\n\t\tchar[][] matrix = canvas.getMatrix();\n\n\t\tif (matrix == null) {\n\t\t\tmatrix = new char[width][height];\n\t\t\tfor (int i = 0; i < width; i++) {\n\t\t\t\tfor (int j = 0; j < height; j++) {\n\t\t\t\t\tmatrix[i][j] = SPACE;\n\t\t\t\t}\n\t\t\t}\n\t\t\tcanvas.setMatrix(matrix);\n\t\t}\n\t}", "public void generate() {\n\t\t\n\t\t// For this system, there are three particles per cell:\n\t\tint nx = size[0][0];\n\t\tint ny = size[0][0];\n\t\tint nz = size[0][0];\n\t\tint nc = nx*ny*nz;\n\t\tn = 3*nc;\n\n\t\t\n\t\t// The AB2 Lattice:\n\t\tAB2Lattice ab2 = new AB2Lattice();\n\t\tab2.setSizeInCells(nx,ny,nz);\n\t\t\n\t\t// Stick them in the latt member:\n\t\tlatt = new VectorD3[2][];\n\t\tlatt[0] = new VectorD3[n];\n\t\tSystem.arraycopy(ab2.getLattice(0),0,latt[0], 0, nx*ny*nz);\n\t\tSystem.arraycopy(ab2.getLattice(1),0,latt[0], nx*ny*nz, 2*nx*ny*nz);\n\t\tlatt_name[0] = \"AB2\";\n\t\tab2.saveAsXYZ(\"initAB2\");\n\t\tab2.saveAsWRL(\"initAB2\");\n\t\t\n\t\t// Build the A and B lattices, A first, then B second:\n\n\t\t// The seperate A and B2 lattices\n\t\tFaceCentredCubicABCLattice fcca = new FaceCentredCubicABCLattice();\n\t\tFaceCentredCubicABCLattice fccb = new FaceCentredCubicABCLattice();\n\t\tfcca.setSizeInCells(nx,ny,nz);\n\t\t\n\t\t// B lattice requires more care:\n\t\tNtp = 2*nx*ny*nz;\n\t\tint nbx = (int) Math.round(Math.pow(Ntp,1.0/3.0));\n\t\tint nby = nbx;\n\t\tint nbz = nbx;\n\t\tif( nbx*nby*nbz != 2*nx*ny*nz ) {\n\t\t\t// Warn that we cannot create a sensible B-phase with this number of particles:\n\t\t\tSystem.out.println(\" H WARNING: AB2Fcc2SwitchMap cannot create a cubic B-FCC phase with \"+(2*nx*ny*nz)+\" particles.\");\n\t\t\t// Fall back to a system that is simply twice as long in one dimension (z):\n\t\t\tnbx = nx;\n\t\t\tnby = ny;\n\t\t\tnbz = 2*nz;\n\t\t\tSystem.out.println(\" H WARNING: AB2Fcc2SwitchMap creating a phase that is twice as long in the z-direction: [\"+nbx+\",\"+nby+\",\"+nbz+\"].\");\n\t\t}\n\t\t// Create the new system at the new size:\n\t\tfccb.setSizeInCells(nbx,nby,nbz);\n\n\t\t// Copy the two FCC lattices into the 1th phase:\n\t\tlatt[1] = new VectorD3[n];\n\t\tlatt_name[1] = \"2.FCC\";\n\t\tSystem.arraycopy(fcca.getLattice(), 0, latt[1], 0, nx*ny*nz);\n\t\tSystem.arraycopy(fccb.getLattice(), 0, latt[1], nx*ny*nz, Ntp);\n\n\t\t// Set up the dimensions of the third-phase box:\n\t\tboxT.x = fccb.getBasicUnitCell()[0]*nbx;\n\t\tboxT.y = fccb.getBasicUnitCell()[1]*nby;\n\t\tboxT.z = fccb.getBasicUnitCell()[2]*nbz;\n\n\t\t/* Define distances between neighbouring atoms in the same stacking plane \n\t\t * taking advantage of the fact that both lattices have the same Unit Cell: */\n\t\tdouble[] c_uc = new double[3];\n\t\tc_uc = fcca.getUnitCell();\n\t\tSystem.out.println(\" H DEBUG FCC UC [ \"+c_uc[0]+\" \"+c_uc[1]+\" \"+c_uc[2]);\n\t\tc_uc = ab2.getUnitCell();\n\t\tSystem.out.println(\" H DEBUG AB2 UC [ \"+c_uc[0]+\" \"+c_uc[1]+\" \"+c_uc[2]);\n\t\tuc.x = c_uc[0];\n\t\tuc.y = c_uc[1];\n\t\tuc.z = c_uc[2];\n\t\t\n\t\t// Put the lattices in the class members, for later use:\n\t\tlats[0] = (Lattice)ab2;\n\t\tlats[1] = (Lattice)fcca;\n\t\tlatT = (Lattice)fccb;\n\n\t}", "void applyRotationMatrix() {\n for (int i = 0; i < coors.length; i++) {\n for (int j = 0; j < coors[i].length; j++) {\n newCoors[i][j] = coors[i][0] * R[j][0] + coors[i][1] * R[j][1] + coors[i][2] * R[j][2];\n }\n // add perspective\n float scale = map(Math.abs(newCoors[i][2]), 0, (float) (halfSize * Math.sqrt(3)), 1, 1.5f);\n if (newCoors[i][2] < 0) {\n scale = 2f - scale;\n }\n for (int j = 0; j < 2; j++) {\n newCoors[i][j] *= scale;\n }\n }\n // to R2\n // just dont use Z\n setPathAndAlpha();\n }", "public void makeIdentity() {\n if (rows == cols) {\n for (int i=0; i<rows; i++) {\n for (int j=0; j<cols; j++) {\n if (i == j) {\n matrix.get(i)[j] = 1;\n }\n else {\n matrix.get(i)[j] = 0;\n }\n }\n }\n }\n else {\n throw new NonSquareMatrixException();\n }\n }" ]
[ "0.6295873", "0.58681935", "0.5807994", "0.56388676", "0.56196004", "0.5614657", "0.56045747", "0.5595118", "0.55341613", "0.55212826", "0.55157685", "0.54728824", "0.54689604", "0.5427661", "0.5415776", "0.5404574", "0.53870857", "0.5377504", "0.53686315", "0.5357971", "0.52991563", "0.526241", "0.5261087", "0.52580756", "0.52566165", "0.52498925", "0.52441233", "0.52415454", "0.5241163", "0.52393395", "0.52251977", "0.5218599", "0.52144367", "0.52041775", "0.51725405", "0.51655114", "0.5154134", "0.5138757", "0.51375943", "0.5137089", "0.5136967", "0.51216644", "0.5119882", "0.5116931", "0.5112717", "0.5099926", "0.50974834", "0.5080832", "0.5080057", "0.5071976", "0.50699943", "0.5064147", "0.5062973", "0.50494653", "0.50325704", "0.5023058", "0.5019587", "0.50147", "0.5013382", "0.501298", "0.5008152", "0.50076854", "0.5003984", "0.5002772", "0.49981725", "0.4996893", "0.498781", "0.49713162", "0.4970175", "0.4952641", "0.49469495", "0.49448022", "0.49402982", "0.49363506", "0.49341527", "0.49329177", "0.49302155", "0.49261454", "0.49224415", "0.49222144", "0.4921125", "0.49179125", "0.4914941", "0.4911377", "0.49098217", "0.49034908", "0.4896026", "0.48938853", "0.48923478", "0.48856065", "0.48784176", "0.4875349", "0.48732722", "0.48658133", "0.48631638", "0.486177", "0.48611617", "0.48608875", "0.48607668", "0.4857633" ]
0.6805649
0
Get the next state in the traceback
public Traceback next(Traceback tb) { TracebackAffine tb3 = (TracebackAffine)tb; if(tb3.i + tb3.j + B[tb3.k][tb3.i][tb3.j].i + B[tb3.k][tb3.i][tb3.j].j == 0) return null; //traceback has reached origin therefore stop. else return B[tb3.k][tb3.i][tb3.j]; }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public String getNextState() {\n return nextState;\n }", "public SLR1_automat.State next_state(String symbol) throws Exception;", "public Symbol cur_err_token() {\r\n return this.lookahead[this.lookahead_pos];\r\n }", "public String get_state() throws Exception {\n\t\treturn this.state;\n\t}", "public String get_state() throws Exception {\n\t\treturn this.state;\n\t}", "public State next () { return nextState(); }", "WorkflowProcessingState getGenericErrorState();", "protected Solution<T> backTrace(State<T> s){\r\n\t\tSolution<T> sol = new Solution<T>(); // Initiate Solution\r\n\t\tState<T> itr = s; // Initiate Iterator as the given state (needs to be the goal state)\r\n\t\tsol.addState(itr);\r\n\t\twhile(itr != null) {\r\n\t\t\titr = itr.getCameFrom();\r\n\t\t\tsol.addState(itr); // add to the solution where it came from\r\n\t\t}\r\n\t\treturn sol;\r\n\t}", "public int getStackDepth()\n/* */ {\n/* 139 */ StackTraceElement[] stes = new Exception().getStackTrace();\n/* 140 */ int len = stes.length;\n/* 141 */ for (int i = 0; i < len; i++) {\n/* 142 */ StackTraceElement ste = stes[i];\n/* 143 */ if (ste.getMethodName().equals(\"_runExecute\"))\n/* */ {\n/* 145 */ return i - 1;\n/* */ }\n/* */ }\n/* 148 */ throw new AssertionError(\"Expected task to be run by WorkerThread\");\n/* */ }", "private int getFirstExpectedToken(int state) {\n return getNextExpectedToken(state, -1);\n }", "private State getNextState(State currentState, Token token)\n\t\t\tthrows SyntaxException {\n\t\tswitch (currentState) {\n\t\tcase VAR_TYPE:\n\t\t\tif (token.getTokenType() == TokenType.VARNAME) {\n\t\t\t\treturn State.VAR_NAME;\n\t\t\t}\n\t\t\tthrow new SyntaxException(\"No var name after type\");\n\n\t\tcase VAR_NAME:\n\t\t\tif (token.getTokenType() == TokenType.EQUALS) {\n\t\t\t\treturn State.EQUALS;\n\t\t\t}\n\n\t\t\tif (token.getTokenType() == TokenType.COMMA) {\n\t\t\t\treturn State.COMMA;\n\t\t\t}\n\n\t\t\tif (token.getTokenType() == TokenType.SEMICOLON) {\n\t\t\t\treturn State.SEMICOLON;\n\t\t\t}\n\n\t\t\tthrow new SyntaxException(\"Expected equals sign\");\n\n\t\tcase EQUALS:\n\t\t\tif (TokenType.isVarValue(token.getTokenType())\n\t\t\t\t\t|| token.getTokenType() == TokenType.VARNAME) {\n\t\t\t\treturn State.VAR_VAL;\n\t\t\t}\n\n\t\t\tif (token.getTokenType() == TokenType.VARNAME) {\n\t\t\t\treturn State.VAR_VAL;\n\t\t\t}\n\t\t\tthrow new SyntaxException(\"Expected variable value\");\n\n\t\tcase VAR_VAL:\n\t\t\tif (token.getTokenType() == TokenType.COMMA) {\n\t\t\t\treturn State.COMMA;\n\t\t\t}\n\t\t\tif (token.getTokenType() == TokenType.SEMICOLON) {\n\t\t\t\treturn State.SEMICOLON;\n\t\t\t}\n\t\t\tthrow new SyntaxException(\"Unexpected token\");\n\n\t\tcase COMMA:\n\t\t\tif (token.getTokenType() == TokenType.VARNAME) {\n\t\t\t\treturn State.VAR_NAME;\n\t\t\t}\n\n\t\t\tthrow new SyntaxException(\"Expected variable name\");\n\n\t\tcase SEMICOLON:\n\t\t\tthrow new SyntaxException(\"Nothing should appear after semicolon\");\n\t\tdefault:\n\t\t\tthrow new SyntaxException(\"Unknown state\");\n\t\t}\n\t}", "private synchronized BackStep peek() {\r\n\t\t\treturn stack[top];\r\n\t\t}", "public String getErrorState();", "void nextState();", "private int enterHistory(int state) {\n\t\tboolean skip_entry = false;\n\t\tif (state >= STATE_MAX) {\n\t\t\tstate = (state - STATE_MAX);\n\t\t\tskip_entry = true;\n\t\t}\n\t\twhile (true) {\n\t\t\tswitch (state) {\n\t\t\t\tcase STATE_Ready:\n\t\t\t\t\t/* in leaf state: return state id */\n\t\t\t\t\treturn STATE_Ready;\n\t\t\t\tcase STATE_TOP:\n\t\t\t\t\tstate = this.history[STATE_TOP];\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t/* should not occur */\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tskip_entry = false;\n\t\t}\n\t\t/* return NO_STATE; // required by CDT but detected as unreachable by JDT because of while (true) */\n\t}", "private static Map peekAtStack(SessionState state)\n\t{\n\t\tMap current_stack_frame = null;\n\t\tStack operations_stack = (Stack) state.getAttribute(STATE_SUSPENDED_OPERATIONS_STACK);\n\t\tif(operations_stack == null)\n\t\t{\n\t\t\toperations_stack = new Stack();\n\t\t\tstate.setAttribute(STATE_SUSPENDED_OPERATIONS_STACK, operations_stack);\n\t\t}\n\t\tif(! operations_stack.isEmpty())\n\t\t{\n\t\t\tcurrent_stack_frame = (Map) operations_stack.peek();\n\t\t}\n\t\treturn current_stack_frame;\n\n\t}", "public TSLexerState getState() {\r\n \t\treturn state;\r\n \t}", "private final int internalPrev(int n) {\n if (n == 0 || n == -1 || this.backwardsTrie == null) {\n return n;\n }\n resetState();\n while (n != -1 && n != 0 && breakExceptionAt(n)) {\n n = this.delegate.previous();\n }\n return n;\n }", "public Stacktrace next() throws IOException {\n\t\tString line;\n\t\tStacktrace stacktrace = null;\n\t\twhile (stacktrace == null && (line = input.readLine()) != null) {\n\t\t\tif (!StringUtils.isEmpty(line)) {\n\t\t\t\tlineBuffer.add(line);\n\t\t\t\tstacktrace = processLine(line);\n\t\t\t}\n\t\t}\n\t\treturn stacktrace;\n\t}", "StateT getState();", "State getState();", "State getState();", "State getState();", "State getState();", "java.lang.String getNextStep();", "public abstract State getSourceState ();", "protected int getNextExpectedToken(int state, int token) {\n this.state = state;\n int lastTokenId = getLastTokenId();\n while (++token <= lastTokenId) {\n if (isValid(token)) {\n return token;\n }\n }\n return -1;\n }", "public int getState()\r\n\t{\r\n\t\treturn currentstate;\r\n\t}", "public int getTryCatchBlockIndex() {\n/* 424 */ return (this.value & 0xFFFF00) >> 8;\n/* */ }", "public HashMap<String,ArrayList<Rule_in_State>> get_rules_of_next_state() throws Exception;", "private PlayState getNext(){\n return values()[(this.ordinal() + 1) % PlayState.values().length];\n }", "protected abstract List breakOutOfStateStack();", "public State getPreviousState()\r\n\t{\r\n\t\treturn previousState;\r\n\t}", "@Override\r\n\tpublic void nextState() {\n\t\t\r\n\t}", "public State getLastState() {\n\t\treturn endState;\r\n\t}", "protected ThreadState pickNextThread() {\n Lib.assertTrue(Machine.interrupt().disabled());\n if (threadStates.isEmpty())\n return null;\n\n return threadStates.last();\n }", "java.lang.String getState();", "public void next()\r\n\t{\r\n\t\tif(state<3)\r\n\t\t\tstate++;\r\n\t\telse\r\n\t\t\tstate=1;\r\n\t}", "public TurtleState getCurrentState() {\n\t\treturn states.peek();\n\t}", "public S getCurrentState();", "private Estado getStateError() {\n\t\tEstado state = null;\n\t\tif (!automata.containState(cerraduras.size())) {\n\t\t\tstate = new Estado(cerraduras.size());\n\t\t\tstate.setError(true);\n\t\t\tautomata.addEstado(state);\n\t\t} else {\n\t\t\tstate = automata.getState(cerraduras.size());\n\t\t}\n\t\treturn state;\n\t}", "public Token next()\n\t{\n\t\tint munchSize = 0;\n\t\tStringBuilder buffer = new StringBuilder();\n\n\t\t// iterate until we either:\n\t\t//\t1. Match a token in any state but MANY_STATE\n\t\t//\t2. Whitespace, newline or EOF\n\t\tboolean was_good = false, can_continue = true;\n\t\tToken to_return = Token.generateToken(lineNum, charPos, \"EOF\", Token.Kind.EOF);\n\n\t\t// skip any initial white space.\n\t\twhile (readChar() == -1) { }\n\t\tthis.lastChar = this.nextChar;\n\t\twhile (can_continue && readChar() > -1) {\n\t\t\tchar next = (char)this.nextChar;\n\t\t\tint pos = (charPos - (buffer.length() + 1));\n\t\t\tswitch (munchSize) {\n\t\t\t\tcase EMPTY_STATE:\n\t\t\t\t\t// Search for all tokens of one token. If we match\n\t\t\t\t\t// store it, and attempt to switch states.\n\t\t\t\t\tif (Token.isValidLexeme(Token.getSingleCharacterMap(), String.valueOf(next), 0)) {\n\t\t\t\t\t\t// We can transition.\n\t\t\t\t\t\tbuffer.append(next);\n\t\t\t\t\t\tto_return = Token.generateToken(lineNum, pos, buffer.toString(),\n\t\t\t\t\t\t\t\tToken.getSingleCharacterMap());\n\t\t\t\t\t\tmunchSize++;\n\t\t\t\t\t\twas_good = true;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// error.\n\t\t\t\t\t\twas_good = false;\n\t\t\t\t\t\tbuffer.append(next);\n\t\t\t\t\t\tmunchSize++;\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase SINGLE_STATE:\n\t\t\t\t\t// Search for all tokens of two tokens. If we match\n\t\t\t\t\t// store it, and attempt to switch states.\n\t\t\t\t\tif (Token.isValidLexeme(Token.getDoubleCharTokens(), buffer.toString() + next, 1)) {\n\t\t\t\t\t\t// we can transition\n\t\t\t\t\t\tbuffer.append(next);\n\t\t\t\t\t\tto_return = Token.generateToken(lineNum, pos, buffer.toString(),\n\t\t\t\t\t\t\t\tToken.getDoubleCharTokens());\n\t\t\t\t\t\tmunchSize++;\n\t\t\t\t\t\twas_good = true;\n\n\t\t\t\t\t\t// is this a comment?\n\t\t\t\t\t\tif (to_return.is(Token.Kind.COMMENT)) {\n\t\t\t\t\t\t\t// restart parse.\n\t\t\t\t\t\t\tthis.on_comment = true;\n\t\t\t\t\t\t\tmunchSize = 0;\n\t\t\t\t\t\t\tbuffer.delete(0, buffer.length());\n\t\t\t\t\t\t\twas_good = false;\n\t\t\t\t\t\t\tcan_continue = true;\n\t\t\t\t\t\t\tto_return = Token.generateToken(lineNum, pos, \"EOF\", Token.Kind.EOF);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// if we had a previous good state, return, else error.\n\t\t\t\t\t\tcan_continue = false;\n\t\t\t\t\t\tthis.lastChar = this.nextChar;\n\t\t\t\t\t\tif (!was_good) {\n\t\t\t\t\t\t\t// error.\n\t\t\t\t\t\t\twas_good = false;\n\t\t\t\t\t\t\tto_return = Token.generateToken(lineNum, pos, \"Unexpected token: \" + buffer.toString(),\n\t\t\t\t\t\t\t\t\tToken.Kind.ERROR);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tcase DOUBLE_STATE:\n\t\t\t\t\t// Search for multiple character states and keywords.\n\t\t\t\t\tif (Token.isValidLexeme(Token.getMultiCharTokens(), buffer.toString() + next, 2)) {\n\t\t\t\t\t\t// we can transition\n\t\t\t\t\t\tbuffer.append(next);\n\t\t\t\t\t\tto_return = Token.generateToken(lineNum, pos, buffer.toString(),\n\t\t\t\t\t\t\t\tToken.getMultiCharTokens());\n\t\t\t\t\t\tmunchSize++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\t// if we had a previous good state, return, else error.\n\t\t\t\t\t\tcan_continue = false;\n\t\t\t\t\t\tif (was_good) {\n\t\t\t\t\t\t\tthis.lastChar = this.nextChar;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twas_good = false;\n\t\t\t\t\t\t\tto_return = Token.generateToken(lineNum, pos, \"Unexpected token: \" + buffer.toString(),\n\t\t\t\t\t\t\t\t\tToken.Kind.ERROR);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: // MANY_STATE\n\t\t\t\t\tif (Token.isValidLexeme(Token.getKeywords(), buffer.toString() + next, munchSize)) {\n\t\t\t\t\t\tbuffer.append(next);\n\t\t\t\t\t\tto_return = Token.generateToken(lineNum, pos, buffer.toString(), Token.getKeywords());\n\t\t\t\t\t\tmunchSize++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tcan_continue = false;\n\t\t\t\t\t\tif (was_good) {\n\t\t\t\t\t\t\tthis.lastChar = this.nextChar;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\twas_good = false;\n\t\t\t\t\t\t\tto_return = Token.generateToken(lineNum, pos, \"Unexpected token: \" + buffer.toString(),\n\t\t\t\t\t\t\t\t\tToken.Kind.ERROR);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\treturn to_return;\n\t}", "State getTarget();", "java.lang.String getStateReason();", "public int getState() {return state;}", "public int getState() {return state;}", "private final int internalNext(int n) {\n if (n == -1 || this.backwardsTrie == null) {\n return n;\n }\n resetState();\n int textLen = this.text.getLength();\n while (n != -1 && n != textLen && breakExceptionAt(n)) {\n n = this.delegate.next();\n }\n return n;\n }", "private void findNewNextInStack() {\n if (stack.empty()) {\n next = Chunk.NONE;\n return;\n }\n next = stack.pop();\n long valueReference = INVALID_VALUE_REFERENCE;\n if (next != Chunk.NONE) {\n valueReference = getEntryFieldLong(next, OFFSET.VALUE_REFERENCE);\n }\n while (next != Chunk.NONE && valueReference == INVALID_VALUE_REFERENCE) {\n if (!stack.empty()) {\n next = stack.pop();\n if (next != Chunk.NONE) {\n valueReference = getEntryFieldLong(next, OFFSET.VALUE_REFERENCE);\n }\n } else {\n next = Chunk.NONE;\n return;\n }\n }\n }", "int getState();", "int getState();", "int getState();", "int getState();", "int getState();", "int getState();", "public STATE getState() {\n return this.lastState;\n }", "public E nextStep() {\r\n\t\tthis.current = this.values[Math.min(this.current.ordinal() + 1, this.values.length - 1)];\r\n\t\treturn this.current;\r\n\t}", "public List<NextStateInfo> getTransitions(String state) {\r\n \t\treturn transitions.get(state).getNextStateInfo();\r\n \t}", "public LexerState getState() {\n\t\treturn state;\n\t}", "ESMFState getState();", "public E finishedState() {\r\n\t\treturn this.values[this.values.length - 1];\r\n\t}", "final public state_t get_latest_entry_state(final Registration reg) {\r\n\t\tboolean found[] = new boolean[1];\r\n\r\n\t\tForwardingInfo info = get_latest_entry(reg, found);\r\n\t\tif (!found[0]) {\r\n\t\t\treturn state_t.NONE;\r\n\t\t}\r\n\r\n\t\treturn info.state();\r\n\t}", "public java_cup.runtime.Symbol debug_next_token() throws java.io.IOException {\n java_cup.runtime.Symbol s = next_token();\n System.out.println( \"line:\" + (yyline+1) + \" col:\" + (yycolumn+1) + \" --\"+ yytext() + \"--\" + getTokenName(s.sym) + \"--\");\n return s;\n }", "public java_cup.runtime.Symbol debug_next_token() throws java.io.IOException {\n java_cup.runtime.Symbol s = next_token();\n System.out.println( \"line:\" + (yyline+1) + \" col:\" + (yycolumn+1) + \" --\"+ yytext() + \"--\" + getTokenName(s.sym) + \"--\");\n return s;\n }", "public java_cup.runtime.Symbol debug_next_token() throws java.io.IOException {\n java_cup.runtime.Symbol s = next_token();\n System.out.println( \"line:\" + (yyline+1) + \" col:\" + (yycolumn+1) + \" --\"+ yytext() + \"--\" + getTokenName(s.sym) + \"--\");\n return s;\n }", "@Override\r\n public FlowState call() {\r\n // TODO: We should not need? to pass the flowState because this flow is already known (reapplying same values???)\r\n FlowState flowState = getFlowState();\r\n if ( flowState == null ) {\r\n throw new FlowException(\"No flowState with id:\", getExistingFlowStateLookupKey());\r\n } else {\r\n return getFlowManagementWithCheck().continueFlowState(getExistingFlowStateLookupKey(), true, this.getInitialFlowState());\r\n }\r\n }", "public State getState();", "public State getState();", "@VisibleForTesting\n int getInternalState() {\n return currentState;\n }", "@androidx.annotation.Nullable\r\n public synchronized android.graphics.Bitmap getNextFrame() {\r\n /*\r\n r7 = this;\r\n monitor-enter(r7);\r\n r0 = r7.header;\t Catch:{ all -> 0x00ea }\r\n r0 = r0.frameCount;\t Catch:{ all -> 0x00ea }\r\n r1 = 3;\r\n r2 = 1;\r\n if (r0 <= 0) goto L_0x000d;\r\n L_0x0009:\r\n r0 = r7.framePointer;\t Catch:{ all -> 0x00ea }\r\n if (r0 >= 0) goto L_0x003b;\r\n L_0x000d:\r\n r0 = TAG;\t Catch:{ all -> 0x00ea }\r\n r0 = android.util.Log.isLoggable(r0, r1);\t Catch:{ all -> 0x00ea }\r\n if (r0 == 0) goto L_0x0039;\r\n L_0x0015:\r\n r0 = TAG;\t Catch:{ all -> 0x00ea }\r\n r3 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00ea }\r\n r3.<init>();\t Catch:{ all -> 0x00ea }\r\n r4 = \"Unable to decode frame, frameCount=\";\r\n r3.append(r4);\t Catch:{ all -> 0x00ea }\r\n r4 = r7.header;\t Catch:{ all -> 0x00ea }\r\n r4 = r4.frameCount;\t Catch:{ all -> 0x00ea }\r\n r3.append(r4);\t Catch:{ all -> 0x00ea }\r\n r4 = \", framePointer=\";\r\n r3.append(r4);\t Catch:{ all -> 0x00ea }\r\n r4 = r7.framePointer;\t Catch:{ all -> 0x00ea }\r\n r3.append(r4);\t Catch:{ all -> 0x00ea }\r\n r3 = r3.toString();\t Catch:{ all -> 0x00ea }\r\n android.util.Log.d(r0, r3);\t Catch:{ all -> 0x00ea }\r\n L_0x0039:\r\n r7.status = r2;\t Catch:{ all -> 0x00ea }\r\n L_0x003b:\r\n r0 = r7.status;\t Catch:{ all -> 0x00ea }\r\n r3 = 0;\r\n if (r0 == r2) goto L_0x00c8;\r\n L_0x0040:\r\n r0 = r7.status;\t Catch:{ all -> 0x00ea }\r\n r4 = 2;\r\n if (r0 != r4) goto L_0x0047;\r\n L_0x0045:\r\n goto L_0x00c8;\r\n L_0x0047:\r\n r0 = 0;\r\n r7.status = r0;\t Catch:{ all -> 0x00ea }\r\n r4 = r7.block;\t Catch:{ all -> 0x00ea }\r\n if (r4 != 0) goto L_0x0058;\r\n L_0x004e:\r\n r4 = r7.bitmapProvider;\t Catch:{ all -> 0x00ea }\r\n r5 = 255; // 0xff float:3.57E-43 double:1.26E-321;\r\n r4 = r4.obtainByteArray(r5);\t Catch:{ all -> 0x00ea }\r\n r7.block = r4;\t Catch:{ all -> 0x00ea }\r\n L_0x0058:\r\n r4 = r7.header;\t Catch:{ all -> 0x00ea }\r\n r4 = r4.frames;\t Catch:{ all -> 0x00ea }\r\n r5 = r7.framePointer;\t Catch:{ all -> 0x00ea }\r\n r4 = r4.get(r5);\t Catch:{ all -> 0x00ea }\r\n r4 = (com.bumptech.glide.gifdecoder.GifFrame) r4;\t Catch:{ all -> 0x00ea }\r\n r5 = r7.framePointer;\t Catch:{ all -> 0x00ea }\r\n r5 = r5 - r2;\r\n if (r5 < 0) goto L_0x0074;\r\n L_0x0069:\r\n r6 = r7.header;\t Catch:{ all -> 0x00ea }\r\n r6 = r6.frames;\t Catch:{ all -> 0x00ea }\r\n r5 = r6.get(r5);\t Catch:{ all -> 0x00ea }\r\n r5 = (com.bumptech.glide.gifdecoder.GifFrame) r5;\t Catch:{ all -> 0x00ea }\r\n goto L_0x0075;\r\n L_0x0074:\r\n r5 = r3;\r\n L_0x0075:\r\n r6 = r4.lct;\t Catch:{ all -> 0x00ea }\r\n if (r6 == 0) goto L_0x007c;\r\n L_0x0079:\r\n r6 = r4.lct;\t Catch:{ all -> 0x00ea }\r\n goto L_0x0080;\r\n L_0x007c:\r\n r6 = r7.header;\t Catch:{ all -> 0x00ea }\r\n r6 = r6.gct;\t Catch:{ all -> 0x00ea }\r\n L_0x0080:\r\n r7.act = r6;\t Catch:{ all -> 0x00ea }\r\n r6 = r7.act;\t Catch:{ all -> 0x00ea }\r\n if (r6 != 0) goto L_0x00aa;\r\n L_0x0086:\r\n r0 = TAG;\t Catch:{ all -> 0x00ea }\r\n r0 = android.util.Log.isLoggable(r0, r1);\t Catch:{ all -> 0x00ea }\r\n if (r0 == 0) goto L_0x00a6;\r\n L_0x008e:\r\n r0 = TAG;\t Catch:{ all -> 0x00ea }\r\n r1 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00ea }\r\n r1.<init>();\t Catch:{ all -> 0x00ea }\r\n r4 = \"No valid color table found for frame #\";\r\n r1.append(r4);\t Catch:{ all -> 0x00ea }\r\n r4 = r7.framePointer;\t Catch:{ all -> 0x00ea }\r\n r1.append(r4);\t Catch:{ all -> 0x00ea }\r\n r1 = r1.toString();\t Catch:{ all -> 0x00ea }\r\n android.util.Log.d(r0, r1);\t Catch:{ all -> 0x00ea }\r\n L_0x00a6:\r\n r7.status = r2;\t Catch:{ all -> 0x00ea }\r\n monitor-exit(r7);\r\n return r3;\r\n L_0x00aa:\r\n r1 = r4.transparency;\t Catch:{ all -> 0x00ea }\r\n if (r1 == 0) goto L_0x00c2;\r\n L_0x00ae:\r\n r1 = r7.act;\t Catch:{ all -> 0x00ea }\r\n r2 = r7.pct;\t Catch:{ all -> 0x00ea }\r\n r3 = r7.act;\t Catch:{ all -> 0x00ea }\r\n r3 = r3.length;\t Catch:{ all -> 0x00ea }\r\n java.lang.System.arraycopy(r1, r0, r2, r0, r3);\t Catch:{ all -> 0x00ea }\r\n r1 = r7.pct;\t Catch:{ all -> 0x00ea }\r\n r7.act = r1;\t Catch:{ all -> 0x00ea }\r\n r1 = r7.act;\t Catch:{ all -> 0x00ea }\r\n r2 = r4.transIndex;\t Catch:{ all -> 0x00ea }\r\n r1[r2] = r0;\t Catch:{ all -> 0x00ea }\r\n L_0x00c2:\r\n r0 = r7.setPixels(r4, r5);\t Catch:{ all -> 0x00ea }\r\n monitor-exit(r7);\r\n return r0;\r\n L_0x00c8:\r\n r0 = TAG;\t Catch:{ all -> 0x00ea }\r\n r0 = android.util.Log.isLoggable(r0, r1);\t Catch:{ all -> 0x00ea }\r\n if (r0 == 0) goto L_0x00e8;\r\n L_0x00d0:\r\n r0 = TAG;\t Catch:{ all -> 0x00ea }\r\n r1 = new java.lang.StringBuilder;\t Catch:{ all -> 0x00ea }\r\n r1.<init>();\t Catch:{ all -> 0x00ea }\r\n r2 = \"Unable to decode frame, status=\";\r\n r1.append(r2);\t Catch:{ all -> 0x00ea }\r\n r2 = r7.status;\t Catch:{ all -> 0x00ea }\r\n r1.append(r2);\t Catch:{ all -> 0x00ea }\r\n r1 = r1.toString();\t Catch:{ all -> 0x00ea }\r\n android.util.Log.d(r0, r1);\t Catch:{ all -> 0x00ea }\r\n L_0x00e8:\r\n monitor-exit(r7);\r\n return r3;\r\n L_0x00ea:\r\n r0 = move-exception;\r\n monitor-exit(r7);\r\n throw r0;\r\n */\r\n throw new UnsupportedOperationException(\"Method not decompiled: com.bumptech.glide.gifdecoder.StandardGifDecoder.getNextFrame():android.graphics.Bitmap\");\r\n }", "public AeBpelState getState();", "public E startState() {\r\n\t\treturn this.values[0];\r\n\t}", "int nextState (int state, char c) {\r\n\tif (state < tokLen && c == tok.charAt(state)) {\r\n\t return (state+1) ;\r\n\t} else return tokLen+1 ;\r\n }", "public Signal getTipState() {\n\t\t// find the connector position in the queue\n\t\t// look in the noDelayQueue which value to communicate\n\t\tint now = GameEngine.getSimulationTimeInMillis();\n\t\tSignal signal = this.queue.getExit(now);\n\t\treturn signal;\n\t}", "private int getNextLine() {\n return peekToken().location.start.line;\n }", "public int getStateSwitchPosition();", "Object getState();", "public synchronized String getLatestState(Transaction t) {\n String state = Event.GLOBAL_ABORT;\n \n System.out.print(\"Logger::getLatestState T: \" + t);\n\n try (BufferedReader br = new BufferedReader(new FileReader(path))) {\n while (true) {\n String line = br.readLine();\n if(line==null) break;\n String[] items = line.split(\" \");\n String curState = items[0];\n Transaction curT = Transaction.fromJSON(items[1]); \n \n if (curT.getId() != t.getId())\n continue;\n switch (curState) {\n case Event.GLOBAL_ABORT:\n state = Event.GLOBAL_ABORT;\n break;\n case Event.GLOBAL_COMMIT:\n state = Event.GLOBAL_COMMIT;\n break;\n }\n }\n } catch (IOException e) {\n e.printStackTrace();\n }\n \n System.out.println(\" State: \" + state);\n \n return state;\n }", "public int[] getNext(){\n if (wasExplored) return new int[0];\n int[] nextState = {next1.state_no};\n return nextState;\n }", "public E peek(){\n return this.stack.get(stack.size() -1);\n }", "public static int getStartState() {\n int startState = 1;\n int n = 1;\n for (int i = 2; i <= state; i ++) {\n if (stateList.get(i).getN1() == n || stateList.get(i).getN2() == n) {\n startState = i;\n n = i;\n }\n }\n return startState;\n }", "public String nextStep();", "public Frame nextFrame(final Frame frame) {\n\t\tif (isFinalFrame(frame))throw new IllegalStateException(\"Invalid Entry\"); // input santization -- out of bounds when at last frame\n\t\telse return frames.get(frames.indexOf(frame) + 1); // else return the frame at next index. \n\t}", "public SMTraffic goNext(String nextstate){\n \n \n String nstate = currentrealm + \"_\" + nextstate;\n setCurrent_taskstate(getTaskstates().get(nstate));\n \n if (getCurrent_taskstate() != null){\n return new SMTraffic(0l, 0l, 0, getCurrent_taskstate().getCallstate(), this.getClass(),\n new VirnaPayload()\n .setObject(this)\n .setString(getCurrent_taskstate().getStatecmd())\n );\n }\n return null;\n }", "public static String firstOfStack(){\n StringBuilder sb = new StringBuilder(\"1\");\n try{second(sb);}\n catch(Error e) {\n sb.append(\"Catch\");\n }\n sb.append(\"Out\");\n return sb.toString();\n }", "public String getNextLabel () {\n return nextLabel;\n }", "void determineNextAction();", "State getSource();", "int maxOffsetErrors(int parametricState);", "public int getState();", "public int getState();", "public int getState();", "public int getState();", "public String getState( )\r\n {\r\n if (isEating)\r\n return \"Eating\"; // Exit method w/ current state\r\n\r\n if (isSleeping)\r\n return \"Sleeping\";\r\n\r\n return \"Error in State\";\r\n }", "public State<S, T> getNextState(T transition) {\n\t\tState<S, T> nextState = null;\n\t\tif (transitions.containsKey(transition)) {\n\t\t\tnextState = transitions.get(transition);\n\t\t}\n\t\treturn nextState;\n\n\t}", "public abstract Tuple getNext();", "public String getStack();", "private Token previous() {\n return tokens.get(current-1);\n }", "com.google.dataflow.v1beta3.ExecutionState getState();", "private void updateState (Throwable t) {\n if (exceptions == null) {\n // the dialog is not shown\n exceptions = new QueueEnumeration ();\n current = t;\n update ();\n dialog.show ();\n } else {\n // add the exception to the queue\n exceptions.put (t);\n next.setVisible (true);\n }\n }", "@SuppressWarnings(\"resource\")\n\tpublic synchronized void advance() {\n\t\t/*\n\t\t * Do not advance the state machine if it is still valid. This is a convenience to application code\n\t\t * that can now try to advance the state machine redundantly without it getting costly.\n\t\t * \n\t\t * Here we have to be careful. We cannot just read valid() flag as that would create reactive dependency\n\t\t * that would be invalidated a few lines below when the valid() flag is set to true.\n\t\t * Such immediate invalidation would force another controlling (outer) reactive computation to run immediately after the current one ends.\n\t\t * While such overhead is common in reactive code and it is usually acceptable, it can be very wasteful here in some important use cases,\n\t\t * for example in ReactiveLazy where it would double compute cost of all reactive computations that read new/changed ReactiveLazy.\n\t\t *\n\t\t * We cannot just check for non-null trigger either as that would make the check completely non-reactive.\n\t\t * The controlling (outer) computation wouldn't run again when the state is invalidated and advancement would stop forever.\n\t\t *\n\t\t * Instead of creating dependency on the full valid() flag, we will reactively depend only on trigger state.\n\t\t * The difference is that trigger state only tracks validity of the last controlled (inner) computation\n\t\t * while the valid() flag tracks all current and future state of the whole reactive state machine.\n\t\t * Trigger state can change only in one direction from not fired to fired while valid() changes both ways.\n\t\t * This reduction in the scope of the dependency is sufficient to avoid redundant reactive computations\n\t\t * while keeping the dependency wide enough to ensure the state machine appears to be fully reactive.\n\t\t * \n\t\t * Trigger itself is of course non-reactive, because it is a low-level reactive primitive.\n\t\t * So how do we depend on its state? We will read valid() flag but only after we have already set it to true.\n\t\t * This breaks the basic principle of reactive programming that dependencies are recorded before reads,\n\t\t * but it is safe here, because it is equivalent to a scenario, in which another thread advances the state machine\n\t\t * and the current thread executed shortly afterwards, reads the valid() flag (which is true), and returns without advancing.\n\t\t * \n\t\t * This solution is so efficient that a lot of code can just blindly advance all the time without ever checking valid().\n\t\t * This may be actually more performant thanks to the reduced dependency optimization.\n\t\t */\n\t\tif (trigger != null) {\n\t\t\t/*\n\t\t\t * If the trigger is non-null, then valid() is true and we can just return without advancing.\n\t\t\t * We will record dependency on valid() to ensure that the controlling (outer) computation\n\t\t\t * tries to advance the state machine again when valid() becomes false.\n\t\t\t */\n\t\t\tvalid.get();\n\t\t\treturn;\n\t\t}\n\t\tReactiveScope scope = OwnerTrace.of(new ReactiveScope())\n\t\t\t.parent(this)\n\t\t\t.target();\n\t\tif (pins != null)\n\t\t\tscope.pins(pins);\n\t\tpins = null;\n\t\ttry (CloseableScope computation = scope.enter()) {\n\t\t\tReactiveValue<T> value = ReactiveValue.capture(supplier);\n\t\t\t/*\n\t\t\t * We will be sending two invalidations to the controlling reactive computation.\n\t\t\t * We will first discourage redundant advancement by setting valid() to true.\n\t\t\t * Only then we set the output. This prevents unnecessary attempts to advance the state machine.\n\t\t\t */\n\t\t\tvalid.set(true);\n\t\t\toutput.value(value);\n\t\t}\n\t\t/*\n\t\t * As mentioned above, we will create dependency on valid() to ensure the controlling (outer) computation\n\t\t * tries to advance again when the current state is invalidated, i.e. when valid() is set to false.\n\t\t * We have to do this after setting valid() to true above to avoid immediately invalidating current computation.\n\t\t * We also have to do it before arming the trigger, because trigger could fire immediately (inline)\n\t\t * and such firing involves setting valid() to false, by which time the dependency on valid() must already exist.\n\t\t * We have to be additionally careful not to create the dependency inside the controlled (inner) computation.\n\t\t */\n\t\tvalid.get();\n\t\tif (scope.blocked())\n\t\t\tpins = scope.pins();\n\t\ttrigger = OwnerTrace\n\t\t\t.of(new ReactiveTrigger()\n\t\t\t\t.callback(this::invalidate))\n\t\t\t.parent(this)\n\t\t\t.target();\n\t\t/*\n\t\t * Arming the trigger can cause it to fire immediately.\n\t\t * We don't worry about that, because our invalidation callback is very fast and non-conflicting.\n\t\t */\n\t\ttrigger.arm(scope.versions());\n\t}" ]
[ "0.63150173", "0.6208069", "0.6042502", "0.5941154", "0.5941154", "0.5900475", "0.58397835", "0.5835424", "0.5803836", "0.5761924", "0.57488054", "0.57439744", "0.5743671", "0.56602585", "0.5611719", "0.55565095", "0.5536324", "0.55318624", "0.5513521", "0.551028", "0.5492095", "0.5492095", "0.5492095", "0.5492095", "0.5485414", "0.54246706", "0.5377808", "0.5368966", "0.5350252", "0.53491235", "0.53363705", "0.5329209", "0.5325587", "0.53202677", "0.5306062", "0.52982754", "0.5289011", "0.5280589", "0.527957", "0.5263649", "0.5229963", "0.5222439", "0.521308", "0.52077335", "0.52053815", "0.52053815", "0.52017426", "0.51976013", "0.51820254", "0.51820254", "0.51820254", "0.51820254", "0.51820254", "0.51820254", "0.5180988", "0.5179594", "0.5170865", "0.5165279", "0.51621836", "0.5158748", "0.51578015", "0.5156272", "0.5156272", "0.5156272", "0.5147334", "0.5141855", "0.5141855", "0.51411605", "0.5137896", "0.5136534", "0.51300156", "0.51248974", "0.5120881", "0.51171315", "0.51153606", "0.51126176", "0.5100403", "0.50983125", "0.50921893", "0.5074298", "0.5072748", "0.5062253", "0.50600547", "0.5053353", "0.50503916", "0.5048885", "0.504634", "0.5035753", "0.5023321", "0.5023321", "0.5023321", "0.5023321", "0.50095624", "0.50079364", "0.5003689", "0.5002891", "0.5000309", "0.49825174", "0.49800265", "0.49788156" ]
0.60999733
2
Print matrix used to calculate this alignment.
public void printf(Output out) { for (int k=0; k<3; k++) { out.println("F[" + k + "]:"); for (int j=0; j<=m; j++) { for (int i=0; i<F[k].length; i++) { out.print(padLeft(formatScore(F[k][i][j]), 5)); } out.println(); } } }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void PrintMatrix() {\n\t\t\n\t\tfloat[][] C = this.TermContextMatrix_PPMI;\n\t\t\n\t\tSystem.out.println(\"\\nMatrix:\");\n\t\tfor(int i = 0; i < C.length; i++) {\n\t\t\tfor(int j = 0; j < C[i].length; j++) {\n\t\t\t\tif(j >= C[i].length - 1) {\n\t\t\t\t\tSystem.out.printf(\" %.1f%n\", C[i][j]);\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.printf(\" %.1f \", C[i][j]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\"End of matrix.\");\n\t\t\n\t}", "public void print() {\n mat.print();\n }", "public static void printMatrix()\n {\n for(int i = 0; i < n; i++)\n {\n System.out.println();\n for(int j = 0; j < n; j++)\n {\n System.out.print(connectMatrix[i][j] + \" \");\n }\n }\n }", "public void print() {\n for (int i = 0; i < matrix.length; i++) {\n for (int j = 0; j < matrix[i].length; j++) {\n System.out.print(matrix[i][j] + \" \");\n }\n System.out.println();\n }\n }", "default void print() {\r\n\t\tGenerator.getInstance().getLogger().debug(\"Operation matrix:\\r\");\r\n\t\tString ans = \" operation \";\r\n\t\tfor (double i = 0; i < this.getOperationMap().keySet().size(); i++) {\r\n\t\t\tfinal Element element1 = this.get(i);\r\n\t\t\tans += element1 + \" \";\r\n\t\t}\r\n\t\tLogManager.getLogger(FiniteSemiGroup.class).debug(ans);\r\n\t\tfor (double i = 0; i < this.getOperationMap().keySet().size(); i++) {\r\n\t\t\tfinal Element element1 = this.get(i);\r\n\t\t\tans = element1 + \" \";\r\n\t\t\tfor (double j = 0; j < this.getOperationMap().keySet().size(); j++) {\r\n\t\t\t\tfinal Element element2 = this.get(j);\r\n\t\t\t\tans += \" \" + this.getOperationMap().get(element1).get(element2) + \" \";\r\n\t\t\t}\r\n\t\t\tLogManager.getLogger(FiniteSemiGroup.class).debug(ans);\r\n\t\t}\r\n\t}", "public void printLayout() {\n\n for (int i = 0; i < 5; i++) {\n for (int j = 0; j < 4; j++) {\n System.out.print(matrix[i][j] + \" \");\n\n }\n System.out.println(\"\");\n }\n }", "public void print() {\n\t\tfor(int i = 0; i < size; i++) {\n\t\t\tfor(int j = 0; j < size; j++) {\n\t\t\t\tSystem.out.print(m[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\t\n\t}", "public void printAdjacencyMatrix();", "private void print(Matrix mat) {\n\t\tfor(int i=0;i<mat.numRows();i++){\n\t\t\tfor(int j=0;j<mat.numColumns();j++){\n\t\t\t\tSystem.out.print(mat.value(i, j)+\" \");\n\t\t\t}\n\t\t\tSystem.out.print(\"\\n\");\n\t\t}\n\t}", "public void print() {\n\n for (int i = 0; i < this.rows; i++) {\n for (int j = 0; j < this.cols; j++) {\n System.out.format(\"%.4f\", data[i][j]);\n if (j != this.cols - 1)\n System.out.print(\" \");\n }\n System.out.println(\"\");\n }\n }", "@Override\n public String toString() {\n StringBuilder builder = new StringBuilder();\n for (double[] b : matrix) {\n builder.append(\"\\n\");\n for (double c : b) {\n builder.append(c).append(\" \");\n }\n }\n return builder.toString();\n }", "public void printMatriz( )\n {\n //definir dados\n int lin;\n int col;\n int i;\n int j;\n\n //verificar se matriz e' valida\n if( table == null )\n {\n IO.println(\"ERRO: Matriz invalida. \" );\n } //end\n else\n {\n //obter dimensoes da matriz\n lin = lines();\n col = columns();\n IO.println(\"Matriz com \"+lin+\"x\"+col+\" posicoes.\");\n //pecorrer e mostrar posicoes da matriz\n for(i = 0; i < lin; i++)\n {\n for(j = 0; j < col; j++)\n {\n IO.print(\"\\t\"+table[ i ][ j ]);\n } //end repetir\n IO.println( );\n } //end repetir\n } //end se\n }", "public String toString() {\n\t\tString s = n + \" x \" + n + \" Matrix:\\n\";\n\t\tfor (int i = 0; i < n; i++) {\n\t\t\tfor (int j = 0; j < n; j++) {\n\t\t\t\ts += content[i][j] + \"\\t\\t\";\n\t\t\t}\n\t\t\ts += \"\\n\\n\";\n\t\t}\n\t\treturn s;\n\t}", "public String toString() {\n\tString retStr = \"\";\n\tfor (int r = 0; r < this.size(); r++){\n\t for (int c = 0; c < this.size(); c++){\n\t\tretStr += matrix[r][c] + \"\\t\";\n\t }\n\t retStr += \"\\n\";\n\t}\n\treturn retStr;\n }", "public void display(){\n for(int i=0;i<N;i++){\n for(int j=0;j<N;j++)\n System.out.print(adj_matrix[i][j]+\" \");\n System.out.println();\n }\n }", "public String toString() {\n\t\tString matrixString = new String();\n\t\tArrayList<Doc> docList;\n\t\tfor (int i = 0; i < termList.size(); i++) {\n\t\t\tmatrixString += String.format(\"%-15s\", termList.get(i));\n\t\t\tdocList = docLists.get(i);\n\t\t\tfor (int j = 0; j < docList.size(); j++) {\n\t\t\t\tmatrixString += docList.get(j) + \"\\t\";\n\t\t\t}\n\t\t\tmatrixString += \"\\n\";\n\t\t}\n\t\treturn matrixString;\n\t}", "public void print() {\n \tfor (int i=0; i < this.table.height; i++) {\n \t\tfor (int j=0; j < this.table.width; j++) {\n \t\t\tString tmp = \"e\";\n \t\t\tif(this.table.field[i][j].head != null) {\n \t\t\t\ttmp = \"\";\n \t\t\t\tswitch (this.table.field[i][j].head.direction) {\n\t\t\t\t\tcase 1:\n\t\t\t\t\t\ttmp+=\"^\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2:\n\t\t\t\t\t\ttmp+=\">\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3:\n\t\t\t\t\t\ttmp+=\"V\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 4:\n\t\t\t\t\t\ttmp+=\"<\";\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n \t\t\t}\n \t\t\telse if(this.table.field[i][j].obj != null) {\n \t\t\t\ttmp = this.table.field[i][j].obj.name;\n \t\t\t}\n \t\t\tSystem.out.print(\" \" + tmp);\n \t\t}\n \t\t\tSystem.out.println(\"\");\n \t}\n }", "public static void printMatrix(ArrayList<ArrayList<Integer>> matrix){\r\n\t\tfor (int i = 0; i < matrix.size(); i++){\r\n\t\t\tchar index = (char) ('A' + i);\r\n\t\t\tSystem.out.print(index);\r\n\t\t\tSystem.out.print(\":\\t \"); \r\n\t\t\tfor (int j = 0; j < matrix.get(i).size(); j++){\r\n\t\t\t\tSystem.out.print(matrix.get(i).get(j));\r\n\t\t\t\tif (j != matrix.get(i).size() - 1) System.out.print(\"\\t|\");\r\n\t\t\t\telse System.out.println();\r\n\t\t\t}\r\n\t\t}\r\n\t}", "public static void printMatrix(Object[][] M) {\r\n\r\n\t\t// Calculation of the length of each column\r\n\t\tint[] maxLength = new int[M[0].length];\r\n\t\tfor (int j = 0; j < M[0].length; j++) {\r\n\t\t\tmaxLength[j] = M[0][j].toString().length();\r\n\t\t\tfor (int i = 1; i < M.length; i++)\r\n\t\t\t\tmaxLength[j] = Math.max(M[i][j].toString().length(), maxLength[j]);\r\n\t\t\tmaxLength[j] += 3;\r\n\t\t}\r\n\t\t\r\n\t\t// Display\r\n\t\tString line, word;\r\n\t\tfor (int i = 0; i < M.length; i++) {\r\n\t\t\tline = \"\";\r\n\t\t\tfor (int j = 0; j < M[i].length; j++) {\r\n\t\t\t\tword = M[i][j].toString();\r\n\t\t\t\twhile (word.length() < maxLength[j])\r\n\t\t\t\t\tword += \" \";\r\n\t\t\t\tline += word;\r\n\t\t\t}\r\n\t\t\tSystem.out.println(line);\r\n\t\t}\r\n\t}", "public void outDisTable()\n\t{\n\t\tfor(int i = 0; i < sqNum; i++)\n\t\t{\n\t\t\tfor(int j = 0; j < sqNum; j++)\n\t\t\t{\n\t\t\t\tSystem.out.printf(\"%-18s\", \"[\" + i + \",\" + j + \"]:\" + String.format(\" %.8f\", dm[i][j]));\n\t\t\t}\n\t\t\tSystem.out.print(\"\\r\\n\");\n\t\t}\n\t}", "public String toString(){\r\n\t\tString ret = \"MatrixArray:\\n\";\r\n\t\tfor (int i = 0; i < this.MA.length; i++) {\r\n\t\t\tfor (int j = 0; j < this.MA[i].length; j++){\r\n\t\t\t\tif (j > 0) {\r\n\t\t\t\t\tret += \", \";\r\n\t\t }\r\n\t\t ret += String.valueOf(this.MA[i][j]);\r\n\t\t\t}\r\n\t\t\tret += \"\\n\";\r\n\t\t}\r\n\t\treturn ret;\r\n\t}", "public void displayMatrix(){\r\n\t\t\r\n\t\tfor (int i = 0; i < head.getOrder(); i++) {\r\n\t\t\tElementNode e = head.gethead();\r\n\t\t\tif( i > 0){\r\n\t\t\t\tfor (int j = 0; j <= i-1; j++) {\r\n\t\t\t\t\te = e.getNextRow();\r\n\t\t\t\t}\r\n\t\t\t}\t\r\n\t\t\tfor (int j = 0; j < head.getOrder(); j++) {\r\n\t\t\t\tSystem.out.print( e.getData() + \" \");\r\n\t\t\t\te = e.getNextColumn();\r\n\t\t\t}\r\n\t\t\tSystem.out.print(\"\\n\");\r\n\t\t}\r\n\t}", "public void displayDistanceMatrix() {\n System.out.println(g.stores.get(g.storeSize - 1)); // storeSize-1 denotes the index of Warehouse or Data centre row.\n System.out.println(\"Some Values are: \");\n for (int j = 0; j < g.storeSize; j++) {\n System.out.print(g.DCStoreMatrix[g.storeSize - 1][j] + \" \");\n }\n System.out.println(\"\");\n }", "public String toString() {\n StringBuilder s = new StringBuilder();\n s.append(N + \"\\n\");\n for (int i = 0; i < N; i++) {\n for (int j = 0; j < N; j++) {\n s.append(String.format(\"%2d \", matrix[i][j]));\n }\n s.append(\"\\n\");\n }\n return s.toString();\n }", "public void print(){\n\t\tfor (int i = 0; i < numRows; i++) {\n\t\t\tfor (int j = 0; j < numCols; j++) {\n\t\t\t\tSystem.out.print(table[i][j] + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void printMatrix(){\n for (int row = 0; row < matrix.length; row++){\n for (int count = 0; count < matrix[row].length; count++){\n System.out.print(\"----\");\n }\n System.out.println();\n System.out.print('|');\n for (int column = 0; column < matrix[row].length; column++){\n if (matrix[row][column] == SHIP)\n System.out.print('X' + \" | \");\n else if (matrix[row][column] == HIT)\n System.out.print('+' + \" | \");\n else if (matrix[row][column] == MISS)\n System.out.print('*' + \" | \");\n else\n System.out.print(\" \" + \" | \");\n }\n System.out.println();\n }\n }", "public String toString()\n\t{\n\t\t//DecimalFormat df = new DecimalFormat(\"0.00\");\n\t\tString report = \"\";\n\t\treport += \"m = \" + rows + \"\\n\";\n\t\treport += \"n = \" + cols + \"\\n\";\n\t\treport += \"[ | ] = \" + \"\\n\";\n\t\tfor(int i = 0; i < rows; i++)\n\t\t{\n\t\t\tfor(int j = 0; j < cols+1; j++)\n\t\t\t{\n\t\t\t\treport += /*df.format*/(A[i][j]) + \" \";\n\t\t\t}\n\t\t\treport += \"\\n\";\n\t\t}\n\t\treturn report;\n\t}", "public static void printMatrix(Matrix m) {\n double[][]matrix = m.getData();\n for(int row = 0; row < matrix.length; row++) {\n for(int column = 0; column < matrix[row].length; column++)\n System.out.print(matrix[row][column] + \" \");\n System.out.println(\"\");\n }\n }", "public static void printMatrix(int[][] matrix){\r\n\t\tfor (int i = matrix.length-1; i >= 0; i = i-1){\r\n\t\t\tfor (int j = 0; j < matrix.length; j = j+1){\r\n\t\t\t\tSystem.out.format(\"%4d\", matrix[i][j]);\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "static void showMatrix()\n {\n String sGameField = \"Game field: \\n\";\n for (String [] row : sField) \n {\n for (String val : row) \n {\n sGameField += \" \" + val;\n }\n sGameField += \"\\n\";\n }\n System.out.println(sGameField);\n }", "public void print() {\n\t\tfor (int i = 0; i < TABLE_SIZE; i++) {\n\t\t\tSystem.out.print(\"|\");\n\t\t\tif (array[i] != null) {\n\t\t\t\tSystem.out.print(array[i].value);\n\t\t\t} else {\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.print(\"|\\n\");\n\t}", "public static void printMatrix(BigDecimal[][] m){\n\t\tfor(int i = 0; i < m.length; i++){\n\t\t\tfor(int j = 0; j < m[0].length; j++)\n\t\t\t\tSystem.out.print(m[i][j]+\"\\t\");\n\n\t\t\tSystem.out.println();\n\t\t}\n\t\tSystem.out.println();\n\t}", "public static void printMatrix(int[][] array, boolean format) {\n if (format) {\n \n }\n }", "public void print() {\n System.out.println();\n for (int level = 0; level < 4; level++) {\n System.out.print(\" Z = \" + level + \" \");\n }\n System.out.println();\n for (int row = 3; row >= 0; row--) {\n for (int level = 0; level < 4; level++) {\n for (int column = 0; column < 4; column++) {\n System.out.print(get(column, row, level));\n System.out.print(\" \");\n }\n System.out.print(\" \");\n }\n System.out.println();\n }\n System.out.println();\n }", "public void print() {\n\t\t\n\t\tfor (int j = 0; j < height(); j++) {\n\t\t\tfor (int i = 0; i < width(); i++) {\n\t\t\t\tSystem.out.printf(\"%3d \", valueAt(i, j));\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n\t\tSystem.out.printf(\"\\n\");\t\n\t}", "public void print() {\n for (int i = 0; i < headers.length; i++) {\n System.out.printf(headers[i] + \", \"); // Print column headers.\n }\n System.out.printf(\"\\n\");\n for (int i = 0; i < (data.length - 1); i++) {\n for (int j = 0; j < data[i].length; j++) {\n System.out.printf(data[i][j] + \" \"); // Print value at i,j.\n }\n System.out.printf(\"\\n\");\n }\n }", "public void print() {\n int rows = this.getNumRows();\n int cols = this.getNumColumns();\n\n for (int r = 0; r < rows; r++) {\n\n for (int c = 0; c < cols; c++) {\n System.out.print(this.getString(r, c) + \", \");\n }\n\n System.out.println(\" \");\n }\n }", "public String toString() {\n StringBuilder output = new StringBuilder();\n output.append(\"{\\n\");\n for (int i=0; i<rows; i++) {\n output.append(Arrays.toString(matrix.get(i)) + \",\\n\");\n }\n output.append(\"}\\n\");\n return output.toString();\n }", "public <T> void printMatrix(T matrix[][])\n {\n int longestString = 0;\n \n for (T[] m : matrix)\n {\n for (T j : m)\n {\n if (j.toString().length() > longestString)\n {\n longestString = j.toString().length();\n }\n }\n }\n String matrixLength = \"\";\n matrixLength += matrix.length;\n \n if (longestString < matrixLength.length())\n {\n longestString = matrix.length;\n }\n \n // limit the length of a string to 4 characters\n longestString = (longestString > 4) ? 4 : longestString;\n \n String format = \"%-\" + (longestString + 1) + \".\" + longestString + \"s\";\n \n System.out.printf(format, \" \");\n for (int i = 0; i < matrix.length; i++)\n {\n System.out.printf(format, i);\n }\n System.out.println(\"\");\n\n int k = 0;\n\n for (T j[] : matrix)\n {\n System.out.printf(format, k++);\n\n for (T i : j)\n {\n String s = \"\";\n s += (i == null) ? \"-\" : i;\n System.out.printf(format, s);\n }\n System.out.println(\"\");\n }\n System.out.println(\"\");\n }", "public static void printDP(){\r\n for (int i = 0; i < sequence.length(); i++) {\r\n for (int j = 0; j < sequence.length(); j++) {\r\n System.out.print(DPMatrix[i][j] + \" \");\r\n }\r\n System.out.println(\"\");\r\n }\r\n }", "public String toString(){\n StringBuffer returnString = new StringBuffer();\n for(int i = 0; i < this.matrixSize; i++){\n if(rows[i].length() != 0){\n returnString.append((i+1) + \":\" + rows[i]+ \"\\n\");\n }\n }\n return returnString.toString();\n }", "private static void printMatrix(int[][] matrix) {\n\t\t\n\t\tSystem.out.println(\"\\n\\t[\\n\");\n\t\tArrays.asList(matrix).stream().forEach(intArray -> {\n\t\t\t\n\t\t\tSystem.out.print(\"\\t\\t\" + Arrays.toString(intArray));\n\t\t\tif(!intArray.equals(matrix[matrix.length-1])){\n\t\t\t\tSystem.out.println(\",\");\n\t\t\t}\n\t\t\t\n\t\t});\n\t\tSystem.out.println(\"\\n\\n\\t]\");\n\t}", "public String toString() {\n String s = \"\";\n for(int i = 1; i <= rows; i++){\n for(int j = 1; j <= cols; j++){ \n s = s + String.format(\"%2d\",m[i][j]) + \" \";\n }\n s += \"\\n\";\n }\n return s;\n }", "public void print() {\n\t\tSystem.out.println(word0 + \" \" + word1 + \" \" + similarity);\n\t}", "void printMatrix(int[][] matrix){\n\t\tfor(int i = 0; i < matrix.length; i++){\n\t\t\tfor(int j = 0; j < matrix[i].length; j++){\n\t\t\t\tSystem.out.print(matrix[i][j] + \"\\t\");\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}", "public String toString()\n\t{\n\t\tStringBuilder matrix = new StringBuilder();\n\t\t\n\t\tfor(int i = 0; i < numberOfVertices; i++)\n\t\t{\n\t\t\tmatrix.append(i + \": \");\n\t\t\tfor(boolean j : adjacencyMatrix[i])\n\t\t\t{\n\t\t\t\tmatrix.append((j? 1: 0) + \" \");\n\t\t\t}\n\t\t\tmatrix.append(\"\\n\");\n\t\t}\n\t\t\n\t\treturn matrix.toString();\n\t}", "public static void printMatrix(int[][] m) {\n for (int i = 0; i < m.length; ++i) {\n for (int j = 0; j < m[i].length; ++j) {\n System.out.print(\" \" + m[i][j]);\n }\n System.out.println();\n }\n }", "public void print() {\n int n = getSeq().size();\n int m = n / printLength;\n for (int i = 0; i < m; i++) {\n printLine(i * printLength, printLength);\n }\n printLine(n - n % printLength, n % printLength);\n System.out.println();\n }", "@Override\r\n public String toString() {\r\n String temp = \"\";\r\n\r\n // item statement are used to generate format for the matrix.\r\n String itemStatement = \" %x.yf\"\r\n .replace(\"x\", \"\" + (Prettify.countSingleDigitSpace(this) + Matrix.significantDigit + 2))\r\n .replace(\"y\", \"\" + Matrix.significantDigit);\r\n\r\n for (double[] row : matrix) {\r\n for (double col : row) {\r\n temp += String.format(itemStatement, col);\r\n }\r\n temp += \"\\n\";\r\n }\r\n\r\n // this one are used to clean up those junks.\r\n // if you need to know it's function, you can disable it,\r\n // it's just kind of magic, here :D\r\n return temp.replaceAll(\"[\\\\s\\\\n]+$\", \"\");\r\n }", "public void test(){\n\t\tfor(int i =0; i< this.position.length;i++){\n\t\t\tSystem.out.println(\" \");\n\t\t\tfor(int p = 0 ; p<this.position.length;p++){\n\t\t\t\tSystem.out.print(this.position[i][p]);\n\t\t\t}\n\t\t}\n\t\tSystem.out.println(\" \");\n\t\tfor(int i =0; i< this.position.length;i++){\n\t\t\tSystem.out.println(\" \");\n\t\t\tfor(int p = 0 ; p<this.position.length;p++){\n\t\t\t\tSystem.out.print(this.Ari[i][p]);\n\t\t\t}\n\t\t}\n\t}", "public void print() {\r\n\r\n\t\tfor (int row=0; row<10; row++) \r\n\t\t{\r\n\t\t\tfor (int col=0; col<10; col++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.print(\"\\t\"+nums[row][col]); //separated by tabs\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "private static void printMatrix(char[][] board) {\n\t\tint row = board.length;\n\t\tint col = board[0].length;\n\t\tfor(int i=0; i<row; i++){\n\t\t\t\n\t\t\tfor(int j=0; j<col; j++){\n\t\t\t\t\n\t\t\t\tSystem.out.print(\" \" + board[i][j]+\"\");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t\t\n\t\tSystem.out.println();\n\t}", "public void show() {\n for (int i = 0; i < rowCount; i++) {\n for (int j = 0; j < columnCount; j++)\n System.out.printf(\"%9.4f \", data[i][j]);\n System.out.println();\n }\n }", "static void printMatrix(int[][] inp){\n\n for(int i=0;i<inp.length;i++){\n for(int j=0;j<inp[0].length;j++){\n System.out.print(inp[i][j]+\" \");\n }\n System.out.println(\"\");\n }\n }", "@Override\n public final String toString() {\n \t\n \treturn String.format(\"[%1$s [%2$s\\t%3$s\\t%4$s]%1$s [%5$s\\t%6$s\\t%7$s]%1$s [%8$s\\t%9$s\\t%10$s] ]\", System.getProperty(\"line.separator\"), this.m00, this.m01, this.m02,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t this.m10, this.m11, this.m12,\n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t this.m20, this.m21, this.m22);\n }", "public String toString(){\n\t\tStringBuilder output = new StringBuilder();\n\t\tfor(int i = 0; i<this.size; i++){\n\t\t\tfor(int j=0; j<this.size; j++){\n\t\t\t\toutput.append(this.numbers[i][j] + \"\\t\");\n\t\t\t}\n\t\t\toutput.append(\"\\n\");\n\t\t}\n\t\treturn output.toString();\n\t}", "public void print() {\r\n System.out.print(\"[id: <\" + this.id + \"> \");\r\n if (this.dimension > 0) {\r\n System.out.print(this.data[0]);\r\n }\r\n for (int i = 1; i < this.dimension * 2; i++) {\r\n System.out.print(\" \" + this.data[i]);\r\n }\r\n System.out.println(\"]\");\r\n }", "public void printMatrix(int n, int[][] A)\n {\n\t // go through by line, then by element, and print the output.\n\t for (int i = 0; i<n; i++) {\n\t\t for (int j = 0; j<n; j++) {\n\t\t\t System.out.print(A[i][j] + \" \");\n\t\t }\n\t\t // end the line at each new space. \n\t\t System.out.println(\" \");\n\t }\n }", "@Override\n public void print() {\n for (int i = 1; i <= itertion; i++) {\n if(n <0){\n this.result = String.format(\"%-3d %-3s (%-3d) %-3s %d \", i, \"*\", n, \"=\", (n * i));\n System.out.println(this.result);\n }else {\n this.result = String.format(\"%-3d %-3s %-3d %-3s %d \", i, \"*\", n, \"=\", (n * i));\n System.out.println(this.result);\n }\n }\n }", "@Override\n public String toString() {\n int numeritosY = 0;\n int numeritosX = 0;\n StringBuilder datos = new StringBuilder(\" \");\n\n //Imprime los numeros de arriba\n for (int x = 0; x < casillas.length; x++) {\n datos.append(\" \").append(numeritosX);\n numeritosX++;\n }\n datos.append(\"\\n \");\n //Imprime la primera linea que corresponde con la parte superior del tablero.\n for (int x = 0; x < casillas.length; x++) {\n datos.append(\"\\033[33m\"+\"+----\"+\"\\033[0m\");\n }\n datos.append(\"\\033[33m\"+\"+\"+\"\\033[0m\");\n datos.append(\"\\n\");\n //Imprime el resto del tablero.\n for (int y = 0; y < casillas.length; y++) {\n datos.append(numeritosY).append(\"\\033[33m\"+\" | \"+\"\\033[0m\");\n for (int x = 0; x < casillas[y].length; x++) {\n datos.append(casillas[y][x].toString());\n }\n datos.append(\"\\n\");\n datos.append(\" \");\n for (int i = 0; i < casillas[y].length; i++) {\n datos.append(\"\\033[33m\"+\"+----\"+\"\\033[0m\");\n }\n datos.append(\"\\033[33m\"+\"+\"+\"\\033[0m\");\n datos.append(\"\\n\");\n numeritosY++;\n }\n return datos.toString();\n }", "public void printMaze()\r\n\t{\r\n\t\tfor(int i = 0;i<maze.length;i++)\r\n\t\t{\r\n\t\t\tSystem.out.println(\"\");\r\n\t\t\tfor(int j = 0;j<maze[0].length;j++)\r\n\t\t\t{\r\n\t\t\t\tSystem.out.println(\"\");\r\n\t\t\t\tfor(int k = 0;k<maze[0][0].length;k++)\r\n\t\t\t\t{\r\n\t\t\t\t\tSystem.out.print(maze[i][j][k]);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tSystem.out.println(\"\");\r\n\t}", "public void print() {\n if (this.tuples == null || this.tuples.isEmpty()) return; \n\n // Initialize number of attributes.\n int attributesNumber = attributes.size();\n\n // An array storing the max length of Strings per column.\n // The Strings per column are tuple Values and attributes.\n int[] maxColumnLengthOfStrings = new int[attributesNumber];\n\n // Loop all the attributes and fill the max length array\n for (int index = 0; index < attributesNumber; index++) {\n\n // Initialize the array with the attributes name length.\n maxColumnLengthOfStrings[index] = attributes.get(index).getName().length();\n\n // Loop the values and find the longest value toString().\n for (int rowIndex = 0; rowIndex < this.tuples.size(); rowIndex++) { // Loop the rows\n String value = this.tuples.get(rowIndex).getValues().get(index).toString();\n if (value.length() > maxColumnLengthOfStrings[index]){\n maxColumnLengthOfStrings[index] = value.length();\n }\n }\n }\n\n // A set of tables whose columns are in the attributes list.\n Set<SQLTable> tablesSet = new HashSet<>();\n // The list of attributes to String format.\n String attributesList = new String();\n // A line used to separate the attributes from the data.\n String separationLine = new String();\n // Create the separation line and the attributes line.\n for (int index = 0; index < attributesNumber; index++) {\n\n // The score column has a null table. Dont search it.\n if (!this.attributes.get(index).getName().equals(\"score\"))\n tablesSet.add((this.attributes.get(index).getTable()) );\n\n\n attributesList += \"|\" + PrintingUtils.addStringWithLeadingChars(maxColumnLengthOfStrings[index],\n this.attributes.get(index).getName(), \" \");\n separationLine += \"+\" + PrintingUtils.addStringWithLeadingChars(maxColumnLengthOfStrings[index], \"\", \"-\");\n }\n attributesList += \"|\"; // Add the last \"|\".\n separationLine += \"+\"; // Add the last \"+\".\n\n // Print the tables which contain this tuples (HACK WAY). \n String tablesInString = new String (\"Tables joined : \");\n for (SQLTable table: tablesSet) {\n tablesInString += table.toAbbreviation() + \" |><| \";\n }\n System.out.println(tablesInString.substring(0, tablesInString.length()-5));\n\n // Print the attributes between separation lines.\n System.out.println(separationLine);\n System.out.println(attributesList);\n System.out.println(separationLine);\n\n // Print all the rows of Tuple Values.\n for (OverloadedTuple tuple: this.tuples) {\n String rowOfValues = new String();\n for (int index = 0; index < attributesNumber; index++) {\n rowOfValues += \"|\" + PrintingUtils.addStringWithLeadingChars( maxColumnLengthOfStrings[index],\n tuple.getValues().get(index).toString(), \" \");\n }\n rowOfValues += \"|\";\n System.out.println(rowOfValues);\n }\n\n // Print a separation line.\n System.out.println(separationLine);\n }", "public static void printMatrix(double[][] matrix) {\r\n\r\n if (matrix == null) {\r\n return;\r\n }\r\n\r\n for (int row = 0; row < matrix.length; row++) {\r\n\r\n System.out.print(\"(\");\r\n\r\n for (int column = 0; column < matrix[row].length; column++) {\r\n\r\n if (column != 0) {\r\n System.out.print(\",\");\r\n }\r\n System.out.print(matrix[row][column]);\r\n }\r\n\r\n System.out.println(\")\");\r\n }\r\n }", "@Override\n public String toString() {\n double[][] temp = matx.getArray();\n String tempstr = \"[\";\n for (int i = 0; i < temp.length; i++) {\n for (int j = 0; j < temp.length; j++) {\n tempstr += (int) temp[i][j] + \", \";\n }\n tempstr = tempstr.substring(0, tempstr.length() - 2);\n tempstr += \"]\\n[\";\n }\n return tempstr.substring(0, tempstr.length() - 2);\n }", "public void printBoard() {\r\n // Print column numbers.\r\n System.out.print(\" \");\r\n for (int i = 0; i < BOARD_SIZE; i++) {\r\n System.out.printf(\" %d \", i+1);\r\n }\r\n System.out.println(\"\\n\");\r\n\r\n\r\n for (int i = 0; i < BOARD_SIZE; i++) {\r\n System.out.printf(\"%c %c \", 'A' + i, board[i][0].mark);\r\n\r\n for (int j = 1; j < BOARD_SIZE; j++) {\r\n System.out.printf(\"| %c \", board[i][j].mark);\r\n }\r\n\r\n System.out.println(\"\");\r\n\r\n if (i < BOARD_SIZE - 1) {\r\n System.out.print(\" \");\r\n for (int k = 1; k < BOARD_SIZE * 3 + BOARD_SIZE; k++) {\r\n System.out.print(\"-\");\r\n }\r\n System.out.println(\"\");\r\n }\r\n }\r\n System.out.println(\"\");\r\n }", "public String getTable() {\n StringBuilder table = new StringBuilder();\n\n table.append(\" \");\n for (int i = 0; i < matrix.length; i++) {\n table.append(\" \");\n table.append(i + 1);\n }\n table.append(\"\\n\");\n\n for (int i = 0; i < matrix.length; i++) {\n table.append(i + 1);\n table.append(\" \");\n\n for (int j = 0; j < matrix.length; j++) {\n table.append(matrix[i][j] ? 1 : 0);\n table.append(\" \");\n }\n table.append(\"\\n\");\n }\n table.append(\"\\n\");\n\n return table.toString();\n }", "public static void printMatrix(boolean debug) {\n \tprintHeader ();\n \tchar c = 'A';\n for (int row = 0; row < matrix.length; row++) {\n \tSystem.out.print(c + \" \");\n \tc++;\n for (int col = 0; col < matrix[0].length; col++) {\n if (matrix[row][col] == SHIP_SYMBOL) {\n if (debug) {\n System.out.print(matrix[row][col] + \" \");\n } else {\n System.out.print(Character.toString(EMPTY_SYMBOL) + \" \");\n }\n\t\t\t\t} else {\n\t\t\t\t\tSystem.out.print(matrix[row][col] + \" \");\n\t\t\t\t}\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\n\t}", "public static void printSM(short[][] matrix){\r\n\t\tfor(int y =0;y<matrix.length;y++){\r\n\t\t\tfor(int x =0; x < matrix[0].length; x++){\r\n\t\t\t\tSystem.out.print(matrix[y][x]+\" \");\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "public void print(){\r\n\t\tSystem.out.println(\"Size of each block:\\t\\t\" + this.blockSize);\r\n\t\tSystem.out.println(\"Total Number of Inodes:\\t\\t\" + this.inodeCount);\r\n\t\tSystem.out.println(\"Total Number of Blocks:\\t\\t\" + this.blocksCount);\r\n\t\tSystem.out.println(\"Number of Free Blocks:\\t\\t\" + this.freeBlocksCount);\r\n\t\tSystem.out.println(\"Number of Free Inodes:\\t\\t\" + this.freeInodesCount);\r\n\t\tSystem.out.println(\"First Data Block:\\t\\t\" + this.firstDataBlock);\r\n\t\tSystem.out.println(\"Last Written Date and Time:\\t\" + GeneralUtils.getDateFromLong(this.wTime));\r\n\t\tSystem.out.println(\"First Inode:\\t\\t\\t\" + this.firstInode);\r\n\t\tSystem.out.println(\"Inode Size:\\t\\t\\t\" + this.inodeSize);\r\n\t}", "public void print() {\n\t\tfor(String subj : subjects) {\n\t\t\tSystem.out.println(subj);\n\t\t}\n\t\tSystem.out.println(\"==========\");\n\t\t\n\t\tfor(StudentMarks ssm : studMarks) {\n\t\t\tSystem.out.println(ssm.student);\n\t\t\tfor(Byte m : ssm.marks) {\n\t\t\t\tSystem.out.print(m + \" \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void print () \r\n\t{\r\n\t\tfor (int index = 0; index < count; index++)\r\n\t\t{\r\n\t\t\tif (index % 5 == 0) // print 5 columns\r\n\t\t\t\tSystem.out.println();\r\n\r\n\t\t\tSystem.out.print(array[index] + \"\\t\");\t// print next element\r\n\t\t}\r\n\t\tSystem.out.println();\r\n\t}", "public void print(){\n for(int i=0; i<maze.length;i+=1) {\n for (int j = 0; j < maze[0].length; j += 1){\n if(i == start.getRowIndex() && j == start.getColumnIndex())\n System.out.print('S');\n else if(i == goal.getRowIndex() && j == goal.getColumnIndex())\n System.out.print('E');\n else if(maze[i][j]==1)\n System.out.print(\"█\");\n else if(maze[i][j]==0)\n System.out.print(\" \");\n\n\n }\n System.out.println();\n }\n }", "public static void printMatrix(double[][] matrix) {\n for (int i = 0; i < matrix.length; i++) {\n for (int j = 0; j < matrix[0].length; j++) {\n System.out.print(matrix[i][j] + \" \");\n }\n System.out.println();\n }\n }", "@Override\n public String toString() {\n StringBuilder matrixValues = new StringBuilder(\"\\nMatrix : \"\n + values.length + \"x\" + values[0].length + \"\\n\");\n for (int[] row : values) {\n for (int value : row) {\n matrixValues.append(value + \" \");\n }\n matrixValues.append(\"\\n\");\n }\n return matrixValues.toString();\n }", "public String print(){\r\n\t\t\r\n\t\treturn String.format(\"%9d\\t%-5s\\t\\t%-3d\\t\\t%-15s\",\r\n\t\t\t\tthis.engineNumber, \r\n\t\t\t\tthis.companyName, \r\n\t\t\t\tthis.numberOfRailCars, \r\n\t\t\t\tthis.destinationCity);\r\n\t}", "static void printMat(Integer mat[][], int n)\n\t{\n\t\tfor (int i = 0; i < n; i++)\n\t\t{\n\t\t\tfor (int j = 0; j < n; j++)\n\t\t\t\tSystem.out.print(mat[i][j] + \" \");\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "@Override\n\tpublic String toString() {\n\t\tString out = new String();\n\t\tfor (int i = 0; i < this.maxNumVertices; i++) {\n\t\t\tfor (int j = 0; j < this.maxNumVertices; j++) {\n\t\t\t\tout = out + this.reachabilityMatrix[i][j] + \" \";\n\t\t\t}\n\t\t\tout = out + \"\\n\";\n\t\t}\n\t\treturn out;\n\t}", "public void printA(){\n\t\tfor(int i = 0; i < this.area.length;i++){\n\t\t\tSystem.out.println(\" \");\n\t\t\tSystem.out.print(\" \");\n\t\t\tfor(int p = 0 ; p < this.area.length; p++){\n\n\t\t\t\tif(this.Ari[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" ? \");\n\t\t\t\t}\n\t\t\t\telse if(this.position[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" + \");\n\t\t\t\t}\n\t\t\t\telse if(this.Items[i][p] != null){\n\t\t\t\t\tSystem.out.print(\"<$>\");\n\t\t\t\t}\n\t\t\t\telse if(this.Door[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" D \");\n\t\t\t\t}\n\t\t\t\telse if(this.Stairs[i][p] ==1){\n\t\t\t\t\tSystem.out.print(\" S \");\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tSystem.out.print(this.area[i][p]);\n\t\t\t\t}\n\t\t\t}//end of inner for print\n\t\t}//end of outter for print\n\t}", "public void print() {\r\n this.table.printTable();\r\n }", "public void print()\n {\n System.out.println(\"------------------------------------------------------------------\");\n System.out.println(this.letters);\n System.out.println();\n for(int row=0; row<8; row++)\n {\n System.out.print((row)+\"\t\");\n for(int col=0; col<8; col++)\n {\n switch (gameboard[row][col])\n {\n case B:\n System.out.print(\"B \");\n break;\n case W:\n System.out.print(\"W \");\n break;\n case EMPTY:\n System.out.print(\"- \");\n break;\n default:\n break;\n }\n if(col < 7)\n {\n System.out.print('\\t');\n }\n\n }\n System.out.println();\n }\n System.out.println(\"------------------------------------------------------------------\");\n }", "public static void printMatrix(ArrayList<List<String>> matrix){\r\n\t\tfor (int i = 0; i < matrix.size(); i++) {\r\n\t\t\tfor (int j = 0; j < matrix.get(i).size(); j++) {\r\n\t\t\t\tSystem.out.print(matrix.get(i).get(j)+\", \");\r\n\t\t\t}\r\n\t\t\tSystem.out.println();\r\n\t\t}\r\n\t}", "void print() {\n\n\t\t// Print \"Sym Table\"\n\t\tSystem.out.print(\"\\nSym Table\\n\");\n\n\t\tfor (int i = 0; i < list.size(); i++) {\n\t\t\tHashMap<String, Sym> M = list.get(i);\n\t\t\t// Print each HashMap in list\n\t\t\tSystem.out.print(String.format(M.toString() + \"\\n\"));\n\t\t}\n\n\t\t// Print New Line\n\t\tSystem.out.println();\n\t}", "public static void displayMatrix(char[][] M, int size){\n for (int i = 0 ; i < size ; i++){\n for (int j=0 ; j< size ; j++){\n System.out.print(M[i][j]);\n }\n System.out.println ();\n }\n }", "private void print(){\n\t\tfor(int i = 0; i < maxNum; i++){\n\t\t\tSystem.out.print(m[i] + \" \");\n\t\t\t\n\t\t\tif((i + 1) % order == 0){\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t}\n\t\tSystem.out.println();\n\t}", "public void printTable() {\n\t\tString s = String.format(\"Routing table (%.3f)\\n\"\n\t\t\t\t+ \"%10s %10s %8s %5s %10s \\t path\\n\", now, \"prefix\", \n\t\t\t\t\"timestamp\", \"cost\",\"link\", \"VLD/INVLD\");\n\t\tfor (Route rte : rteTbl) {\n\t\t\ts += String.format(\"%10s %10.3f %8.3f\",\n\t\t\t\t\trte.pfx.toString(), rte.timestamp, rte.cost);\n\n\t\t\ts += String.format(\" %5d\", rte.outLink);\n\n\t\t\tif (rte.valid == true)\n\t\t\t\ts+= String.format(\" %10s\", \"valid\");\n\t\t\telse\n\t\t\t\ts+= String.format(\" %10s \\t\", \"invalid\");\n\n\t\t\tfor (int r :rte.path)\n\t\t\t\ts += String.format (\" %s\",Util.ip2string(r));\n\n\t\t\tif (lnkVec.get(rte.outLink).helloState == 0)\n\t\t\t\ts += String.format(\"\\t ** disabled link\");\n\t\t\ts += \"\\n\";\n\t\t}\n\t\tSystem.out.println(s);\n\t}", "private void print_solution() {\n System.out.print(\"\\n\");\n for (int i = 0; i < rowsCount; i++) {\n for (int j = 0; j < colsCount; j++) {\n System.out.print(cells[i][j].getValue());\n }\n System.out.print(\"\\n\");\n }\n }", "public void print()\n {\n StringBuffer buffer = new StringBuffer();\n for (int i = 0; i < memorySize; i++)\n {\n buffer.append(mainMemory[i]);\n }\n System.out.println(buffer.toString());\n }", "public static void printMatrix(Object[][] matrix) {\n for (Object[] row : matrix) {\n for (Object cell : row) {\n System.out.print(cell + \" \");\n }\n System.out.println();\n }\n }", "public void printMatrix(String tag, double[][] matrix) {\n\t\tm.printMatrix(tag, matrix);\n\t}", "void print() {\n for (int i = 0; i < 8; i--) {\n System.out.print(\" \");\n for (int j = 0; j < 8; j++) {\n System.out.print(_pieces[i][j].textName());\n }\n System.out.print(\"\\n\");\n }\n }", "public void printMultiplicationTable() {\n for(int i = 1;i <= 12;i++) {\n for(int j = 1;j <= 12;j++) {\n //prints out the result each time\n //use %4 to create the columns\n System.out.printf(\"%5d\", multiplicationFunction(i, j));\n }\n //uses %n once the inner loop completes once\n System.out.printf(\"%n\");\n }\n }", "public void printTable() {\r\n System.out.println(frame+\") \");\r\n for (int y = 0; y < table.length; y++) {\r\n System.out.println(Arrays.toString(table[y]));\r\n }\r\n frame++;\r\n }", "public String print() {\n StringBuilder sb = new StringBuilder();\n sb.append(tableName).append(System.lineSeparator());\n\n if (columnsDefinedOrder.size() <= 0) {\n columnsDefinedOrder = rows.stream()\n .findFirst()\n .map(x -> new ArrayList<>(x.keySet()))\n .orElse(columnsDefinedOrder);\n }\n\n Map<String, Integer> widthEachColumn = new HashMap<>();\n for (String columnName : columnsDefinedOrder) {\n widthEachColumn.put(columnName, 0);\n }\n\n for (Map<String, String> row : rows) {\n for (String columnName : columnsDefinedOrder) {\n int length = row.get(columnName).length();\n if (length > widthEachColumn.get(columnName)) {\n widthEachColumn.put(columnName, length);\n }\n }\n }\n\n for (String columnName : columnsDefinedOrder) {\n int width = widthEachColumn.get(columnName) + 5;\n widthEachColumn.put(columnName, width);\n }\n\n for (Map<String, String> row : rows) {\n for (String columnName : columnsDefinedOrder) {\n sb.append(String.format(\"%-\" + widthEachColumn.get(columnName) + \"s\", row.get(columnName)));\n }\n sb.append(System.lineSeparator());\n }\n\n return sb.toString();\n }", "public void print(){\n\t\tfor (int i=0; i<_size; i++){\n\t\t\tSystem.out.print(_a[i].getKey()+\"; \");\n\t\t}\n\t\tSystem.out.println();\n\t}", "void printGrid() {\n\t\tSystem.out.println();\n\t\tfor (int row = 0; row < moleGrid.length; row++) {\n\t\t\tfor (int col = 0; col < moleGrid[row].length; col++) {\n\t\t\t\tSystem.out.print(moleGrid[row][col] + \"\\t\");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public String print(){\r\n\t\treturn String.format(\"%9d\\t%-5s\\t\\t%-3d\\t\\t%-15s\",\r\n\t\t\t\tthis.trackNumber, \r\n\t\t\t\tthis.engineNumber, \r\n\t\t\t\tthis.numRailCars, \r\n\t\t\t\tthis.destCity);\r\n\t\t}", "private void print() {\n printInputMessage();\n printFrequencyTable();\n printCodeTable();\n printEncodedMessage();\n }", "public void printAlignment(SWGAlignment alignment){\n\t\t\tString \torigSeq1 = alignment.getOriginalSequence1().toString(),\n\t\t\t\t\torigSeq2 = alignment.getOriginalSequence2().toString(),\n\t\t\t\t\talnSeq1 = new String(alignment.getSequence1()),\n\t\t\t\t\talnSeq2 = new String(alignment.getSequence2());\n\t\t\tint \tstart1 = alignment.getStart1(),\n\t\t\t\t\tstart2 = alignment.getStart2(),\n\t\t\t\t\tgap1 = alignment.getGaps1(),\n\t\t\t\t\tgap2 = alignment.getGaps2();\n\t\t\t\n\t\t\tString seq1, seq2, mark;\n\t\t\tif(start1>=start2){\n\t\t\t\tseq1=origSeq1.substring(0, start1) + alnSeq1 + origSeq1.substring(start1+alnSeq1.length()-gap1);\n\t\t\t\tString \tseq2Filler = start1==start2?\"\":String.format(\"%\"+(start1-start2)+\"s\", \"\"),\n\t\t\t\t\t\tmarkFiller = start1==0?\"\":String.format(\"%\"+start1+\"s\", \"\");\n\t\t\t\tseq2= seq2Filler + origSeq2.substring(0, start2) + alnSeq2 + origSeq2.substring(start2+alnSeq2.length()-gap2);\n\t\t\t\tmark= markFiller+String.valueOf(alignment.getMarkupLine());\n\t\t\t}else{\n\t\t\t\tseq2=origSeq2.substring(0, start2) + alnSeq2 + origSeq2.substring(start2+alnSeq2.length()-gap2);\n\t\t\t\tString \tmarkFiller = start2==0?\"\":String.format(\"%\"+start2+\"s\", \"\");\n\t\t\t\tseq1=String.format(\"%\"+(start2-start1)+\"s\", \"\") + origSeq1.substring(0, start1) + alnSeq1 + origSeq1.substring(start1+alnSeq1.length()-gap1);\n\t\t\t\tmark=markFiller+String.valueOf(alignment.getMarkupLine());\n\t\t\t}\n\t\t\tSystem.out.println(alignment.getSummary());\n\t\t\tSystem.out.println(seq1);\n\t\t\tSystem.out.println(mark);\n\t\t\tSystem.out.println(seq2);\n\t\t}", "public String toString()\n {\n String str = \"\";\n switch (align)\n {\n case LEFT :\n str = \",align=left\";\n break;\n case CENTER :\n str = \",align=center\";\n break;\n case RIGHT :\n str = \",align=right\";\n break;\n }\n return getClass().getName() + \"[hgap=\" + hgap + \",vgap=\" + vgap + str + \"]\";\n }", "public void display() {\n\t\tfor (int i = 0; i < size; i++) {\n\t\t\tSystem.out.print(a[i] + \"\\t\");\n\t\t}\n\t\tSystem.out.println();\n\t}", "public String toString()\n\t{\n\t\tString output = \"\";\n\t\tfor(String[] at:atMat){\n\t\t\tfor(String a:at){\n\t\t\t\toutput += a+ \" \";\n\t\t\t}\n\t\t\toutput += \"\\n\";\n\t\t}\n\t\treturn output;\n\t}" ]
[ "0.75420344", "0.7243872", "0.71485305", "0.7128738", "0.70161843", "0.69661725", "0.6839923", "0.6825355", "0.6779104", "0.6753959", "0.6748858", "0.6708596", "0.66799253", "0.666531", "0.65976983", "0.6582275", "0.6560419", "0.65585774", "0.64962184", "0.64837104", "0.64678884", "0.6464992", "0.6457403", "0.64467466", "0.643514", "0.6429808", "0.6428709", "0.64255923", "0.6419041", "0.6363543", "0.63625956", "0.63359", "0.63335603", "0.632174", "0.6298349", "0.6294553", "0.6294336", "0.62874466", "0.6280873", "0.6262118", "0.62529904", "0.623666", "0.621378", "0.6207606", "0.6203415", "0.6200628", "0.61998206", "0.6162257", "0.6145758", "0.61437297", "0.6136452", "0.6123048", "0.6121504", "0.6070731", "0.60671365", "0.60546434", "0.6051157", "0.6030316", "0.60204786", "0.60152304", "0.60113996", "0.60093504", "0.60023415", "0.59864557", "0.59800375", "0.5971629", "0.59639454", "0.5957652", "0.5956138", "0.5954869", "0.59464395", "0.5938192", "0.5936109", "0.5932508", "0.59324306", "0.5928981", "0.5927773", "0.5912522", "0.5908955", "0.590341", "0.58649474", "0.5851249", "0.5847414", "0.58448404", "0.58444095", "0.5837601", "0.58268285", "0.5825068", "0.58182144", "0.5816502", "0.58090615", "0.5806911", "0.57807803", "0.57794833", "0.57768375", "0.57657766", "0.5762927", "0.5760635", "0.57587755", "0.57573545", "0.57536054" ]
0.0
-1
Returns the index of the turtle's current image
@Override public void doCommand(TreeNode commandNode) { int currentImage = displayOption.getImageIndex().get(); commandNode.setResult(currentImage + ""); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "protected int getImageIndex() {\n/* 216 */ return this.mlibImageIndex;\n/* */ }", "public Sprite getCurrentSprite() {\n\t\tif (this.getVx() <= 0) {\n\t\t\treturn getImages()[0];\n\t\t}\n\t\treturn getImages()[1];\n\t}", "public ImageIdentifier getImageIdentifier() {\n synchronized (this.imageLock) {\n return this.animation.getCurrentImage();\n }\n }", "public Texture getCurrentFrame(){\n\t\treturn images[currentFrame];\n\t}", "private int terminalLocation(){\n int answer = 0;\n for(int ii = 0; ii < (currentIm.getRows() * currentIm.getCols()); ii = ii + 1){\n if(126 == getHidden(ii)){\n return answer = ii;\n }\n }\n \n return answer;\n }", "public int getIndex() { \n\t\t\treturn currIndex;\n\t\t}", "public int getCurIdx() {\n\t\treturn dDisplay.getCurIdx();\n\t}", "public int getimagecounter() {\n\t\treturn imagecounter;\r\n\t}", "public int getCurrentIdx() {\n\t\treturn currentIdx;\n\t}", "public int getCurrentIdx() {\n\t\treturn this.currentIdx;\n\t}", "private int getInstr(int index) {\n switch (index) {\n case 0:\n return R.drawable.chickpeacurry;\n case 1:\n return R.drawable.sweetpotatoblackbeanburger;\n case 2:\n return R.drawable.cabbagedietsoup;\n case 3:\n return R.drawable.instantpotvegetablesoup;\n case 4:\n return R.drawable.veganpumpkinsoup;\n\n default:\n return -1;\n }\n }", "private int getIdx(MouseEvent e) {\n Point p = e.getPoint();\n p.translate(-BORDER_SIZE, -BORDER_SIZE);\n int x = p.x / CELL_SIZE;\n int y = p.y / CELL_SIZE;\n if (0 <= x && x < GUI.SIZE[1] && 0 <= y && y < GUI.SIZE[1]) {\n return GUI.SIZE[1] * x + y;\n } else {\n return -1;\n }\n }", "int getCurrentIdx() {\n return currentIdx;\n }", "public int getIconIndex() {\n return iconIndex;\n }", "public BufferedImage getCurrentFrame(){\n\t\tif(first)\n\t\t\treturn animation_frame[index];\n\t\telse\n\t\t\treturn animation_frame[0];\n\t\t\n\t}", "public int getIndex() {\r\n \t\t\treturn index;\r\n \t\t}", "int index(){\n\n\t\t\n\t\tif (cursor == null) \n\t\t{\n\t\t\treturn -1;\n\t\t}\n\t\treturn index;\n\t}", "int getIndex() {\n\t\treturn index;\n\t}", "private Image getCurrentPicture(){\r\n\t\tif (i >= images.size()) {\r\n\t\t\ti = 0;\r\n\t\t}else if(i<0){\r\n\t\t\ti = images.size() -1;\r\n\t\t}\r\n\t\treturn new Image(images.get(i).getUrl());\r\n\t}", "public int getIndex() {\n \t\treturn index;\n \t}", "public int getSelectionIndex () {\r\n\tcheckWidget();\r\n\tint [] args = {OS.Pt_ARG_PG_CURRENT_INDEX, 0, 0};\r\n\tOS.PtGetResources (handle, args.length / 3, args);\r\n\treturn args [1] == OS.Pt_PG_INVALID ? -1 : args [1];\r\n}", "public int getIndex()\n {\n return index;\n }", "public int getImageNumber() {\n return imageNumber;\n }", "public ImageIcon getCurrentImage() {\n\t\t\treturn this.currentImage;\n\t}", "int index();", "private int getIndex() {\n\t\treturn this.index;\r\n\t}", "public final int getIndex(){\n return index_;\n }", "private int getAnimationRow() {\n double dirDouble = (Math.atan2(xSpeed, ySpeed) / (Math.PI / 2) + 2);\n int direction = (int) Math.round(dirDouble) % BMP_ROWS;\n return DIRECTION_TO_ANIMATION_MAP[direction];\n }", "public int getIndex() {\r\n return index;\r\n }", "private int getRealIndex()\r\n\t{\r\n\t\treturn index - 1;\r\n\t}", "public int getIndex() {\n return index;\n }", "public int getIndex(){\n\t\treturn index;\n\t}", "public int getIndex(){\n\t\treturn index;\n\t}", "public int getIndex(){\n\t\treturn index;\n\t}", "public int getIndex() {\r\n\t\treturn index;\r\n\t}", "public int getIndex(){\r\n \treturn index;\r\n }", "public MorphCell current()\n {\n return this.morphs.get(this.index);\n }", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "int getIndex();", "public int getIndex()\n {\n return index;\n }", "int getIndex(){\r\n\t\treturn index;\r\n\t}", "public ImageArray getCurrentImage() {\n return currentIm;\n }", "public int getIndex(){\n return index;\n }", "public int getIndex(){\n return index;\n }", "public int FrameIndex() {\r\n return frameIndex;\r\n }", "public int getIndex()\n {\n return m_index;\n }", "public int currentindex() {\n\t\treturn currentElement;\n\t}", "public int getIndex() {\n\t\treturn index;\n\t}", "public int getIndex() {\n\t\treturn index;\n\t}", "public int getIndex() {\n\t\treturn index;\n\t}", "public int getIndex() {\n return index;\n }", "public int getIndex() {\n return index;\n }", "public int getIndex() {\n return index;\n }", "public int getIndex() {\n return index;\n }", "public int getIndex() {\n return index;\n }", "@Override\n public synchronized int getCurrentIndex() {\n return mCurrentIndex;\n }", "public static int currentPlayerIndex() {\n return turn-1;\n }", "protected final int getIndex() {\n return index;\n }", "public synchronized final int getIndex() {\r\n return f_index;\r\n }", "public int getIndex() {\n return index;\n }", "public int getImage();", "public static int getSelectedSongIndex() {\n\t\tint x =list.getSelectedIndex();\n\t\treturn x;\n\t}", "public Image getState () {\n\t\treturn images[state];\n\t}", "public int getIndex() {\n return index_;\n }", "public int getIndex() {\n return index_;\n }", "public int getIndex() {\n return index_;\n }", "public int getIndex() {\n return index_;\n }", "public int getIndex() {\n return index_;\n }", "public int getIndex() {\n return index_;\n }", "public IborIndex getIborIndex() {\n //TODO think about this\n return _swapGenerator.getIborIndex();\n }", "public int getIdx() {\n return idx;\n }", "public int index();", "public int getIndex() {\r\n return _index;\r\n }", "public int getIndex() {\r\n return _index;\r\n }", "public int getIndex() { return this.index; }", "public static int getHomeCellIndex()\n {\n switch (TurnController.getPlayerTurn())\n {\n case BLUE:\n return 48;\n case RED:\n return 55;\n case GREEN:\n return 62;\n case YELLOW:\n return 69;\n }\n return -1;\n }", "public int getBitmapIndex(char objectType){\n int index;\n switch (objectType){\n case '.': index = 0; break;\n case '1': index = 1; break;\n case 'p': index = 2; break;\n default: index = 0; break;\n }\n return index;\n }", "public int getIndex();", "public int getIndex();", "public int getIndex();", "public Integer getIdx() {\r\n\t\treturn idx;\r\n\t}", "@Override\r\n\tpublic int getIndex() {\n\t\treturn index;\r\n\t}", "int getSelectedSpriteValue();", "public int getIndex(\n )\n {return index;}", "public int index() {\n\t\treturn this.index;\n\t}", "private int getIndex(Entity entity){\n int currentIndex = 0;\n\n for(QuadTree node: this.getNodes()){\n\n /*PhysicsComponent bp = (PhysicsComponent)entity.getProperty(PhysicsComponent.ID);\n if( node.getBounds().contains(bp.getBounds())){\n return currentIndex;\n }*/\n currentIndex++;\n }\n return -1; // Subnode not found (part of the root then)\n }", "public void nextTextureIndexX() {\n/* 245 */ this.particleTextureIndexX++;\n/* */ }", "public int getIconImageNumber(){return iconImageNumber;}", "public int mouseToPreviewTile()\n {\n for (int i = 0; i < previews.length; i += 2)\n {\n if (mouseX > (width/4*3 + 30) && mouseX < (width/4*3 + 30 + previews[0].width) &&\n mouseY > (20 + (i/2)*130) && mouseY < (20 + (i/2)*130 + previews[0].height) &&\n previews[i] != null)\n {\n return i;\n }\n if (mouseX > (width/4*3 + 160) && mouseX < (width/4*3 + 160 + previews[0].width) &&\n mouseY > (20 + (i/2)*130) && mouseY < (20 + (i/2)*130 + previews[0].height) &&\n previews[i+1] != null)\n {\n return i+1;\n }\n }\n return -1;\n }", "public ImageObj prevImage() {\n if (position != 0) {\n position--;\n }\n else {\n position = model.getImageList().size() - 1;\n }\n\n return model.getImageList().get(position);\n }" ]
[ "0.65179443", "0.6327418", "0.631957", "0.6305557", "0.6224094", "0.62022233", "0.62008494", "0.612662", "0.61049366", "0.6097565", "0.6094083", "0.6078922", "0.6058608", "0.600662", "0.6001852", "0.5960679", "0.5943499", "0.59209615", "0.5914747", "0.591121", "0.58909446", "0.58873135", "0.5886461", "0.5884404", "0.5880855", "0.5880032", "0.58603245", "0.5859657", "0.58582646", "0.58538884", "0.58473444", "0.5843169", "0.5843169", "0.5843169", "0.5838637", "0.5827977", "0.58274424", "0.5827146", "0.5827146", "0.5827146", "0.5827146", "0.5827146", "0.5827146", "0.5827146", "0.5827146", "0.5827146", "0.5827146", "0.5827146", "0.5827146", "0.5827146", "0.5827049", "0.5821354", "0.5818285", "0.58105636", "0.58105636", "0.5802713", "0.57887816", "0.5787903", "0.57876486", "0.57876486", "0.57876486", "0.5785566", "0.5785566", "0.5785566", "0.5785566", "0.5785566", "0.5784242", "0.57815677", "0.57785285", "0.5768147", "0.57655007", "0.5762013", "0.574937", "0.5747888", "0.5745114", "0.5745114", "0.5745114", "0.5745114", "0.5745114", "0.5745114", "0.574405", "0.5742064", "0.5735277", "0.57185405", "0.57185405", "0.57185", "0.5715709", "0.57112676", "0.5707525", "0.5707525", "0.5707525", "0.569857", "0.5696139", "0.569136", "0.5691012", "0.56799906", "0.5679712", "0.56748235", "0.5673108", "0.5670725", "0.56698966" ]
0.0
-1
TODO Autogenerated method stub
@Override public void turnToward(int x, int y) { }
{ "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
printing out the values for each variable
public static void printSolutions(float[][]matrix, int dimension){ for (int i = 0; i< dimension; i++){ System.out.println("x" + (i+1) + " = " + Math.round(matrix[i][dimension]*1000)/1000.0d);} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private static void displayVariables() {\n Iterator i = dvm.getVariableNames().iterator();\n Object temp;\n while(i.hasNext()){\n temp = i.next();\n System.out.print(temp + \": \" + dvm.getValue(temp.toString()) + \"\\n\");\n }\n }", "public void printVal()\n {\n for (int i=0;i<intData.length;i++)\n System.out.print(intData[i] + \" \");\n System.out.println();\n System.out.println(\"Sum: \" + sum + \", Avg: \" + avg + \", Prod: \" + prod);\n }", "public void displayValues()\n {\n \tSystem.out.println(\"The name of a bicycle is \"+name);\n \tSystem.out.println(\"The cost of a bicycle is \"+cost);\n \tSystem.out.println(\"The total numer of gears \"+gears);\n \t\n \t\n }", "public void printValues() {\n\t\tfor (int i = 0; i < 7; i++) {\n\t\t\tfor (int j = 0; j < 7; j++) {\n\t\t\t\tlblCenter[i][j].setText(\"\" + array.getElement(i, j));\n\t\t\t}\n\t\t\ttfWest[i].setText(\"\" + leftCol.getElement(i));\n\t\t\ttfSouth[i].setText(\"\" + bottomRow.getElement(i));\n\t\t}\n\t}", "public String variableValues() {\n\t\tif (name.values().size()==0)\n\t\t\treturn \"Symbol table is empty\";\n\t\tString s = \"Variable values\\n\";\n\t\tfor (NameSSA n : name.values()) {\n\t\t\tVariable v = var.get(n.current());\n\t\t\tif (v.isConstant())\n\t\t\t\ts += n.current() + \":\" + v.constantNumber();\n\t\t\telse \n\t\t\t\ts += n.current() + \":\" + \" unknown\";\n\t\t\ts+=\" \";\n\t\t}\n\t\treturn s;\n\t}", "static void PrintVarValues(String s){\n System.out.println(s);\n }", "public void printValues(){\r\n\r\n for(String key : values.keySet()){\r\n String value = values.get(key).toString();\r\n System.out.println(key + \" = \" + value);\r\n }\r\n\r\n }", "void printValues(Vector Vect){\n\t\tint index;\n\t\tfor(index=0;index< Vect.size(); index++){\t\n\t\t\tSystem.out.println(\"Element \" + Vect.elementAt(index));\n\t\t}\n\t\t\n\t}", "public void dump() {\n List<String> variableStrings = new ArrayList<>();\n for (int i = 1; i <= VARIABLE_COUNT; i++) {\n if (variables.containsKey(i)) {\n variableStrings.add(variables.get(i).toString());\n }\n }\n System.out.println(String.format(\"site %d - %s\", id, String.join(\", \", variableStrings)));\n }", "public void print() {\n System.out.print(\"[ \" + value + \":\" + numSides + \" ]\");\n }", "public void showAssignments(){\n\t\tIterator it = this.clauses.iterator();\n\t\tint numVar = this.getVocabulary().getMaxVariableId();\n\t\tint[] assign = new int[numVar*2+1]; \n\n\t\twhile (it.hasNext()) {\n\t\t\tSystem.out.println(\"___________________________\");\n IClause cl = (IClause) it.next();\n Iterator litIterator = cl.literalIterator();\n while (litIterator.hasNext()){\n \tILiteral lit = (ILiteral) litIterator.next();\n \tint idx = lit.getId();\n \tif (idx<0) \n \t\tidx = numVar - idx;\n \tassign[idx] = lit.value();\n }\n }\n\t\t\n\t\tfor (int i=1;i<assign.length;i++){\n\t\t\tint k = i;\n\t\t\tif (i>numVar)\n\t\t\t\tk = numVar - i;\n\t\t\tSystem.out.print(k + \"|\" + assign[i] + \";\");\n\t\t}\n\t\tSystem.out.println();\n\t}", "public void print (){\r\n\t\tSystem.out.print(\" > Inputs (\"+numInputAttributes+\"): \");\r\n\t\tfor (int i=0; i<numInputAttributes; i++){\r\n\t\t\tif (missingValues[Instance.ATT_INPUT][i]){\r\n\t\t\t\tSystem.out.print(\"?\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tswitch(Attributes.getInputAttribute(i).getType()){\r\n\t\t\t\tcase Attribute.NOMINAL:\r\n\t\t\t\t\tSystem.out.print(nominalValues[Instance.ATT_INPUT][i]); \r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase Attribute.INTEGER:\r\n\t\t\t\t\tSystem.out.print((int)realValues[Instance.ATT_INPUT][i]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase Attribute.REAL:\r\n\t\t\t\t\tSystem.out.print(realValues[Instance.ATT_INPUT][i]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.print(\" \");\r\n\t\t}\r\n\t\tSystem.out.print(\" > Outputs (\"+numOutputAttributes+\"): \");\r\n\t\tfor (int i=0; i<numOutputAttributes; i++){\r\n\t\t\tif (missingValues[Instance.ATT_OUTPUT][i]){\r\n\t\t\t\tSystem.out.print(\"?\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tswitch(Attributes.getOutputAttribute(i).getType()){\r\n\t\t\t\tcase Attribute.NOMINAL:\r\n\t\t\t\t\tSystem.out.print(nominalValues[Instance.ATT_OUTPUT][i]); \r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase Attribute.INTEGER:\r\n\t\t\t\t\tSystem.out.print((int)realValues[Instance.ATT_OUTPUT][i]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase Attribute.REAL:\r\n\t\t\t\t\tSystem.out.print(realValues[Instance.ATT_OUTPUT][i]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.print(\" \");\r\n\t\t}\r\n\r\n\t\tSystem.out.print(\" > Undefined (\"+numUndefinedAttributes+\"): \");\r\n\t\tfor (int i=0; i<numUndefinedAttributes; i++){\r\n\t\t\tif (missingValues[Instance.ATT_NONDEF][i]){\r\n\t\t\t\tSystem.out.print(\"?\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tswitch(Attributes.getUndefinedAttribute(i).getType()){\r\n\t\t\t\tcase Attribute.NOMINAL:\r\n\t\t\t\t\tSystem.out.print(nominalValues[Instance.ATT_NONDEF][i]); \r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase Attribute.INTEGER:\r\n\t\t\t\t\tSystem.out.print((int)realValues[Instance.ATT_NONDEF][i]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase Attribute.REAL:\r\n\t\t\t\t\tSystem.out.print(realValues[Instance.ATT_NONDEF][i]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.print(\" \");\r\n\t\t}\r\n\t}", "public void printAllGradeValues() {\n\t\tfor ( int i = 0; i < gradeValues.size(); i++ ) {\n\t\t\tSystem.out.println( gradeValues.get(i) );\n\t\t}\n\t}", "public void displayStateValues()\n\t{\n\t\tfor (State s : stateSpace)\n\t\t{\n\t\t\tSystem.out.println(s.state + \"\\t\" + this.value.get(s));\n\t\t}\n\t}", "public static void printField(){\n System.out.println(\"---------\");\r\n for (char[] cell : output) {\r\n System.out.print(\"| \");\r\n for (char value : cell) {\r\n System.out.print(value + \" \");\r\n }\r\n System.out.print(\"|\\n\");\r\n }\r\n System.out.println(\"---------\");\r\n }", "public void print(){\r\n\r\n\r\n System.out.println(\"File: \" + file.getName());\r\n Set<String> keys = getDataMap().keySet();\r\n System.out.println(\"Die Variablen in diesem File: \" + keys);\r\n System.out.println(\"Geben Sie eine Variable an: \");\r\n\r\n Scanner wert = new Scanner(System.in);\r\n String wert1 = wert.nextLine();\r\n\r\n DataContainer dc = getDataMap().get(wert1);\r\n\r\n if (dc != null) {\r\n System.out.println(wert1 + \":\" + dc.getValues());\r\n }\r\n /*System.out.println(\"File: \" + file.getName());\r\n\r\n\r\n if (dc1 != null && dc2 != null) {\r\n System.out.println(dc1.getVariableName() + \": \" + dc1.getValues());\r\n System.out.println(dc2.getVariableName() + \": \" + dc2.getValues());*/\r\n }", "public void printScalars() {\n for (ScalarSymbol ss: scalars) {\n System.out.println(ss);\n }\n }", "private static void showValues(Derived derived) {\n\t\tSystem.out.println(\"\\n\\tX = \" + derived.getX()\n\t\t+ \";\\tY = \" + derived.getY() + \";\\tZ = \"\n\t\t+ derived.getZ() + \";\\tThe Largest Value Is : \"\n\t\t+ derived.getLargestValue());\n\t}", "public void printOutValues() {\n for (String key : myList.keySet()) {\n System.out.println(key + \" --> \" + myList.get(key));\n }\n }", "public void display() {\r\n\t\tArrayList<String> vnames = new ArrayList<>(vces.keySet());\r\n\t\tfor (String vname : vnames) {\r\n\t\t\tString str = vname + \" => \";\r\n\t\t\tVertex vtx = vces.get(vname);\r\n\r\n\t\t\tArrayList<String> nbrnames = new ArrayList<>(vtx.nbrs.keySet());\r\n\t\t\tfor (String nbrname : nbrnames) {\r\n\t\t\t\tstr += nbrname + \"[\" + vtx.nbrs.get(nbrname) + \"], \";\r\n\t\t\t}\r\n\r\n\t\t\tSystem.out.println(str + \".\");\r\n\t\t}\r\n\t}", "String explainValue() {\n ArrayList ts = new ArrayList();\n\n // collect all variables together that contribute to this variable's\n // value\n\n ts.add((variable) this);\n collectAntecedents( ts );\n\n // now, iterate over this set in order from ground up\n\n String result = \"\";\n Iterator i = ts.iterator();\n /*while(i.hasNext()){\n variable v = (variable) i.next();\n System.out.println(\"ts: \" + v.name + v.reason);\n }\n i = ts.iterator();*/\n while (i.hasNext()) {\n variable v = (variable) i.next();\n //System.out.println(\"explainValue: \" + v.name);\n result = v.explainVariable() + result;\n //System.out.println(\"returned explainValue: \" + v.name);\n }\n return result;\n }", "public void dump() {\n\t\tfor(Symbol s: assignments.keySet()) {\n\t\t\tSystem.out.println(s.toString() + \" = \" + assignments.get(s));\n\t\t}\t\n\t}", "public String getVals(){\n return (\"a: \" + a + \"\\nr: \" + r + \"\\nb: \" + b + \"\\ng: \" + g);\n }", "@Override\n\tpublic void display() {\n\t\tSystem.out.println(valueType+\": \"+value);\n\t}", "public void printInfo()\n {\n System.out.println(\"position Value:\" + pos_.get(0).getPosition());\n System.out.println(\"velocitiy Value:\" + vel_.get(0).getVelocity());\n System.out.println(\"lastUpdateTime Value:\" + lastPosUpdateTime_);\n System.out.println(\"KalmanGain_ Value:\" + KalmanGain_);\n }", "public void printAllValues ()\n\t{\n\t\tfor (int index = 0; index < count; index = index + 1 ) {\n\t\t\t\n\t\t\tif (index%5 == 0){\n\t\t\t\t\n\t\t\t\tSystem.out.println();\n\t\t\t}\n\t\t\t\n\t\tSystem.out.print(array1[index] + \"\\t\");\t\n\t\t}\n\t}", "static void print() {\n\t\tSystem.out.println(\"Value of x1 = \" +x1);\n\t}", "public void print() {\n for (int i = 0; i < headers.length; i++) {\n System.out.printf(headers[i] + \", \"); // Print column headers.\n }\n System.out.printf(\"\\n\");\n for (int i = 0; i < (data.length - 1); i++) {\n for (int j = 0; j < data[i].length; j++) {\n System.out.printf(data[i][j] + \" \"); // Print value at i,j.\n }\n System.out.printf(\"\\n\");\n }\n }", "public void print() {\n\t\t\n\t\tfor (int j = 0; j < height(); j++) {\n\t\t\tfor (int i = 0; i < width(); i++) {\n\t\t\t\tSystem.out.printf(\"%3d \", valueAt(i, j));\n\t\t\t}\n\t\t\tSystem.out.printf(\"\\n\");\n\t\t}\n\t\tSystem.out.printf(\"\\n\");\t\n\t}", "public void print(){\n System.out.println(\"(\"+a.getAbsis()+\"_a,\"+a.getOrdinat()+\"_a)\");\n System.out.println(\"(\"+b.getAbsis()+\"_b,\"+b.getOrdinat()+\"_b)\");\n System.out.println(\"(\"+c.getAbsis()+\"_b,\"+c.getOrdinat()+\"_c)\");\n }", "public void printFields(){\n\t\tif(this.returnValueType==null){\n\t\t\tthis.returnValueType=\"\";\n\t\t}\n\t\tif(this.returnValueType==null){\n\t\t\tthis.className=\"\";\n\t\t}\n\t\tif(this.returnValueType==null){\n\t\t\tthis.methodName=\"\";\n\t\t}\n\t\tSystem.out.print(\"\t\"+this.address+\"\t\"+this.returnValueType+\" \"+this.className+\".\"+this.methodName+\" \");\n\t\tSystem.out.print(\"(\");\n\t\tif(this.hasParameter()){\n\t\t\t\n\t\t\tfor(int j=0;j<this.parameterType.length;j++){\n\t\t\t\tSystem.out.print(this.parameterType[j]);\n\t\t\t\tif(j!=(this.parameterType.length-1)){\n\t\t\t\t\tSystem.out.print(\", \");\n\t\t\t\t}\n\t\t\t}\n\t\t\n\t\t}\n\t\tSystem.out.println(\")\");\n\n\t}", "public void printResults() {\n\t System.out.println(\"BP\\tBR\\tBF\\tWP\\tWR\\tWF\");\n\t System.out.print(NF.format(boundaryPrecision) + \"\\t\" + NF.format(boundaryRecall) + \"\\t\" + NF.format(boundaryF1()) + \"\\t\");\n\t System.out.print(NF.format(chunkPrecision) + \"\\t\" + NF.format(chunkRecall) + \"\\t\" + NF.format(chunkF1()));\n\t System.out.println();\n }", "private void printMap() {\n\t\tfor(Integer key: location.keySet()){\n\t\t\tString val= location.get(key).toString();\n\t\t\tSystem.out.println(\"(\" + key.toString() + \", \" + val+ \")\");\n\t\t}\n\t}", "public void printTruthAssesment(){\n for(CustomHashmap.HashMapEntry<Integer, Boolean> e: tarjan.getTruthAssignment().entrySet()){\n if(e.getKey()>tarjan.getNumVariables()){\n continue;\n }else{\n String number=\"x\";\n for(char c: e.getKey().toString().toCharArray()){\n number+=UnicodeUtil.numbers[c-'0'];\n }\n io.println(number+\" = \"+ e.getValue());\n }\n }\n }", "public static void printValues(){\n\t\tSet s = config.entrySet();\n\t\tIterator si = s.iterator();\n\t\tMap.Entry me;\n\t\twhile(si.hasNext()){\n\t\t\tme = ((Map.Entry) (si.next()));\n\t\t\tSystem.out.println(me.getKey() + \" \" + me.getValue());\n\t\t}\n\n\t}", "public void printResult(){\n StringBuilder sb = new StringBuilder(20);\n sb.append(left_value)\n .append(space)\n .append(symbol)\n .append(space)\n .append(right_value)\n .append(space)\n .append('=')\n .append(space)\n .append(result);\n System.out.println(sb);\n }", "public void print() {\n System.out.println();\n for (int level = 0; level < 4; level++) {\n System.out.print(\" Z = \" + level + \" \");\n }\n System.out.println();\n for (int row = 3; row >= 0; row--) {\n for (int level = 0; level < 4; level++) {\n for (int column = 0; column < 4; column++) {\n System.out.print(get(column, row, level));\n System.out.print(\" \");\n }\n System.out.print(\" \");\n }\n System.out.println();\n }\n System.out.println();\n }", "static void dumpVariablesInOrder( PrintWriter pw ) {\n try {\n for ( int i=0; i<Vtable.size(); i++ ) {\n int v = i+1;\n String varname = findVar(v);\n variable var = find(varname);\n if (var.userVisible)\n pw.println( \"c u \" + v + \" \" + varname );\n else\n pw.println( \"c c \" + v + \" \" + varname );\n }\n }\n catch ( Exception e ) {\n Util.fatalError( \"dumpVariablesInOrder Exception \" +\n e.getMessage() );\n }\n }", "protected void printValConfig(){\n\t\t//System.out.println(\"writing values\");\n\t\tif(valueFxn.compareToIgnoreCase(\"additive\")==0){\n\t\t\tprintAdditive();\n\n\t\t}else if(valueFxn.compareToIgnoreCase(\"schedule\")==0){\n\t\t\tprintSchedule();\n\n\n\t\t}else if(valueFxn.compareToIgnoreCase(\"contract\")==0){\n\t\t\tprintContracts();\n\n\t\t}else{\n\t\t\tSystem.out.println(\"Value function not set correctly.\");\n\t\t}\n\t}", "private void print_solution() {\n System.out.print(\"\\n\");\n for (int i = 0; i < rowsCount; i++) {\n for (int j = 0; j < colsCount; j++) {\n System.out.print(cells[i][j].getValue());\n }\n System.out.print(\"\\n\");\n }\n }", "public void printAll() {\n\t\tfor(int i = 0; i<r.length; i++)\n\t\t\tprintReg(i);\n\t\tprintReg(\"hi\");\n\t\tprintReg(\"lo\");\n\t\tprintReg(\"pc\");\n\t}", "void printInfo() {\n\t\tdouble salary=120000;\n\t System.out.println(salary);\n\t\tSystem.out.println(name+\" \"+age);\n\t}", "public void printt() {\n for (int i=0 ; i<number ; i++) {\n System.out.println(\"LAB\" + (i+1) + \" ON \" + labs[i].getDay() + \" TEACHING BY: \" + labs[i].getTeacher());\n for (int j=0 ; j<labs[i].getCurrentSize() ; j++) {\n System.out.println(labs[i].getStudents()[j].getFirstName() + \" \" + labs[i].getStudents()[j].getLastName() + \" \" + labs[i].getStudents()[j].getId() + \" \" +labs[i].getStudents()[j].getGrade());\n }\n System.out.println(\"THE CAPACITY OF THE LAB IS: \" + labs[i].getCapacity());\n System.out.println(\"THE AVERAGE IS : \" + labs[i].getAvg());\n System.out.println();\n }\n }", "public void showSamples(){\n\t\tfor(int i=0; i<arrIns.size(); i++){\n\t\t\tfor(int j=0; j<arrIns.get(i).numAttributes(); j++){\n\t\t\t\tSystem.out.print(\" | \" + arrIns.get(i).value(j) + \" | \");\n\t\t\t}\n\t\t\tSystem.out.println(\"\");\n\t\t}\n\t}", "public void printRoutine()\n\t{\n\t\tfor (String name: vertices.keySet())\n\t\t{\n\t\t\tString value = vertices.get(name).toString();\n\t\t\tSystem.out.println(value);\n\t\t}\n\t}", "public void printInfo(){\n\t\tSystem.out.println(\"id : \" + id + \" label : \" + label);\n\t\tSystem.out.println(\"vms : \" );\n\t\tfor(VirtualMachine v : vms){\n\t\t\tv.printInfo();\n\t\t}\n\t}", "public void print() {\n\t\tfor (int i = 0; i < TABLE_SIZE; i++) {\n\t\t\tSystem.out.print(\"|\");\n\t\t\tif (array[i] != null) {\n\t\t\t\tSystem.out.print(array[i].value);\n\t\t\t} else {\n\t\t\t\tSystem.out.print(\" \");\n\t\t\t}\n\t\t}\n\n\t\tSystem.out.print(\"|\\n\");\n\t}", "@Override\r\n\tpublic void printResult() {\n\t\tfor(Integer i:numbers)\r\n\t\t{\r\n\t\t\tSystem.out.println(i+\" \");\r\n\t\t}\r\n\t\t\r\n\t}", "public void print() {\n print$$dsl$guidsl$guigs();\n System.out.print( \" eqn =\" + eqn );\n }", "public void print() {\r\n System.out.print(\"[id: <\" + this.id + \"> \");\r\n if (this.dimension > 0) {\r\n System.out.print(this.data[0]);\r\n }\r\n for (int i = 1; i < this.dimension * 2; i++) {\r\n System.out.print(\" \" + this.data[i]);\r\n }\r\n System.out.println(\"]\");\r\n }", "private void printData() {\n\n\t\tfor (int i = 0; i < data.size(); i++) {\n\t\t\tlog(\" *** data index \" + i + \" = \" + data.elementAt(i));\n\t\t}\n\t}", "public void mostrarVariablesForrester(){\n System.out.println(\"\");\n for (int i = 0; i < tam; i++) {\n if(matrizTipos[i][i].equals(\"P\")){\n System.out.println(\"[\"+i+\"] es un parametro\"); // parametro = constante\n }\n else if(matrizTipos[i][i].equals(\"V\")){\n System.out.println(\"[\"+i+\"] es un auxiliar\"); // auxiliar = constante * auxiliar (?) ó constante +/- auxiliar\n }\n else if(matrizTipos[i][i].equals(\"R\")){\n System.out.println(\"[\"+i+\"] es un flujo\"); // flujo = constante * auxiliar * nivel\n }\n else if(matrizTipos[i][i].equals(\"X\")){\n System.out.println(\"[\"+i+\"] es un nivel\");// xi(t + Δt) = xi(t) + Δt{rj - rk} rj = entrada y rk = salida, \"el - es por la salida\" (creo) \n }\n }\n }", "public void display() {\n \n //Print the features representation\n System.out.println(\"\\nDENSE REPRESENTATION\\n\");\n \n //Print the header\n System.out.print(\"ID\\t\");\n for (short i = 0 ; i < dimension; i++) {\n System.out.format(\"%s\\t\\t\", i);\n }\n System.out.println();\n \n //Print all the instances\n for (Entry<String, Integer> entry : mapOfInstances.entrySet()) {\n System.out.format(\"%s\\t\", entry.getKey());\n for (int i = 0; i < vectorDimension(); i++) {\n //System.out.println(allFeatures.get(entry.getValue())[i]);\n System.out.format(\"%f\\t\", allValues.get(entry.getValue())[i]); \n }\n System.out.println();\n }\n }", "String getValues() {\n String r = x + \" \";\n Lista iter = new Lista(this);\n while(iter.next != null) {\n iter = iter.next;\n r += iter.x + \" \";\n } \n return r;\n }", "public void printAll(){\n\t\tSystem.out.println(\"Single hits: \" + sin);\n\t\tSystem.out.println(\"Double hits: \" + doub);\n\t\tSystem.out.println(\"Triple hits: \" + trip);\n\t\tSystem.out.println(\"Homerun: \" + home);\n\t\tSystem.out.println(\"Times at bat: \" + atbat);\n\t\tSystem.out.println(\"Total hits: \" + hits);\n\t\tSystem.out.println(\"Baseball average: \" + average);\n\t}", "public void print() {\n\t\tint i = 1;\n\t\tfor (String s: g.keySet()) {\n\t\t\tSystem.out.print(\"Element: \" + i++ + \" \" + s + \" --> \");\n\t\t\tfor (String k: g.get(s)) {\n\t\t\t\tSystem.out.print(k + \" ### \");\n\t\t\t}\n\t\t\tSystem.out.println();\n\t\t}\n\t}", "public void printSummary() {\n\t\tSystem.out.println(MessageFormat.format(\"\\nSummary:\\n Name: {0}\\n Range: 1 to {1}\\n\", this.name, this.numSides));\n\t}", "public void print ( InstanceAttributes instAttributes ){\r\n\t\tSystem.out.print(\" > Inputs (\"+numInputAttributes+\"): \");\r\n\r\n\t\tfor (int i=0; i<numInputAttributes; i++){\r\n\t\t\tif (missingValues[Instance.ATT_INPUT][i]){\r\n\t\t\t\tSystem.out.print(\"?\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tswitch(instAttributes.getInputAttribute(i).getType()){\r\n\t\t\t\tcase Attribute.NOMINAL:\r\n\t\t\t\t\tSystem.out.print(nominalValues[Instance.ATT_INPUT][i]); \r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase Attribute.INTEGER:\r\n\t\t\t\t\tSystem.out.print((int)realValues[Instance.ATT_INPUT][i]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase Attribute.REAL:\r\n\t\t\t\t\tSystem.out.print(realValues[Instance.ATT_INPUT][i]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.print(\" \");\r\n\t\t}\r\n\t\tSystem.out.print(\" > Outputs (\"+numOutputAttributes+\"): \");\r\n\t\tfor (int i=0; i<numOutputAttributes; i++){\r\n\t\t\tif (missingValues[Instance.ATT_OUTPUT][i]){\r\n\t\t\t\tSystem.out.print(\"?\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tswitch(instAttributes.getOutputAttribute(i).getType()){\r\n\t\t\t\tcase Attribute.NOMINAL:\r\n\t\t\t\t\tSystem.out.print(nominalValues[Instance.ATT_OUTPUT][i]); \r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase Attribute.INTEGER:\r\n\t\t\t\t\tSystem.out.print((int)realValues[Instance.ATT_OUTPUT][i]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase Attribute.REAL:\r\n\t\t\t\t\tSystem.out.print(realValues[Instance.ATT_OUTPUT][i]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.print(\" \");\r\n\t\t}\r\n\r\n\t\tSystem.out.print(\" > Undefined (\"+numUndefinedAttributes+\"): \");\r\n\t\tfor (int i=0; i<numUndefinedAttributes; i++){\r\n\t\t\tif (missingValues[Instance.ATT_NONDEF][i]){\r\n\t\t\t\tSystem.out.print(\"?\");\r\n\t\t\t}\r\n\t\t\telse{\r\n\t\t\t\tswitch(instAttributes.getUndefinedAttribute(i).getType()){\r\n\t\t\t\tcase Attribute.NOMINAL:\r\n\t\t\t\t\tSystem.out.print(nominalValues[Instance.ATT_NONDEF][i]); \r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase Attribute.INTEGER:\r\n\t\t\t\t\tSystem.out.print((int)realValues[Instance.ATT_NONDEF][i]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase Attribute.REAL:\r\n\t\t\t\t\tSystem.out.print(realValues[Instance.ATT_NONDEF][i]);\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tSystem.out.print(\" \");\r\n\t\t}\r\n\t}", "public void printInfo(){\n System.out.println(\" this is my y \"+(y+1)+\" this is my x \"+ X.valueOfInt(x));\n System.out.println(\"i am full: \"+ isFull);\n }", "public void print(){\n\t\tfor (int i=0; i<_size; i++){\n\t\t\tSystem.out.print(_a[i].getKey()+\"; \");\n\t\t}\n\t\tSystem.out.println();\n\t}", "public void displayResult()\n {\n for(int i = 0; i < this.etatPopulation.size(); i++)\n {\n String line = \"\";\n for (int j = 0; j < this.etatPopulation.get(i).size(); j++)\n {\n line += this.etatPopulation.get(i).get(j).toString() + \" \";\n }\n System.out.println(line);\n }\n }", "void printPlaceArtifacts()\r\n\t{\r\n\t\tfor( Map.Entry <String, Artifact> entry : artPlace.entrySet()) \r\n\t\t{\r\n\t\t\t String key = entry.getKey();\r\n\t\t\t Artifact value = entry.getValue();\r\n\t\t\t \r\n\t\t\t // System.out.println(\"Place Name: \" + this.name());\r\n\t\t\t \r\n\t\t\t System.out.println(\" Artifact Name----->\" + value.getName());\r\n\t\t\t System.out.println(\"Size-----> \" + value.getSize());\r\n\t\t\t System.out.println(\"Value-----> \" + value.getValue() + \" \\n\");\t\r\n\t\t}\r\n\t}", "public String getVariablesInternal() {\n StringBuilder b = new StringBuilder();\n JTable table = m_table.getTable();\n int numRows = table.getModel().getRowCount();\n\n for (int i = 0; i < numRows; i++) {\n String paramName = table.getValueAt(i, 0).toString();\n String paramValue = table.getValueAt(i, 1).toString();\n if (paramName.length() > 0 && paramValue.length() > 0) {\n b.append(paramName).append(SetVariables.SEP2).append(paramValue);\n }\n if (i < numRows - 1) {\n b.append(SetVariables.SEP1);\n }\n }\n\n return b.toString();\n }", "void print() {\n\n\t\t// Print \"Sym Table\"\n\t\tSystem.out.print(\"\\nSym Table\\n\");\n\n\t\tfor (int i = 0; i < list.size(); i++) {\n\t\t\tHashMap<String, Sym> M = list.get(i);\n\t\t\t// Print each HashMap in list\n\t\t\tSystem.out.print(String.format(M.toString() + \"\\n\"));\n\t\t}\n\n\t\t// Print New Line\n\t\tSystem.out.println();\n\t}", "public static void main(String[] args) {\n\r\n\t\t\r\n\t\tint[] number = {2,3,4,5,6,67,75,3,43,4};\r\n\t\t\r\n\t\tfor(int value: number) {\r\n\t\t\t\r\n\t\t\tshowvalue(value);\r\n\t\t}\r\n\t}", "public void print() {\n for (int i = 0; i < table.length; i++) {\n System.out.printf(\"%d: \", i);\n \n HashMapEntry<K, V> temp = table[i];\n while (temp != null) {\n System.out.print(\"(\" + temp.key + \", \" + temp.value + \")\");\n \n if (temp.next != null) {\n System.out.print(\" --> \");\n }\n temp = temp.next;\n }\n \n System.out.println();\n }\n }", "private void printInfo() {\n for (Coordinate c1 : originCells) {\n System.out.println(\"Origin: \" + c1.toString());\n }\n for (Coordinate c2 : destCells) {\n System.out.println(\"destination: \" + c2.toString());\n }\n for (Coordinate c3 : waypointCells) {\n System.out.println(\"way point: \" + c3.toString());\n }\n }", "public void printInfo() {\n\t\tString nodeType = \"\";\n\t\tif (nextLayerNodes.size() == 0) {\n\t\t\tnodeType = \"Output Node\";\n\t\t} else if (prevLayerNodes.size() == 0) {\n\t\t\tnodeType = \"Input Node\";\n\t\t} else {\n\t\t\tnodeType = \"Hidden Node\";\n\t\t}\n\t\tSystem.out.printf(\"%n-----Node Values %s-----%n\", nodeType);\n\t\tSystem.out.printf(\"\tNumber of nodes in next layer: %d%n\", nextLayerNodes.size());\n\t\tSystem.out.printf(\"\tNumber of nodes in prev layer: %d%n\", prevLayerNodes.size());\n\t\tSystem.out.printf(\"\tNext Layer Node Weights:%n\");\n\t\tNode[] nextLayer = new Node[nextLayerNodes.keySet().toArray().length];\n\t\tfor (int i = 0; i < nextLayer.length; i++) {\n\t\t\tnextLayer[i] = (Node) nextLayerNodes.keySet().toArray()[i];\n\t\t}\n\t\tfor (int i = 0; i < nextLayerNodes.size(); i++) {\n\t\t\tSystem.out.printf(\"\t\t# %f%n\", nextLayerNodes.get(nextLayer[i]));\n\t\t}\n\t\tSystem.out.printf(\"%n\tPartial err partial out = %f%n%n\", getPartialErrPartialOut());\n\t}", "private static void print(String valNames, Object... objects) {\n\t\tvalNames = valNames.trim();\n\t\tString[] arr = valNames.split(\":\");\n\t\tString format = valNames + \" \";\n\t\tString prefix = \"\";\n\t\tfor(String str : arr ) {\n\t\t\tformat += prefix + \"%2s\";\n\t\t\tprefix = \":\";\n\t\t}\t\t\n\t\tSystem.out.println(\"\"+String.format(format, objects)); \n\t}", "public void outputRandomVariableAtoms() {\n for (StandardPredicate openPredicate : parentDataStore.getRegisteredPredicates()) {\n for (GroundAtom atom : getAtomStore().getRandomVariableAtoms(openPredicate)) {\n System.out.println(atom.toString() + \" = \" + atom.getValue());\n }\n }\n }", "public void display(){\r\n System.out.println(\"The Vacancy Number is : \" + getVacancyNumber());\r\n System.out.println(\"The Designation is : \" + getDesignation());\r\n System.out.println(\"The Job Type is : \" + getJobType());\r\n }", "public void print() {\r\n for (final Map.Entry<State, StatePolicyProperties> mapping : mStateMap.entrySet()) {\r\n final StatePolicyProperties properties = mapping.getValue();\r\n\r\n // Print the state\r\n mapping.getKey().print();\r\n System.out.println(\" State value = \" + properties.getValue());\r\n\r\n // Print the actions with their probability\r\n for (Map.Entry<Action, Double> actionProbability : properties.getActionProbabilities().entrySet()) {\r\n System.out.println(\" Action probability \" + actionProbability.getKey() + \" = \"\r\n + actionProbability.getValue());\r\n }\r\n // Print the actions with their value\r\n for (Map.Entry<Action, Double> actionValue : properties.getActionValues().entrySet()) {\r\n System.out.println(\" Action value \" + actionValue.getKey() + \" = \" + actionValue.getValue());\r\n }\r\n }\r\n System.out.println();\r\n }", "public void printValues(){\n Node runner = head;\n while(runner != null){ //iterate through end of list\n System.out.println(runner.value);\n runner = runner.next;\n }\n }", "public void printResults(){\n\t\tSystem.out.println(\"The area of the triangle is \" + findArea());\n\t\tSystem.out.println(\"The perimeter of the triangle is \"+ findPerimeter());}", "public void print() {\r\n\t\tint size = list.size();\r\n\r\n\t\tSystem.out.println();\r\n\t\tSystem.out.println(\"┌───────────────────────────┐\");\r\n\t\tSystem.out.println(\"│ \t\t\t성적 출력 \t\t │\");\r\n\t\tSystem.out.println(\"└───────────────────────────┘\");\r\n\r\n\t\tfor (int i = 0; i < size; i++) {\r\n\r\n\t\t\tExam exam = list.get(i);\r\n\t\t\tint kor = exam.getKor();\r\n\t\t\tint eng = exam.getEng();\r\n\t\t\tint math = exam.getMath();\r\n\r\n\t\t\tint total = exam.total();// kor + eng + math;\r\n\t\t\tfloat avg = exam.avg();// total / 3.0f;\r\n\t\t\tSystem.out.printf(\"성적%d > 국어:%d, 영어:%d, 수학:%d\", i + 1, kor, eng, math);\r\n\t\t\tonPrint(exam);\r\n\t\t\tSystem.out.printf(\"총점:%d, 평균:%.4f\\n\", total, avg);\r\n\r\n\t\t}\r\n\r\n\t\tSystem.out.println(\"─────────────────────────────\");\r\n\r\n\t}", "public void print() {\n\t\tSystem.out.println(word0 + \" \" + word1 + \" \" + similarity);\n\t}", "public String toString() {\r\n return this.variable;\r\n }", "void print(){\n\t\tSystem.out.println(\"[\"+x+\",\"+y+\"]\");\n\t}", "public void showAllNu()\r\n {\r\n for (int i = 1; i < T; i++) {\r\n System.out.println(\"(nu(\"+(i+1)+\"))^2 : \"+getNu()[i]+\"\\t\\t| nu(\"+(i+1)+\") : \"+Math.sqrt(getNu()[i]));\r\n }\r\n }", "public void printFieldInformation() {\n \t\tint isnull = 0;\n \t\tint studentsA = 0;\n \t\tint empty = 0;\n \t\tfor (int a = 0; a < 5; a++) {\n \t\t\tfor (int b = 0; b < 7; b++) {\n \t\t\t\tif (students[a][b] == null) {\n \t\t\t\t\tisnull++;\n \t\t\t\t\tSystem.out.println(a + \" / \" + b);\n \t\t\t\t} else if (students[a][b] instanceof EmptyPlace)\n \t\t\t\t\tempty++;\n \t\t\t\telse if (students[a][b] instanceof Student)\n \t\t\t\t\tstudentsA++;\n \t\t\t}\n \t\t}\n \t\tSystem.out.println(\"null: \" + isnull);\n \t\tSystem.out.println(\"empty: \" + empty);\n \t\tSystem.out.println(\"studentsA: \" + studentsA);\n \t}", "private void print() {\n\t\tList<Entry<String, Double>> entries = sort();\n\t\tfor (Entry<String, Double> entry: entries) {\n\t\t\tSystem.out.println(entry);\n\t\t}\n\t}", "public void show()\n {\n System.out.println( getFullName() + \", \" +\n String.format(Locale.ENGLISH, \"%.1f\", getAcademicPerformance()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getSocialActivity()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getCommunicability()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getInitiative()) + \", \" +\n String.format(Locale.ENGLISH,\"%.1f\", getOrganizationalAbilities())\n );\n }", "public void print() {\n\t\t\n\t\tfor(Solution sol : population) {\n\t\t\tSystem.out.println(sol.getPossibleSolution() + \" \" + sol.getPath());\n\t\t}\n\t}", "public void print(){\n String res = \"\" + this.number;\n for(Edge edge: edges){\n res += \" \" + edge.toString() + \" \";\n }\n System.out.println(res.trim());\n }", "@Override\r\n\t\tpublic String toString() {\n\t\t\treturn \" \" + wt + \"- \" + val;\r\n\t\t}", "public void printData(){\n for(int i=0; i<list.size(); i++){\n System.out.print(list.get(i) + \" \");\n }\n System.out.println();\n }", "private void printStats()\n\t{\n\t\t// X\n\t\tSystem.out.println(\"X:\");\n\t\tfor(int i = 0; i < xPosList.size(); i++)\n\t\t{\n\t\t\tSystem.out.println(xPosList.get(i));\n\t\t}\n\n\t\t// Y\n\t\tSystem.out.println(\"Y:\");\n\t\tfor(int i = 0; i < yPosList.size(); i++)\n\t\t{\n\t\t\tSystem.out.println(yPosList.get(i));\n\t\t}\n\n\t\t// Time\n\t\tSystem.out.println(\"Time:\");\n\t\tfor(int i = 0; i < timeList.size(); i++)\n\t\t{\n\t\t\tSystem.out.println(timeList.get(i));\n\t\t}\n\t}", "public void print(){\n\t\tfor(int i=0; i<degreecoeff.length;i++) {\n\t\t\tif(degreecoeff[i]==0) {\n\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\tSystem.out.print(degreecoeff[i]+\"X\"+i+\" \");\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public void printList(){\n System.out.println(\"Printing the list\");\n for(int i = 0; i<adjacentcyList.length;i++){\n System.out.println(adjacentcyList[i].value);\n }\n }", "void printData()\n {\n System.out.println(\"Studentname=\" +name);\n System.out.println(\"Student city =\"+city);\n System.out.println(\"Student age = \"+age);\n }", "public void showAllMu()\r\n {\r\n for (int i = 1; i < T; i++) {\r\n System.out.println(\"mu[\"+(i+1)+\"]^2 : \"+getNu()[i]+\"\\t\\t| nu[\"+(i+1)+\"] : \"+Math.sqrt(getNu()[i]));\r\n }\r\n }", "public void displayVariables(TextArea textArea) {\r\n\r\n Enumeration enum1 = variableList.elements() ;\r\n while(enum1.hasMoreElements()) {\r\n RuleVariable temp = (RuleVariable)enum1.nextElement() ;\r\n textArea.appendText(\"\\n\" + temp.name + \" value = \" + temp.value) ;\r\n }\r\n }", "public void print() {\n\t\tSystem.out.println(\"[System] 펫 정보입니다.\\n 이름 : \"+TMGCSYS.tmgcName+\", 레벨 : \"+TMGCSYS.tmgcLV+\", 경험치 : \"+TMGCSYS.tmgcEXP+\"/\"+(100*TMGCSYS.tmgcLV)+\", 체력 : \"+TMGCSYS.tmgcHP+\", 스트레스 : \"+TMGCSYS.tmgcStress);\r\n\t}", "public void show() {\n for (int i = 0; i < rowCount; i++) {\n for (int j = 0; j < columnCount; j++)\n System.out.printf(\"%9.4f \", data[i][j]);\n System.out.println();\n }\n }", "public void print(){\n\t\t\n\t\tfor(int i=0;i<maxindex;i++)\n\t\t{\n\t\t\tif(data[i] != 0)\n\t\t\t{\n\t\t\t\tSystem.out.print(data[i]+\"x\"+i+\" \");\n\t\t\t}\n\t\t}\n\t\t\n\t}", "public void display() {\n\t\tSystem.out.println(x + \" \" + y + \" \" + z);\n\t}", "public void printTotalValue( ) {\n\t\tSystem.out.println(\"This method prints the total cost for all computers\");\n\t\tint i=1;\n\t\tfor (Computer temp : computers ) {\n\n\t\t\tSystem.out.println(\"Computer number : \"+i+\" has the total cost of \"+temp.getPrice());\n\t\t\ti++;\n\t\t}\n\t}", "public void regDump() {\r\n\t\t// Print each available register (id) and its value\r\n\t\tfor (int i = 0; i < NUMGENREG; i++) {\r\n\t\t\tSystem.out.print(\"r\" + i + \"=\" + m_registers[i] + \" \");\r\n\t\t}// for\r\n\t\t\r\n\t\t// Removed unnecessary concatenation\r\n\t\tSystem.out.print(\"PC=\" + getPC());\r\n\t\tSystem.out.print(\" SP=\" + getSP());\r\n\t\tSystem.out.print(\" BASE=\" + getBASE());\r\n\t\tSystem.out.print(\" LIM=\" + getLIM());\r\n\t\tSystem.out.println(\"\");\r\n\t}", "public void display(){\n\t\tfor (Entry<String, Map<String, Integer>> entry : collocationMap.entrySet()){\n\t\t for (Entry<String, Integer> subEntry : entry.getValue().entrySet()){\n\t\t\t System.out.println(entry.getKey() + \" \" + subEntry.getKey() + \": \" + subEntry.getValue());\n\t\t }\n\t\t}\n\t}", "public void printOut() {\n System.out.println(\"\\t\" + result + \" = icmp \" + cond.toLowerCase() + \" \" + type + \" \" + op1 + \", \" + op2 );\n\n // System.out.println(\"\\t\" + result + \" = bitcast i1 \" + temp + \" to i32\");\n }", "public void printArray(){\n\n\t\tfor (int i=0;i<1;i++){\n\n\t\t\tfor (int j=0;j<population[i].getLength();j++){\n\n\t\t\t\tSystem.out.println(\"X\" + j + \": \" + population[i].getX(j) + \" \" + \"Y\"+ j + \": \" + population[i].getY(j));\n\t\t\t\tSystem.out.println();\n\n\t\t\t}//end j\n\n\t\t\tSystem.out.println(\"The duplicate count is: \" + population[i].duplicateCheck());\n\t\t\tSystem.out.println(\"The fitness is \" + population[i].computeFitness());\n\t\t\t//population[i].computeFitness();\n\n\t\t}//end i\n\n\t}" ]
[ "0.79395455", "0.74134386", "0.7391068", "0.7294995", "0.71870595", "0.7048558", "0.70310754", "0.6999797", "0.69954276", "0.68545157", "0.6829667", "0.6820818", "0.6798436", "0.6786246", "0.675918", "0.6729713", "0.67196584", "0.6715805", "0.6683448", "0.6664581", "0.66552776", "0.66282046", "0.662654", "0.6610632", "0.6571201", "0.6567664", "0.65639174", "0.6511496", "0.64272076", "0.6419316", "0.64104545", "0.6393094", "0.6382253", "0.63797456", "0.6373712", "0.6317308", "0.63131833", "0.6308603", "0.6302176", "0.62910986", "0.62822783", "0.6282148", "0.6278144", "0.6276611", "0.6275169", "0.62468874", "0.62458056", "0.62361443", "0.62348574", "0.62162036", "0.62096477", "0.62023354", "0.6197679", "0.6195164", "0.6193226", "0.6190084", "0.6170946", "0.61684734", "0.6168074", "0.6165916", "0.61642903", "0.61603534", "0.6157635", "0.61565995", "0.6149317", "0.6145447", "0.61316097", "0.6128512", "0.61236924", "0.6119538", "0.61140585", "0.61106896", "0.61024845", "0.6101551", "0.60980064", "0.6094788", "0.6094623", "0.6085567", "0.60848635", "0.6075653", "0.607323", "0.6069758", "0.60632414", "0.6061544", "0.6060324", "0.6059785", "0.60562265", "0.60451525", "0.6041856", "0.60399795", "0.603215", "0.6028099", "0.6026045", "0.6018843", "0.6012576", "0.6010303", "0.60079026", "0.6007216", "0.60011786", "0.59986496", "0.59978503" ]
0.0
-1
swapping two rows of the matrix
public static void rowSwap(float[][] matrix, int row1, int row2, int dimension){ float temp; for (int i = 0; i <= dimension; i++){ temp = matrix[row1][i]; matrix[row1][i] = matrix[row2][i]; matrix[row2][i] = temp;} }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void swapRows( int r1, int r2 ) {\n\tfor (int c = 0; c < this.size(); c++){\n\t Object r1Val = matrix[r1][c];\n\t matrix[r1][c] = matrix[r2][c];\n\t matrix[r2][c] = r1Val;\n\t}\n }", "void swapRow(Matrix m, int i1, int i2) {\r\n double[] temp = m.M[i1];\r\n m.M[i1] = m.M[i2];\r\n m.M[i2] = temp;\r\n }", "private void swapRow(int row1, int row2){\r\n int[] rowTmp = solution[row1].clone();\r\n for(int i = 0; i<9; i++)\r\n solution[row1][i] = solution[row2][i];\r\n for(int i = 0; i<9; i++)\r\n solution[row2][i] = rowTmp[i];\r\n }", "private void swapRow(int row1, int row2){\r\n\t\tfor(int j=0; j<KolEff; j++){\r\n\t\t\tdouble temp = this.Elmt[row1][j];\r\n\t\t\tthis.Elmt[row1][j] = this.Elmt[row2][j];\r\n\t\t\tthis.Elmt[row2][j] = temp;\r\n\t\t}\r\n\t}", "private static void swapMatrix(int[][] matrix, int i1, int j1, int i2, int j2) {\n int temp = matrix[i1][j1];\n matrix[i1][j1] = matrix[i2][j2];\n matrix[i2][j2] = temp;\n }", "public void swapRows (int pos1, int pos2) {\n\t \tint swap = this.subset[pos1];\n\t \tthis.subset[pos1] = this.subset[pos2];\n\t \tthis.subset[pos2] = swap;\n\t }", "private Board swap(int row1, int col1, int row2, int col2) {\n int[][] copy = new int[N][N]; // Instantiate a new N x N tile grid to avoid mutating the instance tile grid\n for (int row = 0; row < N; row++)\n copy[row] = tiles[row].clone(); // Copy each row of the instance grid to the copy grid\n\n // Swap tiles at the row/column indeces passed to the method\n int temp = copy[row1][col1];\n copy[row1][col1] = copy[row2][col2];\n copy[row2][col2] = temp;\n\n return new Board(copy); // Return new board containing swapped tiles\n }", "public void swapRows(int i, int j) {\n swap(rowPivot, rowUnpivot, i, j);\n }", "public void swapRows(int i1,int i2){\n\t\tint n = length();\n\t\tif (i1 < 0 || i1 >= n || i2 < 0 || i2 >= n) {\n\t\t\tthrow new IllegalArgumentException();\n\t\t}\n\t\tfor (int k = 0; k < n; k++) {\n\t\t\tdouble c = get(i1, k);\n\t\t\tset(i1, k, get(i2, k));\n\t\t\tset(i2, k, c);\n\t\t}\n\t}", "void swapTiles(int row1, int col1, int row2, int col2) {\n Tile temp = tiles[row1][col1];\n tiles[row1][col1] = tiles[row2][col2];\n tiles[row2][col2] = temp;\n\n setChanged();\n notifyObservers();\n }", "private static void swapTwoLines(int rowOne, int rowTwo, double[][] matrix,\r\n double[] vector) {\r\n\r\n double[] tmpLine;\r\n double tmpVar;\r\n\r\n tmpLine = matrix[rowOne];\r\n tmpVar = vector[rowOne];\r\n\r\n matrix[rowOne] = matrix[rowTwo];\r\n vector[rowOne] = vector[rowTwo];\r\n\r\n matrix[rowTwo] = tmpLine;\r\n vector[rowTwo] = tmpVar;\r\n }", "protected void swapTilesInPlace(int row1, int col1, int row2, int col2) {\r\n int temp = getTile(row1, col1);\r\n state.setTile(row1, col1, getTile(row2, col2));\r\n state.setTile(row2, col2, temp);\r\n }", "public void swapRows(int pos1, int pos2) {\n\n for (int i = 0; i < columns.length; i++) {\n Object Obj1 = columns[i].getRow(pos1);\n columns[i].setRow(columns[i].getRow(pos2), pos1);\n columns[i].setRow(Obj1, pos2);\n\n // swap missing values.\n boolean missing1 = columns[i].isValueMissing(pos1);\n boolean missing2 = columns[i].isValueMissing(pos2);\n columns[i].setValueToMissing(missing2, pos1);\n columns[i].setValueToMissing(missing1, pos2);\n\n }\n }", "@Override\n public INDArray swap(INDArray x, INDArray y) {\n //NativeBlas.dswap(x.length(), x.data(), 0, 1, y.data(), 0, 1);\n JavaBlas.rswap(x.length(), x.data(), x.offset(), 1, y.data(), y.offset(), 1);\n return y;\n }", "public void swapColumns( int c1, int c2 ) {\n\tfor (int r = 0; r < this.size(); r++){\n\t Object c1Val = matrix[r][c1];\n\t matrix[r][c1] = matrix[r][c2];\n\t matrix[r][c2] = c1Val;\n\t}\n }", "public static void swap2DArr(int a[][], int i, int j, int x, int y) {\n\t\tint temp = a[i][j];\n\t\ta[i][j] = a[x][y];\n\t\ta[x][y] = temp;\n\n\t}", "public Matrix rowSwitch(int rowI, int rowJ) {\n\t\tMatrix m = copy();\n\t\tComplexNumber[] temp = m.ROWS[rowI];\n\t\tm.ROWS[rowI] = m.ROWS[rowJ];\n\t\tm.ROWS[rowJ] = temp;\n\t\treturn m;\n\t}", "public static String[][] swap(String[][] arr, int row1, int col1, int row2, int col2){\n String a = arr[row1][col1];\n arr[row1][col1] = arr[row2][col2];\n arr[row2][col2] = a;\n print (arr);\n return arr;\n\n }", "public void swap(int i, int j) {\n swapRows(i, j);\n swapColumns(i, j);\n }", "private void swapFirstTwoTiles() {\n ((Board) boardManager.getBoard()).swapTiles(0, 0, 0, 1);\n }", "public static Matrix rowSwitchE(int row1, int row2, int m) {\n\t\treturn identity(m).rowSwitch(row1, row2);\n\t}", "protected PuzzleState swapTilesNewState(PuzzleState state, int row1, int col1, int row2, int col2) {\r\n PuzzleState newState = state.copy();\r\n int temp = newState.getTile(row1, col1);\r\n newState.setTile(row1, col1, newState.getTile(row2, col2));\r\n newState.setTile(row2, col2, temp);\r\n return newState;\r\n }", "private static void swap(int[] A, int a, int b){\n\t\tint temp = A[a];\n\t\tA[a] = A[b];\n\t\tA[b] = temp;\n\t}", "private void swapTwoTroopPositions(int row1, int col1, int row2, int col2) {\n BaseSingle temp = aliveTroopsFormation[row1][col1];\n aliveTroopsFormation[row1][col1] = aliveTroopsFormation[row2][col2];\n aliveTroopsFormation[row2][col2] = temp;\n if (aliveTroopsFormation[row1][col1] != null) {\n aliveTroopsMap.put(aliveTroopsFormation[row1][col1], row1 * width + col1);\n }\n if (aliveTroopsFormation[row2][col2] != null) {\n aliveTroopsMap.put(aliveTroopsFormation[row2][col2], row2 * width + col2);\n }\n }", "private static void swap(int[] A, int i, int j) {\n int temp = A[i];\n A[i] = A[j];\n A[j] = temp;\n }", "public static void flipHorizontalAxis(int[][] matrix) {\n for(int i = matrix.length - 1; i >= matrix.length/2; i-- ){\n for(int j = 0; j < matrix[i].length; j++){\n int temp = matrix[i][j];\n matrix[i][j] = matrix[(matrix.length - 1) - i][j];\n matrix[(matrix.length - 1) - i][j] = temp;\n }\n }\n}", "@Override\n public Matrix assignRow(int row, Vector other) {\n // note the reversed pivoting for other\n return base.assignRow(rowPivot[row], new PermutedVectorView(other, columnUnpivot, columnPivot));\n }", "private static void swap(double x[], double[] a2, int a, int b) {\n\t\tdouble t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tdouble t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "private static void swap(int x[], int[] a2, int a, int b) {\n\t\tint t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tint t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "private static void swap(double x[], int[] a2, int a, int b) {\n\t\tdouble t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tint t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "private static void swap(int[] arry , int a,int b) {\n int temp = arry[a];\n arry[a]=arry[b];\n arry[b]=temp;\n }", "private void swapCol(int col1, int col2) {\r\n List<Integer> columnTmp = new ArrayList<Integer>();\r\n for (int row = 0; row < 9; row++)\r\n columnTmp.add(solution[row][col1]);\r\n for(int row = 0; row<9; row++)\r\n solution[row][col1] = solution[row][col2];\r\n for(int row = 0; row<9; row++)\r\n solution[row][col2] = columnTmp.get(row);\r\n }", "private static void swap(int[] a, int x, int y) {\n\t\tint temp = a[x];\n\t\ta[x] = a[y];\n\t\ta[y] = temp;\n\t}", "protected Matrix symmetrize(Matrix lower) {\r\n Matrix upper = lower;\r\n for(int i = 0; i < upper.getRowCount(); i++) {\r\n int index = i;\r\n upper.getAndSet(i, r -> {\r\n for(int j = index + 1; j < r.length; j++) {\r\n r[j] = lower.get(j, index);\r\n }\r\n });\r\n }\r\n return upper;\r\n }", "private void swap(int i, int j) {\n\t\tint tmp = data.get(i);\n\t\tdata.set(i, data.get(j));\n\t\tdata.set(j, tmp);\n\t}", "private void swapAt(int i, int j) {\n\t\tfloat tmp = sequence[i];\n\t\tsequence[i] = sequence[j];\n\t\tsequence[j] = tmp;\n\t}", "@Override\n \tpublic void swap(int i, int j) {\n \t\tint t=data[i];\n \t\tdata[i]=data[j];\n \t\tdata[j]=t;\n \t}", "Matrix transpose(){\n int newMatrixSize = this.getSize();\n Matrix newM = new Matrix(newMatrixSize);\n for(int i = 1; i <= newMatrixSize; i++){\n List itRow = rows[i - 1];\n // if(!itRow[i].isEmpty()){\n itRow.moveFront();\n // itRow[i].moveFront();\n while(itRow.index() != -1){\n Entry c = (Entry)itRow.get();\n newM.changeEntry(c.column, i, c.value);\n itRow.moveNext();\n }\n }\n return newM;\n }", "public static void swap(int[][] matrix, int i, int j, int n) {\n\t\tint temp = matrix[i][j];\n\t\tmatrix[i][j] = matrix[n - j - 1][i];\n\t\tmatrix[n - j - 1][i] = matrix[n - i - 1][n - j - 1];\n\t\tmatrix[n - i - 1][n - j - 1] = matrix[j][n - i - 1];\n\t\tmatrix[j][n - i - 1] = temp;\n\t}", "private static void exch(Alumno[] a, int i, int j) {\n\t Alumno swap = a[i];\n\t a[i] = a[j];\n\t a[j] = swap;\n\t }", "void replaceRow(Matrix m, int i1, int i2, double k) {\r\n int j, n = m.cols;\r\n for (j=0; j<n; j++) {\r\n m.M[i2][j] = m.M[i2][j] + (k * m.M[i1][j]);\r\n }\r\n }", "private void swap(int firstIdx, int secondIdx) {\r\n // TODO\r\n }", "private static void swap(int[] A, int i , int j){\r\n\t\tint temp = A[i];\r\n\t\tA[i] = A[j];\r\n\t\tA[j] = temp;\r\n\t}", "private void swapElement ( int p1, int p2 )\n\t{\n\t}", "public static void swapPosts(int[][] view, int i, int j) {\n int[] temp = view[i];\n view[i] = view[j];\n view[j] = temp;\n }", "private void swap(int[] a, int i, int j) {\n int tmp = a[i];\n a[i] = a[j];\n a[j] = tmp;\n }", "private void swap(int i, int j){\n \t\tint temp = a[i];\n \t\ta[i] = a[j];\n \t\ta[j] = temp;\n }", "private static <T> void swap(int x[], double[] a2, int a, int b) {\n\t\tint t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tdouble t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "private static void swap(int[] array, int ind1, int ind2) {\n int temp = array[ind1];\n array[ind1] = array[ind2];\n array[ind2] = temp;\n }", "private void swapTiles(Tile tile1, Tile tile2) {\n\n\t\tint temp = tile2.getValue();\n\t\ttile2.setValue(tile1.getValue());\n\t\ttile1.setValue(temp);\n\t}", "public void swapAdjacentElements(int[] values)\n {\n // your work here\n\n\n\n\n }", "private void swap(int []a, int i, int j){\n\t\tint temp = a[i];\n\t\ta[i] = a[j];\n\t\ta[j] = temp;\n\t}", "private void swap(int i, int j) {\n\t\tlong temp = a[i];\n\t\ta[i] = a[j];\n\t\ta[j] = temp;\n\t}", "private static void vecswap(double x[], int[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "private int[] swap(int[] a, int i, int j) {\n int tmp;\n tmp = a[i];\n a[i] = a[j];\n a[j] = tmp;\n return a;\n }", "public void transpose() {\n // Follow this plan: \n // (1) Create a new ImageArray ia, using currentIM's row-major order array\n // and rows and columns, but swap the roles of its numbers\n // of rows and columns.\n // (2) Store the transpose of the currentIm array in ia, using currentIm's\n // 2-parameter getPixel function and ia's 3-parameter setPixel\n // function.\n // (3) assign ia to currentIm.\n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n ImageArray ia= new ImageArray(currentIm.getRmoArray(), cols, rows);\n \n //Copy each element ImageArray[r,c] to ia[c,r]\n // invariant: rows 0..r-1 have been copied to ia[.., 0..r-1]\n for (int r= 0; r != rows; r= r+1)\n // invariant: elements [r..0..c-1] have been copied to ia[0..c-1, r]\n for (int c= 0; c != cols; c= c+1) {\n ia.setPixel(c, r, currentIm.getPixel(r,c));\n }\n \n currentIm= ia;\n }", "public static void switchRow(boolean[] row, int x){\n\t\tfor(int i = -1; i < 2; i++){\r\n\t \tif(x+i >= 0 && x+i < row.length)\r\n\t \t\trow[x+i] = !row[x+i]; \r\n\t }\r\n\t}", "private void swap(int one, int two)\r\n {\r\n//*** one->two\r\n long temp = a[two];\r\n a[one] = a[two];\r\n a[two] = temp;\r\n }", "private static void swap(int[] a, int i, int j) {\n int swap = a[i];\n a[i] = a[j];\n a[j] = swap;\n }", "private static void swap(Integer[] a, int x, int y) {\n\t\tInteger temp = a[x];\n\t\ta[x] = a[y];\n\t\ta[y] = temp;\n\t}", "@Override\n\tpublic void swap(int pos1, int pos2) {\n\t}", "private static <T,S> void swap(T x[], int[] a2, int a, int b) {\n\t\tT t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tint t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "public void swapButtons(int i1, int j1, int i2, int j2) {\n\n\t// Swap locations of two elements in the state array.\n int temp = stateArray[i1][j1];\n stateArray[i1][j1] = stateArray[i2][j2];\n stateArray[i2][j2] = temp;\n\n // Update state if there is collapsed row or column after swapping.\n if(!isGoodState()) {\n updateState();\n\n // Else - swap back the positions of the elements.\n }else {\n \ttemp = stateArray[i2][j2];\n \tstateArray[i2][j2] = stateArray[i1][j1];\n stateArray[i1][j1] = temp;\n }\n }", "private static void vecswap(double x[], double[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x,a2, a, b);\n\t}", "public void swap(int index1, int index2) {\n \n }", "private void swap(int[] a, int index1, int index2) {\n int temp = a[index1];\n a[index1] = a[index2];\n a[index2] = temp;\n }", "private static void trans(Board board) {\n\t\tint[][] M = new int[board.size][board.size];\n\t\tfor (int i = 0; i < board.size; i++)\n\t\t\tfor (int j = 0; j < board.size; j++)\n\t\t\t\tM[i][j] = board.board[j][i];\n\t\tboard.board = M.clone();\n\t}", "private static void vecswap(int x[], int[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "public void swap(int i, int j) {\n int temp = a[i];\n a[i] = a[j];\n a[j] = temp;\n }", "public void hreflect() {\n int rows= currentIm.getRows();\n int cols= currentIm.getCols();\n int h= 0;\n int k= rows-1;\n //invariant: rows 0..h-1 and k+1.. have been inverted\n while (h < k) {\n // Swap row h with row k\n // invariant: pixels 0..c-1 of rows h and k have been swapped\n for (int c= 0; c != cols; c= c+1) {\n currentIm.swapPixels(h, c, k, c);\n }\n \n h= h+1; k= k-1;\n }\n }", "private static void swap(int[] array, int first, int second) {\n int temp = array[first];\n array[first] = array[second];\n array[second] = temp;\n }", "public void rotateRow(int a, int b) {\n for (int i = 0; i < b; i++) {\n char last = screen[a][screen[a].length - 1];\n for (int j = screen[a].length - 2; j >= 0; j--) {\n screen[a][j + 1] = screen[a][j];\n }\n screen[a][0] = last;\n }\n }", "public static void moveElement(int[][] currentPuzzleState, int row1, int column1, int row2, int column2) {\n int tmp = currentPuzzleState[row1][column1];\n currentPuzzleState[row1][column1] = currentPuzzleState[row2][column2];\n currentPuzzleState[row2][column2] = tmp;\n\t}", "private void swap(int i, int j) {\n double[] temp = data[i];\n data[i] = data[j];\n data[j] = temp;\n }", "private static <T> void swap(int x[], T[] a2, int a, int b) {\n\t\tint t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tT t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "private void swapPosition(int curRow, int curCol, int newRow, int newCol){\n gameBoard[newRow][newCol] = gameBoard[curRow][curCol];\n gameBoard[curRow][curCol] = new EmptyPiece();\n }", "static void swap(int[] array, int i, int j) {\n if (i >= 0 && j >= 0 && i < array.length && j < array.length) {\n int tmp = array[i];\n array[i] = array[j];\n array[j] = tmp;\n }\n }", "private static <T> void swap(byte x[],T[] a2, int a, int b) {\n\t\tbyte t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tT t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "private static <T,S> void swap(T x[], S[] a2, int a, int b) {\n\t\tT t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tS t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "private void swap(int pos1, int pos2) {\n\t\tE temp = apq.get(pos1);\n\t\tapq.set(pos1, apq.get(pos2));\n\t\tapq.set(pos2, temp);\n\n\t\tlocator.set(apq.get(pos1), pos1);\n\t\tlocator.set(apq.get(pos2), pos2);\n\t}", "static void swap(int[] A, int i, int j) {\n\t\tint temp = A[i];\n\t\tA[i] = A[j];\n\t\tA[j] = temp;\n\t}", "private static void swap(int[] array, int index1, int index2) {\n int x = array[index1];\n array[index1] = array[index2];\n array[index2] = x;\n }", "public void swapPieceValues(int x, int y, int row, int col) {\n\t\tthis.x = x;\n\t\tthis.y = y;\n\t\tthis.row = row;\n\t\tthis.col = col;\n\t}", "private void swap(int[] values, int p1, int p2) {\n int temp = values[p1];\n values[p1] = values[p2];\n values[p2] = temp;\n moves++;\n }", "public static void flipHorizontalAxis(int[][] matrix){\n\n int beginIndex = 0;\n int endIndex = (matrix.length - 1);\n int[] begin = matrix[beginIndex];\n int[] end = matrix[endIndex];\n int[] temp;\n\n\n while(endIndex > beginIndex){\n //swap the arrays with a temp variable\n temp = Arrays.copyOf(begin, begin.length);\n begin = Arrays.copyOf(end, end.length);\n end = Arrays.copyOf(temp, temp.length);\n\n //update the new arrays in the matrix\n matrix[beginIndex] = begin;\n matrix[endIndex] = end;\n\n //update the new indexes\n beginIndex++;\n endIndex--;\n\n //move begin and end to the next set to be swapped\n begin = matrix[beginIndex];\n end = matrix[endIndex];\n }\n\n }", "public static void swap(int[] a, int x, int y) {\n int tmp = a[x];\n a[x] = a[y];\n a[y] = tmp;\n }", "private void transpose() {\n Utils.transpose(this._board);\n }", "private static void swap(int[] arr, int a, int b) {\n int temp = arr[a];\n arr[a] = arr[b];\n arr[b] = temp;\n }", "private static void swap(int[] array, int i, int j) {\n\n int temp = array[i];\n array[i] = array[j];\n array[j] = temp;\n }", "private Board swapTiles1d(short[] swap1, short[] swap2) {\n short[][] arr = tempArray(arr1d, N);\n int[][] tempTiles = new int[N][N];\n for (int i = 0; i < N; i++)\n for (int j = 0; j < N; j++)\n tempTiles[i][j] = (int) arr[i][j];\n int temp = tempTiles[swap1[0]][swap1[1]];\n tempTiles[swap1[0]][swap1[1]] = tempTiles[swap2[0]][swap2[1]];\n tempTiles[swap2[0]][swap2[1]] = temp;\n return new Board(tempTiles);\n }", "private static <T> void vecswap(int x[], double[] a2, int a, int b, int n) {\n\t\tfor (int i=0; i<n; i++, a++, b++)\n\t\t\tswap(x, a2, a, b);\n\t}", "static void rotate(int[][] matrix) {\n int n = matrix.length;\n for (int i = 0; i < (n + 1) / 2; i++) {\n for (int j = 0; j < n / 2; j++) {\n int temp = matrix[n - 1 - j][i];\n matrix[n - 1 - j][i] = matrix[n - 1 - i][n - j - 1];\n matrix[n - 1 - i][n - j - 1] = matrix[j][n - 1 - i];\n matrix[j][n - 1 - i] = matrix[i][j];\n matrix[i][j] = temp;\n }\n }\n }", "@Test\r\n public void testSwapFirstTwo() {\r\n int id1 = boardManager4.getBoard().getTile(0,0).getId();\r\n int id2 = boardManager4.getBoard().getTile(0,1).getId();\r\n boardManager4.getBoard().swapTiles(0,0,0,1);\r\n assertEquals(id1, boardManager4.getBoard().getTile(0,1).getId());\r\n assertEquals(id2,boardManager4.getBoard().getTile(0,0).getId());\r\n }", "private void swap(double x[], int a, int b) {\r\n double t = x[a];\r\n x[a] = x[b];\r\n x[b] = t;\r\n }", "private void swap(int from, int to) {\n E tmp = array[from];\n array[from] = array[to];\n array[to] = tmp;\n }", "private static <T> void swap(long x[], T[] a2, int a, int b) {\n\t\tlong t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tT t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "private static void swap(int[] arr, int i, int j) {\n arr[i] = arr[j]^arr[i]^(arr[j] = arr[i]);\n }", "private static <T> void swap(double x[], T[] a2, int a, int b) {\n\t\tdouble t = x[a];\n\t\tx[a] = x[b];\n\t\tx[b] = t;\n\t\tT t2 = a2[a];\n\t\ta2[a] = a2[b];\n\t\ta2[b] = t2;\n\t}", "public void rotateInPlace(int[][] matrix) {\n for (int i = 0; i < matrix.length; i++) {\n for (int j = i; j < matrix[0].length; j++) {\n int temp = 0;\n temp = matrix[i][j];\n matrix[i][j] = matrix[j][i];\n matrix[j][i] = temp;\n }\n }\n for (int i = 0; i < matrix.length; i++) {\n for (int j = 0; j < matrix.length / 2; j++) {\n int temp = 0;\n temp = matrix[i][j];\n matrix[i][j] = matrix[i][matrix.length - 1 - j];\n matrix[i][matrix.length - 1 - j] = temp;\n }\n }\n }", "void swap(int[] array, int i, int j) {\n\t\tint t = array[i];\n\t\tarray[i] = array[j];\n\t\tarray[j] = t;\n\t}" ]
[ "0.7787569", "0.7650721", "0.76080513", "0.72652656", "0.72522634", "0.6889796", "0.66977346", "0.66241765", "0.6617374", "0.6580273", "0.65708613", "0.6542914", "0.63808215", "0.63724726", "0.6354202", "0.63267666", "0.6324824", "0.6321792", "0.6243342", "0.6204765", "0.6169823", "0.6153031", "0.61329985", "0.61012554", "0.6090741", "0.60775465", "0.6076418", "0.60365343", "0.6035551", "0.60347724", "0.6026837", "0.60204077", "0.6018916", "0.60113555", "0.60043424", "0.5988484", "0.598465", "0.5982218", "0.59741586", "0.59697086", "0.5956471", "0.59511334", "0.59350836", "0.5932497", "0.59320474", "0.592442", "0.5919313", "0.5897379", "0.58947194", "0.5888946", "0.58816004", "0.5858612", "0.58521897", "0.58516127", "0.5844855", "0.5842315", "0.5835387", "0.5816057", "0.5814752", "0.5808826", "0.5782441", "0.5779691", "0.5775685", "0.5773391", "0.57708937", "0.5757041", "0.57565224", "0.5756242", "0.57527626", "0.5752422", "0.57483274", "0.57426345", "0.5738871", "0.5735207", "0.5726099", "0.5721167", "0.57149404", "0.57138354", "0.5705315", "0.5701808", "0.5695892", "0.5691565", "0.56861585", "0.56838804", "0.56810045", "0.5678884", "0.56777537", "0.5663192", "0.5660418", "0.56570977", "0.5653951", "0.56522554", "0.5650889", "0.5644862", "0.56440896", "0.56195194", "0.5607901", "0.55964184", "0.5593443", "0.5590794" ]
0.71721685
5
checks to make sure pivot is nonzero, if it is zero: find a row to swap with
public static void checkPivot(float[][] matrix, int column, int dimension){ if (matrix[column][column] != 0){ return; } for (int i = column+1; i < dimension; i++){ if (matrix[i][column] != 0){ rowSwap(matrix, column, i, dimension); System.out.print("Swapping rows " + (column+1) + " and " + (i+1) + " will give us:\n\n"); printMatrix(matrix, dimension); return;}} System.out.print("no unique solution"); // if we made it this far, we couldn't find a non-zero row to swap with so there is no solution System.exit(0); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "private boolean rowSwap(int pr, int pc)\n\t{\n\t\tif(A[pr][pc] == 0) //if pivot is 0\n\t\t{\n\t\t\tfor(int i = pr+1; i < rows; i++) //for everything underneath pivot\n\t\t\t{\n\t\t\t\t\n\t\t\t\tif(A[i][pc] != 0) //if non-0 underneath pivot\n\t\t\t\t{\n\t\t\t\t\t//find max in row ie half-pivot\n\t\t\t\t\tint maxI = i;\n\t\t\t\t\tfor(int p = i+1; p < rows; p++)\n\t\t\t\t\t{\n\t\t\t\t\t\tif(A[p][pc] > A[i][pc])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tmaxI = p;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t//swap rows\t\n\t\t\t\t\t\n\t\t\t\t\tdouble[] temp = A[pr];\n\t\t\t\t\tA[pr] = A[maxI];\n\t\t\t\t\tA[maxI] = temp;\n\t\n\t\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t\t//else { return false; } //whole col is 0's\n\t\t\t}\n\t\t\treturn false; //whole col is 0's\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\t\n\t}", "static int findPivot(int[] arr){\n int start = 0;\n int end = arr.length-1;\n\n while(start<=end){\n int mid = start + (end - start) / 2;\n\n if(mid < end && arr[mid] > arr[mid+1]){\n return mid;\n }\n else if(mid > start && arr[mid] < arr[mid-1]){\n return mid - 1;\n }\n// Pivot lies on the left-hand side and mid is currently in section 2\n else if(arr[start] >= arr[mid]){\n end = mid - 1;\n }\n// Pivot lies on the right-hand side and mid is currently in section1\n// arr[start] < arr[mid]\n else {\n start = mid + 1;\n }\n }\n return -1;\n }", "static int findPivot(int[] a) {\n int start = 0, end = a.length - 1;\n\n while (start <= end) {\n int mid = start + (end - start) / 2;\n\n if (mid < end && a[mid] > a[mid + 1])\n return mid;\n if (mid > start && a[mid] < a[mid - 1])\n return mid - 1;\n if (a[mid] <= a[start])\n end = mid - 1;\n else\n start = mid + 1;\n }\n\n return -1;\n }", "private static int partition(int[] a, int p, int r) {\n int i = p;\n int pivot = a[r];\n // put the larger number front, put the smaller number behind.\n\n for (int j = p; j < r; j++) {\n if (a[j] < pivot) {\n int tmp = a[i];\n a[i] = a[j];\n a[j] = tmp;\n i++;\n }\n }\n\n // exchange a[i] and a[r].\n int tmp = a[i];\n\n a[i] = a[r];\n a[r] = tmp;\n System.out.println(i);\n return i;\n }", "public int searchRot(int[] nums, int targ) {\n //Find pivot\n int lo = 0;\n int hi = nums.length - 1;\n while (lo < hi) {\n int mid = (lo + hi) / 2;\n if (nums[mid] > nums[hi]) {\n lo = mid + 1;\n } else {\n hi = mid;\n }\n }\n\n int piv = lo;\n lo = 0;\n hi = nums.length - 1;\n while (lo < hi) {\n int mid = (lo + hi) / 2;\n int realMid = (mid + piv) % nums.length;\n if (nums[realMid] == targ) {\n return realMid;\n } else if (nums[realMid] > targ) {\n hi = mid - 1;\n } else {\n lo = mid + 1;\n }\n }\n\n return -1;\n}", "public static int findPivot(int[] arr) {\n // write your code here\n /*\n - if arr[rhs]<arr[mid] then min-val will lie in rhs\n else if arr[rhs]>arr[mid] then min-val will lie in lhs\n else if(i==j) means we have found the min-val, so return its value.\n */\n int i=0, j = arr.length-1, mid = (i+j)/2;\n while(i<=j) {\n mid = (i+j)/2;\n if(arr[j]<arr[mid])\n i = mid+1;\n else if(arr[j]>arr[mid])\n j = mid;\n else if(i==j)\n return arr[mid];\n }\n return -1;\n }", "public static int partition(int[] arr, int pivot, int lo, int hi) {\n System.out.println(\"pivot -> \" + pivot);\n int i = lo, j = lo;\n while (i <= hi) {\n if (arr[i] <= pivot) {\n swap(arr, i, j);\n i++;\n j++;\n } else {\n i++;\n }\n }\n System.out.println(\"pivot index -> \" + (j - 1));\n return (j - 1);\n }", "private static int partion(int[] arr, int lo, int hi) {\n int pivot = arr[hi];\n int i = lo;\n for (int j = lo; j <= hi; j++) {\n if (arr[j] < pivot) {\n int tmp = arr[i];\n arr[i] = arr[j];\n arr[j] = tmp;\n i++;\n }\n }\n int tmp = arr[i];\n arr[i] = arr[hi];\n arr[hi] = tmp;\n return i;\n }", "private static int partition(int left, int right, int pivot, List<Integer> A) {\n int pivotValue = A.get(pivot);\n int largerIndex = left;\n\n Collections.swap(A, pivot, right);\n for (int i = left; i < right; ++i) {\n if (A.get(i) > pivotValue) {\n Collections.swap(A, i, largerIndex++);\n }\n }\n Collections.swap(A, right, largerIndex);\n return largerIndex;\n }", "private static int getPivot(int left, int right) {\n\t\treturn (left+right)/2;\n\t}", "public void swapRows(int i, int j) {\n swap(rowPivot, rowUnpivot, i, j);\n }", "public static int findPivot(int[] arr) {\n\t int low=0;\n\t int high=arr.length-1;\n\t while(low<high)\n\t {\n\t int mid= (low+high)/2;\n\t if(arr[mid]<arr[high])\n\t {\n\t high=mid;\n\t }\n\t else\n\t {\n\t low=mid+1;\n\t }\n\t }\n\t return arr[low];\n\t }", "private static int partition2(int[] a, int p, int r) {\n int pivot = a[p];\n int left = p+1;\n int right = r;\n boolean flag= false;\n while (!flag) {\n while (left <= right && a[left] <= pivot) {\n left++;\n }\n while (left <= right && a[right] >= pivot) {\n right--;\n }\n if (left > right) {\n flag = true;\n } else {\n int tmp = a[left];\n a[left] = a[right];\n a[right] = tmp;\n }\n }\n\n // exchange a[p] and a[right].\n int tmp = a[p];\n a[p] = a[right];\n a[right] = tmp;\n\n // the right is the index of pivot.\n return right;\n }", "private int choosePivot(int leftPos, int rightPos)\n {\n // iden \n int midPos = (leftPos+rightPos)/2;\n\n int firstCode = cardAry[leftPos].hashCode();\n int midCode = cardAry[midPos].hashCode(); \n int lastCode = cardAry[rightPos].hashCode();\n\n int medianCode = pickMedian(firstCode,midCode,lastCode);\n\n this.nqSortComparisons+=4;\n if( medianCode==firstCode)\n return leftPos;\n if(medianCode==midCode)\n return midPos;\n\n return rightPos; \n }", "public static void zeroOutValuesAboveAndBelowThePivot(float[][] matrix, int column, int dimension){\n\t\tfloat zeroValue; // the coefficient that we want to 0 out\n\t\tfor (int i = 0; i <dimension; i++){\n\t\tif (column == i){ // if we are in the same row as the pivot, skip (because we don't want to zero out the pivot)\n\t\t\tcontinue;}\n\t\tzeroValue = matrix[i][column];\n\t\tSystem.out.print(\"Replacing row\" + (i+1) + \" with row\" + (i+1) + \" - \" + Math.round(zeroValue*1000)/1000.0d + \"*\" + \"row\" + (column+1) + \" to give us:\\n\\n\");\n\t\tfor (int j = 0; j <= dimension; j++){\n\t\t\tmatrix[i][j] -= zeroValue*matrix[column][j];}\n\t\tprintMatrix(matrix, dimension);\n\t\t\t} // doing operations on the whole row\n\t}", "private static int partition(int[] arr, int low, int high) {\n int pivot = arr[high];\n int temp;\n int partitionIndex = low - 1;\n for (int k = low; k < high; k++) {\n if (arr[k] < pivot) {\n partitionIndex++;\n //swap if index are not same, so as avoid redundant swaps\n swap(arr, partitionIndex, k);\n }\n }\n //swap pivot to correct position\n swap(arr, partitionIndex + 1, high);\n // return correct pivot index\n LOGGER.info(\"Placeed pivot {} : position {}\", arr[partitionIndex + 1], partitionIndex + 1);\n return partitionIndex + 1;\n }", "private static int partitionAssumingPivotIsLastElement(int arr[], int startIndex, int endIndex) {\n if (startIndex < 0 || endIndex > arr.length - 1) {\n return -1;\n }\n int pivotIndex = endIndex;\n int i = -1; //i holds the index whose left is smaller and right side is bigger than arr[i]\n int pivotVal = arr[pivotIndex];\n for ( int j = startIndex ; j <= endIndex; j++) {\n if (arr[j] > pivotVal && i == -1) {\n i = j;\n continue;\n }\n\n if(arr[j] < pivotVal && j != endIndex && i != -1) {\n swap(arr, i, j);\n i++;\n }\n }\n// shiftRightByOnePosition(arr, i);\n// if (i != -1) {\n// arr[i] = pivotVal;\n// }\n swap(arr, i, pivotIndex);\n return i;\n }", "static void quickSortFirst(int[] array, int left, int right) {\n if (left < right) {\n //Selecting first element as pivot\n int pivot = array[left];\n //For partition\n int i = left;\n int j = right;\n while (i < j) {\n //Shift one place to past pivot element\n i += 1;\n //Search right part to find elements greater than pivot\n while (i <= right && array[i] < pivot) {\n i += 1;\n\n }\n //Search left part to find elements smaller than pivot\n while (j >= left && array[j] > pivot) {\n j -= 1;\n\n }\n if (i <= right && i < j) {\n //Swap\n swap(array, i, j);\n\n }\n }\n //Place pivot in correct place\n swap(array, left, j);\n //Sorting again for partition parts\n quickSortFirst(array, left, j - 1);\n quickSortFirst(array, j + 1, right);\n }\n }", "public static int twoWaypartitionWithRandomPivot(int[] nums, int lo, int hi) {\n\t\tint pivotIndex = randomPivot(lo, hi);\n\t\tint pivot = nums[pivotIndex];\n\t\tint i = lo;\n\t\tint j = hi + 1;\n\t\t// swap the pivot at the head of the array\n\t\tif (pivotIndex != lo) {\n\t\t\tswap(nums, pivotIndex, lo);\n\t\t}\n\n\t\twhile (true) {\n\n\t\t\twhile (nums[--j] > pivot)\n\t\t\t\tif (j == lo)\n\t\t\t\t\tbreak;\n\t\t\twhile (nums[++i] < pivot)\n\t\t\t\tif (i == hi)\n\t\t\t\t\tbreak;\n\n\t\t\tif (i >= j)\n\t\t\t\tbreak;\n\n\t\t\t// swap i j\n\t\t\tswap(nums, i, j);\n\n\t\t}\n\t\tswap(nums, lo, j);\n\n\t\treturn j;\n\t}", "public void moveZeroes(int[] nums) \n {\n if ( nums == null || nums.length < 2 ) return;\n \n int pivot = nums.length - 1;\n int curr = 0;\n while ( curr < pivot )\n {\n if ( nums[curr] == 0 )\n {\n shiftLeft(nums, curr);\n pivot--;\n }\n else\n {\n curr++;\n }\n }\n }", "public boolean pivot(int fromEdge, int toEdge, int fromLayer, int toLayer, int flags) throws EdgeOutOfRangeException, LayerOutOfRangeException, DataDirectorException {\n return false;\n }", "private void swapRow(int row1, int row2){\r\n int[] rowTmp = solution[row1].clone();\r\n for(int i = 0; i<9; i++)\r\n solution[row1][i] = solution[row2][i];\r\n for(int i = 0; i<9; i++)\r\n solution[row2][i] = rowTmp[i];\r\n }", "public Matrix[] palu() {\n\t\tHashMap<Integer, Integer> permutations = new HashMap<Integer,Integer>();\n\t\tMatrix m = copy();\n\t\tint pivotRow = 0;\n\t\tfor (int col = 0; col < m.N; col++) {\n\t\t\tif (pivotRow < m.M) {\n\t\t\t\tint switchTo = m.M - 1;\n\t\t\t\twhile (pivotRow != switchTo && \n\t\t\t\t\t\tm.ROWS[pivotRow][col].equals(new ComplexNumber(0))) {\n\t\t\t\t\tm = m.rowSwitch(pivotRow, switchTo);\n\t\t\t\t\tpermutations.put(pivotRow, switchTo);\n\t\t\t\t\tswitchTo--;\n\t\t\t\t}\n\t\t\t\tif (!m.ROWS[pivotRow][col].equals(new ComplexNumber(0))) {\n\t\t\t\t\t// We got a non-zero pivot\n\t\t\t\t\tfor (int lowerRow = pivotRow + 1; lowerRow < m.M;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlowerRow++) {\n\t\t\t\t\t\tComplexNumber factor1 = new ComplexNumber(-1);\n\t\t\t\t\t\tComplexNumber factor2 = m.ROWS[lowerRow][col];\n\t\t\t\t\t\tComplexNumber factor3 = m.ROWS[pivotRow][col];\n\t\t\t\t\t\tComplexNumber factor4 = new ComplexNumber(1);\n\t\t\t\t\t\tComplexNumber factor5 = factor1.multiply(factor2);\n\t\t\t\t\t\tComplexNumber factor6 = factor4.divide(factor3);\n\t\t\t\t\t\tComplexNumber weight = factor5.multiply(factor6);\n\n\t\t\t\t\t\tm = m.rowAdd(lowerRow, pivotRow, weight);\n\t\t\t\t\t}\n\t\t\t\t\tpivotRow++;\n\t\t\t\t\t/* Keep the same pivot row if we currently have a\n\t\t\t\t\t * zero-pivot. Move on to see if there's a pivot in the\n\t\t\t\t\t * next column.\n\t\t\t\t\t */\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\t\n\t\tMatrix p = identity(m.M);\n\t\tfor (Integer rowI : permutations.keySet()) {\n\t\t\tp.rowSwitch(rowI, permutations.get(rowI));\n\t\t}\n\t\tMatrix l = identity(m.M);\n\t\tMatrix u = p.multiply(copy());\n\t\t\n\t\tpivotRow = 0;\n\t\tfor (int col = 0; col < u.N; col++) {\n\t\t\tif (pivotRow < u.M) {\n\t\t\t\t// Should not have to do any permutations\n\t\t\t\tif (!u.ROWS[pivotRow][col].equals(new ComplexNumber(0))) {\n\t\t\t\t\t// We got a non-zero pivot\n\t\t\t\t\tfor (int lowerRow = pivotRow + 1; lowerRow < u.M;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlowerRow++) {\n\t\t\t\t\t\tComplexNumber factor1 = new ComplexNumber(-1);\n\t\t\t\t\t\tComplexNumber factor2 = u.ROWS[lowerRow][col];\n\t\t\t\t\t\tComplexNumber factor3 = u.ROWS[pivotRow][col];\n\t\t\t\t\t\tComplexNumber factor4 = new ComplexNumber(1);\n\t\t\t\t\t\tComplexNumber factor5 = factor1.multiply(factor2);\n\t\t\t\t\t\tComplexNumber factor6 = factor4.divide(factor3);\n\t\t\t\t\t\tComplexNumber weight = factor5.multiply(factor6);\n\n\t\t\t\t\t\tu = u.rowAdd(lowerRow, pivotRow, weight);\n\t\t\t\t\t\tl = l.rowAdd(lowerRow, pivotRow, weight);\n\t\t\t\t\t}\n\t\t\t\t\tpivotRow++;\n\t\t\t\t\t/* Keep the same pivot row if we currently have a\n\t\t\t\t\t * zero-pivot. Move on to see if there's a pivot in the\n\t\t\t\t\t * next column.\n\t\t\t\t\t */\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\t\n\t\tl = l.inverse();\n\t\tMatrix[] palu = {p, this, l, u};\n\t\treturn palu;\n\t}", "public static void sort012(int a[], int n)\r\n{\r\n int start=0, mid=0, end=n-1, pivot=1;\r\n \r\n while(mid <= end)\r\n {\r\n if(a[mid] < pivot) // current element is 0\r\n {\r\n swap(a, mid, start);\r\n start++;\r\n mid++;\r\n }\r\n else if(a[mid] > pivot) // current element is 2\r\n {\r\n swap(a, mid, end);\r\n end--;\r\n }\r\n else //a[mid]==pivot --- current element is 1\r\n mid++;\r\n }\r\n}", "private int partition(Comparable[] items, int first, int last) {\n /**\n * Get a random pivot for the current section.\n * <p/>\n * It should be noted that I made a decision to choose a randomized pivot\n * over selecting a hard-coded pivot (i.e. the middle), or a median. This\n * is to avoid situations where we might get the 'worst case' scenario for\n * QuickSort, leading to O(n^2) time complexity. By using a random pivot,\n * it becomes highly unlikely for the algorithm to run into this situation.\n * <p/>\n * I felt this was the safest and most reliable way of implementing the\n * pivot selection.\n */\n int pivot = (int) Math.floor(UtilityMethods.getPivot(first, last));\n\n /**\n * Swap the pivot item with the first element to move it out\n * of the way during sorting. Assign a variable to hold this\n * for quick comparison.\n */\n UtilityMethods.swapElements(items, pivot, first);\n Comparable pivotElement = items[first];\n\n /**\n * The index to begin the swapping of the elements is the next\n * index after the pivot, currently at first.\n */\n int swapPosition = first + 1;\n\n /**\n * For each element within the current section, we iterate through\n * the section, starting from one after the pivot (the swap position)\n */\n for (int currentElement = swapPosition; currentElement <= last; currentElement++) {\n\n /**\n * If the currently being checked element is smaller than the pivot,\n * we swap the current element with the 'swap position'. This results\n * in gathering all of the numbers less than the pivot element to\n * one side of the array.\n *\n * The index that is then to be swapped is incremented. This means\n * that any elements before the swap position will be sorted as 'less'\n * than the pivot. We don't need to move any elements greater than\n * the pivot.\n */\n if (items[currentElement].compareTo(pivotElement) < 0) {\n UtilityMethods.swapElements(items, swapPosition, currentElement);\n swapPosition++;\n }\n\n }\n\n /**\n * After all elements have been swapped around, we switch the first element\n * (the pivot element), with the last sorted 'less than' element in swap\n * position -1. The works, as it doesn't matter what element is in what\n * position, as long as there are greater and less than sections. By\n * doing this swap, we keep the elements less than the pivot to the left\n * of the pivot, and put the pivot in the 'correct' sorted place in the list.\n */\n UtilityMethods.swapElements(items, first, swapPosition - 1);\n\n /**\n * We return the swapPosition -1, which is the final index of the pivot element.\n */\n return swapPosition - 1;\n }", "protected void pivot() {\n\t\twhile (seenColor != ev3.SUIVRE && c < 10) {\n\t\t\tif (first) {// on indique la futur direction pour tourne que la\n\t\t\t\t\t\t// premiere fois\n\t\t\t\tc = lastC % 2;// on recuperere la derniere valeur de c pour\n\t\t\t\t\t\t\t\t// d'abord tester cette direction\n\t\t\t\tswitch (c) {\n\t\t\t\tcase 0:\n\t\t\t\t\tev3.setDirection(0);\n\t\t\t\t\tgeorges++;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\tev3.setDirection(2);\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tfirst = false;\n\t\t\t} else {\n\t\t\t\tif (c % 2 == 0) {// en fonction de la direction je vais à gauche\n\t\t\t\t\t\t\t\t\t// ou droite\n\t\t\t\t\tev3.avance(\"droite\");\n\t\t\t\t} else {\n\t\t\t\t\tev3.avance(\"gauche\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t// si on a effectue un pivot dun certain temps, on alterne la\n\t\t\t// direction et augmente le temps du pivot\n\t\t\tif (System.currentTimeMillis() - times > times2) {\n\t\t\t\tc++;// je vais tester la direction opposee\n\t\t\t\tlastC = c;\n\t\t\t\tfirst = true;// ca sera la prochaine fois la premiere fois pivot\n\t\t\t\t\t\t\t\t// de plus en plus grand, donc on augmente le\n\t\t\t\t\t\t\t\t// temps d'un pivot\n\t\t\t\ttimes2 += (c < 3) ? (c % 2 == 0) ? 250 : 260 : (c % 2 == 0) ? 500 : 520;\n\t\t\t\t// on reprend comme referentiel le temps courant\n\t\t\t\ttimes = System.currentTimeMillis();\n\t\t\t}\n\t\t\tseenColor = find.whatColor(ev3.lireColor());\n\t\t}\n\t}", "public static int partition(int[] ar, int lo, int hi){\n int pivot = ar[hi];\n int pIndex = lo-1;\n for(int i=lo; i<=hi-1;i++){\n if(ar[i] < pivot){\n pIndex++;\n numSwapsQuick++; \n swap(ar, i, pIndex);\n }\n }\n swap(ar, pIndex+1, hi);\n numSwapsQuick++; \n return pIndex+1; \n }", "private int partition(MyNode[] arr, int lo, int hi) {\n MyNode pivot = arr[lo];\n int left = lo + 1;\n int right = hi;\n transitions.add(colorNode(arr, PIVOT_COLOR, lo));\n while (true)\n {\n while ((left <= right) && arr[left].getValue() < pivot.getValue())\n {\n transitions.add(colorNode(arr, LEFT_COLOR, left));\n transitions.add(colorNode(arr, START_COLOR, left));\n left++;\n }\n while ((left <= right) && arr[right].getValue() >= pivot.getValue())\n {\n transitions.add(colorNode(arr, RIGHT_COLOR, right));\n transitions.add(colorNode(arr, START_COLOR, right));\n right--;\n }\n if (left < right)\n {\n transitions.add(colorNode(arr, SELECT_COLOR, left, right));\n transitions.add(swap(arr, left, right));\n transitions.add(colorNode(arr, START_COLOR, left, right));\n left++;\n right--;\n }\n else\n {\n break;\n }\n }\n transitions.add(colorNode(arr, SELECT_COLOR, lo, right));\n transitions.add(swap(arr, lo, right));\n transitions.add(colorNode(arr, START_COLOR, lo, right));\n return right;\n }", "private int pivotIndex(int left, int right){\n\t\treturn left+ (int)(Math.random()*(right - left + 1));\n\t}", "private int getUnmatchedRow(){\n for (int i = 0; i < rows; i++)\n if(chosenInRow[i] < 0) return i;\n\n return -1;\n }", "private static int partitionArray(int left, int right, int pivot) {\r\n\t\tint leftPointer = left - 1;\r\n\t\t// Exclude pivot so take the last index as right pointer\r\n\t\tint rightPointer = right;\r\n\t\twhile (true) {\r\n\t\t\twhile (leftPointer < right && array[++leftPointer] < pivot) {\r\n\t\t\t\tcomparisons++;\r\n\t\t\t\t// Do nothing, only check the pointer where number is greater\r\n\t\t\t\t// than pivot.\r\n\t\t\t}\r\n\t\t\twhile (rightPointer > left && array[--rightPointer] > pivot) {\r\n\t\t\t\tcomparisons++;\r\n\t\t\t\t// Do nothing, only check the pointer where number is greater\r\n\t\t\t\t// than pivot.\r\n\t\t\t}\r\n\t\t\tif (rightPointer <= leftPointer)\r\n\t\t\t\tbreak;\r\n\t\t\telse \t\t\t// Swap the elements\r\n\t\t\t\tswap(leftPointer, rightPointer);\r\n\t\t}\r\n\t\t// place pivot to the actual position by swapping it to last element of\r\n\t\t// left array.\r\n\t\tswap(leftPointer, right);\r\n\t\treturn leftPointer;\r\n\t}", "public static int partition(int[] data, int i, int pivot){\n\t\tint left = i - 1;\n\t\tint right = i;\n\t\twhile(right < data.length){\n\t\t\tif(pivot >= data[right]){\n\t\t\t\tint tmp = data[++left];\n\t\t\t\tdata[left] = data[right];\n\t\t\t\tdata[right] = tmp;\n\t\t\t}\n\t\t\tright++;\n\t\t}\n\t\treturn left;\n\t}", "private static <E extends Comparable<? super E>> int partition(\r\n\t\t\tComparable<E>[] data, int left, int right, E pivot) {\r\n\t\tint i = left;\r\n\t\tint j = right - 1;\r\n\r\n\t\twhile (true) {\r\n\t\t\twhile (data[++i].compareTo(pivot) < 0) {\r\n\t\t\t}\r\n\t\t\twhile (data[--j].compareTo(pivot) > 0) {\r\n\t\t\t}\r\n\t\t\tif (i < j)\r\n\t\t\t\tswap(data, i, j);\r\n\t\t\telse\r\n\t\t\t\tbreak;\r\n\t\t}\r\n\r\n\t\tswap(data, i, right - 1);\r\n\t\treturn i;\r\n\t}", "private int partition (Column A, int [] ix, int p, int r, int begin) {\n\t\tint i = p - 1;\n\t\tint j = r + 1;\n\t\tboolean isMissing = A.isValueMissing(ix[p]);\n\t\twhile (true) {\n\t\t\tif (isMissing) {\n\t\t\t\tj--;\n\t\t\t\tdo {\n\t\t\t\t\ti++;\n\t\t\t\t} while (!A.isValueMissing(ix[i]));\n\t\t\t} else {\n\n\t\t\t\t// find the first entry [j] <= entry [p].\n\t\t\t\tdo {\n\t\t\t\t\tj--;\n\t\t\t\t} while (A.isValueMissing(ix[j]) || A.compareRows (ix[j], ix[p]) > 0);\n\t\n\t\t\t\t// now find the first entry [i] >= entry [p].\n\t\t\t\tdo {\n\t\t\t\t\ti++;\n\t\t\t\t} while (!A.isValueMissing(ix[i]) && A.compareRows (ix[i], ix[p]) < 0);\n\t\t\t}\n\n\t\t\tif (i < j) {\n\t\t\t\tthis.swapRows(i+begin, j+begin);\n\t\t\t\tint tmp = ix[i];\n\t\t\t\tix[i] = ix[j];\n\t\t\t\tix[j] = tmp;\n\t\t\t} else\n\t\t\t\treturn j;\n\t\t}\n\t}", "int partition(int arr[], int low, int high, SequentialTransition sq,ArrayList<StackPane> list,double speed) \n\t {\n\t\t\tint step;\n//\t\t\tint n = arr.length;\n\t int pivot = arr[high]; \n\t int i = (low-1);\n\t for (int j=low; j<high; j++) \n\t { \n\t if (arr[j] <= pivot) \n\t { \n\t i++; \n\t int temp = arr[i]; \n\t arr[i] = arr[j]; \n\t arr[j] = temp; \n\t step = j - i;\n\t sq.getChildren().add(FillBeforeSwap(list.get(i), list.get(j),speed));\n\t sq.getChildren().add(swapMe(list.get(i), list.get(j), step, list, speed));\n\t sq.getChildren().add(FillAfterSwap(list.get(j), list.get(i), speed));\n\t } \n\t } \n\t int temp = arr[i+1]; \n\t arr[i+1] = arr[high]; \n\t arr[high] = temp; \n\t step = (high) - (i+1);\n\t sq.getChildren().add(FillBeforeSwap(list.get(i+1), list.get(high), speed));\n\t sq.getChildren().add(swapMe(list.get(i+1), list.get(high), step, list, speed));\n\t sq.getChildren().add(FillAfterSwap(list.get(i+1), list.get(high), speed));\n\t \n\t return i+1; \n\t }", "private static int partition(int[] arr, int low, int high) {\n int pivot = arr[high]; \n int i = (low-1); // index of smaller element\n for (int j=low; j<high; j++)\n {\n // If current element is smaller than or\n // equal to pivot\n if (arr[j] <= pivot)\n {\n i++;\n \n // swap arr[i] and arr[j]\n int temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n }\n }\n \n // swap arr[i+1] and arr[high] (or pivot)\n int temp = arr[i+1];\n arr[i+1] = arr[high];\n arr[high] = temp;\n \n return i+1;\n }", "public void setPivot(int x, int y) {\n pivot = new Point(x, y);\n }", "private int partition(int[] array, int low, int high) {\n int pivot = array[high];\n int pIndex = low;\n for(int i = low; i <= high - 1; i++) {\n if (array[i] <= pivot) {\n swap(array, i, pIndex);\n pIndex++;\n }\n }\n swap(array, pIndex, high);\n return pIndex;\n }", "private int partition(int[] nums, int start, int end) {\n int mid = (end - start) / 2 + start;\n int pivot = nums[mid];\n // it is the correct index where pivot value should place after partition\n int correct_index = start;\n // swap the pivot value to the end\n swap(nums, mid, end);\n\n for (int i = start; i < end; i++) {\n if (nums[i] < pivot) {\n // keep swapping smaller values to the left of where pivot value should have been\n swap(nums, i, correct_index);\n // found smaller value, increment correct index by 1\n correct_index++;\n }\n }\n\n // partition is done, swap the pivot value from the end to the correct place\n swap(nums, correct_index, end);\n // return the pivot index\n return correct_index;\n }", "public void quicksort(ArrayList<Node> array, int low, int high)\n {\n Node pivot = new Node(array.get(low).element);\n //Start value for pivot index\n int pivotIndex = low;\n //Define index in list where values start being higher than the pivot \n int higherThan = -1;\n //Begin the for loop after the first element\n for (int i = low + 1; i <= high; i++)\n \n { int gap = Math.abs(pivotIndex - i);\n if (array.get(i).element.compareTo(pivot.element) <= 0 && gap == 1)\n { switchPosition(i,pivotIndex);\n pivotIndex = i;\n }\n else if (array.get(i).element.compareTo(pivot.element) <= 0 && gap > 1)\n { //higherThan = i;\n switchPosition(i, pivotIndex);\n int temp = i;\n i = pivotIndex;\n pivotIndex = temp;\n switchPosition(i+1, pivotIndex); \n pivotIndex = i+1;\n //i++;\n //pivotIndex = higherThan;\n //higherThan++;\n }\n else // (array.get(i).element.compareTo(pivot.element) > 0 )\n { //Do nothing, element should stay in its position greater than the pivot\n }\n \n }\n System.out.println(\"Pivot index: \" + pivotIndex + \"\\n\");\n for (int i = 0; i < array.size(); i++)\n {\n System.out.println(\" \" + array.get(i).element.toString());\n }\n if ((pivotIndex - 1) >= 1)\n { quicksort(array, 0, pivotIndex - 1);\n System.out.println(\"\\n low index call, pivot element \" + array.get(pivotIndex).element.toString());\n }\n if ((high - pivotIndex) >= 1)\n {\n quicksort(array, pivotIndex + 1, high-1); \n }\n }", "private int hoaresPartition2(int[] arr, int start, int end)\n {\n int pivot = arr[end];\n int left = start;\n int right = end - 1;\n\n while(left < right)\n {\n while(arr[left] < pivot && left < end) left ++;\n while(arr[right] > pivot && right > start) right --;\n if(left < right) {\n swap(arr, left, right);\n }\n }\n swap(arr, end, left);\n return left;\n }", "public int partition(int[] arr, int leftPointer, int rightPointer) {\n\n int pivot = arr[Math.floorDiv((leftPointer + rightPointer), 2)];\n //System.out.println(\"The pivot value is: \" + pivot);\n\n while (leftPointer < rightPointer) {\n while (arr[leftPointer] < pivot) {\n leftPointer++;\n //System.out.println(\"Incrementing left pointer to \" + arr[leftPointer]);\n }\n while (arr[rightPointer] > pivot) {\n rightPointer--;\n // System.out.println(\"Decrementing right pointer to \" + arr[rightPointer]);\n }\n if (leftPointer < rightPointer) {\n //System.out.println(\"Swapping \" + arr[leftPointer] + \" and \" + arr[rightPointer]);\n Swap.swap(arr, leftPointer, rightPointer);\n }\n }\n return leftPointer;\n }", "public <T extends Comparable<T>> int partition(T[] list, int first, int last) {\n\t/**\n\t * System.out.println(\"hey\" + Arrays.toString(list));\n\n\tint pivotIndex = 0;\n\tif(list.length < 3) {\n\t\tpivotIndex = 0;\n\t} else {\n\t\tT[] temp = Arrays.copyOfRange(list, 0, 3);\n\t\tArrays.sort(temp);\n\t\tT a = temp[1];\n\t\tfor(int i=0; i<3; i++) {\n\t\t\tif(a.equals(list[i])) {\n\t\t\t\tpivotIndex = i;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t// Move pivot to first Index...\n\t\tT tempo = list[first];\n\t\tlist[first] = list[pivotIndex];\n\t\tlist[pivotIndex] = tempo;\n\t}\n\t\n\t\t */\n\t\n\t\n\tT pivot = list[first]; \n\tdisplay(list, pivot);\n\t// Choose the first element as the pivot 17 \n\tint low = first + 1; // Index for forward search\n\tint high = last; \n\t// Index for backward search\n\n\twhile (high > low) {\n\t\t// Search forward from left\n\t\twhile (low <= high && list[low].compareTo(pivot) <= 0)\n\t\t\tlow++;\n\n\t\t// Search backward from right\n\t\twhile (low <= high && list[high].compareTo(pivot) > 0)\n\t\t\thigh--;\n\n\t\t// Swap two elements in the list\n\t\tif (high > low) {\n\t\t\tT temp = list[high]; \n\t\t\tlist[high] = list[low]; \n\t\t\tlist[low] = temp;\n\t\t} \n\t} \n\n\n\twhile (high > first && list[high].compareTo(pivot) >= 0) high--;\n\tif (list[high].compareTo(pivot) <= 0){ \n\t\tlist[first] = list[high]; \n\t\tlist[high] = pivot;\n\t\treturn high;\n\t}else {\n\t\treturn first; \n\t}\n}", "private static int partition(int[] arr, int left, int right) {\n\t\t\n\t\tint pivot = arr[(left + right) / 2];\n\t\t\n\t\twhile(left <= right) {\n\t\t\twhile(arr[left] < pivot) {\n\t\t\t\tleft++;\n\t\t\t}\n\t\t\twhile(arr[right] > pivot) {\n\t\t\t\tright--;\n\t\t\t}\n\t\t\tif(left <= right) { // once we find element > pivot on left and element < pivot on right :: swap\n\t\t\t\tswap(arr, left, right);\n\t\t\t\tleft++;\n\t\t\t\tright--;\n\t\t\t}\n\t\t}\n\t\treturn left;\n\t}", "private static int pickPivot(int[] A, int lo, int hi){\n\t\tint[] arr = new int[A.length-1];\n\t\tfor(int i = 0; i < arr.length; i++){\n\t\t\tarr[i] = A[i];\n\t\t}\n\t\t\n\t\tif((hi - lo) < 5){\n\t\t\treturn findMedian(arr, lo, hi);\n\t\t}\n\t\t\n\t\tint index = lo;\n\t\tfor(int i = lo; i < hi; i += 5){\n\t\t\tint rightEnd = i + 4;\n\t\t\t\n\t\t\tif(rightEnd > hi){\n\t\t\t\trightEnd = hi;\n\t\t\t}\n\t\t\t\n\t\t\tint median = findMedian(arr, i, rightEnd);\n\t\t\tswap(arr, median, index);\n\t\t\tindex++;\n\t\t}\n\t\t\n\t\treturn pickPivot(arr, lo, (lo + (int)Math.ceil((hi-lo)/5)));\n\t}", "public static void quickSort(ArrayList<Integer> S){\n\t\t\n\t\tif (S.isEmpty()) { //if empty just return itself \n\t\t\treturn; \n\t\t}\n\t\t\n\t\tint pivot = S.get(S.size()-1); //creating a pivot point for the sort \n\t\t\n\t\tArrayList<Integer> L = new ArrayList<Integer>(); //Creating array list for Less than\n\t\tArrayList<Integer> E = new ArrayList<Integer>(); //Creating array list for Equal than\n\t\tArrayList<Integer> G = new ArrayList<Integer>(); //Creating array list for Greater than \n\t\t\n\t\twhile (!S.isEmpty()) { //run while the array list isn't empty \n\t\t\t\n\t\t\tif (S.get(0)< pivot) { //if its less than the pivot, add less than \n\t\t\t\t\n\t\t\t\tL.add(S.get(0)); //adds the less than \n\t\t\t\tS.remove(0); //removes the elements at that index position \n\t\t\t}\n\t\t\telse if(S.get(0) == pivot) { //if its equal to the pivot, add equal to \n\t\t\t\t\n\t\t\t\tE.add(S.get(0));\n\t\t\t\tS.remove(0);\n\t\t\t}\n\t\t\t\n\t\t\telse if (S.get(0) > pivot) { //if its greater than the pivot point, add greater than \n\t\t\t\t\n\t\t\t\tG.add(S.get(0));\n\t\t\t\tS.remove(0);\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t}\n\t\t\n\t\tif (!L.isEmpty()) { //if Less than isn't empty, call quick sort on less than \n\t\t\t\n\t\t\tquickSort(L); //calls the quick sort for less than \n\t\t}\n\t\t\n\t\tif (!G.isEmpty()) { //if Greater than isn't empty, call quick sort on greater than \n\t\t\t\n\t\t\tquickSort(G); //calls quick sort for greater than \n\t\t}\n\t\t\n\t\tS.addAll(L); //Shifting all of the elements to the right \n\t\tS.addAll(E); //Shifting all of the elements to the right \n\t\tS.addAll(G); //Shifting all of the elements to the right \n\t}", "private int partition(int[] array, int left, int right){\n int pivotId = getPivot(array,left,right);\n int pivot = array[pivotId];\n swap(array,pivotId,right);\n int i = left;\n int j = right-1;\n while(i<=j){\n if(array[i]<pivot){\n i++;\n }else if(array[i]>=pivot){\n swap(array,i,j);\n j--;\n }\n }\n swap(array,i,right);\n return i;\n }", "public static int partitionArray(int left, int right, int pivot) {\n\r\n\t\tint leftPointer = left;\r\n\r\n\t\tint rightPointer = right-1;\r\n\r\n\t\twhile (true) {\r\n\r\n\t\t\twhile (theArray[leftPointer] < pivot)\r\n\t\t\t\tleftPointer++;\r\n\t\t\t\t;\r\n\r\n\t\t\twhile (rightPointer > 0 && theArray[rightPointer] > pivot)\r\n\t\t\t\trightPointer--;\r\n\t\t\t\t;\r\n\r\n\t\t\tif (leftPointer >= rightPointer) {\r\n\r\n\t\t\t\tbreak;\r\n\r\n\t\t\t}\r\n\r\n\t\t\telse {\r\n\r\n\t\t\t\tswapValues(leftPointer, rightPointer);\r\n\r\n\t\t\t\tSystem.out.println(theArray[leftPointer] + \" was swapped for \" + theArray[rightPointer]);\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\tswapValues(leftPointer, right);// this swap is for the pivot ie. swap left ptr with pivot index\r\n\r\n\t\treturn leftPointer;\r\n\r\n\t}", "public static void switchRow(boolean[] row, int x){\n\t\tfor(int i = -1; i < 2; i++){\r\n\t \tif(x+i >= 0 && x+i < row.length)\r\n\t \t\trow[x+i] = !row[x+i]; \r\n\t }\r\n\t}", "private static void segregateThreeTypes(int[] arr, int l, int h, int pivot) {\n int mid;\n mid = 0;\n int temp;\n while (mid < h) {\n\n if (arr[mid] < pivot) {\n temp = arr[mid];\n arr[mid] = arr[l];\n arr[l] = temp;\n l++;\n mid++;\n } else if (arr[mid] == pivot) {\n mid++;\n } else {\n temp = arr[mid];\n arr[mid] = arr[h];\n arr[h] = temp;\n h--;\n }\n }\n }", "public static int partition_Hoare(int[] array, int left, int right, int pivot) {\n swap(array, left, pivot);\n\n int p = array[left];\n int i = left;\n int j = right + 1;\n\n while (true) {\n\n while (true) {\n i = i + 1;\n if (i >= array.length) {\n i = array.length - 1;\n break;\n }\n if (array[i] >= p) {\n break;\n }\n }\n while (true) {\n j = j - 1;\n if (j <= -1) {\n i = 0;\n break;\n }\n if (array[j] <= p) {\n break;\n }\n }\n swap(array, i, j);\n\n if (i >= j) {\n break;\n }\n }\n\n swap(array, i, j);\n swap(array, left, j);\n\n return j;\n }", "private static int partition2 (List<Point> array, int low, int high)\n {\n int pivot = (int) array.get(high).getX(); \n \n int i = (low - 1); // Index of smaller element\n\n for (int j = low; j <= high- 1; j++)\n {\n // If current element is smaller than or\n // equal to pivot\n if (array.get(j).getX() <= pivot)\n {\n i++; // increment index of smaller element\n swap(array, i, j);\n }\n }\n swap(array, i + 1, high);\n return (i + 1);\n }", "@Override\n public Matrix assignRow(int row, Vector other) {\n // note the reversed pivoting for other\n return base.assignRow(rowPivot[row], new PermutedVectorView(other, columnUnpivot, columnPivot));\n }", "public int partition(int[] array, int left, int right, int pivot){\r\n while(left<=right){\r\n while(array[left] < pivot){\r\n left++;\r\n }\r\n while(array[right] > pivot){\r\n right--;\r\n }\r\n if(left <= right){\r\n\r\n int temp = array[left];\r\n array[left] = array[right];\r\n array[right] = temp;\r\n left++;\r\n right--;\r\n }\r\n }\r\n return left;\r\n }", "static\nint\nfindPivot(\nint\narr[], \nint\nn) \n{ \n\nint\ni; \n\nfor\n(i = \n0\n; i < n; i++) \n\n{ \n\nif\n(arr[i] > arr[(i + \n1\n) % n]) \n\nreturn\ni; \n\n} \n\nreturn\n0\n; \n}", "public Matrix ref() {\n\t\tMatrix m = copy();\n\t\tint pivotRow = 0;\n\t\tfor (int col = 0; col < m.N; col++) {\n\t\t\tif (pivotRow < m.M) {\n\t\t\t\tint switchTo = m.M - 1;\n\t\t\t\twhile (pivotRow != switchTo && \n\t\t\t\t\t\tm.ROWS[pivotRow][col].equals(new ComplexNumber(0))) {\n\t\t\t\t\tm = m.rowSwitch(pivotRow, switchTo);\n\t\t\t\t\tswitchTo--;\n\t\t\t\t}\n\t\t\t\tif (!m.ROWS[pivotRow][col].equals(new ComplexNumber(0))) {\n\t\t\t\t\t// We got a non-zero pivot\n\t\t\t\t\tfor (int lowerRow = pivotRow + 1; lowerRow < m.M;\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlowerRow++) {\n\t\t\t\t\t\tComplexNumber factor1 = new ComplexNumber(-1);\n\t\t\t\t\t\tComplexNumber factor2 = m.ROWS[lowerRow][col];\n\t\t\t\t\t\tComplexNumber factor3 = m.ROWS[pivotRow][col];\n\t\t\t\t\t\tComplexNumber factor4 = new ComplexNumber(1);\n\t\t\t\t\t\tComplexNumber factor5 = factor1.multiply(factor2);\n\t\t\t\t\t\tComplexNumber factor6 = factor4.divide(factor3);\n\t\t\t\t\t\tComplexNumber weight = factor5.multiply(factor6);\n\n\t\t\t\t\t\tm = m.rowAdd(lowerRow, pivotRow, weight);\n\t\t\t\t\t}\n\t\t\t\t\tpivotRow++;\n\t\t\t\t\t/* Keep the same pivot row if we currently have a\n\t\t\t\t\t * zero-pivot. Move on to see if there's a pivot in the\n\t\t\t\t\t * next column.\n\t\t\t\t\t */\n\t\t\t\t}\t\n\t\t\t}\n\t\t}\n\t\treturn m;\n\t}", "private void checkVertical() {\n\n for(int i = 0; i < 2; i++){ // winning column can be either 0-1-2-(3) or (0)-1-2-3\n for (int j = 0; j < stateArray[3].length; j++) {\n\n if (check3Vertical(i, j)) {\n maskResultArray[stateArray[i][j]] = 1;\n maskArray[i][j] = 1;\n maskArray[i+1][j] = 1;\n maskArray[i+2][j] = 1;\n }\n\n }\n }\n\n }", "private static int partition(int[] input, int start, int end) {\n int pivot = input[start];\n int i = start;\n int j = end;\n\n while (i < j) {\n while (i < j && input[--j] >= pivot) ; // empty loop body\n if (i < j) input[i] = input[j];\n\n while (i < j && input[++i] <= pivot) ; // empty loop body\n if (i < j) input[j] = input[i];\n }\n\n input[j] = pivot;\n return j;\n }", "private void sort(T[] arr, int lo, int hi) {\n if (lo >= hi) return; // we return if the size of the part equals 1\n int pivot = partition(arr, lo, hi); // receiving the index of the pivot element\n sort(arr, lo, pivot - 1); // sorting the left part\n sort(arr, pivot + 1, hi); // sorting the right part\n }", "public static int partition_Jon(int[] array, int left, int right, int pivot) {\n // left pointer/right pointer values that are walked towards eachother\n int lp = left;\n int rp = right;\n // pivot value\n int pv = array[pivot];\n\n /// Loop until break\n while (true) {\n\n /// Walk LP rightward, looking for first value greater than pivot value\n while (array[lp] <= pv && lp != rp) {\n lp++;\n }\n if (lp == rp) {\n break;\n }\n\n /// Walk RP leftward, looking for first value less than pivot value\n while (array[rp] >= pv && lp != rp) {\n rp--;\n }\n if (lp == rp) {\n break;\n }\n\n // Swap values to correct sides\n swap(array, lp, rp);\n }\n // Find correct index to swap pivot into.\n int swapIndex = (pivot < lp)\n // If pivot is to the left, use the index of lower value\n ? ((array[lp] > pv) ? lp - 1 : lp)\n // If pivot is to the right, use the index of higher value\n : ((array[rp] < pv) ? rp + 1 : rp);\n\n // Swap elements\n swap(array, pivot, swapIndex);\n\n // Return index where pivot was placed\n return swapIndex;\n }", "public void reorder(int low, int high) {\n if (low < high) {\n // Select pivot position and put all the elements smaller\n // than pivot on left and greater than pivot on right\n int pi = partition(low, high);\n\n // Sort the elements on the left of pivot\n reorder(low, pi - 1);\n\n // Sort the elements on the right of pivot\n reorder(pi + 1, high);\n }\n }", "private int hoaresPartition(int[] arr, int start, int end)\n {\n int pivot = arr[start];\n int left = start + 1;\n int right = end;\n\n while(left < right)\n {\n while(arr[left] < pivot && left < end) left ++;\n while(arr[right] > pivot && right > start) right --;\n if(left < right) {\n swap(arr, left, right);\n }\n }\n swap(arr, start, right);\n return right;\n }", "private boolean checkRowForQuadPair(int i1) {\n for(int j=0;j<4;j++)\r\n {\r\n if(Kmap[i1][j]==0 || Kmap[i1][j]==-1)\r\n return false;\r\n }\r\n for(int j=0;j<4;j++)\r\n {\r\n Kmap[i1][j]=-1;\r\n }\r\n return true;\r\n }", "public boolean up() {\r\n if( row <= 0 ) return false;\r\n --row;\r\n return true;\r\n }", "public interface IPivotStrategy<T>\r\n{\r\n /**\r\n * Returns the index of the element selected as the pivot value\r\n * within the subarray between first and last (inclusive).\r\n * \r\n * @param arr the array in which to select the pivot\r\n * @param first beginning of the subarray\r\n * @param last end of the subarray\r\n * @param comp the comparator to be used\r\n * @return index of the element selected as the pivot value\r\n * @throws IllegalArgumentException if the length of the subarray\r\n * (last - first + 1) is less than the value returned by minLength().\r\n */\r\n int indexOfPivotElement(T[] arr, int first, int last, Comparator<? super T> comp);\r\n\r\n /**\r\n * Returns the minimum length of the subarray to which this \r\n * partitioning strategy can be applied.\r\n * \r\n * @return minimum size of the subarray required to apply this\r\n * pivot selection strategy\r\n */\r\n int minLength();\r\n\r\n /**\r\n * Returns the number of comparisons performed in the most recent call\r\n * to indexOfPivotElement\r\n * @return number of comparisons\r\n */\r\n int getComparisons();\r\n \r\n /**\r\n * Returns the number of swaps performed in the most recent call\r\n * to indexOfPivotElement. For algorithms that do not use swapping, \r\n * this method returns an estimate of swaps equivalent to one-third\r\n * the number of times that an array element was assigned.\r\n * @return equivalent number of swaps\r\n */\r\n int getSwaps();\r\n \r\n}", "public static int partition_Lomuto(int[] array, int left, int right, int pivot) {\n swap(array, left, pivot);\n\n int p = array[left];\n int s = left;\n\n for (int i = left + 1; i <= right; i++) {\n if (array[i] < p) {\n s = s + 1;\n swap(array, s, i);\n }\n }\n swap(array, left, s);\n return s;\n }", "private void checkHorizontal() {\n\n for(int i = 0; i < stateArray.length; i++) {\n for (int j = 0; j < 2; j++){ // iterate only twice, because winning row\n \t // can be either 0-1-2-(3) or (0)-1-2-3\n if (check3Horizontal(i, j)){\n maskResultArray[stateArray[i][j]] = 1;\n maskArray[i][j] = 1;\n maskArray[i][j+1] = 1;\n maskArray[i][j+2] = 1;\n }\n\n }\n }\n\n }", "public static void quickSort(int[] arr, int lo, int hi) {\n //write your code here\n if(lo>hi){\n return;\n }\n int pivot = partition(arr, arr[hi], lo, hi);\n quickSort(arr, lo, pivot-1);\n quickSort(arr, pivot+1, hi);\n }", "public boolean checkSwitch(int row, int col){\n boolean output = false;\n Tile[] updownleftright = new Tile[4]; //Array which holds the four adjacent tiles\n if (row - 1 >= 0) updownleftright[0] = tiles[row - 1][col];\n else updownleftright[0] = nulltile;\n \n if (row + 1 < sidelength) updownleftright[1] = tiles[row + 1][col];\n else updownleftright[1] = nulltile;\n \n if (col - 1 >= 0) updownleftright[2] = tiles[row][col - 1];\n else updownleftright[2] = nulltile;\n \n if (col + 1 < sidelength) updownleftright[3] = tiles[row][col + 1];\n else updownleftright[3] = nulltile;\n \n for (int i = 0; i < 4; i ++) //Goes through the array and checks to see if any adjacent tile is the blank tile\n {\n if (updownleftright[i].getCurPic() == blankindex){\n tiles[row][col].swap(updownleftright[i]);\n return true;\n }\n }\n return false;\n }", "private void markRowsAndCols(int row){\n if(row < 0)\n return;\n\n markedRows[row] = true;\n for (int j = 0; j < cols; j++)\n if(j != chosenInRow[row] && source[row][j] == 0) {\n markedCols[j] = true;\n markRowsAndCols(chosenInCol[j]);\n }\n }", "int indexOfPivotElement(T[] arr, int first, int last, Comparator<? super T> comp);", "static int minimumSwaps(int[] arr) {\r\n int result = 0;\r\n \r\n // Gets the length of the input array\r\n int size = arr.length;\r\n \r\n // Cycles through the input array\r\n for (int i = 0; i < size; i++) {\r\n // Checks if the element is in the right position\r\n if (arr[i] != i+1) {\r\n result += 1; // The element ISN'T in the right position. A new swap is needed!\r\n \r\n // Cycles through the remaining input array\r\n for (int j = i+1; j < size; j++) {\r\n if (arr[j] == i+1) { // Gets the element that should be in the place of arr[i] and swaps it!\r\n int swap = arr[j];\r\n arr[j] = arr[i];\r\n arr[i] = swap;\r\n break;\r\n }\r\n } \r\n }\r\n }\r\n \r\n return result;\r\n}", "static void quickSort (int a[], int lo, int hi){\n\t int i=lo, j=hi, h;\r\n\t int pivot=a[lo];\r\n\r\n\t // pembagian\r\n\t do{\r\n\t while (a[i]<pivot) i++;\r\n\t while (a[j]>pivot) j--;\r\n\t if (i<=j)\r\n\t {\r\n\t h=a[i]; a[i]=a[j]; a[j]=h;//tukar\r\n\t i++; j--;\r\n System.out.println(\"i = \"+i + \" j = \" + j);\r\n\t }\r\n\t } while (i<=j);\r\n\r\n\t // pengurutan\r\n\t if (lo<j) quickSort(a, lo, j);\r\n\t if (i<hi) quickSort(a, i, hi);\r\n\t }", "protected int swim(int ind) {\n if (ind == 1) return ind;\n\n int curVal = heap[ind];\n int parentInd = ind / 2;\n int parentVal = heap[parentInd];\n \n if (parentVal < curVal) {\n // move up\n swap(ind, parentInd);\n return swim(parentInd);\n } else {\n return ind;\n }\n }", "private static int partition(Array A, int iStart, int iEnd, int pivot)\n\t{\n\t\tA.swap(iStart, pivot);\n\t\tint p = A.get(iStart); // the value of the pivot element\n\t\tint i = iStart + 1;\n\t\tfor (int j = iStart + 1; j <= iEnd; ++j)\n\t\t{\n\t\t\tif (A.get(j) < p)\n\t\t\t{\n\t\t\t\tA.swap(i,j);\n\t\t\t\t++i;\n\t\t\t}\n\t\t}\n\t\tA.swap(iStart, i - 1);\n\t\treturn i - 1; // return the final position of the pivot\n\t}", "public static int partition(int[] arr, int left,int right)\n\t{\n//\t\tint pivot = arr[pivotIndex];\n\t\tint random = generateRandom(left, right);\n\t\tint pivot = arr[random];\n\t\tswap(arr,left,random);\n\t\n\t\tint tmp=left;//tmp is the index to partition the array for the given pivot\n\t\tfor(int i=left+1;i<=right;i++)\n\t\t{\n\t\t\tif(arr[i] <= pivot) \n\t\t\t{\n\t\t\t\ttmp++;\n\t\t\t\tswap(arr,tmp,i);\n\t\t\t}\n\t\t\t\t\n\t\t}\n\t\tswap(arr, left, tmp);\n\t\treturn tmp;\n\t\t\t\n\t}", "boolean hasPivot();", "private int partition(int leftPos, int rightPos, int pivotPos)\n {\n\n int leftScan = leftPos;\n int rightScan = rightPos;\n\n // place the pivot at the start of the sequence\n this.swapCards(pivotPos, leftPos);\n\n boolean isPartitioned = false;\n while( !isPartitioned )\n {\n if (rightScan > leftScan) {\n //leftScan++;\n this.nqSortComparisons++;\n }\n // scan from the left and find an element greater than the pivot element\n // note the pivot element is temporarily at the left position\n // remember to check to see if we have hit the right Scan position\n while( leftScan<rightScan && \n cardAry[leftScan].hashCode() <= cardAry[leftPos].hashCode()) {\n leftScan++;\n this.nqSortComparisons+=1;\n }\n // scan from the right right and find an element less than the pivot \n // not the pivot element is temporarily in the left position.\n while( rightScan>leftScan &&\n cardAry[rightScan].hashCode() > cardAry[leftPos].hashCode()) {\n rightScan--;\n this.nqSortComparisons += 1;\n }\n\n // #DEBUG \n if( this.debugOn == true && rightScan < leftScan) {\n System.err.println(\"found instance where left/right scanners crossed\");\n }\n\n if( rightScan == leftScan)\n isPartitioned = true;\n else\n swapCards(leftScan, rightScan);\n\n }\n\n // remember to put the pivot element at the right/left scan position - 1\n int newPivotPos = rightScan - 1;\n\n this.swapCards(leftPos, newPivotPos);\n\n return (newPivotPos);\n }", "public boolean arraySwap (int i, int j){\n //Initialize a temporary card for switching values and index values for\n //row and column\n Card cardToSwitch = null;\n int iNum = -1;\n int jNum = -1;\n\n //Populate the temporary card and indices\n cardToSwitch = cardArray[i][j];\n iNum = i;\n jNum = j;\n\n //Error check to see if the temporary card was populated\n if(cardToSwitch == null){\n return false;\n }\n\n /* For each case, check the surrounding neighbors of the card. If one of\n the neighbors is the blank card use the temporary values to switch the\n cards values, then call swapLocation to swap the location values of the cards\n */\n else{\n //Case 1 it is not a corner or an edge, check if it is a neighbor\n if((iNum > 0) && (iNum < cardArray.length - 1) && (jNum > 0) &&\n (jNum < cardArray.length - 1)){\n if(cardArray[iNum][jNum - 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum - 1];\n cardArray[iNum][jNum - 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum - 1]);\n return true;\n }\n if(cardArray[iNum][jNum + 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum + 1];\n cardArray[iNum][jNum + 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum + 1]);\n return true;\n }\n if(cardArray[iNum + 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum + 1][jNum];\n cardArray[iNum + 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum + 1][jNum]);\n return true;\n }\n if(cardArray[iNum - 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum - 1][jNum];\n cardArray[iNum - 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum - 1][jNum]);\n return true;\n }\n }\n\n //Case 2: it is on the top edge but not a corner, check if it is a neighbor\n else if((iNum == 0) && (jNum > 0) && (jNum < cardArray.length - 1)){\n if(cardArray[iNum][jNum - 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum - 1];\n cardArray[iNum][jNum - 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum - 1]);\n return true;\n }\n if(cardArray[iNum][jNum + 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum + 1];\n cardArray[iNum][jNum + 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum + 1]);\n return true;\n }\n if(cardArray[iNum + 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum + 1][jNum];\n cardArray[iNum + 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum + 1][jNum]);\n return true;\n }\n }\n\n //Case 3: it is on the bottom edge but not a corner, check if it is a neighbor\n else if((iNum == cardArray.length - 1) && (jNum > 0) &&\n (jNum < cardArray.length - 1)){\n if(cardArray[iNum][jNum - 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum - 1];\n cardArray[iNum][jNum - 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum - 1]);\n return true;\n }\n if(cardArray[iNum][jNum + 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum + 1];\n cardArray[iNum][jNum + 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum + 1]);\n return true;\n }\n if(cardArray[iNum - 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum - 1][jNum];\n cardArray[iNum - 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum - 1][jNum]);\n return true;\n }\n }\n\n //Case 4: it is on the left edge but not a corner, check if it is a neighbor\n else if((iNum > 0) && (iNum < cardArray.length - 1) && (jNum == 0)){\n if(cardArray[iNum][jNum + 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum + 1];\n cardArray[iNum][jNum + 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum + 1]);\n return true;\n }\n if(cardArray[iNum - 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum - 1][jNum];\n cardArray[iNum - 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum - 1][jNum]);\n return true;\n }\n if(cardArray[iNum + 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum + 1][jNum];\n cardArray[iNum + 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum + 1][jNum]);\n return true;\n }\n }\n\n //Case 5: It is on the right edge but not a corner, check if it is a neighbor\n else if((iNum > 0) && (iNum < cardArray.length - 1) &&\n (jNum == cardArray.length - 1)){\n if(cardArray[iNum][jNum - 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum - 1];\n cardArray[iNum][jNum - 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum - 1]);\n return true;\n }\n if(cardArray[iNum - 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum - 1][jNum];\n cardArray[iNum - 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum - 1][jNum]);\n return true;\n }\n if(cardArray[iNum + 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum + 1][jNum];\n cardArray[iNum + 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum + 1][jNum]);\n return true;\n }\n }\n\n\n //Case 6: it is the top left corner, check if it is a neighbor\n else if((iNum == 0) && (jNum == 0)){\n if(cardArray[iNum + 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum + 1][jNum];\n cardArray[iNum + 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum + 1][jNum]);\n return true;\n }\n if(cardArray[iNum][jNum + 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum + 1];\n cardArray[iNum][jNum + 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum + 1]);\n return true;\n }\n }\n\n //Case 7: It is the top right corner, check if it is a neighbor\n else if((iNum == 0) && (jNum == cardArray.length - 1)){\n if(cardArray[iNum][jNum - 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum - 1];\n cardArray[iNum][jNum - 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum - 1]);\n return true;\n }\n\n if(cardArray[iNum + 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum + 1][jNum];\n cardArray[iNum + 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum + 1][jNum]);\n return true;\n }\n }\n\n //Case 8: It is the bottom left corner, check if it is a neighbor\n else if((iNum == cardArray.length - 1) && (jNum == 0)){\n if(cardArray[iNum -1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum - 1][jNum];\n cardArray[iNum - 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum - 1][jNum]);\n return true;\n }\n if(cardArray[iNum][jNum + 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum + 1];\n cardArray[iNum][jNum + 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum +1]);\n return true;\n }\n }\n\n //Case 9: It is the bottom right corner, check if it is a neighbor\n else if((iNum == cardArray.length - 1) && (jNum == cardArray.length - 1)){\n if(cardArray[iNum][jNum - 1].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum][jNum - 1];\n cardArray[iNum][jNum - 1] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum][jNum - 1]);\n return true;\n }\n if(cardArray[iNum - 1][jNum].getCardNum() == 16){\n cardArray[iNum][jNum] = cardArray[iNum - 1][jNum];\n cardArray[iNum - 1][jNum] = cardToSwitch;\n swapLocation(cardArray[iNum][jNum], cardArray[iNum - 1][jNum]);\n return true;\n }\n }\n\n //Case 10: The card is not a neighbor of the blank card, return false\n else{\n return false;\n }\n }\n\n //This case should never be hit, if it is, something is wrong\n return false;\n }", "public T[] sortAux(T array[], int low, int high, int switchSize) {\n\t\t \n\t if (low < high) {\n\t \t \n\t \t \tif (array.length < switchSize) {\n\t \t \t\tarray = insertionSort.sort(array);\n\t \t \t} else {\n\t \t \t\t//Find the correct index for the pivot\n\t \t int pivotCorrected = helpers.partition(array, low, high);\n\n\t \t //Recursively sort elements to the left and right of pivot\n\t \t array = sortAux(array, low, pivotCorrected - 1, switchSize);\n\t \t array = sortAux(array, pivotCorrected + 1, high, switchSize);\n\t \t \t}\n\t }\n\t return array;\n\t }", "private void quickSort(int[] array, int left, int right) {\n if (left>=right){\n return;\n }\n\n //2. Pick a pivot element -> we will choose the centre element:\n // Note: Better would be to choose left + (right-left)/2 (as this would avoid overflow error for large arrays i.e. 2GB))\n\n int pivot = array[(left+right)/2];\n\n //3. Partition the array around this pivot and return the index of the partition.\n int index = partition(array,left,right,pivot);\n\n //4. Sort on the left and right side recursively.\n quickSort(array,left,index-1); //Left side\n quickSort(array,index,right); //Right side\n }", "private int quickSelect(int[] a, int low, int high,int k) {\n //using quick sort\n //put nums that are <= pivot to the left\n //put nums that are > pivot to the right\n int i = low, j = high, pivot = a[high];\n while(i < j) {\n if(a[i++] > pivot)\n swap(a, --i, --j);\n }\n swap(a, i, high);\n\n //count the nums that are <= pivot from low\n int m = i - low + 1;\n if(m == k)\n return i;\n //pivot is too big\n else if(m > k)\n return quickSelect(a, low, i-1, k);\n else\n return quickSelect(a, i+1, high, k - m);\n }", "Node partition(Node l,Node h)\n {\n // set pivot as h element\n int x = h.data;\n \n // similar to i = l-1 for array implementation\n Node i = l.prev;\n \n // Similar to \"for (int j = l; j <= h- 1; j++)\"\n for(Node j=l; j!=h; j=j.next)\n {\n if(j.data <= x)\n {\n // Similar to i++ for array\n i = (i==null) ? l : i.next;\n int temp = i.data;\n i.data = j.data;\n j.data = temp;\n }\n }\n i = (i==null) ? l : i.next; // Similar to i++\n int temp = i.data;\n i.data = h.data;\n h.data = temp;\n return i;\n }", "public boolean checkUp()\n\t{\n\t\tif(row-1>=0)\n\t\t\treturn true;\n\t\treturn false;\n\t}", "private static void rotate(int[][] a, start, end){\n for (int current = 0; start+current < end; current++){\n int temp = a[start][start+current]; // save the top \n a[start][start+current] = a[end-current][start]; // left to top moveing left elemnt to top\n a[end-current][start] = a[end][end-current]; // bottom element to left \n a[end][end-current] = a[start+current][end]; // right element to bottom \n a[start+current][end] = temp; // top elemrnt to right\n }\n}", "private boolean nextPermutation(int row) {\n \tint rightMostBlockSize = rowHints.get(row).get(rowHints.get(row).size() - 1);\n \tif (rightMostBlockSize == 0) return false;\n \tint[] vector = matrix[row];\n \tif (vector[0] == UNKNOWN) {\n \t\tfirstPermutationWithPredictions(row); // could be changed to firstPermutation(row) if no predictions shall be made.\n \t\treturn true;\n \t}\n \t// First step: find the starting position of the rightmost block\n \tint rightMostBlockPosition = vector.length - 1;\n \twhile (vector[rightMostBlockPosition] == EMPTY && rightMostBlockPosition > 0) {\n \t\trightMostBlockPosition--;\n \t}\n \trightMostBlockPosition -= rightMostBlockSize - 1;\n \t// if there is empty space after rightmost block\n \tif (rightMostBlockPosition + rightMostBlockSize < vector.length) { \n \t\t// move the last block to the right by 1 unit --> this is the next permutation\n \t\tvector[rightMostBlockPosition] = EMPTY;\n \t\tvector[rightMostBlockPosition + rightMostBlockSize] = FILLED;\n \t\treturn true;\n \t}\n \t// If there is no space after the rightmost block: \n \t// try to find the next block from the right that can be moved to the right\n \tint i = rightMostBlockPosition - 2; // it is at least 2 units further away (there is always a space between blocks)\n \tif (i < 0) return false; // if there is no such block: no more permutations possible\n \tint emptyCells = 1; // count the empty cells between blocks\n \t// do until we found a block and there are at least 2 spaces right to it\n \twhile(vector[i] == EMPTY || vector[i+1] != EMPTY || vector[i+2] != EMPTY) {\n \t\tif (vector[i] == EMPTY) emptyCells++;\n \t\telse emptyCells = 0;\n \t\ti--;\n \t\tif (i < 0) return false;\n \t}\n \tif (emptyCells < 1) return false; // if there is not at least 1 space: no more permutations\n \tint filledCells = 1; // now count the size of the block we found (it's at least 1 unit long)\n \twhile (i > 0 && vector[i-1] == FILLED) {\n \t\tfilledCells++;\n \t\ti--;\n \t}\n \tvector[i] = EMPTY; // \"move\" the found block 1 unit to right\n \tvector[i + filledCells] = FILLED;\n \t// move all the other blocks as far to the left as possible (zeros is used as offset basically)\n \t// the +2 / -2 is there because starting from the rightmost side of the found block (i + ones), \n \t// we don't just need to go 1 unit to the right, but 2, since there is a space between each block.\n \tfor (int j = i + filledCells + 2; j < vector.length - emptyCells + 2; j++) {\n \t\tif (j != j + emptyCells - 2) {\n\t \t\tvector[j] = vector[j + emptyCells - 2];\n\t \t\tvector[j + emptyCells - 2] = EMPTY;\n \t\t}\n \t}\n \treturn true;\n }", "private static int partition(Comparable[] elements, int low, int high) {\n Comparable pivot = elements[low];\n // left pointer\n int i = low + 1;\n // right pointer\n int j = high;\n while (true) {\n //Increment i till we find element greater than pivot\n while (Utils.isLess(elements[i++], pivot)) {\n if (i == high) break;\n }\n\n // decrement j till we find element smaller that pivot\n while (Utils.isLess(pivot, elements[j--])) {\n if (j == low) break;\n }\n\n if (i >= j) break;\n // Exchange the above 2 elements to maintain invariant of having smaller element to the left of the pivot\n // and greater elements to the right of the pivot\n Utils.swap(elements, i, j);\n }\n // finally put the pivot element in the right place\n Utils.swap(elements, low, j);\n // return the index of the pivot in the array\n return j;\n }", "public static void getBubbleSortwithoutOutput(int range) {\n\n Integer[] number = GetRandomArray.getIntegerArray(range);\n\n //pivot to indicate current cursor\n int pivot = 0;\n\n //get initial value of array to start\n int init = number[pivot];\n\n //first and last element of array\n int last = 0, first = 0;\n\n //length of array\n int array_lenght = number.length - 1;\n\n for (int i = 0; i < number.length; i++) {\n\n //get last number of modified array\n last = number[number.length - 1];\n\n //get first number of modified array\n first = number[0];\n\n //increase pivot by 1\n pivot = pivot + 1;\n\n //if current number is is greater than next right to it\n if (init > number[pivot]) {\n\n //swap number\n number[i] = number[pivot];\n number[pivot] = init;\n\n //set pivot to 0,init to first number,i to less than 0, if its length is equal to array size\n if (pivot == array_lenght) {\n init = first;\n pivot = 0;\n i = -1;\n }\n }\n\n //if current number is is less than next right to it\n if (init < number[pivot]) {\n //do nothing and set current number as pivot\n init = number[pivot];\n }\n\n //if init number is equal last number of array\n if (init == last) {\n\n //set pivot to 0,init to first number,i to less than 0, if its length is equal to array size\n init = first;\n pivot = 0;\n i = -1;\n }\n System.out.println(Arrays.toString(number));\n }\n }", "int partition(int arr[], int low, int high) {\n\t\tint pivot = arr[high];\n\t\tint i = (low - 1); // index of smaller element\n\t\tfor (int j = low; j < high; j++) {\n\t\t\t// If current element is smaller than the pivot\n\t\t\tif (arr[j] < pivot) {\n\t\t\t\ti++;\n\n\t\t\t\t// swap arr[i] and arr[j]\n\t\t\t\tint temp = arr[i];\n\t\t\t\tarr[i] = arr[j];\n\t\t\t\tarr[j] = temp;\n\t\t\t}\n\t\t}\n\n\t\t// swap arr[i+1] and arr[high] (or pivot)\n\t\tint temp = arr[i + 1];\n\t\tarr[i + 1] = arr[high];\n\t\tarr[high] = temp;\n\n\t\treturn i + 1;\n\t}", "public static int pivotInteger(int n) {\n int total = n * (n + 1) / 2;\n\n int sum = 0;\n\n for (int i = 1; i <= n; i++) {\n sum += i;\n\n if ((total + i) % 2 == 0 && (total + i) / 2 == sum) {\n return i;\n }\n }\n\n return -1;\n }", "public static int[] moveZero(int[] nums) {\n int j = 0; // This pointer is similar to quick sort?\n for (int i = 0; i < nums.length; i++) {\n if (nums[i] != 0) {\n int tmp = nums[i];\n nums[i] = nums[j];\n nums[j] = tmp;\n j++;\n }\n System.out.println(Arrays.toString(nums));\n }\n return nums;\n }", "private int chooseInitialPivot(int beginIndex, int endIndex) {\n\t\treturn beginIndex + (endIndex - beginIndex) / 2; // Guard against\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// boundary\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// overflows\n\n\t}", "private static void quicksort(int[] array, int fromIndex, int toIndex) {\r\n\t\tint pivot = array[toIndex];\r\n\t\tint j = toIndex;\r\n\r\n\t\t// searching for a bigger value than pivot starting at fromIndex\r\n\t\tfor (int i = fromIndex; i <= toIndex; i++) {\r\n\t\t\tif (array[i] >= pivot) {\r\n\r\n\t\t\t\t// searching for a smaller value than pivot starting at toIndex\r\n\t\t\t\twhile (j > i) {\r\n\t\t\t\t\tj--;\r\n\r\n\t\t\t\t\t// swap values at i and j\r\n\t\t\t\t\tif (array[j] <= pivot) {\r\n\t\t\t\t\t\tswap(array, j, i);\r\n\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\r\n\t\t\t\t/*\r\n\t\t\t\t * if right position for pivot has been found swap pivot and\r\n\t\t\t\t * element at reached position\r\n\t\t\t\t */\r\n\t\t\t\tif (i == j) {\r\n\t\t\t\t\tswap(array, i, toIndex);\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * Checks if there are more elements to sort on the left\r\n\t\t\t\t\t * side of the right of pivot\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (i - 1 > fromIndex) {\r\n\t\t\t\t\t\tquicksort(array, fromIndex, i - 1);\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t/*\r\n\t\t\t\t\t * calls quicksort if there are more elements to sort on the\r\n\t\t\t\t\t * right side of the of pivot\r\n\t\t\t\t\t */\r\n\t\t\t\t\tif (i + 1 < toIndex) {\r\n\t\t\t\t\t\tquicksort(array, i + 1, toIndex);\r\n\t\t\t\t\t}\r\n\t\t\t\t\treturn;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t// i shouldn't be bigger than j\r\n\t\t\tif (i > j) {\r\n\t\t\t\tthrow new IllegalStateException(\"i > j\");\r\n\t\t\t}\r\n\t\t}\r\n\t}", "private void quickSort(int low, int high) {\n\t\tint i = low;\n\t\tint k = high;\n\t\tint pivot = array[low + (high - low) / 2];\n\n\t\twhile (i <= k) {\n\t\t\t// Stops when element on left side is greater than the pivot\n\t\t\twhile (array[i] < pivot) {\n\t\t\t\ti++;\n\t\t\t}\n\t\t\t// Stops when the element on the right side is less than the pivot\n\t\t\twhile (array[k] > pivot) {\n\t\t\t\tk--;\n\t\t\t}\n\t\t\t// Swap the left and right elements, since the one on the left is\n\t\t\t// greater than the one on the right (proved via pivot)\n\t\t\tif (i <= k) {\n\t\t\t\texchangeNums(i, k);\n\t\t\t\t// Move on to the next elements\n\t\t\t\ti++;\n\t\t\t\tk--;\n\t\t\t}\n\t\t}\n\t\t// Recursive calls\n\t\tif (low < k) {\n\t\t\tquickSort(low, k);\n\t\t}\n\t\tif (i < high) {\n\t\t\tquickSort(i, high);\n\t\t}\n\t}", "private static void pushDown(int[]data, int size, int index){\n boolean leftinbounds = 2*index + 1 < size;\n boolean rightinbounds = 2*index + 2 < size;\n int temp = data[index];\n if ((leftinbounds&&data[index]<data[2*index + 1]) || (rightinbounds && data[index]<data[2*index + 2])){\n if (leftinbounds && rightinbounds && data[index]<data[2*index + 1] && data[index]<data[2*index + 2]){\n if (data[2*index + 1]>data[2*index + 2]){\n data[index] = data[2*index + 1];\n data[2*index + 1] = temp;\n index = 2*index + 1;\n }\n else{\n data[index] = data[2*index + 2];\n data[2*index + 2] = temp;\n index = 2*index + 2;\n }\n }\n else if (leftinbounds && data[index]<data[2*index + 1]){\n data[index] = data[2*index + 1];\n data[2*index + 1] = temp;\n index = 2*index + 1;\n }\n else if(rightinbounds && data[index]<data[2*index + 2]){\n data[index] = data[2*index + 2];\n data[2*index + 2] = temp;\n index = 2*index + 2;\n }\n pushDown(data, size, index);\n }\n }", "PartitionResult partition(int[] array, int start, int end, int pivot) {\n\t\tint left = start; // Stays at right edge of left side\n\t\tint right = end; // Stays at left edge of right side\n\t\tint middle = start; // Stays at right edge of middle\n\t\twhile (middle <= right) {\n\t\t\tif (array[middle] < pivot) {\n\t\t\t\t// Middle is smaller than the pivot. Left is either smaller or\n\t\t\t\t// equal to the pivot. Either way, swap them. Then middle and\n\t\t\t\t// left should move by one.\n\t\t\t\tswap(array, middle, left);\n\t\t\t\tmiddle++;\n\t\t\t\tleft++;\n\t\t\t} else if (array[middle] > pivot) {\n\t\t\t\t// Middle is bigger than the pivot. Right could have any value.\n\t\t\t\t// Swap them, then we know that the new right is bigger than the\n\t\t\t\t// pivot. Move right by one.\n\t\t\t\tswap(array, middle, right);\n\t\t\t\tright--;\n\t\t\t} else if (array[middle] == pivot) {\n\t\t\t\t// Middle is equal to the pivot. Move by one.\n\t\t\t\tmiddle++;\n\t\t\t}\n\t\t}\n\t\treturn new PartitionResult(left - start, right - left + 1);\n\t}", "public void compactUp() {\n\t// Iteramos a través del tablero partiendo de la primera fila\n\t// y primera columna. Si esta contiene un 0 y la fila posterior\n\t// de la misma columna es distinta de 0, el valor se intercambia.\n\t// El proceso se repite hasta que todas las posiciones susceptibles\n\t// al cambio se hayan comprobado.\n\tfor (int i = 0; i < board.length; i++) {\n\t for (int j = 0; j < board.length - 1; j++) {\n\t\tif (board[j][i] == EMPTY && board[j + 1][i] != EMPTY) {\n\t\t board[j][i] = board[j + 1][i];\n\t\t board[j + 1][i] = EMPTY;\n\t\t compactUp();\n\t\t}\n\t }\n\t}\n }", "public static void makeRowsCols0(int [][]input) {\n\t\tint previ=-1,prevj=-1;\n\t\tfor(int i=0;i<input.length;i++)\n\t\t{\n\t\t\tfor(int j=0;j<input[0].length;j++)\n\t\t\t{\n\t\t\t\tif(input[i][j]==0)\n\t\t\t\t{\t\n\t\t\t\t\tif(i!=previ&&j!=prevj)\n\t\t\t\t\t{\n\t\t\t\t\t\tfor(int k=0;k<input.length;k++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinput[k][j]=0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tfor(int k=0;k<input[0].length;k++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tinput[i][k]=0;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tprevi=i;\n\t\t\t\t\t\tprevj=j;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public int quickSelect(int[] a, int l, int h, int k){\n int pivot=a[h],pIndex=l;\n for(int i=l;i<h;i++){\n if(a[i]<=pivot){\n swap(a,i,pIndex);\n pIndex++;\n }\n }\n \n swap(a,pIndex,h);\n if(k==pIndex)return a[pIndex]);\n else if(k>pIndex){\n return quickSelect(a,l,pIndex-1,k);\n }else return quickSelect(a,pIndex+1,h,k); \n \n }", "public static void sort2D(int[][] arr){\n boolean check = true;\n int temp =0;\n while(check){\n check = false;\n int i =0;\n for(int j =0; j<arr[i].length; j++){\n if(j==arr[i].length-1){\n if(i==arr.length-1) break;\n int nextRow=i+1;\n if(arr[i][j]>arr[nextRow][0]){\n temp=arr[i][j];\n arr[i][j]=arr[nextRow][0];\n arr[nextRow][0]=temp;\n check=true;\n }\n i++;\n j=-1;\n\n }else if(arr[i][j]>arr[i][j+1]){\n temp=arr[i][j];\n arr[i][j]=arr[i][j+1];\n arr[i][j+1]=temp;\n check =true;\n }\n }\n\n\n }\n }" ]
[ "0.70458126", "0.5961114", "0.58427685", "0.5643027", "0.5595781", "0.55891144", "0.5579542", "0.5560033", "0.55523896", "0.5516705", "0.5503447", "0.54947245", "0.5485659", "0.54408014", "0.5439524", "0.5438558", "0.5437799", "0.5408532", "0.54014844", "0.5372469", "0.5346966", "0.5342499", "0.5341038", "0.5303659", "0.5295899", "0.52766", "0.5255902", "0.5248714", "0.5244282", "0.5243399", "0.5233792", "0.52298105", "0.5227856", "0.5227161", "0.52266216", "0.5226094", "0.52120966", "0.519914", "0.5158414", "0.514934", "0.5123913", "0.51184046", "0.51108676", "0.5103094", "0.50944984", "0.5090984", "0.50686103", "0.5063858", "0.5062933", "0.50606805", "0.5058156", "0.50555307", "0.50551134", "0.5051884", "0.5036189", "0.50318986", "0.5028965", "0.50229895", "0.50103253", "0.49940777", "0.49907136", "0.499004", "0.49878466", "0.49779132", "0.497442", "0.4964034", "0.4962746", "0.49607408", "0.4951736", "0.49457598", "0.49456954", "0.49424717", "0.49423227", "0.4939729", "0.49390998", "0.49358934", "0.4927293", "0.4926737", "0.4926482", "0.49252632", "0.4910704", "0.49097946", "0.4904929", "0.49028274", "0.48952618", "0.48946095", "0.48868737", "0.48852503", "0.48818052", "0.48737767", "0.48572975", "0.48571876", "0.4847254", "0.4846564", "0.48435208", "0.483609", "0.48332584", "0.48324278", "0.48277086", "0.48256403" ]
0.6372662
1
divide every row by the coefficient
public static void divideRow(float[][] matrix, int row, int dimension){ float divideValue = matrix[row][row]; // coefficient to divide by if (divideValue == 1) { // don't need to divide out the row if the pivot is already 1 return; } System.out.print("Dividing row " + (row+1) + " by " + Math.round(divideValue*1000)/1000.0d + " will give us:\n\n"); for (int i = row; i <= dimension; i++){ matrix[row][i] /= divideValue;} printMatrix(matrix, dimension); }
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "public void divide(double skalar) {\r\n for (int i = 0; i < matrix.length; i++) {\r\n for (int j = 0; j < matrix[0].length; j++) {\r\n matrix[i][j] /= skalar;\r\n }\r\n }\r\n }", "@Override\n\tpublic void\n\tscalarDiv( double value )\n\t{\n\t\tdata[0] /= value;\n\t\tdata[1] /= value;\n\t\tdata[2] /= value;\n\t}", "public static void normalize()\n {\n int sum;\n\n for(int i=0;i<12;i++)\n {\n for(int j=0;j<12;j++) {\n sum = sumAll(i,j);\n if (sum != 0)\n for (int n = 0; n < 12; n++)\n weights[i][j][n] /= sum;\n }\n }\n }", "public double[][] division()\n\t{\n\t\trank = 0;\n\t\tint pivR = 0;\n\t\tfor(int h = 0; h < cols && pivR < rows; h++) //for each col of A\n\t\t{\n\t\t\tif(A[pivR][h] != 0) //there's a pivot in this col\n\t\t\t{\t\n\t\t\t\trank++;\n\t\t\t\tdouble denom = A[pivR][h]; //thing to divide by\n\t\t\t\tfor(int i = 0; i < cols+1; i++)\n\t\t\t\t{\n\t\t\t\t\tA[pivR][i] /= denom; \n\n\n\t\t\t\t}\n\t\t\t\tpivR++;\n\t\t\t}\n\t\t}\n\t\tif(rank == cols) {numSols = 1;}\n\t\telse if(rank < cols) {numSols = 2;}\n\t\treturn A;\n\t}", "private static void divideLine(int row, double div, double[][] matrix,\r\n double[] vector) {\r\n\r\n for (int column = 0; column < matrix[row].length; column++) {\r\n\r\n matrix[row][column] = matrix[row][column] / div;\r\n }\r\n\r\n vector[row] = vector[row] / div;\r\n }", "public static void normalise(double[] v) {\n double tot = 0;\r\n for (int i=0; i<v.length; i++) {\r\n tot += v[i] * v[i];\r\n }\r\n double div = Math.sqrt(tot);\r\n if (div > 0) {\r\n for (int i=0; i<v.length; i++) {\r\n v[i] /= div;\r\n }\r\n }\r\n }", "public void makeRowStochastic() {\n \n for(T row : getFirstDimension()) {\n \n double sum = 0.0;\n \n // sum all values of the current row\n for(T col : getMatches(row)) {\n \n sum += get(row, col);\n \n }\n \n // divide each value by the sum\n for(T col : getMatches(row)) {\n \n set(row, col, get(row, col) / sum);\n \n }\n }\n \n }", "@Override \n public double[] fastApply(double[] x) {\n double d = dot.norm(x);\n scale.fastDivide(x, d);\n return x;\n }", "public T divide( double val ) {\n T ret = createLike();\n ops.divide(mat, val, ret.getMatrix());\n return ret;\n }", "private double[] normalize(double[] p) {\n double sum = 0;\n double[] output = new double[p.length];\n for (double i : p) {\n sum += i;\n }\n for (int i = 0; i < output.length; i++) {\n output[i] = p[i]/sum;\n }\n return output;\n }", "public double[] Normalizar(int[] v){\n double[] result=new double[v.length];\n double s=0;\n for (int i=0;i<v.length;i++){\n s+=v[i];\n }\n for (int i=0;i<v.length;i++){\n result[i]=(double)v[i]/(double)s;\n }\n\n return result;\n }", "private static double[] normalize(double[] data)\n {\n double sum = 0;\n \n for (double d : data)\n sum += d;\n \n if (sum != 1 && sum != 0)\n {\n for (int i = 0; i < data.length; i++)\n data[i] /= sum;\n }\n \n return data;\n }", "@Override\n public double divideBy( AlgOptCost cost ) {\n VolcanoCost that = (VolcanoCost) cost;\n double d = 1;\n double n = 0;\n if ( (this.rowCount != 0)\n && !Double.isInfinite( this.rowCount )\n && (that.rowCount != 0)\n && !Double.isInfinite( that.rowCount ) ) {\n d *= this.rowCount / that.rowCount;\n ++n;\n }\n if ( (this.cpu != 0)\n && !Double.isInfinite( this.cpu )\n && (that.cpu != 0)\n && !Double.isInfinite( that.cpu ) ) {\n d *= this.cpu / that.cpu;\n ++n;\n }\n if ( (this.io != 0)\n && !Double.isInfinite( this.io )\n && (that.io != 0)\n && !Double.isInfinite( that.io ) ) {\n d *= this.io / that.io;\n ++n;\n }\n if ( n == 0 ) {\n return 1.0;\n }\n return Math.pow( d, 1 / n );\n }", "@Override\n public double calculate(double input)\n {\n return input/getValue();\n }", "private void normalize(DMatrixRMaj M) {\n double suma=0;\n Equation eq = new Equation();\n eq.alias(M, \"M\");\n eq.alias(suma,\"s\");\n\n// for (int i=0;i<M.numRows;i++) {\n// for (int j = 0; j < M.numCols; j++) {\n// eq.alias(i, \"i\");\n// eq.alias(j, \"j\");\n// eq.process(\"s = s + M(i,j)\");\n//// suma = suma + M.get(i,j);\n// }\n// }\n// for (int i=0;i<M.numRows;i++){\n// for (int j=0;j<M.numCols;j++){\n//// eq.alias(i,\"i\");\n//// eq.alias(j,\"j\");\n//// eq.process(\"s = s + M(i,j)\");\n// M.set(i,j,M.get(i,j)/suma);\n// }\n for(int i=0; i < M.numRows; i++){\n eq.alias(i, \"i\");\n //eq.process(\"M(i,:) = exp(M(i,:) - max(M(i,:)))\"); // to prevent high values in exp(M)\n //eq.process(\"M(i,:) = M(i,:) / sum(M(i,:))\");\n eq.process(\"M(i,:) = M(i,:) / sum(M(i,:))\");\n// eq.process(\"M(i,:) = M(i,:) / s\");\n }\n }", "@Override\n public double evaluate(float x) {\n\n int polynomial[] = getPolynomialCoefficientArray();\n double result = 0;\n for (int i = 0; i < polynomial.length; i++) {\n result += polynomial[i] * Math.pow(x, i);\n }\n return result;\n }", "private double timesRow(int i,MyPoint3D x) {\n return d[i][0]*x.getX() + d[i][1]*x.getY() + d[i][2]*x.getZ();\n }", "public double[] Normalizar01(int[] v){\n double[] result=new double[v.length];\n double s=v[0];\n double max=v[0];\n double min=v[0];\n for (int i=1;i<v.length;i++){\n s+=v[i];\n //minimo\n if (v[i]<min)\n min=v[i];\n if (v[i]>max)\n max=v[i];\n //maximo\n }\n for (int i=0;i<v.length;i++){\n result[i]=((double)v[i]-min)/(max-min);\n }\n\n return result;\n }", "public static float power(float[] coefficients) {\n float p = 0f;\n\n for (int i = MultiWave.SINE; i < MultiWave.VARIABLE; i++) {\n p += (MultiWave.CROSS_CORRELATIONS[i][i] * coefficients[i] * coefficients[i]);\n for (int j = MultiWave.SINE; j < i; j++) {\n p += (2.0f * MultiWave.CROSS_CORRELATIONS[i][j] * coefficients[i] * coefficients[j]);\n }\n } // end for i\n\n return p;\n }", "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 getCoefficient();", "public Double[][] normalize(Double[][] dataSet) {\n Double maxVal = Collections.max(DataClean.twoDArrToArrList(dataSet));\n Double minVal = Collections.min(DataClean.twoDArrToArrList(dataSet)); \n \n Double[][] newData = new Double[dataSet.length][dataSet[0].length];\n for (int i=0; i<dataSet.length; i++) {\n for (int j=0; j<dataSet[0].length; j++) {\n newData[i][j]= (dataSet[i][j]-minVal)/(maxVal-minVal);\n }\n }\n return newData;\n }", "private double[][] normalize (float[][] in) {\n\n\t\tdouble[][] temp = new double[in.length][2];\n\n\t\t// Get centroid\n\t\tfloat[] centroid = getCentroid(in);\n\n\t\t// Normalize\n\t\tfor(int i = 0; i < in.length; i++) {\n\t\t\ttemp[i][0] = in[i][0] - centroid[0];\n\t\t\ttemp[i][1] = in[i][1] - centroid[1];\n\t\t}\n\n\t\treturn temp;\n\t}", "public Vector<T> divide(T aScalar);", "public double eval(double x) {\n double result = 0;\n for (int i = coefs.length - 1; i >= 0; i--) {\n result = result * x + coefs[i];\n }\n return result;\n }", "private double calcB1() {\n double[] dataX = dsX.getDataX();\n double[] dataY = dsY.getDataY();\n double sumX = 0;\n double sumY = 0;\n double sumXY = 0;\n double sumXsq = 0;\n\n for (int i = 0; i < dataX.length; i++) {\n sumX += dataX[i];\n sumY += dataY[i];\n sumXY += dataX[i] * dataY[i];\n sumXsq += Math.pow(dataX[i], 2);\n }\n return (((dataX.length * sumXY) - (sumX * sumY)) / ((dataX.length * sumXsq) - (Math.pow(sumX, 2))));\n }", "public double[][] normalize( double[][] data )\n {\n double[][] result = new double[ data.length ][];\n\n for( int i=0; i<data.length; i++ )\n {\n result[ i ] = normalize( data[ i ], 1 );\n }\n\n return result;\n }", "public final void div() {\n\t\tif (size > 1) {\n\n\t\t\tdouble topMostValue = pop();\n\t\t\tdouble secondTopMostValue = pop();\n\t\t\tif (topMostValue > 0) {\n\t\t\t\tpush(secondTopMostValue / topMostValue);\n\t\t\t}\n\t\t}\n\t}", "public double eval(double[] data) {\r\n\t\tif (rChild.eval(data) == 0){\r\n\t\t\tSystem.out.println(\"Divisor = 0\");\r\n\t\t\tSystem.exit(0);\r\n\t\t}\r\n\t\treturn lChild.eval(data) / rChild.eval(data);\r\n\t}", "private double selectDivisor( double v[], double param[] ) {\n\n\t\tdouble maxValue = 0;\n\t\tint maxIndex = 0;\n\t\tfor (int i = 0; i < v.length; i++) {\n\t\t\tif (Math.abs(v[i]) > maxValue) {\n\t\t\t\tmaxValue = Math.abs(v[i]);\n\t\t\t\tmaxIndex = i;\n\t\t\t}\n\t\t}\n\n\t\tdouble divisor = v[maxIndex];\n\n\t\tint index = 0;\n\t\tfor (int i = 0; i < v.length; i++) {\n\t\t\tv[i] /= divisor;\n\n\t\t\tif (i != maxIndex) {\n\t\t\t\t// save first 5 parameters\n\t\t\t\tparam[index] = v[i];\n\t\t\t\t// save indexes in the matrix\n\t\t\t\tint col = i < 3 ? col0 : col1;\n\t\t\t\tindexes[index++] = 3*(i%3) + col;\n\t\t\t}\n\t\t}\n\n\t\t// index of 1\n\t\tint col = maxIndex >= 3 ? col1 : col0;\n\t\tindexes[5] = 3*(maxIndex%3) + col;\n\n\t\treturn divisor;\n\t}", "public double[] coeff();", "default DiscreteDoubleMap2D dividedBy(double value) {\r\n\t\treturn pushForward(d -> d / value);\r\n\t}", "public void testDivide() {\r\n System.out.println(\"Divide\");\r\n Double [][] n = new Double[][]{{-3., -2.5, -1., 0., 1., 2., 3.4, 3.5, 1.1E100, -1.1E100}, \r\n {-3., 2.5, 0., 0., 1., -2., 3., 3.7, 1.1E100, 1.1E100}, \r\n {1., -1., 0., 0., 1., -1., 1.133333, 0.945945, 1., -1.}};\r\n for(int i = 0; i < 10; i++){\r\n try{\r\n Double x = n[0][i];\r\n Double y = n[1][i];\r\n double expResult = n[2][i];\r\n double result = MathOp.Divide(x, y);\r\n assertEquals(expResult, result, 0.001);\r\n }\r\n catch(DividedByZeroException e){\r\n assertTrue(e instanceof DividedByZeroException);\r\n }\r\n }\r\n }", "Matrix div(Matrix m){\n if(m.cols != this.cols || m.rows != this.rows) throw new RuntimeException(String.format(\"Wrong dimensions\"));\n Matrix matrix_to_return = new Matrix(m.rows, m.cols);\n for(int i=0; i<m.rows * m.cols; i++){\n if(m.data[i] == 0) throw new RuntimeException(String.format(\"Div by 0\"));\n else matrix_to_return.data[i] = this.data[i] / m.data[i];\n }\n return matrix_to_return;\n }", "List<BigDecimal> computeRes();", "public static double getAverage(int arr[][], int row) {\t// 算陣列所有數平均值\n\t\t/* Overloading Method */\n\t\tint sum = 0, count = 0;\n\t\tdouble result;\n\t\t\t\n\t\t\tfor (int j = 0; j < arr[row].length; j++) {\n\t\t\t\tsum += arr[row][j];\n\t\t\t\tcount++;\n\t\t\t}\n\t\tresult = (double) sum / count;\n\t\treturn result;\n\t}", "public static void divide(Double[] vector, Double divider) {\r\n for(int i = 0; i < vector.length; i++){\r\n vector[i] = vector[i] / divider;\r\n }\r\n }", "public static double[] normalize(double[] v) {\n double[] tmp = new double[3];\n tmp[0] = v[0] / VectorMath.length(v); \n tmp[1] = v[1] / VectorMath.length(v); \n tmp[2] = v[2] / VectorMath.length(v); \n return tmp; \n }", "public BigDecimal divideNumbers(List<Integer> numbers) throws Exception;", "Sum getMultiplier();", "private Vector<Double> multiplyRow(Vector<Double> row, double scalar) {\n row.replaceAll(n -> round(scalar * n, 8));\n return row;\n }", "public void derivate () {\n int size = myCoefficients.size();\n for (int i = 1; i < size; ++i) {\n myCoefficients.set(i - 1, myCoefficients.get(i) * i);\n }\n myCoefficients.remove(size - 1);\n }", "public double[] compute(Matrix matrix, double[] mean) {\r\n \tThrow.when().isNull(() -> matrix, () -> \"No matrix to compute.\");\r\n if(matrix.getRowCount() == 0){\r\n return new double[0];\r\n }\r\n \r\n double[] var = this.serial(matrix, 0, matrix.getRowCount(), mean);\r\n for(int i = 0; i < var.length; i++){\r\n var[i] /= matrix.getRowCount();\r\n }\r\n return var;\r\n }", "@Override\n\tpublic double apply(double value) {\n\t\tfor (int i = 0; i < constants.length; i++) {\n\t\t\tnextConstant = new Constant(constants[constants.length - i - 1]);\n\t\t\tnextExponent = new LinearProduct(nextConstant, new Exponent(i));\n\t\t\tresult += nextExponent.apply(value);\n\t\t}\n\t\treturn result;\n\t}", "public Matrix times(double constant){\r\n \tMatrix cmat = new Matrix(this.nrow, this.ncol);\r\n \tdouble [][] carray = cmat.getArrayReference();\r\n\r\n \tfor(int i=0; i<this.nrow; i++){\r\n \t\tfor(int j=0; j<this.ncol; j++){\r\n \t\tcarray[i][j] = this.matrix[i][j]*constant;\r\n \t\t}\r\n \t}\r\n \treturn cmat;\r\n \t}", "Matrix scalarMult(double x){\n int newMatrixSize = this.getSize();\n Matrix newM = new Matrix(newMatrixSize);\n for(int i = 1; i <= newMatrixSize; i++){\n List itRow = rows[i - 1];\n itRow.moveFront();\n while(itRow.index() != -1){\n Entry c = (Entry)itRow.get();\n newM.changeEntry(i, c.column, (x*c.value));\n itRow.moveNext();\n }\n }\n\n return newM;\n }", "Matrix div(double w){\n if(w == 0) throw new RuntimeException(String.format(\"Div by 0\"));\n Matrix matrix_to_return = new Matrix(this.rows, this.cols);\n for(int i=0; i<this.rows * this.cols; i++){\n matrix_to_return.data[i] = this.data[i] / w;\n }\n return matrix_to_return;\n }", "public void normalize(double normalizingFactor) {\n //System.out.println(\"norm: \" + normalizingFactor);\n for (T value : getFirstDimension()) {\n for (T secondValue : getMatches(value)) {\n double d = get(value, secondValue) / normalizingFactor;\n set(value, secondValue, d);\n }\n }\n }", "public static Matrix pow(Matrix base, double index)\n {\n double[][] d = base.getArray();\n int row = base.getRowDimension(), col = base.getColumnDimension();\n Matrix X = new Matrix(row, col);\n double[][] C = X.getArray();\n // double[][] result = new double[row][col];\n double val = 1.0;\n for (int i = 0; i < row; i++)\n {\n for (int j = 0; j < col; j++)\n {\n val = Math.pow(d[i][j], index); // System.out.println(\"val = \"+val);\n if (val > Double.MAX_VALUE)\n {\n C[i][j] = Double.MAX_VALUE;\n }\n else\n {\n C[i][j] = val;\n }\n }\n }\n return X;\n }", "public DoubleColumn linear() {\n DoubleColumn result = col.asDoubleColumn();\n int last = -1;\n for (int i = 0; i < col.size(); i++) {\n if (!col.isMissing(i)) {\n if (last >= 0 && last != i - 1) {\n for (int j = last + 1; j < i; j++) {\n result.set(\n j,\n col.getDouble(last)\n + (col.getDouble(i) - col.getDouble(last)) * (j - last) / (i - last));\n }\n }\n last = i;\n }\n }\n return result;\n }", "public double[][] fetchConfusionMatrix() \n\t{\n int[] rowSum = new int[10];\n double[][] CM = new double[10][10];\n \n for (int i = 0; i < 10; i++) \n {\n for (int j = 0; j < 10; j++) \n {\n rowSum[i] = rowSum[i] + confMatrix[i][j];\n }\n }\n\n for (int i = 0; i < 10; i++) \n {\n for (int j = 0; j < 10; j++) \n {\n CM[i][j] = 1.00 * confMatrix[i][j] / rowSum[i];\n }\n }\n return CM;\n }", "public double getCoeff() {\n\t\t\t\treturn coeff;\n\t\t\t}", "private static final void recalc_divide_init(final Jlame_internal_flags gfc,\n\t\tfinal Jgr_info cod_info, final int[] ix, final int r01_bits[], final int r01_div[], final int r0_tbl[], final int r1_tbl[])\n\t{\n\t\tfinal int bigv = cod_info.big_values;\n\n\t\tfor( int r0 = 0; r0 <= 7 + 15; r0++ ) {\n\t\t\tr01_bits[r0] = LARGE_BITS;\n\t\t}\n\n\t\tfor( int r0 = 0; r0 < 16; r0++ ) {\n\t\t\tfinal int a1 = gfc.scalefac_band.l[r0 + 1];\n\t\t\tif( a1 >= bigv ) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\tint r0bits = 0;\n\t\t\tlong tmp = choose_table_nonMMX( ix, 0, a1, r0bits );\n\t\t\tfinal int r0t = (int)tmp;\n\t\t\tr0bits = (int)(tmp >> 32);\n\n\t\t\tfor( int r1 = r0, re = r0 + 8; r1 < re; r1++ ) {\n\t\t\t\tfinal int a2 = gfc.scalefac_band.l[r1 + 2];\n\t\t\t\tif( a2 >= bigv ) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tint bits = r0bits;\n\t\t\t\ttmp = choose_table_nonMMX( ix, a1, a2, bits );\n\t\t\t\tfinal int r1t = (int)tmp;\n\t\t\t\tbits = (int)(tmp >> 32);\n\t\t\t\tif( r01_bits[r1] > bits ) {\n\t\t\t\t\tr01_bits[r1] = bits;\n\t\t\t\t\tr01_div[r1] = r0;\n\t\t\t\t\tr0_tbl[r1] = r0t;\n\t\t\t\t\tr1_tbl[r1] = r1t;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}", "public static void normalization(double[] array)\r\n\t{\r\n\t\tdouble sum = Σ(array);\r\n\r\n\t\tif (sum == 0 || array.length == 0)\r\n\t\t\treturn;\r\n\r\n\t\tfor (int i = 0; i < array.length; i++)\r\n\t\t\tarray[i] = array[i] / sum;\r\n\t}", "@Override\n\tpublic double[][] calc() {\n\t\tfor (int i=0; i<this.singleMatrix.length; i++) {\n\t\t\t\n\t\t\tfor (int j=0; j<this.singleMatrix[i].length; j++) {\n\t\t\t\t\n\t\t\t\tthis.inverse = new double[this.singleMatrix.length][this.singleMatrix[i].length];\n\t\t\t}\n\t\t}\n\t\t\n\t\t\n\t\tif (this.det != 0) {\t//if determinant is not 0.\n\t\t\t\n\t\t\tfor (int i=0; i<this.singleMatrix.length; i++) {\t\n\t\t\t\t\n\t\t\t\tfor (int j=0; j<this.singleMatrix[i].length; j++) {\n\t\t\t\t\t\n\t\t\t\t\tthis.cT = new double[this.singleMatrix.length][this.singleMatrix[i].length];\t//declare the size of co-factor matrix transposed\n\n\t\t\t\t\tthis.cT[i][j] = this.coFactor[j][i];\t//the rows of cT = the cols of coFactor matrix. the cols of cT = the rows of coFactor matrix\n\t\t\t\t\t\n\t\t\t\t\t/* # you might want to initialize this.inverse and calculate right after the above cT calculation done as follow,\n\t\t\t\t\t \n\t\t\t\t\t \t--------------------------------------------------------------------------------------\n\t\t\t\t\t \t- this.inverse = new double[this.singleMatrix.length][this.singleMatrix[i].length]; -\n\t\t\t\t\t \t- this.inverse[i][j] = 1 / this.det * this.cT[i][j]; -\n\t\t\t\t\t \t--------------------------------------------------------------------------------------\n\t\t\t\t\t \n\t\t\t\t\t technically, it's not really a problem when it comes to initializing one more variable in the same loop.\n\t\t\t\t\t however, this specific situation, that three variables (coFacotr, cT and inverse) and their values are involved in, occurs an unexpected result which is still not an error.\n\t\t\t\t\t \n\t\t\t\t\t this.coFactor is done in a loop in initializing and calculating \n\t\t\t\t\t this.cT and this.inverse are done in a loop in initializing and calculating\n\t\t\t\t\t \n\t\t\t\t\t # thus, calculation goes as it goes and this.inverse will be kept initializing until the loop ends.\n\t\t\t\t\t this.inverse will then always & only store its running value at a current location depending on increment of i and j.\n\t\t\t\t\t you will see only one result at the last index and won't see all the values stored correctly.\n\t\t\t\t\t (all of the values will be zero except the last value at the last index)\n\t\t\t\t\t \n\t\t\t\t\t # one simple solution is to initialize and calculate a variable -inverse in this case- in a separate for-loop\n\t\t\t\t\t \n\t\t\t\t\t */\n\n\t\t\t\t\t//calculate inverse here but initialize it in another for-loop\n\t\t\t\t\tthis.inverse[i][j] = 1 / this.det * this.cT[i][j]; //formula: A-1 = 1 / det * cT\n\t\t\t\t}\t\n\t\t\t}\n\t\t\t\n\t\t}else {\t//det is 0\n\t\t\t\n\t\t\tSystem.out.println(\"\\nThe matrix is a singular. singular matrices can not have inverses.\");\n\t\t}\n\t\t\n\t\t//print\n\t\tSystem.out.println(\"\\nInverse of the current matrix is: \");\n\t\tfor (int i=0; i<this.singleMatrix.length; i++) {\n\t\t\t\t\t\n\t\t\tfor (int j=0; j<this.singleMatrix[i].length; j++) {\n\t\t \t\t\n\t\t\t\tSystem.out.print(String.format(\"%.2f\", this.inverse[i][j]) + \" \");\t//display the result with a space between value representing as two decimal point\n//\t\t\t\tSystem.out.print(this.inverse[i][j] + \" \");\t//display the result with a space between value representing as two decimal point\n\t\t\t}\n\t\tSystem.out.println();\t//a new line for the next row and cols\n\t\t}\n\t\t\n\t\treturn inverse;\t//return the value of inverse\n\t}", "Double getMultiplier();", "public abstract Vector4fc div(float x, float y, float z, float w);", "public abstract double compute(final double[] x, final ComputationContext<?> c);", "public static double mean(double[][] mat) { \n int counter = 0;\n double total = 0;\n for (int row = 0; row < mat.length; row++){\n for (int column = 0; column < mat[0].length; column++){\n total += mat[row][column];\n }\n }\n return total/counter;\n }", "public double[] compute(Matrix matrix) {\r\n return this.compute(matrix, new RowReduce.Mean().compute(matrix));\r\n }", "public Array2DRowRealMatrix getNormalisedData() {\r\n\t\t\r\n\t\t//declare variables\r\n\t\tdouble dataVal;\r\n\t\tdouble normalisationVal;\r\n\t\tdouble finalVal;\r\n\t\r\n\t\tArray2DRowRealMatrix returnMatrix = new Array2DRowRealMatrix(noOfWavelengths,2);\r\n\t\t\r\n\t\t//iterate through data\r\n\t\tfor(int rowIndex=0; rowIndex < noOfWavelengths; rowIndex++) {\r\n\t\t\t\r\n\t\t\t//normalised data value = (recorded data value / recorded normalisation value) * calibration ratio\r\n\t\t\tdouble[] normalData = new double[2];\r\n\r\n\t\t\tdataVal = data.getRow(rowIndex)[1];\r\n\t\t\tnormalisationVal = normalisationData.getRow(rowIndex)[1];\r\n\t\t\t\r\n\t\t\tnormalData[0] = data.getRow(rowIndex)[0];\r\n\t\t\tnormalData[1] = (dataVal / normalisationVal) * calibRatio;\r\n\t\t\t\r\n\t\t\treturnMatrix.setRow(rowIndex, normalData);\r\n\t\t}\r\n\r\n\t\treturn returnMatrix;\r\n\t}", "public double getFactor() {\n return ((double) multiplier) / ((double) divisor);\n }", "public Matrix rowMultiply(int row, Fraction weight) {\n\t\treturn rowMultiply(row, new ComplexNumber(weight));\n\t}", "@Override\n\tpublic void\n\tscalarMult( double value )\n\t{\n\t\tdata[0] *= value;\n\t\tdata[1] *= value;\n\t\tdata[2] *= value;\n\t}", "@Override\n public double getResult(Map<String, Double> values) {\n List<Node> nodes = getChildNodes();\n double result = nodes.get(0).getResult(values);\n if (nodes.size() > 1) {\n for (int i = 1; i < nodes.size(); i++) {\n result = result / nodes.get(i).getResult(values);\n }\n }\n return result;\n }", "public void calcular()\r\n/* 530: */ {\r\n/* 531:556 */ this.facturaProveedorSRI.setMontoIva(this.facturaProveedorSRI.getBaseImponibleDiferenteCero().multiply(\r\n/* 532:557 */ ParametrosSistema.getPorcentajeIva().divide(BigDecimal.valueOf(100L))));\r\n/* 533: */ }", "protected final double fr(double x, double rc, double re) {return rc*(K*K)/Math.pow(x, re);}", "public double evaluate (double x) {\n double value = this.getCoeffAt(this.getDegree());\n\n for (int d = this.getDegree() - 1; d >= 0; --d) {\n value = x * value + this.getCoeffAt(d);\n }\n return value;\n }", "@Override\n public void crunch(float values[]){\n int biggest = 0;\n int smallest = 0;\n\n for(int j = 0; j <= values.length -1; j++){\n for(int i = 0; i <= values.length -1; i++){\n if(values[i+1] > values[i]){\n biggest = i+1;\n smallest = i;\n } else{\n biggest = i;\n smallest = i+1;\n }\n }\n if(smallest != 0){\n values[biggest] /= values[smallest];\n }\n }\n }", "default DiscreteDoubleMap2D reciprocal() {\r\n\t\treturn (x, y) -> 1. / this.getValueAt(x, y);\r\n\t}", "static float doSSECalc(int[] votes, float[] preds, int cclass) {\n float err;\n\n // Get the total number of votes for the row\n float sum = doSum(votes);\n\n // No votes for the row\n if (sum == 0) {\n err = 1f - (1f / (votes.length - 0f));\n return err * err;\n }\n\n err = Float.isInfinite(sum)\n ? (Float.isInfinite(preds[cclass + 1]) ? 0f : 1f)\n : 1f - preds[cclass + 1] / sum;\n\n return err * err;\n }", "public abstract double calcular();", "public double get_coefficient() {\r\n\t\treturn this._coefficient;\r\n\t}", "public float[] normalisePNs(int[] image) {\n double sum = 0;\n float[] float_image = new float[image.length];\n for ( int i = 0; i < image.length; ++i ){ sum+=image[i]; }\n sum = Math.sqrt(sum);\n for ( int i = 0; i < image.length; ++i ){ float_image[i] = (float) image[i] / (float) sum; }\n\n return float_image;\n }", "public CubicSegment(double[][] coef) {\n\t\t\n\t}", "private double computeSxx(List<Integer> intList, double mean) {\n double total = 0;\n for (Integer i : intList) {\n total += Math.pow((i - mean), 2);\n }\n return total;\n }", "public static final double[] normalize(final double[] V)\n {\n double []vec = new double[periodNum];\t\n\t//Vector vec = new Vector(periodNum);\n\t//Double zero = new Double(0);\n\t//for(int i=0;i<periodNum;i++)\n\t// vec.insertElementAt(zero,i);\n\n\tdouble sum =0;\n\t\n\tfor(int i=0;i<periodNum;i++)\n\t{\n\t\tsum += V[i];\n\t\t//sum += ((Double)V.elementAt(i)).doubleValue();\n\t}\n\t// if sum is 0, can't divide using it\n\tif(sum ==0)\n\t return V;\n\n\n\tfor(int i=0;i<periodNum;i++)\n\t{\n\t double d = V[i];//((Double)V.elementAt(i)).doubleValue();\n\t double dd = d/sum;\n\n\t vec[i] = dd;\n\t //vec.addElement(new Double(dd));\n\t}\n\t \n\treturn vec;\n }", "public Complex DivideBy (Complex z) {\n\ndouble rz = z.Magnitude();\n\nreturn new Complex((u*z.u+v*z.v)/(rz*rz),(v*z.u-u*z.v)/(rz*rz));\n\n}", "public List<List<GenPolynomial<C>>> \n normalizeMatrix(int flen, List<List<GenPolynomial<C>>> M) { \n if ( M == null ) {\n return M;\n }\n if ( M.size() == 0 ) {\n return M;\n }\n List<List<GenPolynomial<C>>> N = new ArrayList<List<GenPolynomial<C>>>();\n List<List<GenPolynomial<C>>> K = new ArrayList<List<GenPolynomial<C>>>();\n int len = M.get( M.size()-1 ).size(); // longest row\n // pad / extend rows\n for ( List<GenPolynomial<C>> row : M ) {\n List<GenPolynomial<C>> nrow = new ArrayList<GenPolynomial<C>>( row );\n for ( int i = row.size(); i < len; i++ ) {\n nrow.add( null );\n }\n N.add( nrow );\n }\n // System.out.println(\"norm N fill = \" + N);\n // make zero columns\n int k = flen;\n for ( int i = 0; i < N.size(); i++ ) { // 0\n List<GenPolynomial<C>> row = N.get( i );\n if ( debug ) {\n logger.info(\"row = \" + row);\n }\n K.add( row );\n if ( i < flen ) { // skip identity part\n continue;\n }\n List<GenPolynomial<C>> xrow;\n GenPolynomial<C> a;\n //System.out.println(\"norm i = \" + i);\n for ( int j = i+1; j < N.size(); j++ ) {\n List<GenPolynomial<C>> nrow = N.get( j );\n //System.out.println(\"nrow j = \" +j + \", \" + nrow);\n if ( k < nrow.size() ) { // always true\n a = nrow.get( k );\n //System.out.println(\"k, a = \" + k + \", \" + a);\n if ( a != null && !a.isZERO() ) {\n xrow = blas.scalarProduct( a, row);\n xrow = blas.vectorAdd(xrow,nrow);\n //System.out.println(\"xrow = \" + xrow);\n N.set( j, xrow );\n }\n }\n }\n k++;\n }\n //System.out.println(\"norm K reduc = \" + K);\n // truncate \n N.clear();\n for ( List<GenPolynomial<C>> row: K ) {\n List<GenPolynomial<C>> tr = new ArrayList<GenPolynomial<C>>();\n for ( int i = 0; i < flen; i++ ) {\n tr.add( row.get(i) );\n }\n N.add( tr );\n }\n K = N;\n //System.out.println(\"norm K trunc = \" + K);\n return K;\n }", "public float classError() { return _errors / (float) _rows; }", "public void computeEquation()\n {\n // Curve equation of type : y = ax^2 + bx + c\n // OR (x*x)a + (x)b + 1c = y\n // ex : 50 = 4a + 2b + c where y = 50 and x = 2 and z = 1\n double[][] matrice = {{Math.pow(A.getKey(),2),A.getKey(),1},\n {Math.pow(B.getKey(),2),B.getKey(),1},\n {Math.pow(C.getKey(),2),C.getKey(),1}};\n\n double deter = computeSarrus(matrice);\n\n double [][] matriceA = {{A.getValue(),A.getKey(),1},\n {B.getValue(),B.getKey(),1},\n {C.getValue(),C.getKey(),1}};\n\n double [][] matriceB = {{Math.pow(A.getKey(),2),A.getValue(),1},\n {Math.pow(B.getKey(),2),B.getValue(),1},\n {Math.pow(C.getKey(),2),C.getValue(),1}};\n\n double [][] matriceC = {{Math.pow(A.getKey(),2),A.getKey(),A.getValue()},\n {Math.pow(B.getKey(),2),B.getKey(),B.getValue()},\n {Math.pow(C.getKey(),2),C.getKey(),C.getValue()}};\n\n abc[0] = computeSarrus(matriceA) / deter;\n abc[1] = computeSarrus(matriceB) / deter;\n abc[2] = computeSarrus(matriceC) / deter;\n }", "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}", "public static int[][] computeTable() {\n\t\tint [][] ret = new int[10][10];\n\t\tfor (int m = 0; m < 10; m++) {\n\t\t\tfor (int n = 0; n < 10; n++) {\n\t\t\t\tret[m][n] = m*n;\n\t\t\t}\n\t\t}\n\t\treturn ret;\n\t}", "@Override\n\tpublic double computeOutput(double[][] inputs) {\n\t\t// sum weighted inputs\n\t\tdouble sum = 0;\n\t\tfor (int i = 0; i < inputs[0].length; i++) {\n\t\t\tsum += (inputs[0][i] * inputs[1][i]);\n\t\t}\n\t\treturn sum;\n\t}", "public double calcAvg() {\n\t\treturn (double)calcSum() / data.size();\n }", "public void divide(MyDouble val) {\n this.setValue(this.getValue() / val.getValue());\n }", "public double prom () {\n return this.sum()/this.size();\n }", "private void reduce() {\n int gcd = gcd(this.numerator, this.denominator);\n this.numerator = this.numerator / gcd;\n this.denominator = this.denominator / gcd;\n }", "public void division() {\n\t\tx=1;\n\t\ty=0;\n\t\tz=x/y;\n\t\t\t\t\n\t}", "public void divide() {\n\t\t\n\t}", "public static Double[][] operationAvgPooling(Double[][] matrix, int w, int h, int s) {\n if (s < 1) s = 1;\n int fSizeY = matrix.length;\n int kSizeY = h;\n int fSizeX = matrix[0].length;\n int kSizeX = w;\n int p = 0;\n int i, j;\n Double[][] output = new Double[i = ((matrix.length - h) / s) + 1][j = ((matrix[0].length - w) / s) + 1];\n for (int y = 0; y < i; y = y + 1) {\n for (int x = 0; x < j; x = x + 1) {\n double avg = 0;\n for (int yy = 0; yy < h; yy++) {\n for (int xx = 0; xx < w; xx++) {\n double l = matrix[y + yy][x + xx];\n avg += l;\n }\n }\n output[y][x] = avg / (h * w);\n }\n }\n return output;\n }", "private double moyenne(Hashtable<Integer, Double> h){\n\t\tEnumeration<Integer> e = h.keys();\n\t\tdouble res = 0 ;\n\t\t// On somme l'ensemble des distances entre cette tables et les tables occuppées, on divise ensuite.\n\t\twhile(e.hasMoreElements()){ res += h.get(e.nextElement()) ; }\n\t\tres /= h.size() ;\n\t\treturn res ;\n\t}", "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 <V extends Number> FluentExp<V> div (SQLExpression<V> expr)\n {\n return new Div<V>(this, expr);\n }", "protected static double seqArraySum(final double[] input) {\n double sum = 0;\n\n // Compute sum of reciprocals of array elements\n for (int i = 0; i < input.length; i++) {\n sum += 1 / input[i];\n }\n\n return sum;\n }", "public Vector6f divI(float scalar)\n\t{\n\t\tx[0] /= scalar; \n\t\tx[1] /= scalar; \n\t\tx[2] /= scalar; \n\t\tx[3] /= scalar; \n\t\tx[4] /= scalar; \n\t\tx[5] /= scalar;\n\t\treturn this;\n\t}", "public void makeColumnStochastic() {\n \n for(T col : getSecondDimension()) {\n \n double sum = 0.0;\n \n // sum all values of the current column\n for(T row : getFirstDimension()) {\n \n sum += get(row, col);\n \n }\n \n // divide each value by the sum\n for(T row : getFirstDimension()) {\n \n set(row, col, get(row, col) / sum);\n \n }\n }\n \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 }", "public double getMultiplier() {\n\t\t\tint currentWidth = Display.getWidth();\n\t\t\treturn currentWidth / (double) width;\n\t\t}", "public void makeStochastic() {\n \n double sum = 0.0;\n \n for(T row : getFirstDimension()) {\n \n // sum all values\n for(T col : getMatches(row)) {\n \n if(get(row, col)!=null) {\n sum += get(row, col);\n }\n \n }\n }\n \n \n for(T row : getFirstDimension()) {\n \n // sum all values\n for(T col : getMatches(row)) {\n \n if(get(row, col)!=null) {\n set(row, col, get(row, col)/sum);\n }\n \n }\n }\n }" ]
[ "0.620345", "0.5978556", "0.59061533", "0.5901618", "0.5746224", "0.5639999", "0.5579323", "0.555556", "0.55533105", "0.55350864", "0.54497725", "0.54394025", "0.5429771", "0.5374569", "0.5266728", "0.52583206", "0.5227255", "0.5207783", "0.52032644", "0.5193736", "0.51590616", "0.51500696", "0.5141286", "0.51206255", "0.51063514", "0.51057297", "0.5098993", "0.50930196", "0.5089565", "0.5082533", "0.5068964", "0.5067416", "0.504728", "0.5041543", "0.503892", "0.50226915", "0.50112957", "0.49842322", "0.49710837", "0.49691936", "0.49648157", "0.49639198", "0.49490386", "0.48915285", "0.48783648", "0.48699993", "0.4850716", "0.48310798", "0.48245746", "0.48161295", "0.48138398", "0.4807505", "0.48019513", "0.4796237", "0.4783294", "0.4772177", "0.47698128", "0.4762324", "0.4761197", "0.47608095", "0.47557017", "0.47514534", "0.47493032", "0.47446954", "0.47446662", "0.47435257", "0.47409377", "0.47361153", "0.4733933", "0.47322258", "0.4731073", "0.47310212", "0.47285518", "0.47256717", "0.47226197", "0.47218817", "0.4708692", "0.47076797", "0.47027335", "0.47005922", "0.46960098", "0.4693822", "0.46849814", "0.46832284", "0.46814004", "0.46796176", "0.46785572", "0.4674159", "0.4670886", "0.4666391", "0.4650212", "0.46437496", "0.46301398", "0.46297342", "0.46271175", "0.46264452", "0.46177256", "0.4601638", "0.46008438", "0.45998707" ]
0.6220958
0